Accordion / 030 — オーロラリキッド
デザイン見本
- Animated Gradient Background
- Fluid and Liquid Motion
- Beautiful Color Transitions
複数のグラデーションがうねるようにアニメーションする、流体的な美しい背景が特徴のオーロラリキッドデザインです。
実装コード
HTML
<div class="container">
<div class="btn-box">
<button data-default-text="Aurora Liquid Flow" data-open-text="Close">Aurora Liquid Flow</button>
</div>
<div class="more">
<ul>
<li>Animated Gradient Background</li>
<li>Fluid and Liquid Motion</li>
<li>Beautiful Color Transitions</li>
</ul>
</div>
</div>
CSS
@keyframes acc-auroraFlow {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
.container {
margin-bottom: 0;
max-width: 100%;
padding: 4px;
background: linear-gradient(270deg, #ff9a9e, #fecfef, #a1c4fd, #c2e9fb);
background-size: 300% 300%;
animation: acc-auroraFlow 8s ease infinite;
border-radius: 16px;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}
.container .btn-box button {
width: 100%;
padding: 18px 24px;
background: rgba(255, 255, 255, 0.85);
border: none;
border-radius: 12px;
font-size: 15px;
font-weight: 700;
color: #444;
cursor: pointer;
transition: all 0.3s ease;
text-align: left;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
position: relative;
z-index: 2;
}
.container .btn-box button::before {
content: '+';
position: absolute;
right: 24px;
top: 50%;
transform: translateY(-50%);
font-size: 20px;
font-weight: 300;
color: #888;
transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.container:has(.more.appear) .btn-box button::before {
transform: translateY(-50%) rotate(135deg);
color: #ff9a9e;
}
.container .btn-box button:hover {
background: rgba(255, 255, 255, 0.95);
}
.container .more {
max-height: 0;
overflow: hidden;
transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
background: rgba(255, 255, 255, 0.6);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-radius: 0 0 12px 12px;
margin-top: -12px;
padding-top: 12px;
opacity: 0;
transform: translateY(-10px);
}
.container .more.appear {
max-height: 300px;
opacity: 1;
transform: translateY(0);
}
.container .more ul {
list-style: none;
padding: 20px 24px;
margin: 0;
}
.container .more li {
padding: 12px 0;
color: #555;
border-bottom: 1px solid rgba(255, 255, 255, 0.6);
font-size: 14px;
font-weight: 500;
position: relative;
padding-left: 20px;
}
.container .more li::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 8px;
height: 8px;
border-radius: 50%;
background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
}
.container .more li:last-child {
border-bottom: none;
}
JS
(function () {
var container = document.querySelector('.container');
if (!container) return;
var button = container.querySelector('.btn-box button');
var content = container.querySelector('.more');
if (button && content) {
button.addEventListener('click', function() {
content.classList.toggle('appear');
if (content.classList.contains('appear')) {
this.textContent = this.dataset.openText || 'Close';
} else {
this.textContent = this.dataset.defaultText;
}
});
}
})();