<div>
<section class="content">
<div class="poka-wrapper">
<div class="poka-dot"></div>
<div class="poka-dot"></div>
<div class="poka-dot"></div>
<div class="poka-dot"></div>
<div class="poka-dot"></div>
</div>
<div class="title-wrapper">
<p>Imagine if cash become digital</p>
</div>
</section>
<section class="content">
<div class="poka-wrapper">
<div class="poka-dot"></div>
<div class="poka-dot"></div>
<div class="poka-dot"></div>
<div class="poka-dot"></div>
</div>
<div class="title-wrapper">
<p>Imagine if more animals had more access to the global economy.</p>
</div>
</section>
<section class="content">
<div class="poka-wrapper">
<div class="poka-dot"></div>
<div class="poka-dot"></div>
<div class="poka-dot"></div>
</div>
<div class="title-wrapper">
<p>Imagine a new global currency on a new global network.</p>
</div>
</section>
<section class="content">
<div class="poka-wrapper">
<div class="poka-dot"></div>
<div class="poka-dot"></div>
<div class="poka-dot"></div>
<div class="poka-dot"></div>
<div class="poka-dot"></div>
</div>
<div class="title-wrapper">
<p>We think this is how money should be.</p>
</div>
</section>
</div>
@import url('https://fonts.googleapis.com/css?family=Montserrat:600&display=swap');
body {
padding: 56px 0;
margin: 0;
}
.pre-content {
height: 550px;
}
.post-content {
height: 750px;
}
.content {
position: relative;
overflow: initial;
z-index: 1;
}
.title-wrapper {
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
position: relative;
z-index: 4;
opacity: 0;
transform: translate3d(0, 30px, 0);
transition: opacity 666ms cubic-bezier(.17, .17, .06, 1), transform 1s cubic-bezier(.17, .17, .06, 1);
p {
font-size: 27px;
font-weight: 600;
font-family: 'Montserrat', sans-serif;
text-align: center;
padding: 0 15px;
max-width: 730px;
letter-spacing: -1px;
@media screen and (min-width: 1024px) {
font-size: 38px;
font-weight: 600;
}
@media screen and (min-width: 1280px) {
font-size: 48px;
}
color: #000000;
}
}
.poka-wrapper {
height: 110%;
overflow: hidden;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
min-height: 650px;
@media screen and (min-width: 768px) {
min-height: 800px;
}
@media screen and (min-width: 1024px) {
min-height: 900px;
}
&.visible {
& + .title-wrapper {
opacity: 1;
transform: translate3d(0, 0px, 0);
}
.poka-dot {
transform: scale(1);
&:nth-of-type(1){
transition-delay: .075s;
}
&:nth-of-type(2){
transition-delay: .15s;
}
&:nth-of-type(3){
transition-delay: .225s;
}
&:nth-of-type(4){
transition-delay: .3s;
}
&:nth-of-type(5){
transition-delay: .375s;
}
}
}
}
.poka-dot {
transform: scale(0);
transition: transform .65s ease-in-out;
background-size: cover;
background-position: 50%;
border-radius: 500px;
position: absolute;
}
.content:nth-of-type(1) .poka-dot {
&:nth-of-type(1) {
background-image: url(https://ucarecdn.com/15378057-5bf1-46c5-b542-a21d1515ae69/photo1min.jpeg);
width: 130px;
height: 130px;
left: 20px;
top: 60px;
@media screen and (min-width: 768px) {
width: 190px;
height: 190px;
top: 130px;
left: 40px;
}
@media screen and (min-width: 1280px) {
left: 90px;
top: 125px;
}
@media screen and (min-width: 1440px) {
width: 273px;
height: 273px;
left: 70px;
top: 50px;
}
}
&:nth-of-type(2) {
width: 87px;
height: 87px;
right: 20px;
top: 140px;
background-image: url(https://ucarecdn.com/71781fe4-ae56-439a-a1c4-e49a0c56f562/photo2min.jpeg);
@media screen and (min-width: 768px) {
width: 125px;
height: 125px;
right: 55px;
top: 240px;
}
@media screen and (min-width: 1280px) {
right: 80px;
top: 170px;
}
@media screen and (min-width: 1440px) {
width: 180px;
height: 180px;
right: 66px;
top: 160px;
}
}
&:nth-of-type(3) {
width: 132px;
height: 132px;
left: -65px;
bottom: 140px;
background-image: url(https://ucarecdn.com/d71ca026-d5a2-4017-a737-35008fe18697/photo3min.jpeg);
@media screen and (min-width: 768px) {
width: 190px;
height: 190px;
bottom: 250px;
left: -85px;
}
@media screen and (min-width: 1280px) {
bottom: 180px;
}
@media screen and (min-width: 1440px) {
width: 360px;
height: 360px;
bottom: 200px;
left: -180px;
}
}
&:nth-of-type(4) {
background-image: url(https://ucarecdn.com/c6d6beb7-57bf-4fe9-9307-7229028b7867/photo4min.jpeg);
width: 200px;
height: 99px;
bottom: 100px;
right: -130px;
@media screen and (min-width: 768px) {
width: 370px;
height: 185px;
bottom: 230px;
right: -225px;
}
@media screen and (min-width: 1280px) {
width: 412px;
height: 226px;
bottom: 152px;
right: -270px;
}
@media screen and (min-width: 1440px) {
height: 270px;
bottom: 190px;
right: -200px;
}
}
&:nth-of-type(5) {
width: 220px;
height: 95px;
left: 100px;
bottom: 0;
background-image: url(https://ucarecdn.com/f84a5a4a-7ea6-419f-b351-2828bc01c18f/photo5min.jpeg);
background-position: 50% 35%;
@media screen and (min-width: 768px) {
width: 320px;
height: 135px;
left: 190px;
bottom: 0;
}
@media screen and (min-width: 1280px) {
height: 160px;
bottom: 0;
left: 160px;
}
@media screen and (min-width: 1440px) {
width: 470px;
height: 200px;
bottom: 0;
left: 120px;
}
}
}
.content:nth-of-type(2) .poka-dot {
&:nth-of-type(1) {
width: 129px;
height: 129px;
left: -40px;
top: 140px;
background-image: url(https://ucarecdn.com/ab1c202f-af3f-4d4f-ae6a-47aecfee6d1a/photo6.jpeg);
@media screen and (min-width: 768px) {
width: 200px;
height: 200px;
left: 20px;
top: 200px;
}
@media screen and (min-width: 1280px) {
top: 120px;
}
}
&:nth-of-type(2) {
width: 90px;
height: 90px;
right: 20px;
top: 100px;
background-image: url(https://ucarecdn.com/de455031-ac7d-480a-a248-b34c33e94ff1/photo7.jpeg);
background-position: 50%;
@media screen and (min-width: 768px) {
width: 125px;
height: 125px;
right: 50px;
top: 200px;
}
@media screen and (min-width: 1280px) {
right: 70px;
top: 150px;
}
}
&:nth-of-type(3) {
width: 300px;
height: 127px;
bottom: 60px;
left: -150px;
background-image: url(https://ucarecdn.com/5356e331-4e49-41b7-8892-cc2c78497b53/photo8.jpeg);
@media screen and (min-width: 768px) {
width: 445px;
height: 190px;
bottom: 110px;
left: -210px;
}
@media screen and (min-width: 1280px) {
bottom: 80px;
}
}
&:nth-of-type(4) {
background-image: url(https://ucarecdn.com/5ff5e1a9-a334-4789-bd1a-14c944f0bd0c/photo9.jpeg);
width: 140px;
height: 140px;
bottom: 130px;
right: -20px;
@media screen and (min-width: 768px) {
width: 260px;
height: 260px;
bottom: 170px;
right: -50px;
}
@media screen and (min-width: 1280px) {
bottom: 90px;
}
}
}
.content:nth-of-type(3) .poka-dot {
&:nth-of-type(1) {
width: 135px;
height: 135px;
left: -20px;
top: 100px;
background-image: url(https://ucarecdn.com/fcd660ef-4533-4bb1-956a-ed0f1314e291/photo11.jpeg);
@media screen and (min-width: 768px) {
width: 225px;
height: 225px;
top: 190px;
}
@media screen and (min-width: 1280px) {
left: -60px;
top: 120px;
}
@media screen and (min-width: 1440px) {
width: 300px;
height: 300px;
}
}
&:nth-of-type(2) {
width: 140px;
height: 140px;
bottom: 60px;
left: -20px;
background-image: url(https://ucarecdn.com/1e98492f-83ed-4283-82d8-ed8b130c9fa8/photo12.jpeg);
@media screen and (min-width: 768px) {
width: 200px;
height: 200px;
bottom: 100px;
left: 130px;
}
@media screen and (min-width: 1280px) {
bottom: 0;
left: 130px;
}
@media screen and (min-width: 1440px) {
width: 225px;
height: 225px;
}
}
&:nth-of-type(3) {
width: 110px;
height: 110px;
bottom: 150px;
right: -20px;
background-image: url(https://ucarecdn.com/5e578d5d-a67f-48d3-b6df-3b0dfed465cb/photo13.jpeg);
@media screen and (min-width: 768px) {
width: 195px;
height: 195px;
bottom: 250px;
right: -40px;
}
@media screen and (min-width: 1280px) {
bottom: 270px;
right: -50px;
}
@media screen and (min-width: 1440px) {
width: 225px;
height: 225px;
}
}
}
.content:nth-of-type(4) .poka-dot {
&:nth-of-type(1) {
width: 300px;
height: 120px;
bottom: 0;
left: -100px;
background-image: url(https://ucarecdn.com/ea664804-6f50-4375-84d7-8ad993ea935d/photo14.jpeg);
@media screen and (min-width: 768px) {
width: 300px;
height: 150px;
bottom: 150px;
left: 60px;
}
@media screen and (min-width: 1024px) {
bottom: 140px;
left: 20px;
}
@media screen and (min-width: 1280px) {
width: 432px;
height: 189px;
bottom: 60px;
left: 180px;
}
}
&:nth-of-type(2) {
width: 180px;
height: 180px;
right: -55px;
top: 0;
background-image: url(https://ucarecdn.com/a4af5081-3a00-4064-bc6d-deaad7add9bb/photo15.jpeg);
@media screen and (min-width: 768px) {
width: 220px;
height: 220px;
right: -55px;
top: 80px;
}
@media screen and (min-width: 1024px) {
right: -30px;
top: 120px;
}
@media screen and (min-width: 1280px) {
width: 252px;
height: 252px;
right: -35px;
top: 30px;
}
}
&:nth-of-type(3) {
width: 100px;
height: 100px;
bottom: 180px;
left: -45px;
background-image: url(https://ucarecdn.com/4a15749e-9de5-484b-a7ce-7feaf046eb64/photo16.jpeg);
@media screen and (min-width: 768px) {
width: 100px;
height: 100px;
bottom: 55%;
left: -25px;
}
@media screen and (min-width: 1024px) {
bottom: 400px;
left: -20px;
}
@media screen and (min-width: 1280px) {
width: 144px;
height: 144px;
}
}
&:nth-of-type(4) {
width: 140px;
height: 140px;
left: -40px;
top: 80px;
background-image: url(https://ucarecdn.com/3fc9f40d-ee74-4bec-90d3-59ae0db36df1/photo17.jpeg);
@media screen and (min-width: 768px) {
width: 160px;
height: 160px;
left: 40px;
}
@media screen and (min-width: 1024px) {
top: 180px;
}
@media screen and (min-width: 1280px) {
width: 216px;
height: 216px;
left: 120px;
top: 20px;
}
}
&:nth-of-type(5) {
height: 112px;
width: 260px;
bottom: 110px;
right: -98px;
background-image: url(https://ucarecdn.com/140ff563-32ee-4d8b-b5f3-36408e664318/photo18.jpeg);
@media screen and (min-width: 768px) {
width: 325px;
height: 140px;
bottom: 240px;
right: -130px;
}
@media screen and (min-width: 1024px) {
bottom: 240px;
right: -125px;
}
@media screen and (min-width: 1280px) {
width: 465px;
height: 200px;
bottom: 150px;
right: -170px;
}
}
}
View Compiled
const pokaWrappers = [].slice.call(document.querySelectorAll(".poka-wrapper"));
const messages = [].slice.call(document.querySelectorAll(".title-wrapper > p"));
const clearVisibleClassFromPokaWrappers = () => {
pokaWrappers.forEach((pokaWrapper) => {
if (pokaWrapper.classList.contains('visible')) {
pokaWrapper.classList.remove('visible')
}
});
};
const addVisibleClassToPokaWrapper = (index) => {
console.log('index', index);
clearVisibleClassFromPokaWrappers();
if (!pokaWrappers[index].classList.contains("visible")) {
pokaWrappers[index].classList.add("visible");
}
};
const removeVisibleClassFromPokaWrapper = () => {
if (pokaWrapper.classList.contains("visible")) {
pokaWrapper.classList.remove("visible");
}
};
const checkAndPlayPokaDotAnimation = () => {
messages.forEach((message, index) => {
const bounding = message.getBoundingClientRect();
if (bounding.top >= 0 && bounding.top <= window.innerHeight) {
addVisibleClassToPokaWrapper(index);
}
// else {
// removeVisibleClassFromPokaWrapper();
// }
});
};
window.addEventListener("scroll", () => {
requestAnimationFrame(checkAndPlayPokaDotAnimation);
});
requestAnimationFrame(checkAndPlayPokaDotAnimation);
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.