← 一覧へ

Popup / 23 オーロラ|Aurora

デザイン見本

複数の色が混ざるグラデーション背景をアニメーションで動かし、幻想的なオーロラのような揺らぎを演出します。ゆっくりとした動きがユーザーの目を惹きますが、邪魔にはなりません。

実装コード

HTML
<div id="popup-container-23">
    <button id="popup-btn-23">Aurora</button>
</div>
<div id="popup-23" class="popup-23">
    <div class="popup-content-23">
        <p>Aurora Popup</p>
        <p>オーロラのように色がゆっくりと変化・揺らぐポップアップです。</p>
    </div>
</div>
CSS
#popup-btn-23 {
    cursor: pointer;
    border: none;
    padding: 12px 24px;
    border-radius: 16px;
    font-weight: 600;
    display: block;
    margin: 0 auto;
    width: 180px;
    color: #fff; 
    background: linear-gradient(45deg, #a18cd1, #fbc2eb);
    box-shadow: 0 4px 15px rgba(161, 140, 209, 0.4);
}
#popup-btn-23:hover {
    filter: brightness(1.1);
}
.popup-23 {
    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-23.active {
    opacity: 1;
    visibility: visible;
    bottom: 30px;
    transform: translateX(-50%);
    animation: popupShowHide23 3.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes popupShowHide23 {
    0% { opacity: 0; transform: translateX(-50%) translateY(100%); filter: hue-rotate(0deg); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); filter: hue-rotate(90deg); }
    100% { opacity: 0; transform: translateX(-50%) translateY(100%); }
}
.popup-content-23 {
    background: linear-gradient(-45deg, #ff9a9e, #fecfef, #a18cd1, #fbc2eb);
    background-size: 400% 400%;
    animation: auroraBg 10s ease infinite;
    padding: 35px 40px;
    border-radius: 20px;
    text-align: center;
    min-width: 320px;
    box-shadow: 0 15px 35px rgba(161, 140, 209, 0.5);
    color: white;
    position: relative;
    overflow: hidden;
}
@keyframes auroraBg {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.popup-content-23::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 0;
}
.popup-content-23 p {
    position: relative;
    z-index: 1;
}
.popup-content-23 p:first-child {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.popup-content-23 p:last-of-type {
    font-size: 16px;
    margin-bottom: 0;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
JS
var btn = document.getElementById('popup-btn-23');
var popup = document.getElementById('popup-23');

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