Popup / 11 フローティング|Floating Action
デザイン見本
Floating Action Popup
浮遊感のあるアクション指向のポップアップウィンドウです。
フローティングアクションボタン(FAB)のような丸みを帯びた形状が特徴です。カラフルなボーダーと拡大縮小アニメーション(scale)により、アプリライクで軽快な操作感を演出します。
実装コード
HTML
<div id="popup-container-11">
<button id="popup-btn-11">Floating Action</button>
</div>
<div id="popup-11" class="popup-11">
<div class="popup-content-11">
<p>Floating Action Popup</p>
<p>浮遊感のあるアクション指向のポップアップウィンドウです。</p>
</div>
</div>
CSS
/* Button Style */
#popup-btn-11 {
cursor: pointer;
border: none;
padding: 12px 24px;
border-radius: 16px;
font-weight: 600;
display: block;
margin: 0 auto;
width: 180px;
color: #fff;
background-color: #e91e63;
}
#popup-btn-11:hover {
opacity: 0.5;
}
/* Popup Style */
.popup-11 {
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-11.active {
opacity: 1;
visibility: visible;
bottom: 20px;
transform: translateX(-50%);
animation: popupShowHide11 3.4s ease forwards;
}
@keyframes popupShowHide11 {
0% {
opacity: 0;
transform: translateX(-50%) translateY(100%) scale(0.8);
}
20% {
opacity: 1;
transform: translateX(-50%) translateY(0) scale(1.1);
}
30% {
transform: translateX(-50%) translateY(0) scale(1);
}
80% {
opacity: 1;
transform: translateX(-50%) translateY(0) scale(1);
}
100% {
opacity: 0;
transform: translateX(-50%) translateY(100%) scale(0.8);
}
}
.popup-content-11 {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 30px;
border-radius: 25px;
text-align: center;
position: relative;
min-width: 300px;
box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
border: 2px solid rgba(255, 255, 255, 0.2);
animation: floatingAction 3s ease-in-out infinite;
}
@keyframes floatingAction {
0%, 100% {
transform: translateY(0px);
}
50% {
transform: translateY(-8px);
}
}
.popup-content-11::before {
content: '';
position: absolute;
top: -2px;
left: -2px;
right: -2px;
bottom: -2px;
background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
border-radius: 27px;
z-index: -1;
animation: borderRotate 4s linear infinite;
}
@keyframes borderRotate {
0% {
filter: hue-rotate(0deg);
}
100% {
filter: hue-rotate(360deg);
}
}
.popup-content-11 p:first-child {
font-size: 24px;
font-weight: bold;
margin-bottom: 15px;
color: white;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
animation: textPulse 2s ease-in-out infinite;
}
@keyframes textPulse {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(1.05);
}
}
.popup-content-11 p:last-of-type {
font-size: 16px;
color: rgba(255, 255, 255, 0.9);
margin-bottom: 25px;
line-height: 1.6;
}
JS
var btn = document.getElementById('popup-btn-11');
var popup = document.getElementById('popup-11');
if (btn && popup) {
btn.addEventListener('click', function () {
popup.classList.add('active');
});
popup.addEventListener('animationend', function () {
popup.classList.remove('active');
});
}