add robur logo

This commit is contained in:
Pizie Dust 2025-02-10 19:29:17 +01:00
parent 7b7d008f78
commit c890d6ef18
2 changed files with 32 additions and 26 deletions

View file

@ -39,6 +39,12 @@ html {
}
}
#robur-logo {
transform: translate(-20%, 100%) rotate(270deg);
width: 60em;
}
nav ul {
display: flex;
list-style: none;

View file

@ -112,8 +112,8 @@ let layout
(H.head (H.title (H.txt title))
[H.style ~a:H.[a_mime_type "text/css"] static_css])
(H.body ~a:[H.a_class ["bg-gray-50 dark:bg-black-molly text-gray-800 dark:text-gray-50 mx-auto p-10"]] [
H.div ~a:[H.a_class ["fixed text-center"]; H.a_style "padding: 9rem;"] [
H.img ~a:[H.a_class [""]] ~src:"https://i.ibb.co/RTbxHJs9/Screenshot-from-2025-02-08-19-55-25-removebg-preview.png" ~alt:"Robur Logo" ()
H.div ~a:[H.a_class ["fixed text-center"]; H.a_style ""] [
H.img ~a:[H.a_class [""]; H.a_id "robur-logo"] ~src:"https://i.ibb.co/Y4YsvcDb/robur-logo.png" ~alt:"Robur Logo" ()
];
H.div ~a:[H.a_class ["max-w-7xl mx-auto"]] [
H.(div ~a:[a_class ["flex justify-between items-center"]] [
@ -158,20 +158,20 @@ let layout
document.addEventListener('DOMContentLoaded', function () {
const themeToggle = document.getElementById('theme-toggle');
const html = document.documentElement;
const logo = document.getElementById('robur-logo'); // Ensure the image has this ID
function updateIcon() {
themeToggle.innerText = html.classList.contains('dark') ? '' : '🌑' ;
function updateTheme() {
const isDark = html.classList.contains('dark');
themeToggle.innerText = isDark ? '' : '🌑';
logo.src = isDark
? 'https://i.ibb.co/Y4YsvcDb/robur-logo.png' // Dark mode logo
: 'https://i.ibb.co/r2DRDdTt/robur-logo-black-writing.png'; // Light mode logo
}
function toggleTheme() {
if (html.classList.contains('dark')) {
html.classList.remove('dark');
localStorage.setItem('theme', 'light');
} else {
html.classList.add('dark');
localStorage.setItem('theme', 'dark');
}
updateIcon();
html.classList.toggle('dark');
localStorage.setItem('theme', html.classList.contains('dark') ? 'dark' : 'light');
updateTheme();
}
// Load user preference from localStorage
@ -179,8 +179,8 @@ let layout
html.classList.add('dark');
}
// Set correct emoji on load
updateIcon();
// Set correct icon and logo on load
updateTheme();
// Attach event listener (in case onclick fails)
themeToggle.addEventListener('click', toggleTheme);