Skip to content

Commit

Permalink
Add rotating square animation (#2740)
Browse files Browse the repository at this point in the history
Co-authored-by: Laureline Paris <32878345+LaurelineP@users.noreply.github.com>
  • Loading branch information
terrifricker and LaurelineP authored Oct 14, 2024
1 parent 2dec7bb commit aae9d13
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Art/terrifricker-rotatingSquare/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rotating Square</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="square"></div>
</body>
</html>
4 changes: 4 additions & 0 deletions Art/terrifricker-rotatingSquare/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"artName": "Rotating Square",
"githubHandle": "terrifricker"
}
42 changes: 42 additions & 0 deletions Art/terrifricker-rotatingSquare/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
* {
box-sizing: border-box;
}
body {
min-height: 100vh;
margin: 0;
background-color: black;
display: flex;
align-items: center;
justify-content: center;
}
.square {
width: 100px;
aspect-ratio: 1;
animation-delay: 250ms;
animation-duration: 5s;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-name: spin;
}
@keyframes spin {
0% {
width: 100px;
border: 2pt solid #f7240c;
transform: rotate(1.25turn)
}
25% {
width: 150px;
border: 2pt solid #30f70c;
transform: rotate(2.50turn)
}
50% {
width: 200px;
border: 2pt solid #0c3bf7;
transform: rotate(1.25turn)
}
100% {
width: 150px;
border: 2pt solid #f70ca1;
transform: rotate(2.50turn)
}
}

0 comments on commit aae9d13

Please sign in to comment.