Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple animation #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,19 @@ <h2>Score:<span id="score">0</span></h2>
<div class="overlay-screen" id="you-won-screen">
<span>YOU WON!</span>
</div>
<div class="lists">
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<!--<li></li>
<li></li>-->
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</body>
</html>
86 changes: 86 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,84 @@ h2 {
display: flex;
}

/* list animation - hariramjp777 */
.lists {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
overflow: hidden;
}

.lists ul {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
z-index: -1;
}

.lists ul li {
list-style: none;
width: 10px;
height: 10px;
background-color: #ffffff33;
border-radius: 2px;
position: absolute;
bottom: -5%;
transform: translateX(-3rem);
opacity: 1;
animation: list-animation 7s infinite linear;
}

.lists ul li:nth-child(1) {
left: 5%;
background-color: red;
animation-delay: 0.5s;
}

.lists ul li:nth-child(2) {
left: 15%;
animation-delay: 1s;
}

.lists ul li:nth-child(3) {
left: 25%;
background-color: yellow;
animation-delay: 4s;
}

.lists ul li:nth-child(4) {
left: 25%;
background-color: #0fd6cc;
animation-delay: 6s;
}

.lists ul li:nth-child(5) {
left: 75%;
background-color: #0fd6cc;
animation-delay: 0.7s;
}

.lists ul li:nth-child(6) {
left: 85%;
background-color: #dd1282;
animation-delay: 1.2s;
}

.lists ul li:nth-child(7) {
left: 95%;
background-color: #0bf117;
animation-delay: 4.2s;
}

.lists ul li:nth-child(8) {
left: 95%;
animation-delay: 6.2s;
}

@keyframes colours {
0% {
color: yellow;
Expand Down Expand Up @@ -189,3 +267,11 @@ h2 {
opacity: 0;
}
}

@keyframes list-animation {
100% {
bottom: 100%;
transform: translateX(2rem);
opacity: 0;
}
}