Skip to content

Commit deecd4a

Browse files
committed
wip: remove rounded corners
1 parent 82197e9 commit deecd4a

File tree

4 files changed

+42
-31
lines changed

4 files changed

+42
-31
lines changed

Sources/Pages/Components/HeaderView.swift

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,20 @@ private struct CodeSelector: HTML {
7373
.inlineStyle("display", "block")
7474
.inlineStyle("width", "100%")
7575
.inlineStyle("cursor", "pointer")
76-
.inlineStyle("border-radius", "0.75rem")
77-
.inlineStyle("background", "#3A3A3A", post: ":hover")
78-
.inlineStyle("background", "#4A4A4A", post: "[aria-selected=\"true\"]")
76+
.inlineStyle("box-shadow", "inset 1px 1px #383838, inset -1px -1px #383838", post: "[aria-selected=\"true\"]")
77+
.inlineStyle("background", "#3F3F3F", post: ":hover")
78+
.inlineStyle("background", "#303030", post: "[aria-selected=\"true\"]")
7979
}
80-
.inlineStyle("overflow", "hidden")
80+
.inlineStyle("margin", "0.4rem 0")
8181
}
8282
}
83-
.inlineStyle("margin-top", "0.375rem", post: " > li:not(:first-child)")
8483
.inlineStyle("position", "absolute")
8584
.inlineStyle("right", "0")
8685
.inlineStyle("list-style", "none")
87-
.inlineStyle("padding", "0.4rem")
88-
// .inlineStyle("margin-top", "0.25rem")
89-
.inlineStyle("background", "#2A2A2A")
90-
.inlineStyle("border-radius", "1rem")
86+
.inlineStyle("padding", "0 0.4rem")
87+
.inlineStyle("margin-top", "0.25rem")
88+
.inlineStyle("background", "#202020")
89+
.inlineStyle("border", "1px solid #303030")
9190
}
9291
.inlineStyle("position", "relative")
9392
}

Sources/Pages/Components/SectionView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ struct SectionView<Header: HTML, Content: HTML>: HTML {
3333
if let lang {
3434
pre {
3535
code(.class("hljs language-\(lang.rawValue)")) {
36-
"""
37-
// \(CodeLang.slugToFileName(self.id, lang: lang))\n
38-
"""
36+
// """
37+
// // \(CodeLang.slugToFileName(self.id, lang: lang))\n
38+
// """
3939
self.header(lang)
4040
}
4141
}

Sources/Pages/HomePage.swift

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,31 +71,35 @@ private struct UserView: HTML {
7171
name: "Erik Bautista Santibanez",
7272
role: "Mobile & Web Developer",
7373
home: "\(residency ?? .default)"\
74-
\(currentLocation.flatMap { ",\n location: \"Currently in \($0)\"" } ?? ""),
75-
about: \"\"\"
76-
\(Self.aboutDescription)
77-
\"\"\"
74+
\(currentLocation.flatMap { ",\n location: \"Currently in \($0)\"" } ?? "")
7875
)
76+
77+
> print(user.about())
78+
// \(Self.aboutDescription)
7979
"""
8080
case .typescript:
8181
"""
82-
const user = {
82+
const user: User = {
8383
name: "Erik Bautista Santibanez",
8484
role: "Mobile & Web Developer",
8585
home: "\(residency ?? .default)"\
86-
\(currentLocation.flatMap { ",\n location: \"Currently in \($0)\"" } ?? ""),
87-
about: `\(Self.aboutDescription)`
86+
\(currentLocation.flatMap { ",\n location: \"Currently in \($0)\"" } ?? "")
8887
};
88+
89+
> console.log(user.about());
90+
// \(Self.aboutDescription)
8991
"""
9092
case .rust:
9193
"""
9294
let user = User {
9395
name: "Erik Bautista Santibanez",
9496
role: "Mobile & Web Developer",
9597
home: "\(residency ?? .default)"\
96-
\(currentLocation.flatMap { ",\n location: \"Currently in \($0)\"" } ?? ""),
97-
about: "\(Self.aboutDescription)"
98+
\(currentLocation.flatMap { ",\n location: \"Currently in \($0)\"" } ?? "")
9899
};
100+
101+
> println!("{}", user.about());
102+
// \(Self.aboutDescription)
99103
"""
100104
case .none:
101105
h1(.aria.label("Name")) {
@@ -280,14 +284,15 @@ private struct PostsView: HTML {
280284
}
281285
} content: {
282286
for (num, post) in Post.allCases.enumerated().reversed() {
283-
PostView(number: num, post: post)
287+
PostView(number: num, post: post, selected: selected)
284288
}
285289
}
286290
}
287291

288292
struct PostView: HTML {
289293
let number: Int
290294
let post: Post
295+
let selected: Vue.Expression<CodeLang?>
291296

292297
var body: some HTML {
293298
article(
@@ -305,8 +310,13 @@ private struct PostsView: HTML {
305310

306311
pre {
307312
a(.href("#\(self.post.slug)")) {
308-
code(.class("hljs language-swift")) {
309-
"logs[\(self.number)]"
313+
CodeLang.conditionalCases(initial: selected) { lang in
314+
code(.class("hljs \("language-\(lang?.rawValue ?? "markdown")")")) {
315+
switch lang {
316+
case .none: "log-\(self.number).md"
317+
case .some: "logs[\(self.number)]"
318+
}
319+
}
310320
}
311321
}
312322
.inlineStyle("font-size", "0.75em")
@@ -333,7 +343,6 @@ private struct PostsView: HTML {
333343
.inlineStyle("background", "#2A2A2A", post: " blockquote")
334344
.inlineStyle("padding", "0.125rem 1rem", post: " blockquote")
335345
.inlineStyle("border", "1.5px solid #4A4A4A", post: " blockquote")
336-
.inlineStyle("border-radius", "0.125rem", post: " blockquote")
337346
.inlineStyle("margin-left", "0", post: " blockquote")
338347
.inlineStyle("margin-right", "0", post: " blockquote")
339348

@@ -414,7 +423,6 @@ private struct PostsView: HTML {
414423
.inlineStyle("margin-top", "1.25rem", post: " > *")
415424
.inlineStyle("margin-bottom", "1.25rem", post: " > *")
416425
.inlineStyle("border", "1.5px solid #3A3A3A", post: " > *")
417-
.inlineStyle("border-radius", "1rem", post: " > *")
418426
.postCodeBlockStyling()
419427
}
420428
}
@@ -479,7 +487,6 @@ extension HTML {
479487
self.inlineStyle("padding", "0.75rem", post: " pre")
480488
.inlineStyle("background", "#242424", post: " pre")
481489
.inlineStyle("border", "1.5px solid #3A3A3A", post: " pre")
482-
.inlineStyle("border-radius", "0.75rem", post: " pre")
483490
.inlineStyle("overflow-x", "auto", post: " pre")
484491
.inlineStyle("font-size", "0.85em", post: " pre")
485492
}

Sources/Pages/Models/Post+AllCases.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,16 @@ extension Post: CaseIterable {
3939
Self(
4040
title: "Mochi \u{2014} Content Viewer for iOS and macOS",
4141
content: """
42-
> TBD
4342
""",
44-
date: Date(month: 9, day: 15, year: 2024),
45-
lastUpdated: Date(month: 3, day: 15, year: 2025),
46-
kind: .project
43+
date: Date(month: 12, day: 10, year: 2023),
44+
kind: .project,
45+
links: [
46+
.init(
47+
title: "Mochi Website",
48+
href: "https://mochi.erikb.dev",
49+
role: .primary
50+
)
51+
]
4752
),
4853
Self(
4954
header: .code(

0 commit comments

Comments
 (0)