← 一覧へ

Accordion / 006 — ネオン|Neon Style

デザイン見本

  • Neon light glowing effects
  • Cyberpunk atmosphere
  • Perfect for dark themes

暗い背景に映えるネオン風デザイン。 発光エフェクト(text-shadow, box-shadow)を多用し、サイバーパンクな雰囲気を演出します。

実装コード

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>Perfect for dark themes</li>
        </ul>
    </div>
</div>
CSS
/* アニメーション定義 */
@keyframes acc6-fadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px)
    }
    100% {
        opacity: 1;
        transform: none
    }
}

.container {
    width: 100%;
    background: #1a1a1a;
    padding: 12px;
    border-radius: 8px;
}

.container .btn-box button {
    width: 100%;
    padding: 16px 20px;
    background: #1a1a1a;
    border: 2px solid #00ff88;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #00ff88;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    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 20px rgba(0, 255, 136, 0.6);
}

.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;
}

.container .more.appear {
    max-height: 200px;
    margin-top: -10px;
    animation: acc6-fadeIn 0.3s ease;
}

.container .more ul {
    list-style: none;
    padding: 12px 16px;
    margin: 0;
}

.container .more li {
    padding: 8px 0;
    color: #00ff88;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    text-shadow: 0 0 5px #00ff88;
    font-size: 13px;
}

.container .more li:last-child {
    border-bottom: none;
}
JS
document.addEventListener("DOMContentLoaded", () => {
    document.querySelectorAll('.container').forEach(container => {
        const button = container.querySelector('.btn-box button');
        const 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;
                }
            });
        }
    });
});