Save locale
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-05-26 01:51:24 +03:00
parent 9d88c3e353
commit 6176c1c15a
5 changed files with 11 additions and 31 deletions

View File

@@ -7,6 +7,10 @@ export default () => {
const [t, { locale }] = useI18n();
const avaliableLocales = ['en', 'ru'];
const savedLocale = localStorage.getItem('locale');
if (savedLocale) {
locale(savedLocale);
} else {
const preferredLocales = navigator.languages.map((lang) => lang.substring(0, 2));
for (const lang of preferredLocales) {
if (avaliableLocales.includes(lang)) {
@@ -14,6 +18,7 @@ export default () => {
break;
}
}
}
return (
<div
@@ -26,6 +31,7 @@ export default () => {
locale('ru')
break;
}
localStorage.setItem('locale', locale());
}}
class={styles.LanguageSelector}
>

View File

@@ -6,21 +6,18 @@ export default () => {
<a
href='https://github.com/anatolykopyl'
target='_blank'
class='hover-grad'
>
github
</a>
<a
href='https://www.linkedin.com/in/akopyl/'
target='_blank'
class='hover-grad'
>
linkedin
</a>
<a
href='https://t.me/avkopyl'
target='_blank'
class='hover-grad'
>
telegram
</a>

View File

@@ -18,7 +18,6 @@ export default (props: {project: Project}) => {
<a
href={props.project.link}
target="_blank"
class='hover-grad'
>
<h2>{props.project.name}</h2>
</a>

View File

@@ -18,7 +18,6 @@ export default () => {
<div
use:observer={(event) => {
if (event.isIntersecting) {
console.log(chapterName);
if (!state.scrolling()) {
setters.setVisibleChapter(chapterName);
} else if (state.visibleChapter() === chapterName) {

View File

@@ -69,24 +69,3 @@ textarea:focus, input:focus{
input::placeholder, textarea::placeholder {
color: var(--clr-text-secondary);
}
.hover-grad {
background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab, var(--clr-text), var(--clr-text), var(--clr-text));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-size: 200% auto;
}
.hover-grad:hover {
animation: gradient 1s ease forwards;
animation-iteration-count: 1;
}
@keyframes gradient {
0% {
background-position: 0% 50%;
}
100% {
background-position: 100% 50%;
}
}