Retro Gaming Popup
A nostalgic popup window with vintage design elements and retro aesthetics.
HTML
<div class="container">
<div id="popup-container">
<button id="popup-btn" class="popup-btn">Retro Gaming</button>
</div>
<div id="popup" class="popup">
<div class="popup-content">
<p>Retro Gaming Popup</p>
<p>A nostalgic popup window with vintage design elements and retro aesthetics.</p>
</div>
</div>
</div>
CSS
.container {
max-width: 800px;
margin: 0 auto;
text-align: center;
}
.container .popup-btn {
cursor: pointer;
border: none;
padding: 12px 24px;
border-radius: 16px;
color: #333;
background-color: #eee;
font-weight: 600;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
display: block;
margin: 0 auto;
width: 180px;
}
.container .popup-btn:hover {
opacity: 0.5;
}
.container .popup {
position: fixed;
bottom: -100%;
left: 50%;
transform: translateX(-50%);
z-index: 1001;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
max-width: 90%;
max-height: 90%;
}
.container .popup.active {
opacity: 1;
visibility: visible;
bottom: 20px;
transform: translateX(-50%);
animation: popupShowHide 3.4s ease forwards;
}
@keyframes popupShowHide {
0% {
opacity: 0;
transform: translateX(-50%) translateY(100%);
}
20% {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
80% {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
100% {
opacity: 0;
transform: translateX(-50%) translateY(100%);
}
}
.container .popup-content {
background: #222;
padding: 28px 32px 24px 32px;
border-radius: 8px;
text-align: center;
position: relative;
min-width: 320px;
border: 4px solid #00ff00;
box-shadow: 0 0 0 4px #111, 0 8px 0 0 #00ff00, 0 12px 24px #000;
font-family: 'Press Start 2P', 'MS Gothic', 'monospace';
color: #00ff00;
letter-spacing: 1px;
text-shadow: 0 0 6px #00ff00, 0 0 2px #fff;
overflow: hidden;
}
.container .popup-content::before {
content: '';
position: absolute;
top: 0; left: 0; right: 0; height: 8px;
background: repeating-linear-gradient(90deg, #00ff00 0 8px, transparent 8px 16px);
opacity: 0.7;
}
.container .popup-content::after {
content: '';
position: absolute;
left: 0; right: 0; bottom: 0; height: 8px;
background: repeating-linear-gradient(90deg, #00ff00 0 8px, transparent 8px 16px);
opacity: 0.7;
}
.container .popup-content p:first-child {
font-size: 18px;
font-family: 'Press Start 2P', 'MS Gothic', 'monospace';
font-weight: bold;
margin-bottom: 18px;
color: #00ff00;
text-transform: uppercase;
letter-spacing: 2px;
text-shadow: 0 0 6px #00ff00, 0 0 2px #fff;
border-bottom: 2px solid #00ff00;
padding-bottom: 8px;
position: relative;
}
.container .popup-content p:last-of-type {
font-size: 13px;
color: #00ff00;
font-family: 'Press Start 2P', 'MS Gothic', 'monospace';
margin-bottom: 0;
line-height: 1.7;
text-shadow: 0 0 4px #00ff00;
background: rgba(0,0,0,0.3);
padding: 10px 0 0 0;
border-top: 1px dashed #00ff00;
}
JavaScript
document.addEventListener('DOMContentLoaded', function() {
const popupBtn = document.getElementById('popup-btn');
const popup = document.getElementById('popup');
popupBtn.addEventListener('click', function() {
popup.classList.add('active');
});
popup.addEventListener('animationend', function() {
popup.classList.remove('active');
});
});