Skip to content

Commit

Permalink
test: dist
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyang0210 committed Jun 16, 2024
1 parent 45b5e34 commit 5b19f31
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
1 change: 1 addition & 0 deletions dist/script/banner-images.0b8d2149.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion dist/script/banner-images.e7f7f17c.js

This file was deleted.

2 changes: 1 addition & 1 deletion dist/simple-memory.js

Large diffs are not rendered by default.

Binary file modified dist/simple-memory.js.gz
Binary file not shown.
15 changes: 3 additions & 12 deletions src/components/bannerImages/bannerImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default function main(id, images, cols, time, sort, current) {
const bgMain = document.getElementById(id);
const parts = [];
let playing = false;
const animOptions = { duration: 2.3, ease: Power4.easeInOut };

images.forEach((src) => {
const img = new Image();
Expand All @@ -32,30 +33,20 @@ export default function main(id, images, cols, time, sort, current) {
parts.push(part);
}

const animOptions = {
duration: 2.3,
ease: Power4.easeInOut,
};

function go(dir) {
if (playing) return;

playing = true;
current = (current + dir + images.length) % images.length;
const bgMainHeight = bgMain.offsetHeight;

parts.forEach((part, p) => {
const next = document.createElement('div');
next.className = 'section';
const img = document.createElement('img');
img.src = images[current];
next.appendChild(img);

if ((p - Math.max(0, dir)) % 2 === 0) {
up(part, next, bgMainHeight);
} else {
down(part, next, bgMainHeight);
}
if ((p - Math.max(0, dir)) % 2 === 0) up(part, next, bgMainHeight);
else down(part, next, bgMainHeight);
});
}

Expand Down

0 comments on commit 5b19f31

Please sign in to comment.