Skip to content

Commit

Permalink
Added earth animation (#2416)
Browse files Browse the repository at this point in the history
* Create Earth.html

* Add files via upload

* Update include.js

* Update include.js

* fix syntax error in include.js

---------

Co-authored-by: Sophia Brandt <16630701+sophiabrandt@users.noreply.github.com>
  • Loading branch information
stormworm9 and sophiabrandt committed Oct 31, 2023
1 parent cec6931 commit 29fc08e
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Art/stormworm9/EarthAnimation/Earth.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!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="style.css">
<title>Earth Revolving Around the Sun</title>
</head>
<body>
<div class="solar-system">
<div class="sun">
<div class="earth"></div>
</div>
</div>
</body>
</html>
Binary file added Art/stormworm9/EarthAnimation/earth.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions Art/stormworm9/EarthAnimation/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
background-color: #000;
perspective: 1000px;
}

.solar-system {
width: 200px;
height: 200px;
position: relative;
transform-style: preserve-3d;
animation: rotateEarth 10s linear infinite;
}

.sun {
width: 100px;
height: 100px;
background: radial-gradient(circle, #ffdb4d, transparent);
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

.earth {
width: 30px;
height: 30px;
background: #0b24fb;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) translateX(150px);
}

@keyframes rotateEarth {
0% {
transform: translate(-50%, -50%) translateX(150px) rotate(0deg);
}
100% {
transform: translate(-50%, -50%) translateX(150px) rotate(360deg);
}
}
7 changes: 7 additions & 0 deletions include.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
let cards = [
{
artName: 'Earth',
pageLink: './Art/stormworm9/EarthAnimation/Earth.html',
imageLink: './Art/stormworm9/EarthAnimation/earth.gif',
author: 'stormworm9',
githubLink: 'https://github.com/stormworm9'
},
{
artName: 'GoldenCoin',
pageLink: './Art/stormworm9/GoldenCoin/GoldenCoin.html',
Expand Down

0 comments on commit 29fc08e

Please sign in to comment.