1
1
---
2
- const { parentFolder, author, pubDate } = Astro .props ;
3
2
3
+ const { parentFolder, author, pubDate } = Astro .props ;
4
4
function formatDate(isoDateString : string ): string {
5
5
const date = new Date (isoDateString );
6
6
const options: Intl .DateTimeFormatOptions = { year: ' numeric' , month: ' long' , day: ' numeric' };
7
7
return date .toLocaleDateString (' en-US' , options );
8
8
}
9
9
const formattedPubDate = formatDate (pubDate );
10
+
10
11
---
12
+
11
13
<div id =" webzineView" >
12
14
<header >
13
15
<a href ={ parentFolder } class =" delayed" >Back to list</a >
@@ -24,8 +26,11 @@ const formattedPubDate = formatDate(pubDate);
24
26
<small >Created by { author } in { formattedPubDate } </small >
25
27
</footer >
26
28
</div >
29
+
27
30
<style is:global >
31
+
28
32
/* Global Styles */
33
+
29
34
@font-face {
30
35
font-family: "Park";
31
36
src:
@@ -50,6 +55,7 @@ html[class*="wz-"] body {
50
55
}
51
56
52
57
/* Header & Footer */
58
+
53
59
header,
54
60
footer {
55
61
display: flex;
@@ -67,9 +73,9 @@ footer small {
67
73
font-size: 0.75em;
68
74
text-decoration: none;
69
75
display: inline-block;
70
- border-radius: var(--sf );
76
+ border-radius: var(--s16p );
71
77
color: transparent;
72
- background-color: var(--blackLight );
78
+ background-color: var(--cru );
73
79
}
74
80
header a,
75
81
header a:visited,
@@ -93,6 +99,7 @@ footer small {
93
99
}
94
100
95
101
/* Buttons */
102
+
96
103
button:hover,
97
104
button:active {
98
105
padding: 0 0.75em;
@@ -111,12 +118,12 @@ button.nav {
111
118
text-align: center;
112
119
width: 1.5em;
113
120
padding: 0.25em;
114
- border-radius: var(--sz );
121
+ border-radius: var(--s32p );
115
122
}
116
123
button.nav:hover,
117
124
footer small:hover,
118
125
button:hover {
119
- color: var(--blackMedium );
126
+ color: var(--ink );
120
127
}
121
128
button.nav#prev,
122
129
button.nav#next {
@@ -131,6 +138,7 @@ button.nav#next {
131
138
}
132
139
133
140
/* Reel & Slides */
141
+
134
142
main {
135
143
position: relative;
136
144
margin-bottom: 1em;
@@ -149,7 +157,7 @@ main {
149
157
position: relative;
150
158
width: 100%;
151
159
aspect-ratio: 1 / 1;
152
- border-radius: var(--sf );
160
+ border-radius: calc( var(--s8p) + 0.5vw );
153
161
overflow: hidden;
154
162
}
155
163
[slide]:not(:last-child) {
@@ -162,10 +170,10 @@ main {
162
170
[slide] img {
163
171
position: absolute;
164
172
display: block;
165
- top: 0 ;
166
- left: 0 ;
167
- width: 100%;
168
- height: 100%;
173
+ top: -1px ;
174
+ left: -1px ;
175
+ width: calc( 100% + 2px) ;
176
+ height: calc( 100% + 2px) ;
169
177
object-fit: cover;
170
178
cursor: var(--cursorDefault);
171
179
}
@@ -196,14 +204,15 @@ blockquote {
196
204
left: 1rem;
197
205
padding: 0.75em 1em;
198
206
margin: 0;
199
- border-radius: var(--sc) ;
207
+ border-radius: 0.5vw ;
200
208
background-color: var(--paper);
201
209
}
202
210
blockquote p {
203
211
hyphens: none;
204
212
text-align: center;
213
+ margin-bottom: 0;
205
214
}
206
- blockquote > * :not(:last-child) {
215
+ blockquote p :not(:last-child):not(:only -child) {
207
216
margin-bottom: 0.5em;
208
217
}
209
218
@@ -298,5 +307,33 @@ document.addEventListener('DOMContentLoaded', function() {
298
307
}
299
308
});
300
309
});
310
+ window.addEventListener('load', function() {
311
+ // Delayed buttons/links
312
+ const reel = document.getElementById('reel');
313
+ const DELAY = 500;
314
+ const clickableElements = document.querySelectorAll<HTMLAnchorElement | HTMLButtonElement>('a.delayed, #langToggle');
315
+ clickableElements.forEach(element => {
316
+ element.addEventListener('click', function(e) {
317
+ e.preventDefault();
318
+ element.classList.add('visible');
319
+ setTimeout(() => {
320
+ element.classList.remove('visible');
321
+ if (element instanceof HTMLAnchorElement) {
322
+ window.location.href = element.href;
323
+ } else if (element.id === 'langToggle') {
324
+ // Language toggle
325
+ const langAttribute = reel ? reel.getAttribute('lang') : null;
326
+ if (langAttribute === 'en') {
327
+ reel?.setAttribute('lang', 'pt');
328
+ element.textContent = 'Read in English';
329
+ } else {
330
+ reel?.setAttribute('lang', 'en');
331
+ element.textContent = 'Read in Portuguese';
332
+ }
333
+ }
334
+ }, DELAY);
335
+ });
336
+ });
337
+ });
301
338
302
339
</script >
0 commit comments