Bloggerに関するカスタマイズ・テンプレート・TIPSを紹介しています。

2026/02/25

Bloggerデザイン : エクスパンダブル・アコーディオン・カード

1. デザインのタイプ

【エクスパンダブル・アコーディオン・カード】
クリックしたカードが横方向にダイナミックに広がり、画像と詳細情報が連動して表示されるインタラクティブなスライダーデザインです。限られたスペースで複数のコンテンツを視覚的に美しく提示する、モダンなショーケースに最適です。

Blonkisoaz
Omuke trughte a otufta
Oretemauw
Omuke trughte a otufta
Iteresuselle
Omuke trughte a otufta
Idiefe
Omuke trughte a otufta
Inatethi
Omuke trughte a otufta

2. デザインの特徴

  • スムーズな伸縮アニメーション
    CSSの flex-grow と transition を組み合わせることで、カードが伸び縮みする滑らかな操作感を実現しています。
  • 情報の階層化
    非アクティブ時はアイコンと背景のみを表示し、アクティブ時のみタイトルや詳細テキストが浮かび上がるため、スペースを有効活用できます。
  • レスポンシブ自動調整
    画面幅が狭くなるにつれてカードの表示枚数を自動で削減し、モバイル環境でも崩れずに表示される設計になっています。

3. 紹介コード

HTML・CSS JavaScript

<style>
/* --- Slider Wrapper --- */
#blogger-slider-v2 {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 900px;
    height: 400px;
    margin: 2em auto;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
    background-color: #000;
    border-radius: 12px;
}

#blogger-slider-v2 .options {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    height: 100%;
}

/* --- Option Cards --- */
#blogger-slider-v2 .option {
    position: relative;
    overflow: hidden;
    min-width: 60px;
    margin: 8px;
    background: var(--optionBackground, var(--defaultBackground, #E6E9ED));
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: 0.5s cubic-bezier(0.05, 0.61, 0.41, 0.95);
    border-radius: 30px;
}

/* --- Active State --- */
#blogger-slider-v2 .option.active {
    flex-grow: 100;
    transform: scale(1);
    margin: 0px;
    border-radius: 40px;
}

#blogger-slider-v2 .option.active .shadow {
    box-shadow: inset 0 -120px 120px -120px black, inset 0 -120px 120px -100px black;
}

/* --- Labels & Details --- */
#blogger-slider-v2 .label {
    display: flex;
    position: absolute;
    height: 40px;
    transition: 0.5s cubic-bezier(0.05, 0.61, 0.41, 0.95);
    bottom: 10px;
    left: 10px;
}

#blogger-slider-v2 .option.active .label {
    bottom: 25px;
    left: 25px;
}

#blogger-slider-v2 .label .icon {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 40px;
    max-width: 40px;
    height: 40px;
    border-radius: 100%;
    background-color: white;
    color: #333;
}

#blogger-slider-v2 .label .info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 10px;
    color: white;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(20px);
    transition: 0.5s ease;
}

#blogger-slider-v2 .option.active .label .info {
    opacity: 1;
    transform: translateX(0);
}

#blogger-slider-v2 .info .main { font-weight: bold; font-size: 1.1rem; }
#blogger-slider-v2 .info .sub { font-size: 0.8rem; }

/* --- Responsive Hide --- */
@media screen and (max-width: 600px) {
    #blogger-slider-v2 { height: 350px; }
    #blogger-slider-v2 .option:nth-child(5),
    #blogger-slider-v2 .option:nth-child(4) { display: none; }
}
</style>

<div id="blogger-slider-v2">
    <div class="options">
        <div class="option active" style="--optionBackground:url(画像URL);">
            <div class="shadow"></div>
            <div class="label">
                <div class="icon"><i class="fas fa-walking"></i></div>
                <div class="info">
                    <div class="main">Blonkisoaz</div>
                    <div class="sub">Omuke trughte a otufta</div>
                </div>
            </div>
        </div>
        <div class="option" style="--optionBackground:url(画像URL);">
            <div class="shadow"></div>
            <div class="label">
                <div class="icon"><i class="fas fa-snowflake"></i></div>
                <div class="info">
                    <div class="main">Oretemauw</div>
                    <div class="sub">Omuke trughte a otufta</div>
                </div>
            </div>
        </div>
        <div class="option" style="--optionBackground:url(画像URL);">
            <div class="shadow"></div>
            <div class="label">
                <div class="icon"><i class="fas fa-tree"></i></div>
                <div class="info">
                    <div class="main">Iteresuselle</div>
                    <div class="sub">Omuke trughte a otufta</div>
                </div>
            </div>
        </div>
        <div class="option" style="--optionBackground:url(画像URL);">
            <div class="shadow"></div>
            <div class="label">
                <div class="icon"><i class="fas fa-tint"></i></div>
                <div class="info">
                    <div class="main">Idiefe</div>
                    <div class="sub">Omuke trughte a otufta</div>
                </div>
            </div>
        </div>
        <div class="option" style="--optionBackground:url(画像URL);">
            <div class="shadow"></div>
            <div class="label">
                <div class="icon"><i class="fas fa-sun"></i></div>
                <div class="info">
                    <div class="main">Inatethi</div>
                    <div class="sub">Omuke trughte a otufta</div>
                </div>
            </div>
        </div>
    </div>
</div>
  

<script>
document.querySelectorAll('#blogger-slider-v2 .option').forEach(element => {
    element.addEventListener('click', function() {
        document.querySelectorAll('#blogger-slider-v2 .option').forEach(opt => opt.classList.remove('active'));
        this.classList.add('active');
    });
});
</script>
  
まつゆう
アラフォーゲーマーがいろんなゲームを楽しみながらプレイしています。YouTube・Twitch・Mixerで配信中!! 東京パフォーマンスドールの狂信者。 好きすぎてドメインを取得してファンサイトを運営中。

0 comments:

コメントを投稿