ポップアップウィンドウ:ホログラフィック|Pop-up Window: Holographic

HTML
<div class="container">
    <button id="popup-btn">Holographic</button>
</div>

<div id="popup" class="popup">
    <div class="popup-content">
        <p class="title">Holographic Popup</p>
        <p>ホログラム風の未来感あふれるポップアップウィンドウです。</p>
    </div>
</div>
CSS
.container {
    text-align: center;
}

#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;
}

#popup-btn:hover {
    opacity: 0.5;
}

.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%;
}

.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%) scale(0.8) rotateY(-15deg);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1.1) rotateY(0deg);
    }
    30% {
        transform: translateX(-50%) translateY(0) scale(1) rotateY(0deg);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1) rotateY(0deg);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(100%) scale(0.8) rotateY(15deg);
    }
}

.popup-content {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1) 0%, rgba(255, 0, 255, 0.1) 50%, rgba(0, 255, 255, 0.1) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 35px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    min-width: 320px;
    border: 2px solid rgba(0, 255, 255, 0.5);
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.3),
        0 0 60px rgba(255, 0, 255, 0.2),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    animation: holographicGlow 3s ease-in-out infinite alternate;
    overflow: hidden;
}

@keyframes holographicGlow {
    from {
        box-shadow: 
            0 0 30px rgba(0, 255, 255, 0.3),
            0 0 60px rgba(255, 0, 255, 0.2),
            inset 0 0 20px rgba(0, 255, 255, 0.1);
        border-color: rgba(0, 255, 255, 0.5);
    }
    to {
        box-shadow: 
            0 0 40px rgba(0, 255, 255, 0.5),
            0 0 80px rgba(255, 0, 255, 0.3),
            inset 0 0 30px rgba(0, 255, 255, 0.2);
        border-color: rgba(255, 0, 255, 0.5);
    }
}

.popup-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(0, 255, 255, 0.1) 5px, rgba(0, 255, 255, 0.1) 10px),
        repeating-linear-gradient(-45deg, transparent, transparent 5px, rgba(255, 0, 255, 0.1) 5px, rgba(255, 0, 255, 0.1) 10px);
    border-radius: 20px;
    pointer-events: none;
    animation: holographicScan 4s linear infinite;
}

@keyframes holographicScan {
    0% {
        opacity: 0.3;
        transform: translateY(-100%);
    }
    50% {
        opacity: 0.6;
        transform: translateY(0%);
    }
    100% {
        opacity: 0.3;
        transform: translateY(100%);
    }
}

.popup-content::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: conic-gradient(from 0deg, transparent, rgba(0, 255, 255, 0.3), transparent, rgba(255, 0, 255, 0.3), transparent);
    border-radius: 22px;
    z-index: -1;
    animation: holographicRotate 6s linear infinite;
}

@keyframes holographicRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.popup-content p.title {
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 15px;
    color: rgba(0, 255, 255, 0.9);
    text-shadow: 
        0 0 10px rgba(0, 255, 255, 0.8),
        0 0 20px rgba(0, 255, 255, 0.6);
    animation: holographicText 2s ease-in-out infinite alternate;
    font-family: 'Arial', sans-serif;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}

@keyframes holographicText {
    from {
        color: rgba(0, 255, 255, 0.9);
        text-shadow: 
            0 0 10px rgba(0, 255, 255, 0.8),
            0 0 20px rgba(0, 255, 255, 0.6);
    }
    to {
        color: rgba(255, 0, 255, 0.9);
        text-shadow: 
            0 0 10px rgba(255, 0, 255, 0.8),
            0 0 20px rgba(255, 0, 255, 0.6);
    }
}

.popup-content p {
    font-size: 16px;
    margin-bottom: 0;
    line-height: 1.6;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .popup-content {
        padding: 25px;
        min-width: 280px;
    }
    
    .popup-content h2 {
        font-size: 22px;
    }
    
    .popup-content p {
        font-size: 14px;
    }
    
    #popup-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .popup-content {
        padding: 20px;
        min-width: 250px;
    }
    
    .popup-content h2 {
        font-size: 20px;
    }
    
    .popup-content p {
        font-size: 13px;
    }
    
    #popup-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}
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');
    });
});
よかったらシェアしてね!
  • URLをコピーしました!
  • URLをコピーしました!
目次