Skip to content

Commit 18723a1

Browse files
committed
add status and dates to grid layout
1 parent 4c611fe commit 18723a1

File tree

2 files changed

+105
-1
lines changed

2 files changed

+105
-1
lines changed

src/static/css/main.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
--color-amber-700: oklch(55.5% 0.163 48.998);
2525
--color-yellow-400: oklch(85.2% 0.199 91.936);
2626
--color-yellow-600: oklch(68.1% 0.162 75.834);
27+
--color-green-300: oklch(87.1% 0.15 154.449);
2728
--color-green-400: oklch(79.2% 0.209 151.711);
2829
--color-emerald-300: oklch(84.5% 0.143 164.978);
2930
--color-emerald-400: oklch(76.5% 0.177 163.223);
@@ -50,6 +51,7 @@
5051
--color-gray-500: oklch(55.1% 0.027 264.364);
5152
--color-gray-600: oklch(44.6% 0.03 256.802);
5253
--color-gray-700: oklch(37.3% 0.034 259.733);
54+
--color-gray-800: oklch(27.8% 0.033 256.848);
5355
--color-gray-900: oklch(21% 0.034 264.665);
5456
--color-black: #000;
5557
--color-white: #fff;
@@ -2314,6 +2316,21 @@
23142316
}
23152317
}
23162318
}
2319+
.sm\:top-2 {
2320+
@media (width >= 40rem) {
2321+
top: calc(var(--spacing) * 2);
2322+
}
2323+
}
2324+
.sm\:right-2 {
2325+
@media (width >= 40rem) {
2326+
right: calc(var(--spacing) * 2);
2327+
}
2328+
}
2329+
.sm\:left-auto {
2330+
@media (width >= 40rem) {
2331+
left: auto;
2332+
}
2333+
}
23172334
.sm\:col-span-2 {
23182335
@media (width >= 40rem) {
23192336
grid-column: span 2 / span 2;

src/templates/app/components/media_card.html

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,95 @@
88
data-src="{{ item.image }}"
99
src="{{ IMG_NONE }}">
1010

11+
<div class="absolute top-2 left-2 bg-gray-900/90 text-white text-xs px-2 py-1 rounded-md flex items-center shadow-md">
12+
<div class="flex items-center">
13+
{% if media.status == Status.COMPLETED.value %}
14+
<svg xmlns="http://www.w3.org/2000/svg"
15+
width="24"
16+
height="24"
17+
viewBox="0 0 24 24"
18+
fill="none"
19+
stroke="currentColor"
20+
stroke-width="2"
21+
stroke-linecap="round"
22+
stroke-linejoin="round"
23+
class="w-4 h-4 {{ MediaTypes.TV.value|media_color }} {% if media.end_date %}mr-1.5{% endif %}">
24+
<path d="M21.801 10A10 10 0 1 1 17 3.335" />
25+
<path d="m9 11 3 3L22 4" />
26+
</svg>
27+
28+
{% if media.end_date is not None %}
29+
<span class="text-sm text-white">{{ media.end_date|date:"SHORT_DATE_FORMAT" }}</span>
30+
{% endif %}
31+
32+
{% elif media.status == Status.IN_PROGRESS.value %}
33+
<svg xmlns="http://www.w3.org/2000/svg"
34+
width="24"
35+
height="24"
36+
viewBox="0 0 24 24"
37+
fill="none"
38+
stroke="currentColor"
39+
stroke-width="2"
40+
stroke-linecap="round"
41+
stroke-linejoin="round"
42+
class="w-4 h-4 {{ MediaTypes.EPISODE.value|media_color }} {% if media.start_date %}mr-1{% endif %}">
43+
<polygon points="6 3 20 12 6 21 6 3" />
44+
</svg>
45+
46+
{% if media.start_date is not None %}
47+
<span class="text-sm text-white">{{ media.start_date|date:"SHORT_DATE_FORMAT" }}</span>
48+
{% endif %}
49+
50+
{% elif media.status == Status.PAUSED.value %}
51+
<svg xmlns="http://www.w3.org/2000/svg"
52+
width="24"
53+
height="24"
54+
viewBox="0 0 24 24"
55+
fill="none"
56+
stroke="currentColor"
57+
stroke-width="2"
58+
stroke-linecap="round"
59+
stroke-linejoin="round"
60+
class="w-4 h-4 {{ MediaTypes.MOVIE.value|media_color }}">
61+
<rect x="14" y="4" width="4" height="16" rx="1" /><rect x="6" y="4" width="4" height="16" rx="1" />
62+
</svg>
63+
64+
{% elif media.status == Status.PLANNING.value %}
65+
<svg xmlns="http://www.w3.org/2000/svg"
66+
width="24"
67+
height="24"
68+
viewBox="0 0 24 24"
69+
fill="none"
70+
stroke="currentColor"
71+
stroke-width="2"
72+
stroke-linecap="round"
73+
stroke-linejoin="round"
74+
class="w-4 h-4 {{ MediaTypes.ANIME.value|media_color }}">
75+
<path d="m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z" />
76+
<line x1="12" x2="12" y1="7" y2="13" /><line x1="15" x2="9" y1="10" y2="10" />
77+
</svg>
78+
79+
{% elif media.status == Status.DROPPED.value %}
80+
<svg xmlns="http://www.w3.org/2000/svg"
81+
width="24"
82+
height="24"
83+
viewBox="0 0 24 24"
84+
fill="none"
85+
stroke="currentColor"
86+
stroke-width="2"
87+
stroke-linecap="round"
88+
stroke-linejoin="round"
89+
class="w-4 h-4 {{ MediaTypes.MANGA.value|media_color }}">
90+
<path d="m15 9-6 6" />
91+
<path d="M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z" />
92+
<path d="m9 9 6 6" />
93+
</svg>
94+
{% endif %}
95+
</div>
96+
</div>
97+
1198
{% if media.score is not None %}
12-
<div class="absolute top-2 right-2 bg-gray-900/90 text-white text-xs px-2 py-1 rounded-md flex items-center shadow-md">
99+
<div class="absolute sm:top-2 sm:right-2 sm:left-auto top-10 left-2 bg-gray-900/90 text-white text-xs px-2 py-1 rounded-md flex items-center shadow-md">
13100
<div class="flex items-center">
14101
<svg xmlns="http://www.w3.org/2000/svg"
15102
width="24"

0 commit comments

Comments
 (0)