@import url('https://fonts.googleapis.com/css?family=Oswald:400,700&display=swap');
$imgUrl: 'https://picsum.photos/1920/1080?random=1';
*, *::before, *::after {
box-sizing: border-box;
}
body {
position: relative;
overflow: hidden;
font-family: 'Oswald', serif;
}
section {
display: flex;
flex-wrap: wrap;
align-content: flex-start;
width: 100%;
height: 100vh;
background: black;
overflow: hidden;
> span {
width: 10%;
height: 10%;
background-image: url($imgUrl);
background-attachment: fixed;
background-size: cover;
background-position: center center;
}
}
button {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border: none;
outline: none;
padding: 10px 15px;
background: white;
font-size: 1.25rem;
cursor: pointer;
}
View Compiled
const tween = gsap.from('section > span', {
delay: 2,
duration: 0.1,
x: 300,
y: 300,
opacity: 0,
stagger: 0.1,
});
View Compiled