Skip to content

Commit 4e31207

Browse files
authored
Refactor CSS styles and update news section markup
1 parent 04ba846 commit 4e31207

1 file changed

Lines changed: 36 additions & 40 deletions

File tree

‎index.html‎

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
-webkit-background-clip: text;
2626
-webkit-text-fill-color: transparent;
2727
}
28-
29-
.hero-title span {
30-
color: var(--accent-contrast);
28+
29+
.hero-title span {
30+
color: var(--accent-contrast);
3131
-webkit-text-fill-color: var(--accent-contrast);
3232
}
3333

@@ -55,25 +55,25 @@
5555
text-transform: uppercase;
5656
letter-spacing: 1px;
5757
}
58-
58+
5959
.btn-primary {
6060
background: var(--accent-contrast);
6161
color: #000;
6262
border: none;
6363
box-shadow: 0 4px 20px rgba(255, 94, 0, 0.3);
6464
}
65-
.btn-primary:hover {
66-
background: #ff7a2e;
65+
.btn-primary:hover {
66+
background: #ff7a2e;
6767
transform: translateY(-2px);
6868
box-shadow: 0 6px 25px rgba(255, 94, 0, 0.4);
6969
}
70-
70+
7171
.btn-secondary {
7272
background: rgba(0, 210, 255, 0.05);
7373
color: var(--accent-blue);
7474
border: 1px solid rgba(0, 210, 255, 0.3);
7575
}
76-
.btn-secondary:hover {
76+
.btn-secondary:hover {
7777
background: rgba(0, 210, 255, 0.1);
7878
border-color: var(--accent-blue);
7979
transform: translateY(-2px);
@@ -98,7 +98,7 @@
9898
backdrop-filter: blur(10px);
9999
transition: 0.3s;
100100
}
101-
101+
102102
.stat-card:hover {
103103
border-color: var(--accent-blue);
104104
background: rgba(10, 15, 25, 0.85);
@@ -156,13 +156,6 @@
156156
transform: translateY(-3px);
157157
box-shadow: 0 10px 30px rgba(0,210,255,0.15);
158158
}
159-
.home-news-thumb {
160-
width: 100%;
161-
height: 180px;
162-
object-fit: cover;
163-
border-bottom: 1px solid var(--border);
164-
display: block;
165-
}
166159
.home-news-content {
167160
padding: 20px;
168161
display: flex;
@@ -171,6 +164,28 @@
171164
flex-grow: 1;
172165
}
173166

167+
/* MINIATURKA / IKONA NEWSA */
168+
.news-thumb {
169+
width: 100%;
170+
height: 170px;
171+
display: flex;
172+
align-items: center;
173+
justify-content: center;
174+
background: radial-gradient(circle at 30% 20%, rgba(0, 210, 255, 0.12), rgba(0, 0, 0, 0.55));
175+
border-bottom: 1px solid var(--border);
176+
overflow: hidden;
177+
}
178+
.news-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
179+
.news-thumb-img.is-icon { width: 96px; height: 96px; object-fit: contain; }
180+
.news-thumb-fallback {
181+
font-size: 3.2rem;
182+
width: 96px; height: 96px;
183+
display: flex; align-items: center; justify-content: center;
184+
background: rgba(0, 210, 255, 0.08);
185+
border: 1px solid rgba(0, 210, 255, 0.25);
186+
border-radius: 18px;
187+
}
188+
174189
.sponsors-grid {
175190
display: grid;
176191
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
@@ -275,7 +290,7 @@
275290
transition: 0.2s;
276291
text-decoration: none;
277292
}
278-
293+
279294
.archive-item:hover {
280295
background: rgba(0, 210, 255, 0.03);
281296
padding-left: 25px;
@@ -295,7 +310,7 @@
295310
color: var(--text-main);
296311
letter-spacing: 0.5px;
297312
}
298-
313+
299314
.archive-item:hover .archive-title {
300315
color: var(--accent-blue);
301316
}
@@ -371,31 +386,12 @@ <h1 class="hero-title">DEVLAB<br>STUDY<span>_</span></h1>
371386
</a>
372387
</div>
373388

374-
<!-- SEKCJA NAJNOWSZE NEWSY Z AUTOMATYCZNYM WYCIĄGANIEM OBRAZKA -->
389+
<!-- SEKCJA NAJNOWSZE NEWSY -->
375390
<span class="section-tag">NAJNOWSZE RAPORTY TECHNOLOGICZNE (NEWSY)</span>
376391
<div class="newsy-home-grid">
377392
{% for post in site.newsy limit:3 %}
378-
{% assign post_thumb = nil %}
379-
{% if post.content contains '<img' %}
380-
{% assign img_tag = post.content | split: '<img' | second %}
381-
{% assign img_src = img_tag | split: 'src="' | second | split: '"' | first %}
382-
{% if img_src %}
383-
{% assign post_thumb = img_src %}
384-
{% endif %}
385-
{% endif %}
386-
{% unless post_thumb %}
387-
{% if post.content contains '![' %}
388-
{% assign md_img = post.content | split: '![' | second | split: ']' | second | split: '(' | second | split: ')' | first %}
389-
{% if md_img %}
390-
{% assign post_thumb = md_img %}
391-
{% endif %}
392-
{% endif %}
393-
{% endunless %}
394-
395-
<a href="{{ post.url }}" class="home-news-card">
396-
{% if post_thumb %}
397-
<img src="{{ post_thumb | relative_url }}" alt="{{ post.title }}" class="home-news-thumb">
398-
{% endif %}
393+
<a href="{{ post.url | relative_url }}" class="home-news-card">
394+
{% include news-thumb.html post=post %}
399395
<div class="home-news-content">
400396
<div>
401397
<div style="font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--accent-contrast); margin-bottom: 8px; font-weight: 800;">

0 commit comments

Comments
 (0)