轮播图:修订间差异
来自卡厄思梦境WIKI
小无编辑摘要 |
无编辑摘要 |
||
| 第1行: | 第1行: | ||
<includeonly><div class="carousel-container" style="width: 100%; height: 250px; position: relative; overflow: hidden; background: #f0f0f0;"> | <includeonly> | ||
<div class="carousel-container" style="width: 100%; height: 250px; position: relative; overflow: hidden; background: #f0f0f0;"> | |||
<div class="carousel-wrapper" style="display: flex; height: 100%; transition: transform 0.5s ease;"> | <div class="carousel-wrapper" style="display: flex; height: 100%; transition: transform 0.5s ease;"> | ||
{{#if:{{{图1|}}}| | {{#if:{{{图1|}}}| | ||
<div class="carousel-slide" style="min-width: 100%; height: 100%; position: relative;"> | <div class="carousel-slide" style="min-width: 100%; height: 100%; position: relative;"> | ||
[[File:{{{图1}}}|center|link=]] | [[File:{{{图1}}}|center|250px|link=]] | ||
</div> | </div> | ||
}} | }} | ||
{{#if:{{{图2|}}}| | {{#if:{{{图2|}}}| | ||
<div class="carousel-slide" style="min-width: 100%; height: 100%; position: relative;"> | <div class="carousel-slide" style="min-width: 100%; height: 100%; position: relative;"> | ||
[[File:{{{图2}}}|center|link=]] | [[File:{{{图2}}}|center|250px|link=]] | ||
</div> | </div> | ||
}} | }} | ||
{{#if:{{{图3|}}}| | {{#if:{{{图3|}}}| | ||
<div class="carousel-slide" style="min-width: 100%; height: 100%; position: relative;"> | <div class="carousel-slide" style="min-width: 100%; height: 100%; position: relative;"> | ||
[[File:{{{图3}}}|center|link=]] | [[File:{{{图3}}}|center|250px|link=]] | ||
</div> | </div> | ||
}} | }} | ||
{{#if:{{{图4|}}}| | {{#if:{{{图4|}}}| | ||
<div class="carousel-slide" style="min-width: 100%; height: 100%; position: relative;"> | <div class="carousel-slide" style="min-width: 100%; height: 100%; position: relative;"> | ||
[[File:{{{图4}}}|center|link=]] | [[File:{{{图4}}}|center|250px|link=]] | ||
</div> | </div> | ||
}} | }} | ||
| 第24行: | 第25行: | ||
<!-- 标题遮罩层 --> | <!-- 标题遮罩层 --> | ||
<div class="carousel-titles-overlay" style="position: absolute; bottom: 0; left: 0; | <div class="carousel-titles-overlay" style="position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.6)); padding: 15px 0 10px;"> | ||
<div class="carousel-titles- | <div class="carousel-titles-wrapper" style="position: relative; padding: 0 50px;"> | ||
<!-- 左切换按钮 --> | |||
< | <div class="carousel-btn carousel-prev" style="position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; cursor: pointer; z-index: 10; opacity: 0.8; transition: opacity 0.3s;"> | ||
[[File:swiper_button_left.png|30px|link=]] | |||
</div> | </div> | ||
}} | |||
<!-- 标题容器 --> | |||
<div class="carousel-titles-container" style="display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 0 auto;"> | |||
{{#if:{{{图1标题|}}}| | |||
<div class="title-indicator" style="height: | <div class="carousel-title-item active" data-slide="0" style="flex: 1; max-width: 200px; cursor: pointer;"> | ||
<div class="title-text" style="color: white; font-size: 13px; padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;">{{{图1标题}}}</div> | |||
<div class="title-indicator" style="height: 2px; background: #ff6600; margin-top: 6px; transition: all 0.3s;"></div> | |||
</div> | |||
}} | |||
{{#if:{{{图2标题|}}}| | |||
<div class="carousel-title-item" data-slide="1" style="flex: 1; max-width: 200px; cursor: pointer;"> | |||
<div class="title-text" style="color: white; font-size: 13px; padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; opacity: 0.7;">{{{图2标题}}}</div> | |||
<div class="title-indicator" style="height: 2px; background: transparent; margin-top: 6px; transition: all 0.3s;"></div> | |||
</div> | |||
}} | |||
{{#if:{{{图3标题|}}}| | |||
<div class="carousel-title-item" data-slide="2" style="flex: 1; max-width: 200px; cursor: pointer;"> | |||
<div class="title-text" style="color: white; font-size: 13px; padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; opacity: 0.7;">{{{图3标题}}}</div> | |||
<div class="title-indicator" style="height: 2px; background: transparent; margin-top: 6px; transition: all 0.3s;"></div> | |||
</div> | |||
}} | |||
{{#if:{{{图4标题|}}}| | |||
<div class="carousel-title-item" data-slide="3" style="flex: 1; max-width: 200px; cursor: pointer;"> | |||
<div class="title-text" style="color: white; font-size: 13px; padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; opacity: 0.7;">{{{图4标题}}}</div> | |||
<div class="title-indicator" style="height: 2px; background: transparent; margin-top: 6px; transition: all 0.3s;"></div> | |||
</div> | |||
}} | |||
</div> | </div> | ||
<!-- 右切换按钮 --> | |||
< | <div class="carousel-btn carousel-next" style="position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; cursor: pointer; z-index: 10; opacity: 0.8; transition: opacity 0.3s;"> | ||
[[File:swiper_button_right.png|30px|link=]] | |||
</div> | </div> | ||
</div> | </div> | ||
</div> | </div> | ||
</div> | |||
</includeonly><noinclude> | |||
{{面包屑|模板}} | {{面包屑|模板}} | ||
[[分类:模板]] | [[分类:模板]] | ||
</noinclude> | </noinclude> | ||