Accordion / 033 — パステルカード
デザイン見本
- Soft Pastel Color Palette
- Smooth Rounded Design
- Light & Airy Feel
ラベンダー〜ピンクのパステルグラデーション背景が柔らかい印象のデザインです。コンテンツ開閉時の `▾` 回転に `cubic-bezier(0.34, 1.56, 0.64, 1)` を使用し、バネのような弾む動きを演出します。SNS投稿・レビュー・美容系コンテンツとの相性が特に良いデザインです。
実装コード
HTML
<div class="container">
<div class="btn-box">
<button data-default-text="Soft & Gentle Pastel" data-open-text="Close">Soft & Gentle Pastel</button>
</div>
<div class="more">
<ul>
<li>Soft Pastel Color Palette</li>
<li>Smooth Rounded Design</li>
<li>Light & Airy Feel</li>
</ul>
</div>
</div>
CSS
.container {
background: linear-gradient(135deg, #fce4ec, #f3e5f5, #e8eaf6);
border-radius: 20px;
padding: 4px;
}
.container .btn-box button {
width: 100%;
padding: 18px 24px;
background: rgba(255, 255, 255, 0.85);
border: none;
border-radius: 16px;
font-size: 14px;
font-weight: 600;
color: #7c5cbf;
cursor: pointer;
transition: background 0.3s, box-shadow 0.3s;
text-align: left;
position: relative;
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
box-shadow: 0 2px 12px rgba(124, 92, 191, 0.12);
}
.container .btn-box button::after {
content: '▾';
position: absolute;
right: 24px;
top: 50%;
transform: translateY(-50%);
color: #c9a0e8;
font-size: 18px;
transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.container:has(.more.appear) .btn-box button::after {
transform: translateY(-50%) rotate(180deg);
color: #9b59b6;
}
.container .btn-box button:hover {
background: rgba(255, 255, 255, 0.95);
box-shadow: 0 4px 20px rgba(124, 92, 191, 0.2);
}
.container .more {
max-height: 0;
overflow: hidden;
transition: max-height 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
background: rgba(255, 255, 255, 0.6);
border-radius: 0 0 16px 16px;
margin-top: -4px;
padding-top: 4px;
}
.container .more.appear {
max-height: 200px;
}
.container .more ul {
list-style: none;
padding: 16px 24px 20px;
margin: 0;
}
.container .more li {
padding: 8px 0 8px 16px;
color: #9c7abf;
font-size: 13px;
border-bottom: 1px solid rgba(124, 92, 191, 0.1);
position: relative;
}
.container .more li::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 6px;
height: 6px;
background: linear-gradient(135deg, #e091c5, #9b87e8);
border-radius: 50%;
}
.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;
}
});
}
})();