Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .vscode/extensions.json

This file was deleted.

11 changes: 0 additions & 11 deletions .vscode/launch.json

This file was deleted.

21 changes: 0 additions & 21 deletions public/fonts/LICENSE

This file was deleted.

46 changes: 0 additions & 46 deletions public/fonts/README.md

This file was deleted.

Binary file removed public/fonts/symbols-nerdfont-mono-regular.ttf
Binary file not shown.
1 change: 0 additions & 1 deletion public/icons/x.svg

This file was deleted.

Binary file added public/images/nijika_404.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 0 additions & 13 deletions src/components/Button.astro

This file was deleted.

11 changes: 2 additions & 9 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ const tr = useTranslations(lang);

<style lang="scss">

@import "../styles/_colors.scss";
@use "../styles/colors";

.footer {
margin-top: 64px;
overflow: hidden;
display: block;
width: 100%;
Expand All @@ -33,12 +34,4 @@ const tr = useTranslations(lang);
body.light .footer {
color: gray;
}

body.dark a:hover {
color: $accent-color;
}

body.light a:hover {
color: $accent-color-dark;
}
</style>
20 changes: 11 additions & 9 deletions src/components/LinkButton.astro
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
---
interface Props {
href: string;
external?: boolean;
}

const { href } = Astro.props;
const { href, external } = Astro.props;
---

<a class="link-button" href={ href }>
<slot />
<slot /> <i style=`display: ${external ? "initial" : "none"}`
class="nf nf-oct-arrow_up_right" />
</a>

<style lang="scss">

@import "../styles/_colors.scss";
@use "../styles/colors";

a {
display: inline-flex;
Expand All @@ -23,22 +25,22 @@ const { href } = Astro.props;
box-sizing: content-box;
color: inherit;

border: solid 0.032em $accent-color;
border: solid 0.032em colors.$accent-color;
padding: 5px 8px;
border-radius: 12px;
text-decoration: none;
-webkit-tap-highlight-color: transparent;
transition: 150ms linear;
}

body.dark a:hover {
color: white;
background-color: $accent-color-dark;
&:hover {
color: white;
background-color: colors.$accent-color-dark;
}
}

body.light a:hover {
color: black;
background-color: $accent-color;
background-color: colors.$accent-color;
}
</style>

Expand Down
87 changes: 41 additions & 46 deletions src/components/Navigation.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const tr = useTranslations(lang as never);
<nav class="navigation" id="navbar" aria-label="Navigation Bar">
<div class="left-side">
<a rel="author" href="https://github.com/retrozinndev">
<Image class="profile-pic" src="https://github.com/retrozinndev.png" width=32 height=32 alt="Me" />
<Image class="profile-pic"
src="https://1.gravatar.com/avatar/093b64d2016ab8acce8a2fe73cb719f527790d4ecec7f5837db8d46519b38bf8?size=80"
width=32 height=32 alt={ tr("nav.home") } />
</a>
</div>
<ul class="links">
Expand All @@ -22,30 +24,30 @@ const tr = useTranslations(lang as never);
<li class="link">
<a href={`/${lang}#about`} target="_self">{ tr("nav.about") }</a>
</li>

{
pages.map(page => (
<li class="link">
<a href={`/${lang}/${page}`} target="_self">{ tr(`nav.${page}`) }</a>
</li>
))
}

<li class="action">
<a href="#" id="nav-toggle-theme"><span id="nav-theme-icon" class="nf nf-oct-sun"></span></a>
</li>
</ul>
<select name="Language" id="langSelector">
{
languages.map(l => (
<option value=`${l}`>{ i18n[l as keyof typeof i18n]["language" as keyof typeof i18n] }</option>
))
}
</select>
<select name="Language" id="langSelector"> {
languages.map(l => (
<option value=`${l}`>{ i18n[l as keyof typeof i18n].language }</option>
))
} </select>
</nav>
</div>

<script>

import { getStoredTheme, getThemes, applyTheme, getTheme, toggleTheme } from "../scripts/theme.ts";
import { applyTheme, getTheme, toggleTheme } from "../scripts/theme.ts";
import { getLanguageFromURL } from "../i18n/utils.ts";

const navigation = document.getElementById("navbar") as HTMLDivElement;
Expand All @@ -54,51 +56,44 @@ const tr = useTranslations(lang as never);
const languageSelector = document?.getElementById("langSelector") as HTMLSelectElement;

window.onscroll = () => {
if(navigation) {
if(window.scrollY >= 24) {
navigation.classList.add("scrolled");
} else {
navigation.classList.remove("scrolled");
}
}
if(!navigation) return;

window.scrollY >= 24 ?
navigation.classList.add("scrolled")
: navigation.classList.remove("scrolled");
};

if(toggleThemeButton && toggleThemeIcon) {
toggleThemeButton.onclick = () => {
toggleTheme();
applyTheme(getTheme());

if (getTheme() == "dark")
toggleThemeIcon.className = "nf nf-oct-sun";
else
toggleThemeIcon.className = "nf nf-oct-moon";
};

if (getTheme() == "dark")
toggleThemeIcon.className = "nf nf-oct-sun";
else
toggleThemeIcon.className = "nf nf-oct-moon";

toggleThemeIcon.className = getTheme() == "dark" ?
"nf nf-oct-sun"
: "nf nf-oct-moon";
}

window.onload = () => {
applyTheme(getStoredTheme() || getThemes()[0]);

if(languageSelector) {
languageSelector.value = getLanguageFromURL(new URL(window.location.href));
navigation.onload = () => {
if(!languageSelector) return;

languageSelector.onchange = (event: Event) => {
const eventTarget = event.target as HTMLSelectElement,
newLanguage = eventTarget?.value as string;

window.location.href = `/${newLanguage}`;
}
}
languageSelector.value = getLanguageFromURL(new URL(window.location.href));
languageSelector.onchange = (event) =>
window.location.href = `/${(event.target as HTMLSelectElement).value}`;
}

</script>

<style lang="scss">

@import "../styles/_colors.scss";
@use "sass:color";
@use "../styles/colors";

div.navigation-bar {
position: sticky;
Expand All @@ -112,7 +107,8 @@ const tr = useTranslations(lang as never);

#navbar {
display: flex;
border-radius: 12px;
border-radius: 16px;
backdrop-filter: blur(40px);
font-size: medium;
justify-content: center;
align-items: center;
Expand All @@ -124,12 +120,12 @@ const tr = useTranslations(lang as never);
flex-wrap: wrap;
}

body.dark nav.navigation {
background-color: $bg-navbar-color-dark;
.navigation {
background: color.scale($color: colors.$bg-navbar-color-dark, $alpha: -20%);
}

body.light nav.navigation {
background-color: $bg-navbar-color-light;
body.light .navigation {
background-color: color.scale($color: colors.$bg-navbar-color-light, $alpha: -20%);
}

body.dark .navigation.scrolled {
Expand All @@ -140,11 +136,6 @@ const tr = useTranslations(lang as never);
box-shadow: 0 0 5px 2px darkgray;
}

.left-side span.website {
margin: 0;
vertical-align: center;
}

.left-side img {
border-radius: 8px;
}
Expand All @@ -165,6 +156,10 @@ const tr = useTranslations(lang as never);
list-style: none;
padding: 0;

&.link > * {

}

&:first-child {
margin-inline-start: 0px;
};
Expand Down Expand Up @@ -193,16 +188,16 @@ const tr = useTranslations(lang as never);
}

body.dark a:hover {
color: $accent-color;
color: colors.$accent-color;
}

body.light a:hover {
color: $accent-color-dark;
color: colors.$accent-color-dark;
}

@media screen and (max-width: 700px) {
#navbar {
padding-block: 12px;
padding-block: 14px;
}
}

Expand Down
Loading
Loading