← 一覧へ

Popup / 30 メタリック|Metallic

デザイン見本

硬質な金属の反射を複数の重なるグラデーションと動く背景により実現。工業的でメカニカルなデザインや、重厚感が必要なシステム画面などにフィットします。

実装コード

HTML
<div id="popup-container-30">
    <button id="popup-btn-30">Metallic</button>
</div>
<div id="popup-30" class="popup-30">
    <div class="popup-content-30">
        <p>Metallic Popup</p>
        <p>クロムやシルバー金属のような冷たく鋭い光沢感のポップアップです。</p>
    </div>
</div>
CSS
#popup-btn-30 {
    cursor: pointer;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 700;
    display: block;
    margin: 0 auto;
    width: 180px;
    color: #333; 
    background: linear-gradient(to bottom, #f5f5f5 0%, #e0e0e0 50%, #d5d5d5 51%, #bdbdbd 100%);
    box-shadow: 
        inset 0 1px 0 rgba(255,255,255,1), 
        0 2px 4px rgba(0,0,0,0.3), 
        0 1px 2px rgba(0,0,0,0.2);
    text-shadow: 0 1px 0 rgba(255,255,255,0.8);
    transition: all 0.1s;
}
#popup-btn-30:active {
    background: linear-gradient(to bottom, #bdbdbd 0%, #d5d5d5 50%, #e0e0e0 51%, #f5f5f5 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
    text-shadow: none;
    color: #111;
}
.popup-30 {
    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-30.active {
    opacity: 1;
    visibility: visible;
    bottom: 30px;
    transform: translateX(-50%);
    animation: popupShowHide30 3.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes popupShowHide30 {
    0% { opacity: 0; transform: translateX(-50%) translateY(100%) rotateX(-20deg); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0) rotateX(0deg); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0) rotateX(0deg); }
    100% { opacity: 0; transform: translateX(-50%) translateY(100%) rotateX(-20deg); }
}
.popup-content-30 {
    background: linear-gradient(135deg, #e0e0e0 0%, #ffffff 20%, #e0e0e0 40%, #b0b0b0 50%, #e0e0e0 60%, #ffffff 80%, #e0e0e0 100%);
    background-size: 200% 200%;
    animation: metalShine 4s linear infinite;
    padding: 30px 40px;
    border-radius: 8px;
    border: 1px solid #999;
    text-align: center;
    position: relative;
    min-width: 320px;
    box-shadow: 
        inset 0 2px 3px rgba(255,255,255,0.8), 
        inset 0 -2px 3px rgba(0,0,0,0.2), 
        0 10px 20px rgba(0,0,0,0.4),
        0 20px 40px rgba(0,0,0,0.2);
    color: #333;
}
@keyframes metalShine {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 200%; }
}
.popup-content-30::before {
    content: '';
    position: absolute;
    top: 5px; left: 5px; right: 5px; bottom: 5px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 3px;
    pointer-events: none;
}
.popup-content-30 p:first-child {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #444;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.8), -1px -1px 0 rgba(0,0,0,0.3);
    letter-spacing: 1px;
}
.popup-content-30 p:last-of-type {
    font-size: 15px;
    color: #555;
    margin-bottom: 0;
    line-height: 1.6;
    font-weight: 500;
}
JS
var btn = document.getElementById('popup-btn-30');
var popup = document.getElementById('popup-30');

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