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>Lappy - A Laptop</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h1 class="title">Lappy - A Laptop</h1>
<div class="container">
<div class="lappy">
<div class="lappy top">
<div class="screen">
<div class="screen top">
<div class="btn close-btn"></div>
<div class="btn min-btn"></div>
<div class="btn max-btn"></div>
</div>
<div class="screen image"></div>
<div class="text">
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
</div>
</div>
</div>
<div class="lappy bottom"></div>
</div>
</div>
</body>
</html>
Below is the css code for this video.
style.css
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
display: grid;
}
html, body {
height: 100vh;
width: 100%;
}
body {
display: flex;
flex: 1;
align-items: center;
justify-content: center;
background-color: #d9e4f5;
background-image: linear-gradient(135deg, #d9e4f5, #f5e3e6);
overflow: hidden;
}
.title {
position: absolute;
top: 7.5%;
transform: translateY(-7.5%);
font-size: 48px;
font-family: fantasy;
color: #364057;
animation: titleAnim 2s linear;
}
@keyframes titleAnim {
0% {
transform: scale3d(0.5, 0.5, 0.5);
}
50% {
transform: scale3d(0.25, 0.25, 0.25);
}
100% {
transform: scale3d(1, 1, 1);
}
}
.container {
margin: auto;
width: 480px;
height: 324px;
}
.lappy {
position: absolute;
}
.lappy.top {
z-index: 1;
left: 24px;
width: 432px;
height: 288px;
background-color: #364057;
border-radius: 12px 12px 0 0;
animation: lappyTopAnim 0.5s 0.25s both;
}
.screen {
position: absolute;
top: 24px;
left: 24px;
width: 384px;
height: 240px;
background-color: #fafafa;
}
.screen.top {
top: 0;
left: 0;
width: 384px;
height: 36px;
background-color: #707c9c;
}
.btn {
position: absolute;
top: 8.5px;
width: 16px;
height: 16px;
border-radius: 100%;
}
.btn.close-btn {
left: 24px;
background-color: #ff605c;
}
.btn.min-btn {
left: 54px;
background-color: #ffbd44;
}
.btn.max-btn {
left: 84px;
background-color: #00ca4e;
}
.screen.image {
top: 60px;
width: 120px;
height: 84px;
background-color: #dadada;
opacity: 0;
animation: imgAnim 0.5s 1s ease-out forwards;
}
.line {
position: absolute;
width: 192px;
height: 12px;
background-color: #dadada;
opacity: 0;
}
.line:nth-child(1), .line:nth-child(2), .line:nth-child(3) {
left: 168px;
animation: topLinesAnim 0.5s 1s ease-out forwards;
}
.line:nth-child(4), .line:nth-child(5) {
left: 24px;
animation: bottomLinesAnim 0.5s 1s ease-out forwards;
}
.line:nth-child(1) {
top: 60px;
}
.line:nth-child(2) {
top: 96px;
}
.line:nth-child(3) {
top: 132px;
}
.line:nth-child(4) {
top: 168px;
}
.line:nth-child(5) {
top: 204px;
}
.lappy.bottom {
top: 288px;
width: 480px;
height: 36px;
background-color: #dadada;
background-image: linear-gradient(to top, #707c9c, #dadada);
border-radius: 6px 6px 72px 72px;
animation: lappyTopAnim 0.5s both;
}
.lappy.bottom::before {
content: "";
position: absolute;
left: 168px;
height: 20px;
width: 120px;
background-color: #707c9c;
border-radius: 0 0 12px 12px;
border-bottom: 2px solid #fafafa;
}
@keyframes lappyTopAnim {
0% {
opacity: 0;
transform: scale3d(0.25, 0.25, 0.25);
}
100% {
opacity: 1;
}
}
@keyframes imgAnim {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes topLinesAnim {
0% {
width: 0;
}
50% {
width: 96px;
opacity: 1;
}
100% {
width: 192px;
opacity: 1;
}
}
@keyframes bottomLinesAnim {
0% {
width: 0;
}
50% {
width: 192px;
opacity: 1;
}
100% {
width: 336px;
opacity: 1;
}
}
Thanks for visiting