feat: initial portfolio implementation with dark mode and i18n
- Add Astro portfolio with TypeScript - Implement dark/light theme toggle - Add Spanish/English translations - Create under construction page - Style with Tailwind CSS and glassmorphism effects - Add profile image, projects, skills, and experience sections
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
(function () {
|
||||
const savedLang = localStorage.getItem("language") || "en";
|
||||
const htmlLang = document.documentElement.lang || "en";
|
||||
const currentLang = savedLang || htmlLang;
|
||||
|
||||
window.setLanguage = function (lang) {
|
||||
localStorage.setItem("language", lang);
|
||||
location.reload();
|
||||
};
|
||||
|
||||
window.getCurrentLanguage = function () {
|
||||
return localStorage.getItem("language") || "en";
|
||||
};
|
||||
|
||||
window.toggleLanguage = function () {
|
||||
const currentLang = getCurrentLanguage();
|
||||
const newLang = currentLang === "en" ? "es" : "en";
|
||||
setLanguage(newLang);
|
||||
};
|
||||
})();
|
||||
Reference in New Issue
Block a user