アコーディオン:ネオン風|Accordion: Neon Style
- Neon light glowing effects
- Cyberpunk atmosphere
- Glowing animation on hover
- Perfect for dark themes
- Impactful visual effects
HTML
<div class="container">
<div class="btn-box">
<button data-default-text="Neon Style Accordion" data-open-text="Close">Neon Style Accordion</button>
</div>
<div class="more">
<ul>
<li>Neon light glowing effects</li>
<li>Cyberpunk atmosphere</li>
<li>Glowing animation on hover</li>
<li>Perfect for dark themes</li>
<li>Impactful visual effects</li>
</ul>
</div>
</div>
CSS
@keyframes fadeIn {
0% {
opacity: 0;
transform: translateY(-10px);
}
100% {
opacity: 1;
transform: none;
}
}
body {
background: #1a1a1a;
color: #fff;
}
.container {
margin-bottom: 30px;
max-width: 600px;
margin-left: auto;
margin-right: auto;
}
.container .btn-box button {
width: 100%;
padding: 20px 25px;
background: #1a1a1a;
border: 2px solid #00ff88;
border-radius: 8px;
font-size: 16px;
font-weight: 600;
color: #00ff88;
cursor: pointer;
transition: all 0.3s ease;
text-align: left;
position: relative;
text-shadow: 0 0 10px #00ff88;
box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}
.container .btn-box button:hover {
background: #00ff88;
color: #1a1a1a;
text-shadow: none;
box-shadow: 0 0 30px rgba(0, 255, 136, 0.6);
transform: scale(1.02);
}
.container .more {
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease;
background: #1a1a1a;
border: 2px solid #00ff88;
border-top: none;
border-radius: 0 0 8px 8px;
box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}
.container .more.appear {
max-height: 300px;
animation: fadeIn 0.3s ease;
}
.container .more ul {
list-style: none;
padding: 20px;
margin: 0;
}
.container .more li {
padding: 12px 0;
color: #00ff88;
border-bottom: 1px solid rgba(0, 255, 136, 0.3);
text-shadow: 0 0 5px #00ff88;
}
.container .more li:last-child {
border-bottom: none;
}
/* レスポンシブ対応 */
@media (max-width: 768px) {
.container .btn-box button {
font-size: 14px;
padding: 15px 20px;
}
.container .more ul {
padding: 15px;
}
}
JavaScript
document.addEventListener('DOMContentLoaded', function() {
const button = document.querySelector('.btn-box button');
const content = document.querySelector('.more');
button.addEventListener('click', function() {
content.classList.toggle('appear');
// ボタンテキストの切り替え
if (content.classList.contains('appear')) {
this.textContent = this.dataset.openText || '閉じる';
} else {
this.textContent = this.dataset.defaultText;
}
});
});