Skip to content

Commit aac690a

Browse files
committed
重构:样式
1 parent 828d322 commit aac690a

2 files changed

Lines changed: 5 additions & 35 deletions

File tree

templates/css/style.css

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +0,0 @@
1-
.card-img-container {
2-
position: relative;
3-
aspect-ratio: 3/4;
4-
overflow: hidden;
5-
display: flex;
6-
align-items: center;
7-
justify-content: center;
8-
}
9-
10-
.card-img-container img {
11-
width: 100%;
12-
height: 100%;
13-
object-fit: cover;
14-
}
15-
16-
.card {
17-
height: 100%;
18-
display: flex;
19-
flex-direction: column;
20-
}
21-
22-
.card-body {
23-
flex: 1;
24-
}
25-
26-
.card-title {
27-
white-space: nowrap;
28-
overflow: hidden;
29-
text-overflow: ellipsis;
30-
}

templates/js/models.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,25 @@ class ModelDisplayManager {
2424

2525
return `
2626
<div class="col">
27-
<div class="card h-100 model-card" data-model='${JSON.stringify(model)}'>
27+
<div class="card h-100 d-flex flex-column model-card" data-model='${JSON.stringify(model)}'>
2828
<div class="row g-0 h-100">
2929
${model.preview_url ? `
3030
<div class="col-4 col-sm-12">
31-
<div class="card-img-container h-100">
31+
<div class="position-relative d-flex align-items-center justify-content-center overflow-hidden ratio" style="--bs-aspect-ratio: 133%;">
3232
<img
3333
src="${imgSrc}"
3434
alt="${model.name}"
3535
onerror="this.onerror=null; this.src='${model.preview_url}';"
36-
class="rounded-start rounded-sm-top"
36+
class="rounded-start rounded-sm-top w-100 h-100 object-fit-cover"
3737
style="cursor: pointer"
3838
>
3939
</div>
4040
</div>
4141
` : ''}
4242
<div class="col-8 col-sm-12">
43-
<div class="card-body">
43+
<div class="card-body flex-grow-1">
4444
<div class="d-flex justify-content-between align-items-start mb-2">
45-
<h5 class="card-title fw-bold mb-0" title="${model.name}">${model.name}</h5>
45+
<h5 class="card-title text-truncate fw-bold mb-0" title="${model.name}">${model.name}</h5>
4646
${model.nsfw ? '<span class="badge text-bg-danger">NSFW</span>' : ''}
4747
</div>
4848
<p class="card-text">

0 commit comments

Comments
 (0)