Skip to content

Commit 969c1e6

Browse files
committed
teaser
1 parent e448b46 commit 969c1e6

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

public/Lychee-v7-teasing.png

1.24 MB
Loading

src/pages/index.astro

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,4 +255,53 @@ const metadata = {
255255

256256
<Fragment slot="subtitle"> Deploy in a matter of seconds with our docker-compose file. </Fragment>
257257
</CallToAction>
258+
259+
<script>
260+
document.addEventListener('DOMContentLoaded', () => {
261+
const teaser = document.createElement('div');
262+
teaser.id = 'teaser';
263+
teaser.style.position = 'fixed';
264+
teaser.style.top = '0';
265+
teaser.style.left = '0';
266+
teaser.style.width = '100%';
267+
teaser.style.height = '100%';
268+
teaser.style.backgroundColor = 'black';
269+
teaser.style.display = 'flex';
270+
teaser.style.justifyContent = 'center';
271+
teaser.style.alignItems = 'center';
272+
teaser.style.zIndex = '9999';
273+
teaser.style.transition = 'opacity 3s ease-in';
274+
275+
const img = document.createElement('img');
276+
img.src = '/Lychee-v7-teasing.png';
277+
img.alt = 'Teaser Image';
278+
img.style.maxWidth = '90%';
279+
img.style.maxHeight = '90%';
280+
img.style.transform = 'scale(1)';
281+
img.style.opacity = '0';
282+
img.style.transition = 'transform 6s ease-in-out, opacity 3s ease';
283+
284+
teaser.appendChild(img);
285+
document.body.appendChild(teaser);
286+
287+
// Start the zoom animation
288+
setTimeout(() => {
289+
img.style.opacity = '1';
290+
img.style.transform = 'scale(1.5)';
291+
}, 0);
292+
293+
// Fade out the teaser after the zoom animation
294+
setTimeout(() => {
295+
teaser.style.opacity = '0';
296+
img.style.opacity = '0';
297+
setTimeout(() => {
298+
teaser.remove();
299+
}, 3000);
300+
}, 3000);
301+
302+
teaser.addEventListener('click', () => {
303+
teaser.remove();
304+
});
305+
});
306+
</script>
258307
</Layout>

0 commit comments

Comments
 (0)