アコーディオン:ホログラフィック|Accordion: Holographic

  • Rainbow holographic effects
  • Iridescent color shifts
  • 3D depth perception
  • Futuristic appearance
  • Eye-catching design
HTML
<div class="container">  
    <div class="accordion">
        <div class="btn-box">
            <button data-default-text="Holographic Accordion" data-open-text="Close">Holographic Accordion</button>
        </div>
        <div class="more">
                <ul>
                    <li>Rainbow holographic effects</li>
                    <li>Iridescent color shifts</li>
                    <li>3D depth perception</li>
                    <li>Futuristic appearance</li>
                    <li>Eye-catching design</li>
                </ul>
        </div>
    </div>
</div>
CSS
@keyframes holographicShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes holographicGlow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(255, 0, 150, 0.3),
            0 0 40px rgba(0, 255, 255, 0.2),
            0 0 60px rgba(255, 255, 0, 0.1);
    }
    25% {
        box-shadow: 
            0 0 25px rgba(0, 255, 255, 0.4),
            0 0 50px rgba(255, 255, 0, 0.3),
            0 0 75px rgba(255, 0, 150, 0.2);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(255, 255, 0, 0.5),
            0 0 60px rgba(255, 0, 150, 0.4),
            0 0 90px rgba(0, 255, 255, 0.3);
    }
    75% {
        box-shadow: 
            0 0 25px rgba(255, 0, 150, 0.4),
            0 0 50px rgba(0, 255, 255, 0.3),
            0 0 75px rgba(255, 255, 0, 0.2);
    }
}

@keyframes holographicFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
        filter: hue-rotate(0deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: hue-rotate(360deg);
    }
}

.accordion {
    margin: 30px 0;
    position: relative;
    perspective: 1000px;
}

.btn-box button {
    width: 100%;
    padding: 22px 28px;
    background: linear-gradient(
        45deg,
        #ff0080,
        #ff8c00,
        #40e0d0,
        #ee82ee,
        #ff0080,
        #ff8c00,
        #40e0d0,
        #ee82ee
    );
    background-size: 400% 400%;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.4s ease;
    text-align: left;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: holographicShift 3s ease infinite, holographicGlow 2s ease-in-out infinite;
    transform-style: preserve-3d;
    overflow: hidden;
}

.btn-box button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.05),
        rgba(255, 255, 255, 0.1)
    );
    border-radius: 15px;
    pointer-events: none;
}

.btn-box button:hover {
    transform: translateY(-3px) scale(1.02);
    animation: holographicShift 1.5s ease infinite, holographicGlow 1s ease-in-out infinite;
    box-shadow: 
        0 15px 35px rgba(255, 0, 150, 0.4),
        0 10px 25px rgba(0, 255, 255, 0.3),
        0 5px 15px rgba(255, 255, 0, 0.2);
}

.more {
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s ease;
    background: linear-gradient(
        135deg,
        rgba(255, 0, 150, 0.1),
        rgba(0, 255, 255, 0.1),
        rgba(255, 255, 0, 0.1)
    );
    border-radius: 0 0 15px 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-top: -5px;
    position: relative;
    z-index: 1;
}

.more.appear {
    max-height: 500px;
    animation: holographicFadeIn 0.6s ease;
}

.more ul {
    list-style: none;
    padding: 25px 28px;
    margin: 0;
}

.more li {
    padding: 15px 0;
    color: #333;
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

.more li:hover {
    color: #000;
    padding-left: 10px;
}

.more li:last-child {
    border-bottom: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .btn-box button {
        font-size: 14px;
        padding: 18px 22px;
    }
    
    .more ul {
        padding: 20px 22px;
    }
    
    .more.appear {
        max-height: 400px;
    }
}
JavaScript
document.addEventListener('DOMContentLoaded', function() {
    const buttons = document.querySelectorAll('.btn-box button');
    
    buttons.forEach(button => {
        button.addEventListener('click', function() {
            const more = this.parentElement.nextElementSibling;
            const isOpen = more.classList.contains('appear');
            
            // 他のアコーディオンを閉じる
            document.querySelectorAll('.more').forEach(item => {
                item.classList.remove('appear');
            });
            
            // クリックされたアコーディオンの開閉
            if (!isOpen) {
                more.classList.add('appear');
                this.textContent = this.getAttribute('data-open-text');
            } else {
                more.classList.remove('appear');
                this.textContent = this.getAttribute('data-default-text');
            }
        });
    });
});
よかったらシェアしてね!
  • URLをコピーしました!
  • URLをコピーしました!
目次