← 一覧へ

Dialog / 33 アールデコ|Art Deco

デザイン見本

Art Deco Dialog

黒とゴールドで格調高いアールデコ調のダイアログです。

黒(#0f0f0f)とゴールド(#c9a227)の2色で1920年代のアールデコを表現。二重枠線(box-shadow の多重指定)と `::before` による内枠、グラデーション下線が幾何学的な装飾を構成します。scaleY(0.5) から展開するアニメーションが舞台幕のような演出をします。

実装コード

HTML
<button id="dialog-btn-33">Art Deco Dialog</button>
<div id="dialog-33">
    <div class="dialog-content-33">
        <div class="deco-header">
            <span>Art Deco Dialog</span>
        </div>
        <div class="deco-body">
            <p>黒とゴールドで格調高いアールデコ調のダイアログです。</p>
        </div>
        <div class="deco-footer">
            <button class="close-btn-33">Cancel</button>
            <button class="close-btn-33 primary">Confirm</button>
        </div>
    </div>
</div>
CSS
/* ボタン:ゴールドのオフセット二重枠 */
#dialog-btn-33 {
    background: #0a0a0a;
    color: #c9a227;
    border: 1px solid #c9a227;
    padding: 12px 24px;
    border-radius: 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 0 0 1px #c9a227, 3px 3px 0 #c9a227;
    transition: all 0.2s;
    letter-spacing: 2px;
    text-transform: uppercase;
}
#dialog-btn-33:hover {
    background: #c9a227;
    color: #0a0a0a;
}

/* オーバーレイ */
#dialog-33 {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    animation: fadeIn-33 0.3s;
}
@keyframes fadeIn-33 {
    from { opacity: 0; } to { opacity: 1; }
}

/* ダイアログ本体:二重枠 + 内枠 + 舞台幕アニメーション */
.dialog-content-33 {
    background: #0f0f0f;
    width: 80%;
    max-width: 440px;
    margin: 8% auto;
    position: relative;
    padding: 32px 36px;
    border: 1px solid #c9a227;
    box-shadow:
        0 0 0 3px #0f0f0f,
        0 0 0 4px #c9a227,
        0 0 40px rgba(201, 162, 39, 0.2);
    animation: decoIn-33 0.35s ease;
}
/* 内枠(アールデコ装飾) */
.dialog-content-33::before {
    content: '';
    position: absolute;
    top: 6px; left: 6px; right: 6px; bottom: 6px;
    border: 1px solid rgba(201, 162, 39, 0.35);
    pointer-events: none;
}
@keyframes decoIn-33 {
    0%   { opacity: 0; transform: scaleY(0.5); }
    100% { opacity: 1; transform: scaleY(1); }
}

.deco-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 16px;
}
/* グラデーション下線 */
.deco-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%; right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c9a227, transparent);
}
.deco-header span {
    font-size: 18px;
    font-weight: 700;
    color: #c9a227;
    letter-spacing: 3px;
    text-transform: uppercase;
}
.deco-body {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 4px;
}
.deco-body p {
    font-size: 14px;
    color: #c8b89a;
    line-height: 1.7;
    margin: 0;
    letter-spacing: 0.5px;
}
.deco-footer {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 16px;
    border-top: 1px solid rgba(201, 162, 39, 0.3);
}
.close-btn-33 {
    background: transparent;
    color: #c9a227;
    border: 1px solid #c9a227;
    padding: 8px 24px;
    border-radius: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.2s;
}
.close-btn-33:hover { background: rgba(201, 162, 39, 0.1); }
.close-btn-33.primary {
    background: #c9a227;
    color: #0a0a0a;
}
.close-btn-33.primary:hover { background: #e0b82e; }

@media (max-width: 768px) {
    .dialog-content-33 { width: 90%; }
}
JS
(function () {
    var btn = document.getElementById('dialog-btn-33');
    var dialog = document.getElementById('dialog-33');
    var closeBtns = dialog.querySelectorAll('.close-btn-33');

    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();
    });
})();