← 一覧へ

Dialog / 15 ホログラフィック|Holographic

デザイン見本

🌟
Holographic Dialog

ホログラム風の未来感あふれるダイアログボックスです。

ホログラム風の未来感あふれるダイアログボックスです。

実装コード

HTML
<button id="dialog-btn-15">Holographic<br>Dialog</button>
                <div id="dialog-15" class="dialog">
                    <div class="dialog-content">
                        <div class="holographic-header">
                            <div class="holographic-icon">🌟</div>
                            <span>Holographic Dialog</span>
                        </div>
                        <div class="holographic-body">
                            <p>ホログラム風の未来感あふれるダイアログボックスです。</p>
                        </div>
                        <div class="holographic-footer">
                            <button class="holographic-btn-secondary">Cancel</button>
                            <button class="holographic-btn-primary">Activate</button>
                        </div>
                    </div>
                </div>
CSS
#dialog-btn-15 {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 200px;
    min-height: 60px;
    display: inline-block;
    text-align: center;
    line-height: 1.4;
    vertical-align: middle;
}

#dialog-btn-15:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

#dialog-15 {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn-15 0.3s;
}

#dialog-15 .dialog-content {
    width: 80%;
    max-width: 500px;
    margin: 10% auto;
    background: linear-gradient(135deg,
        rgba(138, 43, 226, 0.5),
        rgba(75, 0, 130, 0.5),
        rgba(138, 43, 226, 0.5));
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 30px;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow:
        0 0 30px rgba(138, 43, 226, 0.3),
        0 0 60px rgba(75, 0, 130, 0.2),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
    animation: holographicGlow-15 3s ease-in-out infinite alternate, floatIn-15 0.6s ease-out;
}

#dialog-15 .holographic-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(138, 43, 226, 0.3);
}

#dialog-15 .holographic-icon {
    font-size: 2em;
    animation: holographicFloat-15 2s ease-in-out infinite;
}

#dialog-15 .holographic-header span {
    font-size: 1.5em;
    font-weight: 600;
    background: white;
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: holographicShift-15 3s ease-in-out infinite;
}

#dialog-15 .holographic-body {
    margin-bottom: 25px;
}

#dialog-15 .holographic-body p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 1em;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

#dialog-15 .holographic-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

#dialog-15 .holographic-btn-secondary,
#dialog-15 .holographic-btn-primary {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#dialog-15 .holographic-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(138, 43, 226, 0.3);
}

#dialog-15 .holographic-btn-secondary:hover {
    background: rgba(138, 43, 226, 0.2);
    border-color: rgba(138, 43, 226, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(138, 43, 226, 0.3);
}

#dialog-15 .holographic-btn-primary {
    background: linear-gradient(45deg, #8a2be2, #4b0082);
    color: white;
    border: 1px solid rgba(138, 43, 226, 0.5);
}

#dialog-15 .holographic-btn-primary:hover {
    background: linear-gradient(45deg, #4b0082, #8a2be2);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(138, 43, 226, 0.5);
}

@keyframes fadeIn-15 {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes floatIn-15 {
    0% {
        transform: translateY(50px) scale(0.9);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes holographicGlow-15 {
    0% {
        border-color: rgba(138, 43, 226, 0.5);
        box-shadow:
            0 0 30px rgba(138, 43, 226, 0.3),
            0 0 60px rgba(75, 0, 130, 0.2),
            inset 0 0 30px rgba(255, 255, 255, 0.1);
    }
    100% {
        border-color: rgba(75, 0, 130, 0.8);
        box-shadow:
            0 0 40px rgba(138, 43, 226, 0.5),
            0 0 80px rgba(75, 0, 130, 0.3),
            inset 0 0 40px rgba(255, 255, 255, 0.2);
    }
}

@keyframes holographicFloat-15 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

@keyframes holographicShift-15 {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@media (max-width: 768px) {
    #dialog-15 .dialog-content {
        width: 90%;
        margin: 15% auto;
        padding: 15px;
    }

    #dialog-15 .holographic-header span {
        font-size: 16px;
    }

    #dialog-15 .holographic-body p {
        font-size: 14px;
    }
}
JS
(function () {
      var btn = document.getElementById('dialog-btn-15');
      var dialog = document.getElementById('dialog-15');
      var closeBtns = dialog ? dialog.querySelectorAll('button') : [];

      if (!btn || !dialog) return;

      function openDialog() {
        dialog.style.display = 'block';
        document.body.style.overflow = 'hidden';
      }

      function closeDialog() {
        dialog.style.display = 'none';
        document.body.style.overflow = 'auto';
      }

      btn.addEventListener('click', openDialog);
      
      closeBtns.forEach(function(b) { b.addEventListener('click', closeDialog); });

      dialog.addEventListener('click', function (e) {
        if (e.target === dialog) {
          closeDialog();
        }
      });

      document.addEventListener('keydown', function (e) {
        if (e.key === 'Escape' && dialog.style.display === 'block') {
          closeDialog();
        }
      });
    })();