Template:角色卡片/styles.css:修订间差异
模板页面
更多语言
更多操作
创建页面,内容为“.character-card { display:flex; width:100%; flex-wrap:wrap; min-height:280px; border-radius:10px; overflow:hidden; background-color:var(--chara-card-color); box-shadow: 0 5px 11px rgb(0 0 0 / 18%), 0 4px 15px rgb(0 0 0 / 15%); margin:15px 5px; } .character-card__portrait { width:30%; position:relative; overflow:hidden; background-color: var(--color-surface-0); } .character-card__body { width:70…” |
无编辑摘要 |
||
| 第1行: | 第1行: | ||
.character-card { | .character-card { | ||
display:flex; | display: flex; | ||
width:100%; | width: 100%; | ||
flex-wrap:wrap; | flex-wrap: wrap; | ||
min-height:280px; | min-height: 280px; | ||
border-radius:10px; | border-radius: 10px; | ||
overflow:hidden; | overflow: hidden; | ||
background-color:var(--chara-card-color); | background-color: var(--chara-card-color); | ||
box-shadow: | box-shadow: | ||
0 5px 11px rgb(0 0 0 / 18%), | |||
0 4px 15px rgb(0 0 0 / 15%); | |||
margin:15px 5px; | margin: 15px 5px; | ||
} | } | ||
.character-card__portrait { | .character-card__portrait { | ||
width:30%; | width: 30%; | ||
position:relative; | position: relative; | ||
overflow:hidden; | overflow: hidden; | ||
background-color: | background-color: var(--color-surface-0); | ||
} | } | ||
.character-card__body { | .character-card__body { | ||
width:70%; | width: 70%; | ||
padding:1rem; | padding: 1rem; | ||
box-sizing:border-box; | box-sizing: border-box; | ||
} | } | ||
.character-card__name { | .character-card__name { | ||
font-size:150%; | font-size: 150%; | ||
font-weight:bold; | font-weight: bold; | ||
} | } | ||
.character-card__header { | .character-card__header { | ||
display:flex; | display: flex; | ||
justify-content:space-between; | justify-content: space-between; | ||
flex-wrap:wrap; | flex-wrap: wrap; | ||
} | } | ||
.character-card__cv { | .character-card__cv { | ||
font-style:italic; | font-style: italic; | ||
} | } | ||
.character-card__divider { | .character-card__divider { | ||
margin:1rem 0; | margin: 1rem 0; | ||
border:0; | border: 0; | ||
border-top:1px solid rgba(0,0,0,.1); | border-top: 1px solid rgba(0, 0, 0, .1); | ||
} | } | ||
/* 角色属性区 */ | |||
.character-card__stats { | |||
display: grid; | |||
grid-template-columns: repeat(2, minmax(0, 1fr)); | |||
gap: 0.4rem 1rem; | |||
margin-bottom: 1rem; | |||
font-size: 90%; | |||
} | |||
.character-card__stat { | |||
display: flex; | |||
align-items: baseline; | |||
gap: 0.5rem; | |||
line-height: 1.5; | |||
} | |||
.character-card__stat-label { | |||
flex: 0 0 auto; | |||
min-width: 2.5em; | |||
font-weight: bold; | |||
color: var(--color-subtle, #666); | |||
} | |||
.character-card__stat-label::after { | |||
content: ":"; | |||
} | |||
.character-card__stat-value { | |||
flex: 1 1 auto; | |||
word-break: break-word; | |||
} | |||
/* 立绘 */ | /* 立绘 */ | ||
.portrait-slides { | .portrait-slides { | ||
width:100%; | width: 100%; | ||
height:100%; | height: 100%; | ||
position:absolute; | position: absolute; | ||
inset:0; | inset: 0; | ||
} | } | ||
.portrait-slide { | .portrait-slide { | ||
position:absolute; | position: absolute; | ||
inset:0; | inset: 0; | ||
opacity:0; | opacity: 0; | ||
transition: | transition: opacity .25s ease; | ||
} | } | ||
.portrait-slide.active { | .portrait-slide.active { | ||
opacity:1; | opacity: 1; | ||
z-index:1; | z-index: 1; | ||
} | } | ||
.portrait-slide img { | .portrait-slide img { | ||
width:100%; | width: 100%; | ||
height:100%; | height: 100%; | ||
object-fit:cover; | object-fit: cover; | ||
object-position:top center; | object-position: top center; | ||
} | } | ||
.portrait-label { | .portrait-label { | ||
position:absolute; | position: absolute; | ||
bottom:10px; | bottom: 10px; | ||
left:10px; | left: 10px; | ||
padding:3px 10px; | padding: 3px 10px; | ||
background:rgba(0,0,0,.5); | background: rgba(0, 0, 0, .5); | ||
color:white; | color: white; | ||
border-radius:5px; | border-radius: 5px; | ||
font-size:12px; | font-size: 12px; | ||
} | } | ||
.character-card__switch { | .character-card__switch { | ||
position:absolute; | position: absolute; | ||
z-index:5; | z-index: 5; | ||
right:10px; | right: 10px; | ||
top:10px; | top: 10px; | ||
width:30px; | width: 30px; | ||
height:30px; | height: 30px; | ||
display:flex; | display: flex; | ||
align-items:center; | align-items: center; | ||
justify-content:center; | justify-content: center; | ||
border-radius:50%; | border-radius: 50%; | ||
background:rgba(0,0,0,.5); | background: rgba(0, 0, 0, .5); | ||
color:white; | color: white; | ||
cursor:pointer; | cursor: pointer; | ||
} | } | ||
/* 左右布局 */ | /* 左右布局 */ | ||
.character-card--layout-2 | .character-card--layout-2 .character-card__portrait { | ||
.character-card__portrait { | order: 2; | ||
order:2; | |||
} | } | ||
.character-card--layout-2 | .character-card--layout-2 .character-card__body { | ||
.character-card__body { | order: 1; | ||
order:1 | |||
} | } | ||
/* 响应式 */ | |||
@media (max-width: 767px) { | |||
.character-card__portrait { | |||
width: 100%; | |||
aspect-ratio: 3/4; | |||
} | |||
.character-card__body { | |||
width: 100%; | |||
} | |||
.character-card__name { | |||
font-size: 120%; | |||
} | |||
.character-card__stats { | |||
grid-template-columns: 1fr; | |||
} | |||
} | } | ||
2026年8月27日 (四) 21:33的版本
.character-card {
display: flex;
width: 100%;
flex-wrap: wrap;
min-height: 280px;
border-radius: 10px;
overflow: hidden;
background-color: var(--chara-card-color);
box-shadow:
0 5px 11px rgb(0 0 0 / 18%),
0 4px 15px rgb(0 0 0 / 15%);
margin: 15px 5px;
}
.character-card__portrait {
width: 30%;
position: relative;
overflow: hidden;
background-color: var(--color-surface-0);
}
.character-card__body {
width: 70%;
padding: 1rem;
box-sizing: border-box;
}
.character-card__name {
font-size: 150%;
font-weight: bold;
}
.character-card__header {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.character-card__cv {
font-style: italic;
}
.character-card__divider {
margin: 1rem 0;
border: 0;
border-top: 1px solid rgba(0, 0, 0, .1);
}
/* 角色属性区 */
.character-card__stats {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0.4rem 1rem;
margin-bottom: 1rem;
font-size: 90%;
}
.character-card__stat {
display: flex;
align-items: baseline;
gap: 0.5rem;
line-height: 1.5;
}
.character-card__stat-label {
flex: 0 0 auto;
min-width: 2.5em;
font-weight: bold;
color: var(--color-subtle, #666);
}
.character-card__stat-label::after {
content: ":";
}
.character-card__stat-value {
flex: 1 1 auto;
word-break: break-word;
}
/* 立绘 */
.portrait-slides {
width: 100%;
height: 100%;
position: absolute;
inset: 0;
}
.portrait-slide {
position: absolute;
inset: 0;
opacity: 0;
transition: opacity .25s ease;
}
.portrait-slide.active {
opacity: 1;
z-index: 1;
}
.portrait-slide img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: top center;
}
.portrait-label {
position: absolute;
bottom: 10px;
left: 10px;
padding: 3px 10px;
background: rgba(0, 0, 0, .5);
color: white;
border-radius: 5px;
font-size: 12px;
}
.character-card__switch {
position: absolute;
z-index: 5;
right: 10px;
top: 10px;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: rgba(0, 0, 0, .5);
color: white;
cursor: pointer;
}
/* 左右布局 */
.character-card--layout-2 .character-card__portrait {
order: 2;
}
.character-card--layout-2 .character-card__body {
order: 1;
}
/* 响应式 */
@media (max-width: 767px) {
.character-card__portrait {
width: 100%;
aspect-ratio: 3/4;
}
.character-card__body {
width: 100%;
}
.character-card__name {
font-size: 120%;
}
.character-card__stats {
grid-template-columns: 1fr;
}
}