Skip to content

Commit

Permalink
Merge pull request #1715 from zero-to-mastery/carv0066-animation-button
Browse files Browse the repository at this point in the history
Carv0066 animation button
  • Loading branch information
l-white committed Sep 6, 2023
2 parents 1560856 + a5f8956 commit ff458ab
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 0 deletions.
Binary file added Art/detonate-button/detonate-button.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions Art/detonate-button/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/Art/detonate-button/main.css" />
<title>Document</title>
</head>

<body>
<main class="container">
<button class="doomsday explosion">Doomsday!!</button>
</main>
</body>
</html>
128 changes: 128 additions & 0 deletions Art/detonate-button/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
.container {
text-align: center;
height: 100vh; /*reason it was not centering, i had height at just 100% instead of 100vh*/
display: flex;
justify-content: center;
align-items: center;
}

.doomsday {
margin: 0 auto;
height: 80px;
color: white;
background-color: #dc143c;
font-size: 2em;
font-weight: bold;
animation-name: normalmode;
animation-duration: 2s;
animation-timing-function: linear;
animation-delay: 0;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-fill-mode: both;
border: 2mm ridge rgba(50, 1, 3, 0.6);
border-radius: 10px;
}

.doomsday:hover {
color: white;
font-size: 2em;
font-weight: bold;
animation-name: hovering-active;
animation-duration: 2s;
animation-timing-function: linear;
animation-delay: 0;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-fill-mode: both;
}

/* Not infinite so it stays big and explodes in the end*/
.doomsday:active {
color: white;
font-size: 2em;
font-weight: bold;
animation-name: hovering-active;
animation-duration: 0.3s;
animation-timing-function: linear;
animation-delay: 0;
animation-iteration-count: 29;
animation-direction: alternate;
animation-fill-mode: both;
}

@keyframes normalmode {
0%,
10% {
color: orange;
}

40% {
color: yellow;
}

60% {
color: green;
}

100% {
color: #dc143c;
}
}

@keyframes hovering-active {
0% {
transform: translate(0) scale(1);
}

10% {
transform: translate(-2px, 2px);
color: orange;
}

20% {
transform: translate(2px, -2px);
color: orange;
}

30% {
transform: translate(-2px, 2px) scale(1.2);
color: yellow;
}

40% {
transform: translate(-3px, -3px) scale(1.2);
color: yellow;
}

50% {
transform: translate(3px, -3px) scale(1.2);
color: yellow;
}

60% {
transform: translate(3px, 3px) scale(1.2);
color: green;
}

70% {
transform: translate(-4px, -4px) scale(1.2);
color: green;
}

80% {
transform: translate(4px, -4px) scale(1.5);
color: green;
}

90% {
transform: translate(5px, -5px) scale(1.5);
color: #dc143c;
}

100% {
transform: translate(0) scale(2.5);
color: #dc143c;
animation-delay: 1s;
}
}
7 changes: 7 additions & 0 deletions include.js
Original file line number Diff line number Diff line change
Expand Up @@ -6539,6 +6539,13 @@ let cards = [
imageLink: './Art/nfluk/Screenshot.png',
author: 'nfluk',
githubLink: 'https://github.com/nfluk'
},
{
artName: 'Detonation Button',
pageLink: './Art/detonate-button/index.html',
imageLink: './Art/detonate-button/detonate-button.gif',
author: 'carv066',
githubLink: 'https://github.com/carv0066'
}
];

Expand Down

0 comments on commit ff458ab

Please sign in to comment.