@@ -21,63 +21,46 @@ public struct HomePage: Page {
21
21
22
22
public var content : some HTML {
23
23
HTMLRaw ( " <!DOCTYPE html> " )
24
- html ( . lang( " en " ) , . custom ( name : " data- theme" , value: " dark " ) ) {
24
+ html ( . lang( " en " ) , . data ( " theme " , value: " dark " ) ) {
25
25
head {
26
26
title { " Erik Bautista Santibanez " }
27
27
meta ( . charset( . utf8) )
28
28
meta ( name: . viewport, content: " width=device-width, initial-scale=1.0 " )
29
29
link ( . rel( . stylesheet) , . href( " https://cdnjs.cloudflare.com/ajax/libs/modern-normalize/3.0.1/modern-normalize.min.css " ) )
30
+ style { HTMLRaw ( " .xml .hljs-meta{color:#6C7986}.hljs-comment,.hljs-quote{color:#6C7986}.hljs-tag,.hljs-attribute,.hljs-keyword,.hljs-selector-tag,.hljs-literal,.hljs-name{color:#FC5FA3}.hljs-variable,.hljs-template-variable{color:#FC5FA3}.hljs-code,.hljs-string,.hljs-meta-string{color:#FC6A5D}.hljs-regexp,.hljs-link{color:#5482FF}.hljs-title,.hljs-symbol,.hljs-bullet,.hljs-number{color:#41A1C0}.hljs-section,.hljs-meta{color:#FC5FA3}.hljs-class .hljs-title,.hljs-type,.hljs-built_in,.hljs-builtin-name,.hljs-params{color:#D0A8FF}.hljs-attr{color:#BF8555}.hljs-subst{color:#FFF}.hljs-formula{font-style:italic}.hljs-selector-id,.hljs-selector-class{color:#9b703f}.hljs-doctag,.hljs-strong{font-weight:bold}.hljs-emphasis{font-style:italic} " ) }
30
31
style ( self . styling)
31
32
script ( . src( " https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js " ) )
32
33
script ( . src( " https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/swift.min.js " ) )
33
34
script { HTMLRaw ( " hljs.highlightAll(); " ) }
34
35
VueScript ( )
35
36
}
36
37
body {
37
- header ( . class( " hero " ) , . aria. label ( " About " ) ) {
38
- hgroup {
39
- p ( . class( " file-name " ) ) { " User.swift " }
40
- h1 ( . class( " hero-title " ) ) { " Erik Bautista Santibanez " }
41
- p ( . class( " hero-subtitle " ) ) { " Swift & Web Developer " }
42
-
43
- let location = self . activityClient. location ( )
44
- let residency = location? . residency ?? . default
45
-
46
- p ( . class( " hero-location " ) ) {
47
- span ( . aria. label ( " Residency " ) ) {
48
- svg ( . xmlns( ) , . fill( " currentColor " ) , . viewBox( " 0 0 256 256 " ) , . class( " svg-icon " ) , . aria. label ( " Map pin icon " ) ) {
49
- path (
50
- . d( " M128,16a88.1,88.1,0,0,0-88,88c0,75.3,80,132.17,83.41,134.55a8,8,0,0,0,9.18,0C136,236.17,216,179.3,216,104A88.1,88.1,0,0,0,128,16Zm0,56a32,32,0,1,1-32,32A32,32,0,0,1,128,72Z " )
38
+ header ( . class( " hero container " ) , . aria. label ( " About " ) ) {
39
+ p ( . class( " file-name " ) ) { " User.swift " }
40
+ hgroup ( . class( " container-content " ) ) {
41
+ // h1(.class("hero-title")) { "Erik Bautista Santibanez" }
42
+ // p(.class("hero-subtitle")) { "Mobile & Web Developer" }
43
+ // p { location }
44
+
45
+ pre {
46
+ code ( . data( " highlighted " , value: " yes " ) , . class( " hljs language-swift " ) ) {
47
+ HTMLRaw (
48
+ """
49
+ \( span ( . class( " hljs-type " ) ) { " User " } ) (
50
+ name: \( h1 ( . class( " hero-title hljs-string " ) ) { " \" Erik Bautista Santibanez \" " } ) ,
51
+ role: \( span ( . class( " hero-subtitle hljs-string " ) ) { " \" Mobile & Web Developer \" " } ) ,
52
+ home: " \( span ( . class( " hero-location hljs-string " ) ) { location } ) "
51
53
)
52
- }
53
- " \( residency) "
54
- }
55
-
56
- if let location, location. city != residency. city || location. state != residency. state {
57
- " \u{2022} "
58
-
59
- span ( . aria. label ( " Location " ) ) {
60
- svg ( . xmlns( ) , . fill( " currentColor " ) , . viewBox( " 0 0 256 256 " ) , . class( " svg-icon reversed " ) , . aria. label ( " Navigation icon " ) ) {
61
- path ( . d( " M234.35,129,152,152,129,234.35a8,8,0,0,1-15.21.27l-65.28-176A8,8,0,0,1,58.63,48.46l176,65.28A8,8,0,0,1,234.35,129Z " ) )
62
- path ( . d( " M237.33,106.21,61.41,41l-.16-.05A16,16,0,0,0,40.9,61.25a1,1,0,0,0,.05.16l65.26,175.92A15.77,15.77,0,0,0,121.28,248h.3a15.77,15.77,0,0,0,15-11.29l.06-.2,21.84-78,78-21.84.2-.06a16,16,0,0,0,.62-30.38ZM149.84,144.3a8,8,0,0,0-5.54,5.54L121.3,232l-.06-.17L56,56l175.82,65.22.16.06Z " ) )
63
- }
64
-
65
- " Currently in "
66
-
67
- b {
68
- [ location. city, location. state, location. region == " United States " ? nil : location. region]
69
- . compactMap ( \. self)
70
- . joined ( separator: " , " )
71
- }
72
- }
54
+ """
55
+ )
73
56
}
74
57
}
75
58
}
76
59
}
77
- main ( . v. scope ( " { selection: undefined } " ) ) {
60
+ main ( . class ( " container " ) , . v. scope ( " { selection: undefined } " ) ) {
78
61
header {
79
62
p ( . class( " file-name " ) ) { " Posts.swift " }
80
- hgroup {
63
+ hgroup ( . class ( " container-content " ) ) {
81
64
h2 { " Posts " }
82
65
ul ( . class( " post-tabs " ) ) {
83
66
for kind in Post . Kind? . allCases {
@@ -100,7 +83,7 @@ public struct HomePage: Page {
100
83
}
101
84
}
102
85
}
103
- section {
86
+ section ( . class ( " container-content " ) ) {
104
87
for post in Post . allCases {
105
88
article (
106
89
. class( " post " ) ,
@@ -113,8 +96,7 @@ public struct HomePage: Page {
113
96
}
114
97
}
115
98
}
116
- footer ( . aria. label ( " Credits " ) ) {
117
- hr ( )
99
+ footer ( . aria. label ( " Credits " ) , . style( " text-align: center; " ) ) {
118
100
p { " © \( Self . copyrightDateFormatter. string ( from: Date . now) ) Erik Bautista Santibanez " }
119
101
p {
120
102
" Made with \u{2764} using "
@@ -127,19 +109,56 @@ public struct HomePage: Page {
127
109
}
128
110
}
129
111
}
112
+
113
+ @HTMLBuilder
114
+ var location : some HTML {
115
+ let location = self . activityClient. location ( )
116
+ let residency = location? . residency ?? . default
117
+
118
+ span ( . class( " hero-location " ) ) {
119
+ span ( . aria. label ( " Residency " ) ) {
120
+ svg ( . xmlns( ) , . fill( " currentColor " ) , . viewBox( " 0 0 256 256 " ) , . class( " svg-icon " ) , . aria. label ( " Map pin icon " ) ) {
121
+ path (
122
+ . d( " M128,16a88.1,88.1,0,0,0-88,88c0,75.3,80,132.17,83.41,134.55a8,8,0,0,0,9.18,0C136,236.17,216,179.3,216,104A88.1,88.1,0,0,0,128,16Zm0,56a32,32,0,1,1-32,32A32,32,0,0,1,128,72Z " )
123
+ )
124
+ }
125
+ " \( residency) "
126
+ }
127
+
128
+ if let location, location. city != residency. city || location. state != residency. state {
129
+ " \u{2022} "
130
+
131
+ span ( . aria. label ( " Location " ) ) {
132
+ svg ( . xmlns( ) , . fill( " currentColor " ) , . viewBox( " 0 0 256 256 " ) , . class( " svg-icon reversed " ) , . aria. label ( " Navigation icon " ) ) {
133
+ path ( . d( " M234.35,129,152,152,129,234.35a8,8,0,0,1-15.21.27l-65.28-176A8,8,0,0,1,58.63,48.46l176,65.28A8,8,0,0,1,234.35,129Z " ) )
134
+ path ( . d( " M237.33,106.21,61.41,41l-.16-.05A16,16,0,0,0,40.9,61.25a1,1,0,0,0,.05.16l65.26,175.92A15.77,15.77,0,0,0,121.28,248h.3a15.77,15.77,0,0,0,15-11.29l.06-.2,21.84-78,78-21.84.2-.06a16,16,0,0,0,.62-30.38ZM149.84,144.3a8,8,0,0,0-5.54,5.54L121.3,232l-.06-.17L56,56l175.82,65.22.16.06Z " ) )
135
+ }
136
+
137
+ " Currently in "
138
+
139
+ b {
140
+ [ location. city, location. state, location. region == " United States " ? nil : location. region]
141
+ . compactMap ( \. self)
142
+ . joined ( separator: " , " )
143
+ }
144
+ }
145
+ }
146
+ }
147
+ }
130
148
}
131
149
132
150
extension HomePage {
133
151
struct Style : @unchecked Sendable , StyleSheet {
134
152
var body : some Rule {
135
- resetStyles ( )
136
- generalStyles ( )
137
- heroStyles ( )
138
- postTabsStyles ( )
139
- postStyles ( )
153
+ self . resetStyles ( )
154
+ self . generalStyles ( )
155
+ self . heroStyles ( )
156
+ self . postTabsStyles ( )
157
+ self . postStyles ( )
140
158
}
141
159
142
- /// MARK: - Reset components
160
+ // MARK: - Reset components
161
+
143
162
@CSSBuilder func resetStyles( ) -> some Rule {
144
163
Pseudo ( class: . root) => {
145
164
AnyProperty ( " line-height " , " 1.5 " )
@@ -163,7 +182,7 @@ extension HomePage {
163
182
@CSSBuilder func generalStyles( ) -> some Rule {
164
183
// TODO: Add Work-Sans font?
165
184
166
- /// MARK: - General
185
+ // MARK: - General
167
186
168
187
" @font-face " => {
169
188
AnyProperty ( " font-family " , " \" CommitMono \" " )
@@ -181,22 +200,37 @@ extension HomePage {
181
200
}
182
201
183
202
Element ( . body) => {
184
- // AnyProperty("border-top", "1px solid #404040")
185
- // AnyProperty("border-bottom", "1px solid #404040")
186
- AnyProperty ( " margin-top " , " 2rem " )
187
- AnyProperty ( " margin-bottom " , " 3rem " )
203
+ // AnyProperty("margin-top", "2rem")
204
+ // AnyProperty("margin-bottom", "3rem")
188
205
}
189
206
190
207
Element ( . body) > All ( ) => {
191
- // AnyProperty("border-left", "1px solid #404040")
192
- // AnyProperty("border-right", "1px solid #404040")
193
208
AnyProperty ( " max-width " , " 40rem " )
194
209
AnyProperty ( " margin-right " , " auto " )
195
210
AnyProperty ( " margin-left " , " auto " )
211
+ }
212
+
213
+ Class ( " container " ) => {
214
+ AnyProperty ( " border-top " , " 1px solid #303030 " )
215
+ AnyProperty ( " border-left " , " 1px solid #303030 " )
216
+ AnyProperty ( " border-right " , " 1px solid #303030 " )
217
+ }
218
+
219
+ Class ( " container-content " ) => {
220
+ // AnyProperty("padding-top", "1.25rem")
196
221
AnyProperty ( " padding-left " , " 1.5rem " )
197
222
AnyProperty ( " padding-right " , " 1.5rem " )
198
223
}
199
224
225
+ Class ( " file-name " ) => {
226
+ Color ( " #777 " )
227
+ AnyProperty ( " text-align " , " end " )
228
+ AnyProperty ( " font-size " , " 0.85em " )
229
+ AnyProperty ( " font-weight " , " 600 " )
230
+ AnyProperty ( " font-family " , " \" CommitMono \" , monospace " )
231
+ AnyProperty ( " padding " , " 0.5rem 1.5rem 0.5rem 1.5rem " )
232
+ }
233
+
200
234
Class ( " svg-icon " ) => {
201
235
Display ( . inlineBlock)
202
236
AnyProperty ( " vertical-align " , " middle " )
@@ -211,32 +245,29 @@ extension HomePage {
211
245
AnyProperty ( " scale " , " calc(100% * -1) 100% " )
212
246
}
213
247
214
- Class ( " file-name " ) => {
215
- Color ( " #777 " )
216
- AnyProperty ( " text-align " , " end " )
217
- AnyProperty ( " font-size " , " 0.85em " )
218
- AnyProperty ( " font-weight " , " 600 " )
219
- AnyProperty ( " font-family " , " \" CommitMono \" , monospace " )
220
- }
221
-
222
- Element ( . pre) => {
248
+ Element ( . code) => {
223
249
AnyProperty ( " font-family " , " \" CommitMono \" , monospace " )
224
250
}
225
251
}
226
252
227
253
@CSSBuilder func heroStyles( ) -> some Rule {
228
- /// MARK: - Hero header
254
+ // MARK: - Hero header
229
255
230
256
Class ( " hero " ) => {
231
257
AnyProperty ( " padding-bottom " , " 1.5rem " )
232
258
}
233
259
260
+ Class ( " hero-title " ) => {
261
+ AnyProperty ( " all " , " revert " )
262
+ AnyProperty ( " display " , " inline " )
263
+ }
264
+
234
265
Class ( " hero-location " ) => {
235
266
Color ( . hex( " #D0D0D0 " ) )
236
267
}
237
268
}
238
269
239
- @CSSBuilder func postTabsStyles( ) -> some Rule {
270
+ @CSSBuilder func postTabsStyles( ) -> some Rule {
240
271
Class ( " post-tabs " ) => {
241
272
AnyProperty ( " list-style-type " , " none " )
242
273
AnyProperty ( " margin " , " 0 " )
@@ -267,7 +298,7 @@ extension HomePage {
267
298
}
268
299
269
300
@CSSBuilder func postStyles( ) -> some Rule {
270
- /// MARK: - Posts
301
+ // MARK: - Posts
271
302
272
303
Class ( " post " ) => {
273
304
AnyProperty ( " margin-top " , " 0.75rem " )
@@ -290,15 +321,15 @@ extension HomePage {
290
321
}
291
322
292
323
Class ( " post " ) * Element( . pre) => {
293
- AnyProperty ( " padding " , " 1rem " )
324
+ AnyProperty ( " padding " , " 0.75rem " )
294
325
Background ( " #242424 " )
295
326
AnyProperty ( " border-color " , " #3A3A3A " )
296
327
AnyProperty ( " border-style " , " solid " )
297
328
AnyProperty ( " border-width " , " 1.5px " )
298
- AnyProperty ( " border-radius " , " 0.75rem " )
329
+ AnyProperty ( " border-radius " , " 0.5rem " )
299
330
AnyProperty ( " overflow-x " , " auto " )
300
331
AnyProperty ( " font-size " , " 0.85em " )
301
332
}
302
333
}
303
334
}
304
- }
335
+ }
0 commit comments