Coder Wrap provides free to use snippets Coder Wrap provides free to use snippets

Back to Popup & Model Popup
Preview Source Code
Download
HTML
CSS
/**Typeo CSS Start**/
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');
*{ box-sizing: border-box;}

body {
  font-family: "Poppins", sans-serif;
  color: #444;
  box-sizing: border-box;
  background-color: #f5f5f5;
}
.pupop-btn{background: #08c6fb;
    font-size: 16px;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    margin: auto;
    justify-content: center;
    cursor: pointer;
    max-width: 300px;
    margin-top: 10%;}
/**Typeo CSS End**/   
.popup-box{ 
	width:800px; 
	transition:all 1s ease 0s; 
	-webkit-transition:all 1s ease 0s; 
	margin:auto; 
	background:#fff; 
	position:fixed; 
	top:-100%; 
	left:0px; 
	right:0px;
	pointer-events: none;
	z-index: 999;
}
.popup-box img{
	width: 100%;
}
 .close-btn{ 
 	cursor:pointer; 
 	float:right; 
 	width:50px;
 	font-size: 30px; 
 	height:50px; 
 	text-align:center; 
 	background:#08c6fb; 
 	line-height:48px; 
 	color:#fff;
 	position: absolute;
 	right: 0px;
 	top: 0px;
 }
.popup-bg{ 
	position:fixed; 
	transition:all 0.6s ease 0.6s;
	-webkit-transition:all 1s ease 0s;
	visibility:hidden; 
	opacity:0; 
	width:100%; 
	height:100%; 
	float:left; 
	background:rgba(0, 0, 0, 0.8);
	pointer-events: auto;
	top: 0px;
	z-index: 988;
}
.custom-popup .popup-bg{ 
	pointer-events: auto; 
	opacity:1; 
	visibility:visible;
}
.custom-popup .popup-box {
	pointer-events: auto;
	top: 50%;
	transform: translateY(-50%);
	-webkit-transform: translateY(-50%);
}



.model-header {
    background-color: #08c6fb;
    padding: 20px 6px;
    text-align: center;
    color: #fff;
}

.model-header h2 {
    margin: 0px;
}

.model-body {
    width: 100%;
    padding: 20px;
}

.model-body h2 {
    margin: 0px;
}

.model-footer {
    text-align: center;
    width: 100%;
    padding: 5px 10px;
    background-color: #08c6fb;
    color: #fff;
}
JS
function popupModel() {
  document.body.classList.add('custom-popup');
}
function popupModelClose() {
  document.body.classList.remove('custom-popup');
}

Related Snippets

Leave a comment

Your email address will not be published. Required fields are marked *