Galaxy
How do I make an galaxy?
A galaxy using HTML and CSS that rotates. Uses a sprite animation to make the stars twinkle. . What is a galaxy? How do you make a galaxy? This script and codes were developed by Bryan Jones on 13 July 2022, Wednesday.
Galaxy - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Galaxy</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="galaxy-wrapper"> <div id="galaxy"> <div id="galaxy-inner"> <div class="ring outer"></div> <div class="ring ring-1"></div> <div class="circle circle-1"></div> <div class="circle circle-2"></div> <div class="circle circle-3"></div> <div class="circle circle-4"></div> <div class="ring ring-2"></div> <div class="ring ring-3"></div> <div class="ring ring-4"></div> <div class="ring ring-5"></div> <div class="ring ring-6"></div> <div class="ring full"></div> </div> </div>
</div>
<div class="ship"></div>
<div class="ship-2"></div>
<div class="info-wrapper"> <p>Created by Bryan Jones</p> <p>Follow me on <a target="_blank" href="https://twitter.com/BryanJonesUS"><span class="twitter"></span></a> and on <a target="_blank" href="http://codepen.io/bartuc/"><span class="codepen"></span></a></p>
</div> <script src="js/index.js"></script>
</body>
</html>
Galaxy - Script Codes CSS Codes
/** * Declare functions. */
/** * Declare mixins. */
/** * Declare keyframes. */
@-moz-keyframes rotating { 0% { -moz-transform: rotateZ(0deg); transform: rotateZ(0deg); } 100% { -moz-transform: rotateZ(360deg); transform: rotateZ(360deg); }
}
@-webkit-keyframes rotating { 0% { -webkit-transform: rotateZ(0deg); transform: rotateZ(0deg); } 100% { -webkit-transform: rotateZ(360deg); transform: rotateZ(360deg); }
}
@keyframes rotating { 0% { -moz-transform: rotateZ(0deg); -ms-transform: rotateZ(0deg); -webkit-transform: rotateZ(0deg); transform: rotateZ(0deg); } 100% { -moz-transform: rotateZ(360deg); -ms-transform: rotateZ(360deg); -webkit-transform: rotateZ(360deg); transform: rotateZ(360deg); }
}
@-moz-keyframes go { 0% { margin-left: -200px; } 10% { margin-left: -200px; } 30% { margin-left: calc(100% + 200px); } 100% { margin-left: calc(100% + 200px); }
}
@-webkit-keyframes go { 0% { margin-left: -200px; } 10% { margin-left: -200px; } 30% { margin-left: calc(100% + 200px); } 100% { margin-left: calc(100% + 200px); }
}
@keyframes go { 0% { margin-left: -200px; } 10% { margin-left: -200px; } 30% { margin-left: calc(100% + 200px); } 100% { margin-left: calc(100% + 200px); }
}
@-moz-keyframes go2 { 0% { right: -400px; } 10% { right: -400px; } 15% { right: calc(100% + 400px); } 100% { right: calc(100% + 400px); }
}
@-webkit-keyframes go2 { 0% { right: -400px; } 10% { right: -400px; } 15% { right: calc(100% + 400px); } 100% { right: calc(100% + 400px); }
}
@keyframes go2 { 0% { right: -400px; } 10% { right: -400px; } 15% { right: calc(100% + 400px); } 100% { right: calc(100% + 400px); }
}
@-moz-keyframes stars { 0% { background-position: 0 0; } 100% { background-position: 0 -525px; }
}
@-webkit-keyframes stars { 0% { background-position: 0 0; } 100% { background-position: 0 -525px; }
}
@keyframes stars { 0% { background-position: 0 0; } 100% { background-position: 0 -525px; }
}
body { background: url("http://static.parade.com/wp-content/uploads/2014/03/Why-Do-Stars-All-Look-Almost-the-Same-Size-ftr.jpg") no-repeat 0 0 #000; overflow: hidden;
}
#galaxy-wrapper { height: 500px; left: calc(50% - 350px); position: absolute; top: calc(50% - 50px); width: 500px; -moz-transform: rotateZ(20deg); -ms-transform: rotateZ(20deg); -webkit-transform: rotateZ(20deg); transform: rotateZ(20deg);
}
.full { -moz-animation: stars 0.5s steps(3, end) 0s alternate none infinite running; -webkit-animation: stars 0.5s steps(3, end) 0s alternate none infinite running; animation: stars 0.5s steps(3, end) 0s alternate none infinite running; background: url("http://www.bryanjones.us/sites/default/files/stars.png") repeat scroll left top transparent; height: 800px; left: calc(50% - 400px); margin: 0 auto; position: absolute; top: calc(50% - 400px); width: 800px; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%;
}
#galaxy { -moz-transform: rotateX(70deg); -ms-transform: rotateX(70deg); -webkit-transform: rotateX(70deg); transform: rotateX(70deg);
}
#galaxy-inner { -moz-animation: rotating 60s linear infinite; -webkit-animation: rotating 60s linear infinite; animation: rotating 60s linear infinite;
}
.outer { background-color: #400; height: 500px; left: calc(50% - 250px); margin: 0 auto; position: absolute; top: calc(50% - 250px); width: 500px; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHJhZGlhbEdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IiIgcj0iODAlIj48c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjYWE1NTU1Ii8+PHN0b3Agb2Zmc2V0PSI4MCUiIHN0b3AtY29sb3I9IiMzMzAwMDAiLz48L3JhZGlhbEdyYWRpZW50PjwvZGVmcz48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2dyYWQpIiAvPjwvc3ZnPiA='); background-size: 100%; background-image: -moz-radial-gradient(center, ellipse cover, #aa5555 0%, #330000 80%); background-image: -webkit-radial-gradient(center, ellipse cover, #aa5555 0%, #330000 80%); background-image: radial-gradient(ellipse cover at center, #aa5555 0%, #330000 80%); -moz-box-shadow: 0 0 200px 200px #3f0909; -webkit-box-shadow: 0 0 200px 200px #3f0909; box-shadow: 0 0 200px 200px #3f0909; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%;
}
.ring-1 { background-color: #944; height: 300px; left: calc(50% - 150px); margin: 0 auto; position: absolute; top: calc(50% - 150px); text-align: center; width: 300px; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; -moz-box-shadow: 0 0 40px 40px #944; -webkit-box-shadow: 0 0 40px 40px #944; box-shadow: 0 0 40px 40px #944;
}
.ring-2 { background-color: #622; height: 250px; left: calc(50% - 125px); margin: 0 auto; position: absolute; top: calc(50% - 125px); text-align: center; width: 250px; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; -moz-box-shadow: 0 0 40px 40px #622; -webkit-box-shadow: 0 0 40px 40px #622; box-shadow: 0 0 40px 40px #622;
}
.ring-3 { background-color: #922; height: 200px; left: calc(50% - 100px); margin: 0 auto; position: absolute; top: calc(50% - 100px); text-align: center; width: 200px; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; -moz-box-shadow: 0 0 40px 40px #922; -webkit-box-shadow: 0 0 40px 40px #922; box-shadow: 0 0 40px 40px #922;
}
.ring-4 { background-color: #b88; height: 150px; left: calc(50% - 75px); margin: 0 auto; position: absolute; top: calc(50% - 75px); text-align: center; width: 150px; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; -moz-box-shadow: 0 0 40px 40px #b88; -webkit-box-shadow: 0 0 40px 40px #b88; box-shadow: 0 0 40px 40px #b88;
}
.ring-5 { background-color: #900; height: 100px; left: calc(50% - 50px); margin: 0 auto; position: absolute; top: calc(50% - 50px); text-align: center; width: 100px; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; -moz-box-shadow: 0 0 40px 40px #900; -webkit-box-shadow: 0 0 40px 40px #900; box-shadow: 0 0 40px 40px #900;
}
.ring-6 { background-color: #ebb; height: 50px; left: calc(50% - 25px); margin: 0 auto; position: absolute; top: calc(50% - 25px); text-align: center; width: 50px; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; -moz-box-shadow: 0 0 40px 40px #ebb; -webkit-box-shadow: 0 0 40px 40px #ebb; box-shadow: 0 0 40px 40px #ebb; -moz-transform: rotateX(170deg); -ms-transform: rotateX(170deg); -webkit-transform: rotateX(170deg); transform: rotateX(170deg);
}
.circle { border-left: 30px solid #500; border-top: 1px solid transparent; height: 400px; opacity: 0.5; position: absolute; width: 400px; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%;
}
.circle-2 { top: calc(50% - 200px); left: calc(-50% + 100px); -moz-transform: rotateZ(90deg); -ms-transform: rotateZ(90deg); -webkit-transform: rotateZ(90deg); transform: rotateZ(90deg);
}
.circle-3 { top: calc(50% - 200px); left: calc(50% + 0px); -moz-transform: rotateZ(270deg); -ms-transform: rotateZ(270deg); -webkit-transform: rotateZ(270deg); transform: rotateZ(270deg);
}
.circle-4 { bottom: -100%; -moz-transform: rotateZ(180deg); -ms-transform: rotateZ(180deg); -webkit-transform: rotateZ(180deg); transform: rotateZ(180deg);
}
.ship { background: url("http://www.bryanjones.us/sites/default/files/futurama.png") no-repeat 0 0 transparent; display: block; height: 100px; margin-left: -200px; position: absolute; top: 20%; width: 200px; z-index: 10; -moz-animation: go 20s linear 4s infinite; -webkit-animation: go 20s linear 4s infinite; animation: go 20s linear 4s infinite;
}
.ship-2 { background: url("http://www.bryanjones.us/sites/default/files/futurama-2.png") no-repeat 0 0 transparent; display: block; height: 220px; right: -400px; position: absolute; top: 60%; width: 400px; z-index: 10; -moz-animation: go2 20s linear 10s infinite; -webkit-animation: go2 20s linear 10s infinite; animation: go2 20s linear 10s infinite;
}
.info-wrapper { bottom: 0; height: 100px; left: 30px; position: absolute; width: 400px;
}
.info-wrapper p { color: #fff; font-size: 18px; line-height: 0; text-shadow: 1px 1px 2px #000;
}
.twitter { background: url("http://www.bryanjones.us/sites/default/files/twitter-icon.png") no-repeat 0 0 transparent; display: inline-block; height: 20px; position: relative; top: 4px; width: 20px;
}
.codepen { background: url("http://www.bryanjones.us/sites/default/files/codepen-icon.png") no-repeat 0 0 transparent; display: inline-block; height: 22px; position: relative; top: 3px; width: 22px;
}
Galaxy - Script Codes JS Codes
/** * Created by Bryan Jones. */
Developer | Bryan Jones |
Username | bartuc |
Uploaded | July 13, 2022 |
Rating | 3 |
Size | 5,087 Kb |
Views | 82,984 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Potion | 4,290 Kb |
Solar System | 3,454 Kb |
Planets | 2,959 Kb |
Form Labels | 2,717 Kb |
Lens Flare | 4,199 Kb |
Lightbulb | 2,833 Kb |
Books | 5,030 Kb |
Solar System Maker | 3,893 Kb |
CSS Loader | 2,823 Kb |
Particles | 4,160 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Delete Hover | Chungman93 | 2,557 Kb |
CSS3 keyframe onload animation. | Samueljseay | 1,706 Kb |
Price Comparison Table | Orrinward | 3,459 Kb |
Long Shadow Button | Uixcrazy | 3,550 Kb |
Simple content swap | Snografx | 1,859 Kb |
Material Design-Layout-Principles Practice | Fraina | 2,331 Kb |
Angular-HAML | Cwacht | 2,022 Kb |
Blackberry Mock | Zacharyolson | 1,865 Kb |
Test | Dviate | 2,668 Kb |
My Starter Kit For Codepen | Dkdesign | 2,012 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!