The content on this website, including videos and code examples, is for educational purposes only. All demonstrations and designs are fictional and created to illustrate coding techniques. Any resemblance to existing websites or brands is purely coincidental.
The creators and administrators of this website do not claim ownership or affiliation with any existing websites or companies. Users are encouraged to use the information responsibly for learning purposes. Liability for any misuse of the content provided is not accepted.
Below is the html code for this video.
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mars Landing</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="space">
<div class="ship">
<div class="ship-rotate">
<div class="pod"></div>
<div class="fuselage"></div>
</div>
</div>
<div class="ship-shadow"></div>
<div class="mars">
<div class="flag"></div>
<div class="planet">
<div class="surface"></div>
<div class="crater1"></div>
<div class="crater2"></div>
<div class="crater3"></div>
</div>
</div>
</div>
</body>
</html>
Below is the css code for this video.
style.css
* {
margin: 0;
padding: 0;
}
body {
height: 100vh;
width: 100%;
background-color: #182030;
overflow: hidden;
}
.space {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
overflow: hidden;
}
.ship {
position: absolute;
top: 50%;
right: 50%;
height: 44px;
margin-top: -110px;
margin-right: -110px;
background: #00000040;
transform-origin: 0% 100% 0%;
z-index: 1;
animation: shipAnim 9s cubic-bezier(0.75, 0.05, 0.33, 1) infinite;
}
@keyframes shipAnim {
0% {
top: -10%;
right: -10%;
margin-top: -110px;
margin-right: -110px;
}
40% {
top: 50%;
right: 50%;
}
79.5% {
margin-top: -110px;
margin-right: -110px;
}
84% {
margin-top: -40px;
margin-right: 0;
}
100% {
top: 50%;
right: 50%;
margin-top: 0;
margin-right: 0;
}
}
.ship-rotate {
position: absolute;
height: 44px;
transform: rotate(-110deg);
animation: shipRotateAnim 9s cubic-bezier(0.75, 0.05, 0.33, 1) infinite;
}
@keyframes shipRotateAnim {
0%, 20% {
transform: rotate(-110deg);
}
34%, 79%, 100% {
transform: rotate(47deg);
}
}
.pod {
position: absolute;
top: 0;
left: -16px;
height: 32px;
width: 32px;
background-color: #ddecee;
border-radius: 100% 0 100% 0;
transform: rotate(-45deg);
}
.fuselage {
position: absolute;
top: 28px;
left: -12px;
height: 16px;
width: 24px;
background-color: #bed9dd;
border-radius: 100% 100% 0 0;
}
.fuselage::after {
content: "";
position: absolute;
top: 100%;
left: 4px;
height: 0;
width: 0;
border-top: 12px solid #efa537;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
}
.ship-shadow {
position: absolute;
top: 50%;
right: 50%;
margin-top: 166px;
margin-right: -56px;
height: 8px;
width: 32px;
background-color: #1a1a1a;
border-radius: 100%;
animation: shipShadowAnim 9s cubic-bezier(0.75, 0.05, 0.33, 1) infinite;
}
@keyframes shipShadowAnim {
0% {
right: -10%;
transform: scale(1.5, 1);
opacity: 0.5;
}
40% {
right: 50%;
transform: scale(0.75, 1);
opacity: 1;
}
100% {
right: 50%;
}
}
.mars {
position: absolute;
top: 50%;
left: 50%;
z-index: 2;
}
.mars::before {
content: "";
position: absolute;
top: 160px;
left: -60px;
height: 20px;
width: 120px;
background-color: #1a1a1a;
border-radius: 50%;
}
.flag {
position: absolute;
top: -114px;
left: -2px;
height: 34px;
width: 30px;
animation: flagPoleAnim 9s cubic-bezier(0.75, 0.05, 0.33, 1) infinite;
}
@keyframes flagPoleAnim {
0%, 48%, 92%, 100% {
top: -114px;
}
54%, 90% {
top: -154px;
}
}
.flag::before {
content: "";
position: absolute;
height: 34px;
width: 4px;
background-color: #f7f2e9;
}
.flag::after {
content: "";
position: absolute;
top: 0;
left: 4px;
height: 20px;
width: 28px;
background: radial-gradient(#000080, transparent, transparent, transparent),
linear-gradient(to bottom, #ff9933, #ffffff, #138808);
animation: unRollFlagAnim 9s cubic-bezier(0.75, 0.05, 0.33, 1) infinite;
}
@keyframes unRollFlagAnim {
0%, 55% {
width: 0;
}
60%, 90%, 100% {
width: 28px;
}
}
.planet {
position: absolute;
height: 240px;
width: 240px;
border-radius: 50%;
margin-top: -120px;
margin-left: -120px;
box-sizing: border-box;
z-index: 2;
overflow: hidden;
}
.surface {
position: absolute;
top: -30%;
right: -10%;
height: 140%;
width: 140%;
background-color: #ce3409;
border-radius: 50%;
box-sizing: border-box;
border: 60px solid #00000040;
}
.crater1, .crater2, .crater3 {
position: absolute;
background-color: #00000040;
border-radius: 50%;
box-shadow: inset 6px 6px 0 #00000040;
}
.crater1 {
top: 32%;
left: 17%;
height: 40px;
width: 40px;
}
.crater2 {
top: 26%;
left: 55%;
height: 20px;
width: 20px;
box-shadow: inset 4px 4px 0 #00000040;
}
.crater3 {
top: 60%;
left: 40%;
height: 20px;
width: 20px;
box-shadow: inset 4px 4px 0 #00000040;
}
Thanks for visiting