← 一覧へ

Popup / 22 ニューモーフィズム|Neumorphism

デザイン見本

要素が背景から押し出されているかのような立体感を持つ特徴的なUIです。明暗のドロップシャドウを細かく調整し、統一感と柔らかさを表現しています。

実装コード

HTML
<div id="popup-container-22">
    <button id="popup-btn-22">Neumorphism</button>
</div>
<div id="popup-22" class="popup-22">
    <div class="popup-content-22">
        <p>Neumorphism Popup</p>
        <p>凹凸のある柔らかいプラスチックのような質感のポップアップです。</p>
    </div>
</div>
CSS
#popup-btn-22 {
    cursor: pointer;
    border: none;
    padding: 12px 24px;
    border-radius: 16px;
    font-weight: 600;
    display: block;
    margin: 0 auto;
    width: 180px;
    color: #4a5568; 
    background-color: #e0e5ec;
    box-shadow: 6px 6px 10px rgba(163, 177, 198, 0.6), -6px -6px 10px rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}
#popup-btn-22:hover {
    box-shadow: inset 6px 6px 10px rgba(163, 177, 198, 0.6), inset -6px -6px 10px rgba(255, 255, 255, 0.8);
}
.popup-22 {
    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-22.active {
    opacity: 1;
    visibility: visible;
    bottom: 30px;
    transform: translateX(-50%);
    animation: popupShowHide22 3.4s ease forwards;
}
@keyframes popupShowHide22 {
    0% { opacity: 0; transform: translateX(-50%) translateY(100%); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(100%); }
}
.popup-content-22 {
    background: #e0e5ec;
    padding: 30px 40px;
    border-radius: 20px;
    text-align: center;
    min-width: 320px;
    box-shadow: 12px 12px 24px rgba(163, 177, 198, 0.7), -12px -12px 24px rgba(255, 255, 255, 0.9);
}
.popup-content-22 p:first-child {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #4a5568;
    text-shadow: 2px 2px 4px rgba(163, 177, 198, 0.5), -2px -2px 4px rgba(255, 255, 255, 1);
}
.popup-content-22 p:last-of-type {
    font-size: 16px;
    color: #718096;
    margin-bottom: 0;
    line-height: 1.6;
}
JS
var btn = document.getElementById('popup-btn-22');
var popup = document.getElementById('popup-22');

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