Skip to content

Commit

Permalink
height adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
lenincompres committed Oct 26, 2024
1 parent adfc386 commit 4522229
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ DOM.set({
article: {
model: STYLE.FLEX,
justifyContent: _isMobile.as("flex-start", "center"),
minHeight: "607px",
minHeight: "calc(100vh - 10em)",
height: "fit-content",
width: _isMobile.as("47em", "100%"),
margin: _isMobile.as("6em 0 1.5em 9em", "0 0 1em 0"),
content: _currentPage.as(p => PAGES[p] ? PAGES[p] : undefined),
Expand Down
4 changes: 2 additions & 2 deletions src/CardScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ class CardScroll extends HTMLElement {
margin: "6em auto",
position: "relative",
width: "20em",
minHeight: "30em",
minHeight: "25em",
section: items.map((item, i) => ({
position: 'absolute',
width: "20em",
minHeight: "30em",
minHeight: "25em",
backgroundColor: "white",
borderRadius: "2.5em",
boxShadow: "1px 1px 3px black",
Expand Down
11 changes: 7 additions & 4 deletions src/animations.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const SPEED = 500;
const SPEED = 300;

const queue = [];

const trigger = (s = SPEED) => setTimeout(_ => {
if (!queue.length) return;
let entry = queue.shift();
entry.elem.set(entry.model);
if (!queue.length) return;
trigger(s);
}, 0.3 * s);

Expand All @@ -25,8 +25,11 @@ export const queueDown = (elem, model = {

Object.entries(properModel).forEach(([key, val]) => val.through ? elem.set(val.through[0], key) : null);

queue.push({elem:elem, model:properModel});
if (queue.length === 1) trigger(0.5 * s);
queue.push({
elem: elem,
model: properModel
});
if (queue.length === 1) trigger(s);

}

Expand Down

0 comments on commit 4522229

Please sign in to comment.