-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e434e0b
commit 1ae96ca
Showing
25 changed files
with
911 additions
and
679 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@tailwind base; | ||
@tailwind base; /* Preflight will be injected here */ | ||
|
||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
@tailwind utilities; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
<script> | ||
import { t } from '@i18n'; | ||
import Typography from './core/Typography.svelte'; | ||
import { t } from '@i18n'; | ||
import Typography from './core/Typography.svelte'; | ||
</script> | ||
|
||
<div | ||
class="w-full py-2 flex justify-center items-center bg-primary shadow-md" | ||
style="view-transition-name: footer" | ||
class="w-full py-2 flex justify-center items-center bg-primary-400 shadow-md" | ||
style="view-transition-name: footer" | ||
> | ||
<Typography class="mb-0" | ||
><span class="mr-2">{$t('common.copyright')}</span> | | ||
<a | ||
target="_blank" | ||
rel="noreferrer" | ||
href="https://github.com/hamzaabamboo/ham-san.net" | ||
class="ml-2">{$t('common.view-source')}</a | ||
></Typography | ||
> | ||
<Typography class="mb-0" | ||
><span class="mr-2">{$t('common.copyright')}</span> | | ||
<a | ||
target="_blank" | ||
rel="noreferrer" | ||
href="https://github.com/hamzaabamboo/ham-san.net" | ||
class="ml-2">{$t('common.view-source')}</a | ||
></Typography | ||
> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,109 @@ | ||
<script lang="ts"> | ||
import { invalidateAll } from '$app/navigation'; | ||
import { faBars } from '@fortawesome/free-solid-svg-icons'; | ||
import { locale, t } from '@i18n'; | ||
import { localizationUrls } from '@stores/localizationUrls'; | ||
import { LANGUAGES } from '@utils/localization'; | ||
import Fa from 'svelte-fa'; | ||
import { invalidateAll } from '$app/navigation'; | ||
import { faBars } from '@fortawesome/free-solid-svg-icons'; | ||
import { locale, t } from '@i18n'; | ||
import { localizationUrls } from '@stores/localizationUrls'; | ||
import { LANGUAGES } from '@utils/localization'; | ||
import Fa from 'svelte-fa'; | ||
let menuOpen = false; | ||
let menuOpen = false; | ||
// let navbar: HTMLElement; | ||
// let navbar: HTMLElement; | ||
const handleChangeLanguage = (language: (typeof LANGUAGES)[number]) => { | ||
locale.set(language); | ||
fetch('/?/set-language', { | ||
method: 'POST', | ||
body: `language=${language}`, | ||
headers: { | ||
'Content-Type': 'application/x-www-form-urlencoded' | ||
} | ||
}).then(() => invalidateAll()); | ||
if (menuOpen) menuOpen = false; | ||
}; | ||
const handleChangeLanguage = (language: (typeof LANGUAGES)[number]) => { | ||
locale.set(language); | ||
fetch('/?/set-language', { | ||
method: 'POST', | ||
body: `language=${language}`, | ||
headers: { | ||
'Content-Type': 'application/x-www-form-urlencoded' | ||
} | ||
}).then(() => invalidateAll()); | ||
if (menuOpen) menuOpen = false; | ||
}; | ||
$: links = [ | ||
{ label: $t('common.home'), href: '/' }, | ||
{ label: $t('common.about-me'), href: '/about' }, | ||
{ label: $t('common.projects'), href: '/projects' }, | ||
{ label: $t('common.note'), href: '/notes' }, | ||
// { label: $t('common.hobbies'), href: '/hobbies' }, | ||
// { label: $t('common.blog'), href: '/blog' }, | ||
{ label: $t('common.contact'), href: '/contact' } | ||
]; | ||
$: links = [ | ||
{ label: $t('common.home'), href: '/' }, | ||
{ label: $t('common.about-me'), href: '/about' }, | ||
{ label: $t('common.projects'), href: '/projects' }, | ||
{ label: $t('common.note'), href: '/notes' }, | ||
// { label: $t('common.hobbies'), href: '/hobbies' }, | ||
// { label: $t('common.blog'), href: '/blog' }, | ||
{ label: $t('common.contact'), href: '/contact' } | ||
]; | ||
</script> | ||
|
||
<!-- bind:this={navbar} --> | ||
<nav | ||
class="w-full h-12 flex items-center justify-between sticky bg-primary top-0 shadow-sm z-20" | ||
class="w-full h-12 flex items-center justify-between sticky bg-primary-400 top-0 shadow-sm z-20" | ||
> | ||
<div class="w-full h-12 flex items-center justify-between px-4 z-20" style:view-transition-name="header"> | ||
<!-- Logo Section --> | ||
<div class="w-full md:w-auto relative z-20"> | ||
<!-- <Logo /> --> | ||
<a href="/">{$t('common.name')}</a> | ||
</div> | ||
<div | ||
class="w-full h-12 flex items-center justify-between px-4 z-20" | ||
style:view-transition-name="header" | ||
> | ||
<!-- Logo Section --> | ||
<div class="w-full md:w-auto relative z-20"> | ||
<!-- <Logo /> --> | ||
<a href="/">{$t('common.name')}</a> | ||
</div> | ||
|
||
<!-- Desktop Menu--> | ||
<div class="items-center hidden md:flex"> | ||
<div> | ||
{#each links as link} | ||
<a href={link.href} class="p-2">{link.label}</a> | ||
{/each} | ||
</div> | ||
<div class="px-2">|</div> | ||
<div> | ||
{#each LANGUAGES as language} | ||
{#if $localizationUrls[language]} | ||
<a | ||
class="px-1" | ||
href={$localizationUrls[language]} | ||
on:click={() => handleChangeLanguage(language)} | ||
>{language.toUpperCase()} | ||
</a> | ||
{:else} | ||
<button class="px-1" on:click={() => handleChangeLanguage(language)}> | ||
{language.toUpperCase()}</button | ||
> | ||
{/if} | ||
{/each} | ||
</div> | ||
</div> | ||
<!-- Desktop Menu--> | ||
<div class="items-center hidden md:flex"> | ||
<div> | ||
{#each links as link} | ||
<a href={link.href} class="p-2">{link.label}</a> | ||
{/each} | ||
</div> | ||
<div class="px-2">|</div> | ||
<div> | ||
{#each LANGUAGES as language} | ||
{#if $localizationUrls[language]} | ||
<a | ||
class="px-1" | ||
href={$localizationUrls[language]} | ||
on:click={() => handleChangeLanguage(language)} | ||
>{language.toUpperCase()} | ||
</a> | ||
{:else} | ||
<button class="px-1" on:click={() => handleChangeLanguage(language)}> | ||
{language.toUpperCase()}</button | ||
> | ||
{/if} | ||
{/each} | ||
</div> | ||
</div> | ||
|
||
<!-- Mobile Menu--> | ||
<div | ||
class="items-center flex relative z-20 md:hidden" | ||
on:click={() => (menuOpen = !menuOpen)} | ||
> | ||
<Fa icon={faBars} size="md" /> | ||
</div> | ||
</div> | ||
<div | ||
class="fixed w-full h-full z-10 transition-all bg-white top-0 pt-16 md:hidden" | ||
class:-right-full={!menuOpen} | ||
class:right-0={menuOpen} | ||
> | ||
<div class="flex flex-col justify-center px-2 text-center"> | ||
{#each links as link} | ||
<a href={link.href} class="p-2" on:click={() => (menuOpen = false)}>{link.label}</a> | ||
{/each} | ||
<hr /> | ||
<div class="pt-4"> | ||
{#each LANGUAGES as language} | ||
{#if $localizationUrls[language]} | ||
<a | ||
class="px-1" | ||
href={$localizationUrls[language]} | ||
on:click={() => handleChangeLanguage(language)} | ||
>{language.toUpperCase()} | ||
</a> | ||
{:else} | ||
<button class="px-1" on:click={() => handleChangeLanguage(language)}> | ||
{language.toUpperCase()}</button | ||
> | ||
{/if} | ||
{/each} | ||
</div> | ||
</div> | ||
</div> | ||
<!-- Mobile Menu--> | ||
<div class="items-center flex relative z-20 md:hidden" on:click={() => (menuOpen = !menuOpen)}> | ||
<Fa icon={faBars} size="md" /> | ||
</div> | ||
</div> | ||
<div | ||
class="fixed w-full h-full z-10 transition-all bg-white top-0 pt-16 md:hidden" | ||
class:-right-full={!menuOpen} | ||
class:right-0={menuOpen} | ||
> | ||
<div class="flex flex-col justify-center px-2 text-center"> | ||
{#each links as link} | ||
<a href={link.href} class="p-2" on:click={() => (menuOpen = false)}>{link.label}</a> | ||
{/each} | ||
<hr /> | ||
<div class="pt-4"> | ||
{#each LANGUAGES as language} | ||
{#if $localizationUrls[language]} | ||
<a | ||
class="px-1" | ||
href={$localizationUrls[language]} | ||
on:click={() => handleChangeLanguage(language)} | ||
>{language.toUpperCase()} | ||
</a> | ||
{:else} | ||
<button class="px-1" on:click={() => handleChangeLanguage(language)}> | ||
{language.toUpperCase()}</button | ||
> | ||
{/if} | ||
{/each} | ||
</div> | ||
</div> | ||
</div> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<script> | ||
let _class = ''; | ||
export { _class as class }; | ||
let _class = ''; | ||
export { _class as class }; | ||
</script> | ||
|
||
<button | ||
{...$$restProps} | ||
class="px-4 py-2 mx-auto bg-primary rounded-md transition-shadow shadow-sm hover:shadow-md {_class}" | ||
{...$$restProps} | ||
class="px-4 py-2 mx-auto bg-primary-400 rounded-md transition-shadow shadow-sm hover:shadow-md {_class}" | ||
> | ||
<slot /> | ||
<slot /> | ||
</button> |
Oops, something went wrong.