A Pen by Waliya Yohanna Joseph on CodePen.
Created
November 19, 2018 15:17
-
-
Save yohannawaliya/0c2bee8fc565760c968324656437d927 to your computer and use it in GitHub Desktop.
Earth Rotation By Animating Translation Of Image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="earth"> | |
<div>Jesus</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.earth { | |
width: 300px; | |
height: 300px; | |
position: fixed; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
margin: auto; | |
overflow: hidden; | |
border-radius: 50%; | |
box-shadow: 0 0 20px 20px #000 inset, 0 0 20px 2px #000; | |
} | |
.earth:after { | |
position: absolute; | |
content: ""; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
box-shadow: -20px -20px 50px 2px #000 inset; | |
border-radius: 50%; | |
} | |
.earth > div { | |
width: 200%; | |
height: 100%; | |
animation: spin 30s linear alternate infinite; | |
background: url(https://web.opendrive.com/api/v1/download/file.json/NTlfMTQ1MTkzNDhf?inline=1); | |
/*orginal image at https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Earthmap1000x500compac.jpg/640px-Earthmap1000x500compac.jpg */ | |
background-size: cover; | |
} | |
@keyframes spin { | |
to { | |
transform: translateX(-50%); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment