← 一覧へ

Popup / 18 ネイチャー|Nature

デザイン見本

植物や水滴をイメージした、有機的なフォルムとパステルグリーンのグラデーションが特徴です。border-radiusのアニメーションにより、生き物のようにゆらゆらと形を変える癒やし系のデザインです。

実装コード

HTML
<div id="popup-container-18">
                        <button id="popup-btn-18">Nature</button>
                    </div>
                    <div id="popup-18" class="popup-18">
                        <div class="popup-content-18">
                            <p>Nature Popup</p>
                            <p>自然をテーマにしたオーガニックなポップアップウィンドウです。</p>
                        </div>
                    </div>
CSS
#popup-btn-18 {
    cursor: pointer;
    border: none;
    padding: 12px 24px;
    border-radius: 16px;
    font-weight: 600;
    display: block;
    margin: 0 auto;
    width: 180px;
    color: #fff; background-color: #4caf50;
}
#popup-btn-18:hover {
    opacity: 0.5;
}
.popup-18 {
    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-18.active {
    opacity: 1;
    visibility: visible;
    bottom: 20px;
    transform: translateX(-50%);
    animation: popupShowHide16 3.4s ease forwards;
}
@keyframes popupShowHide16 {
    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-18 {
    background: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 50%, #ffd3b6 100%);
    padding: 35px;
    border-radius: 25px;
    text-align: center;
    position: relative;
    min-width: 320px;
    box-shadow: 
        0 15px 35px rgba(168, 230, 207, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid #4caf50;
    animation: natureFloat 4s ease-in-out infinite;
    overflow: hidden;
}
@keyframes natureFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(0.5deg);
    }
    50% {
        transform: translateY(-4px) rotate(-0.5deg);
    }
    75% {
        transform: translateY(-6px) rotate(0.3deg);
    }
}
.popup-content-18 p:first-child {
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2e7d32;
    text-shadow: 0 2px 4px rgba(46, 125, 50, 0.2);
    animation: natureText 3s ease-in-out infinite;
}
@keyframes natureText {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}
.popup-content-18 p:last-of-type {
    font-size: 16px;
    color: #388e3c;
    margin-bottom: 0;
    line-height: 1.6;
    font-weight: 500;
}
JS
var btn = document.getElementById('popup-btn-18');
var popup = document.getElementById('popup-18');

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

  popup.addEventListener('animationend', function () {
    popup.classList.remove('active');
  });
}