Skip to content

Commit 8f131ac

Browse files
authored
Merge pull request #49 from retrozinndev/devel
✨ redesign website
2 parents 864cd03 + f77c414 commit 8f131ac

25 files changed

+746
-461
lines changed

astro.config.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import { defineConfig } from 'astro/config';
22

3+
import react from "@astrojs/react";
4+
35
// https://astro.build/config
46
export default defineConfig({
57
site: "https://retrozinndev.github.io",
6-
base: "."
8+
base: ".",
9+
integrations: [
10+
react()
11+
],
712
});

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@
1111
},
1212
"dependencies": {
1313
"@astrojs/check": "^0.9.4",
14+
"@astrojs/react": "^4.2.7",
15+
"@octokit/rest": "github:octokit/rest.js",
16+
"@types/react": "^19.1.4",
17+
"@types/react-dom": "^19.1.5",
1418
"astro": "^5.1.7",
19+
"nanostores": "^1.0.1",
20+
"react": "^19.1.0",
21+
"react-dom": "^19.1.0",
22+
"react-icons": "^5.5.0",
1523
"typescript": "^5.4.5"
1624
},
1725
"devDependencies": {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { i18n, languages } from "../i18n/ui";
2+
3+
type Props = {
4+
visible?: boolean;
5+
defaultLanguage?: string;
6+
};
7+
8+
export default function(props: Props) {
9+
return <select name="Language" style={{
10+
display: props.visible ? "initial" : "none"
11+
}} value={props.defaultLanguage} onChange={(e) => {
12+
const htmlSelect = e.target as HTMLSelectElement;
13+
const splitPath: Array<string> = window.location.pathname.split('/');
14+
15+
window.location.pathname = `${htmlSelect.value}/${splitPath.splice(
16+
2, splitPath.length-1
17+
).join('/')}`;
18+
}}> {
19+
languages.map((lang, i) =>
20+
<option value={lang} key={i}>
21+
{ i18n[lang as keyof typeof i18n].language }
22+
</option>
23+
)
24+
} </select>
25+
}

src/components/LinkButton.astro

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
---
2+
import { FaArrowUpRightFromSquare } from 'react-icons/fa6';
3+
24
interface Props {
35
href: string;
46
external?: boolean;
7+
showIcon?: boolean;
8+
title?: string;
9+
spacing?: boolean;
510
}
611
7-
const { href, external } = Astro.props;
12+
const { href, external, title, showIcon = true, spacing = true } = Astro.props;
813
---
914

10-
<a class="link-button" href={ href }>
11-
<slot /> <i style=`display: ${external ? "initial" : "none"}`
12-
class="nf nf-oct-arrow_up_right" />
15+
<a class=`link-button ${spacing ? "space" : ""}` {href}
16+
target={external ? "_blank" : "_self"} {title}>
17+
18+
<slot />
19+
<FaArrowUpRightFromSquare className="external-icon" style={{
20+
display: showIcon && external ? "initial" : "none",
21+
marginLeft: 6,
22+
marginTop: 3
23+
}} />
1324
</a>
1425

1526
<style lang="scss">
@@ -18,29 +29,40 @@ const { href, external } = Astro.props;
1829

1930
a {
2031
display: inline-flex;
21-
margin-inline: 8px;
22-
font-size: normal;
32+
font-size: 1.04em;
2333
font-weight: 600;
24-
width: fit-content;
25-
box-sizing: content-box;
2634
color: inherit;
2735

28-
border: solid 0.032em colors.$accent-color;
29-
padding: 5px 8px;
36+
box-shadow: inset 0 0 0 1px colors.$accent-color-dark;
3037
border-radius: 12px;
3138
text-decoration: none;
32-
-webkit-tap-highlight-color: transparent;
3339
transition: 150ms linear;
3440

35-
&:hover {
36-
color: white;
37-
background-color: colors.$accent-color-dark;
41+
&.space {
42+
padding: 8px 10px;
43+
margin-inline: 8px;
44+
45+
&:hover {
46+
color: white;
47+
border-width: 2px;
48+
background-color: colors.$accent-color-dark;
49+
50+
body.light & {
51+
box-shadow: inset 0 0 0 1px colors.$accent-color-dark;
52+
background-color: colors.$accent-color-dark;
53+
}
54+
}
3855
}
39-
}
4056

41-
body.light a:hover {
42-
color: black;
43-
background-color: colors.$accent-color;
57+
&:not(.space) {
58+
text-decoration: underline;
59+
text-decoration-thickness: 1px;
60+
box-shadow: none;
61+
62+
&:hover {
63+
text-decoration-color: colors.$accent-color-dark;
64+
}
65+
}
4466
}
4567
</style>
4668

src/components/Navigation.astro

Lines changed: 0 additions & 204 deletions
This file was deleted.

0 commit comments

Comments
 (0)