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>Eco Theme Button Popup</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<section class="container">
<div class="wrapper">
<input type="checkbox" name="checkbox" id="checkbox">
<label for="checkbox" class="popup">
<div class="lines">
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
</div>
</label>
<section class="content">
<label for="checkbox" class="close"><span>Close</span></label>
<div class="popup-header">
<div class="popup-header-line"></div>
<div class="popup-header-line"></div>
<div class="popup-header-line"></div>
</div>
<h1>Popup Title</h1>
<p>
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Obcaecati a ipsum tempora sed quis
laudantium dicta, quos itaque incidunt unde distinctio minus dolores necessitatibus voluptatibus
voluptas sit provident ullam? Sunt.
</p>
</section>
</div>
</section>
</body>
</html>
Below is the css code for this video.
style.css
* {
margin: 0;
padding: 0;
}
.container {
position: relative;
width: 100%;
height: 100vh;
background-color: #20bf55;
background-image: linear-gradient(315deg, #20bf55, #01baef);
}
.wrapper, .lines, .line, .popup::after, .content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
input[type="checkbox"] {
display: none;
}
input[type="checkbox"]:checked~label .lines .line:first-child {
transform: translate(-50%, -50%);
transition: transform 0.5s cubic-bezier(0.6, 0.5, 0.6, 1.5);
}
input[type="checkbox"]:checked~label .lines .line:last-child {
transform: translate(-50%, -50%);
transition: transform 0.5s cubic-bezier(0.6, 0.5, 0.6, 1.5);
}
input[type="checkbox"]:checked~label::after {
opacity: 0;
transform: translate(-50%, -50%) scale3d(1, 1, 1);
transition: all 0.5s cubic-bezier(0.6, 0.5, 0.6, 1.5);
}
input[type="checkbox"]:checked~.content {
transform: translate(-50%, -50%) scale3d(1, 1, 1);
transition: transform 0.5s 0.5s cubic-bezier(1, 0.05, 0.6, 1.25), box-shadow 0.5s 0.75s;
box-shadow: 0 0 2px #00000040, 0 20px 10px -15px #00000040;
}
input[type="checkbox"]:checked~.content .close {
transform: scale3d(1, 1, 1);
transition: transform 0.5s 0.75s cubic-bezier(1, 0.05, 0.6, 1.25), opacity 0.5s 0.75s, background 0.25s, box-shadow 0.25s;
opacity: 1;
}
input[type="checkbox"]:checked~.content h1 {
transform: translate(0, 0);
transition: transform 0.5s 0.75s cubic-bezier(1, 0.05, 0.6, 1.25), opacity 0.75s 0.75s;
opacity: 1;
}
input[type="checkbox"]:checked~.content p {
transform: translate(0, 0);
transition: transform 0.5s 0.75s cubic-bezier(1, 0.05, 0.6, 1.25), opacity 0.75s 0.75s;
opacity: 0.75;
}
input[type="checkbox"]:checked~.content .popup-header .popup-header-line {
opacity: 1;
transform: translate(-50%, 0);
transition: transform 0.5s 0.75s cubic-bezier(1, 0.05, 0.6, 1.25), opacity 0.75s 0.75s;
}
input[type="checkbox"]:checked~.content .popup-header .popup-header-line:first-child {
opacity: 1;
transform: translate(calc(0% - 50% - 10px), 0);
transition: transform 0.5s 0.75s cubic-bezier(1, 0.05, 0.6, 1.25), opacity 0.75s 0.75s;
}
input[type="checkbox"]:checked~.content .popup-header .popup-header-line:last-child {
opacity: 1;
transform: translate(calc(0% - 50% + 10px), 0);
transition: transform 0.5s 0.75s cubic-bezier(1, 0.05, 0.6, 1.25), opacity 0.75s 0.75s;
}
.popup {
display: block;
width: 30px;
height: 20px;
cursor: pointer;
}
.popup::after {
content: "";
width: 200px;
height: 200px;
background-color: #ffffff40;
border-radius: 50%;
opacity: 1;
transform: translate(-50%, -50%), scale3d(0, 0, 0);
transition: none;
}
.line {
width: 4px;
height: 30px;
background: #ffffff;
border-radius: 4px;
transition: transform 0.5s 1s cubic-bezier(0.6, 0.5, 0.5, 1.25);
}
.line:first-child {
transform: translate(-15px, -50%);
}
.line:last-child {
transform: translate(11px, -50%);
}
.content {
width: 200px;
height: 300px;
background: #ffffff;
border-radius: 8px;
transform: translate(-50%, -50%) scale3d(0, 0, 0);
padding: 20px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #336699;
font-family: Verdana, Geneva, Tahoma, sans-serif;
text-align: center;
transition: transform 0.5s 0.5s cubic-bezier(1, 0.05, 0.6, 1.25), box-shadow 0.5s 0.5s;
}
.content h1 {
padding-bottom: 20px;
font-size: 20px;
transition: transform 0.5s 0.05s cubic-bezier(1, 0.05, 0.6, 1.25), opacity 0.5s;
}
.content p {
line-height: 1.5;
opacity: 0.5;
font-size: 12px;
padding-bottom: 20px;
transition: transform 0.25s cubic-bezier(1, 0.05, 0.6, 1.25), opacity 0.5s;
}
.content h1, .content p {
transform: translate(0, 60px);
opacity: 0;
}
.close {
position: absolute;
bottom: 30px;
background: #20bf55;
color: #ffffff;
padding: 15px 30px;
cursor: pointer;
border-radius: 4px;
opacity: 0;
transform: scale3d(0, 0, 0);
transition: transform 0.5s cubic-bezier(1, 0.05, 0.6, 1.25), opacity 0.5s, box-shadow 0.25s;
box-shadow: 0 5px 10px -5px #20bf55;
}
.close:active {
box-shadow: 0 0 10px -5px #20bf55;
}
.close:hover {
animation: closeBtnAnim 0.5s;
}
.close span {
display: inline-block;
position: relative;
}
.close:hover span {
animation: closeBtnAnim 0.5s 0.05s;
}
.popup-header {
position: absolute;
top: 20px;
left: 50%;
transform: translate(-50%, 0);
}
.popup-header-line {
position: absolute;
top: 15px;
left: 50%;
transform: translate(-50%, -20px);
width: 4px;
height: 25px;
background: #20bf55;
border-radius: 4px;
opacity: 0;
transition: transform 0.5s 0.15s cubic-bezier(1, 0.05, 0.6, 1.25), opacity 0.75s 0.15s;
}
.popup-header-line:first-child {
transform: translate(calc(0% - 50% - 10px), -20px);
transition: transform 0.5s 0.25s cubic-bezier(1, 0.05, 0.6, 1.25), opacity 0.75s 0.25s;
}
.popup-header-line:last-child {
transform: translate(calc(0% - 50% + 10px), -20px);
transition: transform 0.5s 0.25s cubic-bezier(1, 0.05, 0.6, 1.25), opacity 0.75s 0.25s;
}
@keyframes closeBtnAnim {
0%, 100% {
transform: translate(0px, 0px);
}
40% {
transform: translate(0px, -5px);
}
80% {
transform: translate(0px, 5px);
}
}
Thanks for visiting