← 一覧へ

Popup / 32 サンセット|Sunset

デザイン見本

オレンジ→コーラル→ピンク→パープルの4色グラデーションで夕焼けを表現。 出現時に 1.02 倍に膨らんでから 1.0 に落ち着く微細なバウンスが、通知の鮮やかさを引き立てます。

実装コード

HTML
<div id="popup-container-32">
    <button id="popup-btn-32">Sunset</button>
</div>
<div id="popup-32" class="popup-32">
    <div class="popup-content-32">
        <p>Sunset Popup</p>
        <p>夕焼けのような鮮やかなオレンジ〜パープルのグラデーションポップアップです。</p>
    </div>
</div>
CSS
/* ボタン */
#popup-btn-32 {
    cursor: pointer;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 700;
    display: block;
    margin: 0 auto;
    width: 180px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ff4e6a 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
}
#popup-btn-32:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
}

/* ポップアップ外枠 */
.popup-32 {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-width: 90%;
}
.popup-32.active {
    opacity: 1;
    visibility: visible;
    bottom: 30px;
    animation: popupShowHide32 3.5s ease forwards;
}

/* 微細バウンス付きアニメーション */
@keyframes popupShowHide32 {
    0%   { opacity: 0; transform: translateX(-50%) translateY(60px) scale(0.8); }
    12%  { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.02); }
    18%  { transform: translateX(-50%) translateY(0) scale(1); }
    82%  { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(60px) scale(0.8); }
}

/* 夕焼けグラデーション本体 */
.popup-content-32 {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 35%, #ff4e6a 65%, #c13584 100%);
    padding: 28px 40px;
    border-radius: 16px;
    text-align: center;
    position: relative;
    min-width: 320px;
    box-shadow:
        0 8px 32px rgba(255, 107, 53, 0.5),
        0 20px 40px rgba(193, 53, 132, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

/* 光の反射 */
.popup-content-32::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 30% 70%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(255,220,150,0.2) 0%, transparent 50%);
    pointer-events: none;
}

.popup-content-32 p:first-child {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.popup-content-32 p:last-of-type {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
    line-height: 1.6;
}
JS
var btn = document.getElementById('popup-btn-32');
var popup = document.getElementById('popup-32');

if (btn && popup) {
    btn.addEventListener('click', function () {
        popup.classList.add('active');
    });

    popup.addEventListener('animationend', function (e) {
        if (e.animationName.startsWith('popupShowHide')) {
            popup.classList.remove('active');
        }
    });
}