Skip to content

Commit ec673ab

Browse files
committed
Polishing
1 parent ca5daa5 commit ec673ab

7 files changed

Lines changed: 213 additions & 53 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@ pnpm-debug.log*
2525

2626
# vscode setting folder
2727
.vscode
28+
29+
# unnecessary files
30+
*.txt
31+
32+
# keep ads.txt
33+
!/public/ads.txt

build_log.txt

Lines changed: 0 additions & 25 deletions
This file was deleted.

build_log_2.txt

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/components/BlogCard.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ const cardStyle = lightColor
166166
/* font-family: "Outfit", sans-serif !important; */
167167
font-family: var(--font-carrois);
168168
/* font-family: var(--font-barlow); */
169-
font-size: 1.4rem;
169+
font-size: 1.5rem;
170170
font-weight: 700;
171171
line-height: 1.3;
172172
margin: 0;
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
---
2+
import { formatDate } from "../../utils";
3+
4+
interface Props {
5+
title: string;
6+
description: string;
7+
date: Date;
8+
image?: string;
9+
href: string;
10+
category: string;
11+
tags?: string[];
12+
}
13+
14+
const {
15+
title,
16+
description,
17+
date,
18+
image,
19+
href,
20+
tags = [],
21+
category,
22+
} = Astro.props;
23+
---
24+
25+
<div class="story-card-horizontal group">
26+
{/* Main Link Overlay */}
27+
<a href={href} class="story-cover-link" aria-label={`Read ${title}`}>
28+
<span class="sr-only">Read Story</span>
29+
</a>
30+
31+
<div class="image-container">
32+
{
33+
image ? (
34+
<img src={image} alt={title} loading="lazy" />
35+
) : (
36+
<div class="pattern-fallback" aria-hidden="true">
37+
<div class="logo-fallback">
38+
CIVIC
39+
<br />
40+
Thesis
41+
</div>
42+
</div>
43+
)
44+
}
45+
</div>
46+
<div class="content">
47+
<div class="meta-top">
48+
{category && <span class="category-tag">{category}</span>}
49+
<!-- <time datetime={date.toISOString()}>{formatDate(date)}</time> -->
50+
</div>
51+
52+
<h3 class="title">{title}</h3>
53+
</div>
54+
</div>
55+
56+
<style>
57+
.story-card-horizontal {
58+
display: flex;
59+
flex-direction: row;
60+
background: var(--color-surface);
61+
border-radius: 12px;
62+
overflow: hidden;
63+
position: relative;
64+
transition:
65+
transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
66+
box-shadow 0.4s ease,
67+
border-color 0.3s ease;
68+
border: 1px solid var(--color-border);
69+
height: 100%; /* Fill grid cell */
70+
min-height: 140px;
71+
/* Override accent color */
72+
--card-accent: #d97706;
73+
}
74+
75+
.story-card-horizontal:hover {
76+
border-color: var(--card-accent);
77+
/* background-color: var(--color-surface-offset, #f9fafb); */
78+
z-index: 10;
79+
transform: translateY(-2px);
80+
}
81+
82+
.story-cover-link {
83+
position: absolute;
84+
inset: 0;
85+
z-index: 1;
86+
}
87+
88+
.image-container {
89+
position: relative;
90+
width: 35%; /* Fixed width for image part */
91+
min-width: 120px;
92+
max-width: 200px;
93+
flex-shrink: 0;
94+
overflow: hidden;
95+
z-index: 2;
96+
pointer-events: none;
97+
}
98+
99+
.image-container img {
100+
width: 100%;
101+
height: 100%;
102+
object-fit: cover;
103+
transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
104+
}
105+
106+
.story-card-horizontal:hover .image-container img {
107+
transform: scale(1.05);
108+
}
109+
110+
.pattern-fallback {
111+
width: 100%;
112+
height: 100%;
113+
background-color: var(--color-surface-offset, #f3f4f6);
114+
display: flex;
115+
align-items: center;
116+
justify-content: center;
117+
position: relative;
118+
}
119+
120+
.logo-fallback {
121+
font-family: var(--font-heading);
122+
font-weight: 900;
123+
font-size: 1rem;
124+
line-height: 1;
125+
text-align: center;
126+
color: var(--color-text-muted);
127+
opacity: 0.2;
128+
transform: rotate(-10deg);
129+
text-transform: uppercase;
130+
pointer-events: none;
131+
}
132+
133+
.content {
134+
padding: 1.25rem;
135+
display: flex;
136+
flex-direction: column;
137+
justify-content: center; /* Center content vertically */
138+
gap: 0.5rem;
139+
flex-grow: 1;
140+
position: relative;
141+
z-index: 2;
142+
pointer-events: none;
143+
}
144+
145+
.meta-top {
146+
display: flex;
147+
justify-content: space-between;
148+
align-items: center;
149+
font-size: 0.75rem;
150+
margin-bottom: 0.25rem;
151+
}
152+
153+
.category-tag {
154+
font-family: var(--font-mono);
155+
color: var(--card-accent);
156+
font-weight: 700;
157+
text-transform: uppercase;
158+
letter-spacing: 0.05em;
159+
font-size: 0.7rem;
160+
}
161+
162+
time {
163+
color: var(--color-text-muted);
164+
}
165+
166+
.title {
167+
font-family: var(--font-carrois);
168+
font-size: 1.2rem;
169+
font-weight: 700;
170+
line-height: 1.3;
171+
margin: 0;
172+
color: var(--color-heading);
173+
transition: color 0.2s ease;
174+
/* Limit to 3 lines */
175+
display: -webkit-box;
176+
-webkit-line-clamp: 3;
177+
-webkit-box-orient: vertical;
178+
overflow: hidden;
179+
}
180+
181+
.story-card-horizontal:hover .title {
182+
color: var(--card-accent);
183+
}
184+
185+
@media (max-width: 480px) {
186+
/* On very small screens, maybe just reduce padding */
187+
.content {
188+
padding: 1rem;
189+
}
190+
.image-container {
191+
width: 30%;
192+
}
193+
.title {
194+
font-size: 1rem;
195+
}
196+
}
197+
</style>

src/pages/education/[...slug].astro

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ const nextLesson =
5656
<article
5757
class={`prose ${item.data.hideToc ? "max-w-75ch" : "max-w-75ch"}`}
5858
>
59-
<HorizontalAd />
59+
<div class="top-horizontal-ad">
60+
<HorizontalAd />
61+
</div>
6062
<div class="lesson-header">
6163
<h1>{item.data.title}</h1>
6264
<button
@@ -303,6 +305,10 @@ const nextLesson =
303305
text-align: left;
304306
align-items: flex-start;
305307
}
308+
309+
.top-horizontal-ad {
310+
display: none !important;
311+
}
306312
}
307313

308314
/* Zen Mode Styles */

src/styles/global.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ p {
128128

129129
.container {
130130
width: 100%;
131-
max-width: 800px;
131+
/* max-width: 800px; */
132+
max-width: 1200px;
132133
margin: 0 auto;
133134
padding: 0 var(--spacing-md);
134135
}

0 commit comments

Comments
 (0)