Skip to content

Commit

Permalink
remove actors
Browse files Browse the repository at this point in the history
  • Loading branch information
nrchtct committed Dec 11, 2023
1 parent a189689 commit 057f751
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
9 changes: 2 additions & 7 deletions js/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ function createBaseData(json) {
session.index = sessionIndex
session.height = (json.length-1 == session.index ? window.innerHeight*2 : 0) //height of the session//if last session add padding at the end
//set position for items
let actors = session.actors ?? [];
session.alignment = Math.random() > 0.5? true : false
session.items = [...actors, ...session.content]
session.items = [...session.content]
session.items.map((item,itemIndex) => {
updateItemBase(item, session,itemIndex)
})
Expand All @@ -24,7 +23,7 @@ async function updateView(){
session.items.map((item,itemIndex) => {
item.bounding = item.domObject.getBoundingClientRect()
item.height = item.bounding.height + window.innerHeight * 0.33
if (itemIndex === 0 || item.type == "actor") item.margin = 0
if (itemIndex === 0) item.margin = 0
else item.margin = session.items[itemIndex - 1].margin + session.items[itemIndex - 1].height
session.height += item.height + window.innerHeight * 0.33
})
Expand Down Expand Up @@ -69,9 +68,6 @@ async function updateView(){
document.querySelectorAll('.content').forEach(n => {
n.style.visibility = 'visible'
})
document.querySelectorAll('.actors').forEach(n => {
n.style.visibility = 'visible'
})
document.querySelector('footer').style.visibility = 'visible';

animation()
Expand All @@ -89,7 +85,6 @@ function updateItemPosition(item) {
item.domObject.style.transform = `translate(${item.varianz}px,0)`
}
function updateItemBase(item, session,itemIndex) {
item.type = item.markdown ? 'content' : 'actor'
item.session = session
item.visible = false
item.left = itemIndex % 2 == 0 ? session.alignment : !session.alignment
Expand Down
16 changes: 11 additions & 5 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ li {
div.content:has(img) {
background: unset;
text-align: center;
padding: 0;
}
h1 {
margin: .33em 0;
font-size: 2.5em;
font-size: 2.25em;
}
h2 {
margin: .5em 0;
Expand Down Expand Up @@ -183,7 +184,7 @@ a[href^="#"] {
#anchors p {
margin: 0;
padding: 0.2em;
font-size: 0.8em;
font-size: 1em;
}
#anchors p:hover, #burger:hover{
text-decoration: underline;
Expand Down Expand Up @@ -217,7 +218,7 @@ footer a:hover img, footer a:active img {

@media screen and (orientation: portrait) and (max-width: 767px) {
body {
font-size: 16px !important;
font-size: 15px !important;
}
.content{
max-width: 75vw;
Expand All @@ -228,7 +229,7 @@ footer a:hover img, footer a:active img {
max-height: 75vw;
}
div.content:has(img) {
background: var(--background-content);
background: var(--background);
}
#cursor{
max-width: 85vw;
Expand All @@ -241,10 +242,15 @@ footer a:hover img, footer a:active img {
text-align: right;
font-size: 1.5em;
}
#anchors{
#anchors {
left: unset;
right: -100%;
}
#anchors p {
margin: 0;
padding: 0.2em;
font-size: .9em;
}
#menu.active #anchors{
left: unset;
right: 0;
Expand Down

0 comments on commit 057f751

Please sign in to comment.