Popup / 10 グラスモーフィズム|Glassmorphism
デザイン見本
Glassmorphism Popup
ガラスのような透明感とぼかし効果のポップアップです。
すりガラスのような質感を表現した、トレンドのグラスモーフィズムデザインです。背景をぼかす(backdrop-filter)ことで、コンテンツの可読性を保ちつつ、背景との一体感を生み出します。
実装コード
HTML
<div id="popup-container-10">
<button id="popup-btn-10">Glassmorphism</button>
</div>
<div id="popup-10" class="popup-10">
<div class="popup-content-10">
<p>Glassmorphism Popup</p>
<p>ガラスのような透明感とぼかし効果のポップアップです。</p>
</div>
</div>
CSS
/* Button Style */
#popup-btn-10 {
cursor: pointer;
border: none;
padding: 12px 24px;
border-radius: 16px;
font-weight: 600;
display: block;
margin: 0 auto;
width: 180px;
color: #333;
background: rgba(255, 255, 255, 0.5);
backdrop-filter: blur(5px);
border: 1px solid rgba(255, 255, 255, 0.7);
}
#popup-btn-10:hover {
opacity: 0.5;
}
/* Popup Style */
.popup-10 {
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-10.active {
opacity: 1;
visibility: visible;
bottom: 20px;
transform: translateX(-50%);
animation: popupShowHide10 3.4s ease forwards;
}
@keyframes popupShowHide10 {
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-10 {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
padding: 30px;
border-radius: 20px;
text-align: center;
position: relative;
min-width: 300px;
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37), 0 0 0 1px rgba(255, 255, 255, 0.18);
overflow: hidden;
}
.popup-content-10::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
border-radius: 20px;
pointer-events: none;
}
.popup-content-10 p:first-child {
font-size: 24px;
font-weight: bold;
margin-bottom: 15px;
color: rgba(0, 0, 0, 0.9);
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.popup-content-10 p:last-of-type {
font-size: 16px;
color: rgba(0, 0, 0, 0.8);
margin-bottom: 25px;
line-height: 1.6;
}
JS
var btn = document.getElementById('popup-btn-10');
var popup = document.getElementById('popup-10');
if (btn && popup) {
btn.addEventListener('click', function () {
popup.classList.add('active');
});
popup.addEventListener('animationend', function () {
popup.classList.remove('active');
});
}