Skip to content

Commit 150c9ff

Browse files
committed
refactor(footer): Redesign Footer component structure, add sections for project, community, support, and legal links.
1 parent 1256df9 commit 150c9ff

File tree

1 file changed

+148
-26
lines changed
  • website/src/jsMain/kotlin/io/github/ayfri/kore/website/components/sections

1 file changed

+148
-26
lines changed
Lines changed: 148 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
package io.github.ayfri.kore.website.components.sections
22

33
import androidx.compose.runtime.Composable
4-
import com.varabyte.kobweb.compose.css.TextAlign
5-
import com.varabyte.kobweb.compose.css.textAlign
4+
import com.varabyte.kobweb.compose.css.*
5+
import io.github.ayfri.kore.website.GITHUB_LINK
66
import io.github.ayfri.kore.website.GlobalStyle
77
import io.github.ayfri.kore.website.WEBSITE_GITHUB_LINK
8-
import io.github.ayfri.kore.website.utils.A
9-
import io.github.ayfri.kore.website.utils.P
10-
import kotlin.js.Date
8+
import io.github.ayfri.kore.website.utils.*
119
import org.jetbrains.compose.web.attributes.ATarget
1210
import org.jetbrains.compose.web.attributes.target
1311
import org.jetbrains.compose.web.css.*
14-
import org.jetbrains.compose.web.dom.Footer
15-
import org.jetbrains.compose.web.dom.Hr
16-
import org.jetbrains.compose.web.dom.P
17-
import org.jetbrains.compose.web.dom.Text
12+
import org.jetbrains.compose.web.css.AlignItems
13+
import org.jetbrains.compose.web.dom.*
14+
import kotlin.js.Date
1815

1916
@Composable
2017
fun Footer() {
@@ -23,40 +20,165 @@ fun Footer() {
2320
Footer({
2421
classes(FooterStyle.footer)
2522
}) {
26-
Hr()
23+
Div({
24+
classes(FooterStyle.content)
25+
}) {
26+
Div({
27+
classes(FooterStyle.section)
28+
}) {
29+
H3 { Text("Project") }
30+
A(GITHUB_LINK, "GitHub Repository", attrs = { target(ATarget.Blank) })
31+
A("$GITHUB_LINK/releases", "Releases", attrs = { target(ATarget.Blank) })
32+
A("$GITHUB_LINK/issues", "Issues", attrs = { target(ATarget.Blank) })
33+
A(WEBSITE_GITHUB_LINK, "Website Repository", attrs = { target(ATarget.Blank) })
34+
A("https://github.com/Ayfri/Kore-Template", "Project Template", attrs = { target(ATarget.Blank) })
35+
}
36+
37+
Div({
38+
classes(FooterStyle.section)
39+
}) {
40+
H3 { Text("Community") }
41+
A("https://discord.gg/BySjRNQ9Je", "Discord", attrs = { target(ATarget.Blank) })
42+
A("https://kotlinlang.slack.com/archives/C066G9BF66A", "Slack #kore", attrs = { target(ATarget.Blank) })
43+
A("mailto:pierre.ayfri@gmail.com", "Contact", attrs = { target(ATarget.Blank) })
44+
}
2745

28-
P {
29-
Text("This website is ")
46+
Div({
47+
classes(FooterStyle.section)
48+
}) {
49+
H3 { Text("Support") }
50+
A("https://www.buymeacoffee.com/ayfri", attrs = { target(ATarget.Blank) }) {
51+
Img(src = "https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png", attrs = {
52+
style {
53+
height(41.px)
54+
width(174.px)
55+
}
56+
})
57+
}
58+
}
3059

31-
A(WEBSITE_GITHUB_LINK, "open source") {
32-
target(ATarget.Blank)
60+
Div({
61+
classes(FooterStyle.section)
62+
}) {
63+
H3 { Text("Legal") }
64+
A("$GITHUB_LINK/blob/main/LICENSE", "GNU 3.0 License", attrs = {
65+
target(ATarget.Blank)
66+
})
3367
}
3468
}
3569

36-
val currentYear = Date().getFullYear()
37-
P("Copyright © $currentYear - Ayfri. All rights reserved.")
70+
Hr({
71+
classes(FooterStyle.divider)
72+
})
73+
74+
P({
75+
classes(FooterStyle.copyright)
76+
}) {
77+
val currentYear = Date().getFullYear()
78+
Text("Copyright © $currentYear - Ayfri. All rights reserved.")
79+
}
3880
}
3981
}
4082

4183
object FooterStyle : StyleSheet() {
4284
val footer by style {
43-
alignItems(AlignItems.Center)
85+
backgroundColor(GlobalStyle.secondaryBackgroundColor)
4486
display(DisplayStyle.Flex)
4587
flexDirection(FlexDirection.Column)
46-
justifyContent(JustifyContent.Center)
47-
paddingBottom(2.cssRem)
88+
paddingTop(4.cssRem)
4889
width(100.percent)
4990

50-
"hr" style {
51-
backgroundColor(GlobalStyle.tertiaryBackgroundColor)
52-
border(0.px)
53-
height(1.px)
54-
width(100.percent)
91+
smMax(self) {
92+
paddingTop(2.cssRem)
5593
}
94+
}
5695

57-
"p" style {
96+
val content by style {
97+
display(DisplayStyle.Grid)
98+
gridTemplateColumns { repeat(4) { size(1.fr) } }
99+
gap(6.vw)
100+
justifyItems(JustifyItems.Center)
101+
marginBottom(3.cssRem)
102+
paddingX(15.vw)
103+
width(100.percent)
104+
105+
lgMax(self) {
106+
gap(2.cssRem)
107+
paddingX(7.5.vw)
108+
}
109+
110+
mdMax(self) {
111+
gridTemplateColumns { repeat(2) { size(1.fr) } }
112+
gap(3.cssRem)
113+
justifyItems(JustifyItems.Start)
114+
paddingX(10.vw)
115+
}
116+
117+
smMax(self) {
118+
display(DisplayStyle.Flex)
119+
flexDirection(FlexDirection.Column)
120+
alignItems(AlignItems.Center)
121+
gap(2.cssRem)
122+
paddingX(1.cssRem)
58123
textAlign(TextAlign.Center)
59-
marginBottom(0.cssRem)
124+
}
125+
}
126+
127+
val section by style {
128+
display(DisplayStyle.Flex)
129+
flexDirection(FlexDirection.Column)
130+
gap(0.75.cssRem)
131+
width(Width.FitContent)
132+
133+
"h3" style {
134+
color(GlobalStyle.altTextColor)
135+
fontSize(1.25.cssRem)
136+
fontWeight(700)
137+
marginTop(0.px)
138+
marginBottom(0.5.cssRem)
139+
140+
smMax(self) {
141+
fontSize(1.1.cssRem)
142+
}
143+
}
144+
145+
"a" style {
146+
color(GlobalStyle.textColor)
147+
fontSize(1.cssRem)
148+
textDecorationLine(TextDecorationLine.None)
149+
transition(.2.s, "color")
150+
151+
hover(self) style {
152+
color(GlobalStyle.altTextColor)
153+
}
154+
155+
smMax(self + className("link")) {
156+
fontSize(0.9.cssRem)
157+
}
158+
}
159+
160+
smMax(self) {
161+
gap(0.25.cssRem)
162+
}
163+
}
164+
165+
val divider by style {
166+
backgroundColor(GlobalStyle.tertiaryBackgroundColor)
167+
border(0.px)
168+
height(1.px)
169+
margin(0.px)
170+
width(100.percent)
171+
}
172+
173+
val copyright by style {
174+
color(GlobalStyle.altTextColor)
175+
fontSize(0.9.cssRem)
176+
marginY(1.5.cssRem)
177+
textAlign(TextAlign.Center)
178+
179+
smMax(self) {
180+
fontSize(0.8.cssRem)
181+
marginY(1.cssRem)
60182
}
61183
}
62184
}

0 commit comments

Comments
 (0)