add robur logo
This commit is contained in:
parent
7b7d008f78
commit
c890d6ef18
2 changed files with 32 additions and 26 deletions
|
@ -39,6 +39,12 @@ html {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#robur-logo {
|
||||||
|
transform: translate(-20%, 100%) rotate(270deg);
|
||||||
|
width: 60em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
nav ul {
|
nav ul {
|
||||||
display: flex;
|
display: flex;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
|
52
lib/views.ml
52
lib/views.ml
|
@ -112,8 +112,8 @@ let layout
|
||||||
(H.head (H.title (H.txt title))
|
(H.head (H.title (H.txt title))
|
||||||
[H.style ~a:H.[a_mime_type "text/css"] static_css])
|
[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.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.div ~a:[H.a_class ["fixed text-center"]; H.a_style ""] [
|
||||||
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.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:[H.a_class ["max-w-7xl mx-auto"]] [
|
||||||
H.(div ~a:[a_class ["flex justify-between items-center"]] [
|
H.(div ~a:[a_class ["flex justify-between items-center"]] [
|
||||||
|
@ -156,35 +156,35 @@ let layout
|
||||||
H.script
|
H.script
|
||||||
(H.txt "
|
(H.txt "
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
const themeToggle = document.getElementById('theme-toggle');
|
const themeToggle = document.getElementById('theme-toggle');
|
||||||
const html = document.documentElement;
|
const html = document.documentElement;
|
||||||
|
const logo = document.getElementById('robur-logo'); // Ensure the image has this ID
|
||||||
|
|
||||||
function updateIcon() {
|
function updateTheme() {
|
||||||
themeToggle.innerText = html.classList.contains('dark') ? '☀️' : '🌑' ;
|
const isDark = html.classList.contains('dark');
|
||||||
}
|
themeToggle.innerText = isDark ? '☀️' : '🌑';
|
||||||
|
logo.src = isDark
|
||||||
function toggleTheme() {
|
? 'https://i.ibb.co/Y4YsvcDb/robur-logo.png' // Dark mode logo
|
||||||
if (html.classList.contains('dark')) {
|
: 'https://i.ibb.co/r2DRDdTt/robur-logo-black-writing.png'; // Light mode logo
|
||||||
html.classList.remove('dark');
|
|
||||||
localStorage.setItem('theme', 'light');
|
|
||||||
} else {
|
|
||||||
html.classList.add('dark');
|
|
||||||
localStorage.setItem('theme', 'dark');
|
|
||||||
}
|
}
|
||||||
updateIcon();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load user preference from localStorage
|
function toggleTheme() {
|
||||||
if (localStorage.getItem('theme') === 'dark') {
|
html.classList.toggle('dark');
|
||||||
html.classList.add('dark');
|
localStorage.setItem('theme', html.classList.contains('dark') ? 'dark' : 'light');
|
||||||
}
|
updateTheme();
|
||||||
|
}
|
||||||
|
|
||||||
// Set correct emoji on load
|
// Load user preference from localStorage
|
||||||
updateIcon();
|
if (localStorage.getItem('theme') === 'dark') {
|
||||||
|
html.classList.add('dark');
|
||||||
|
}
|
||||||
|
|
||||||
// Attach event listener (in case onclick fails)
|
// Set correct icon and logo on load
|
||||||
themeToggle.addEventListener('click', toggleTheme);
|
updateTheme();
|
||||||
});
|
|
||||||
|
// Attach event listener (in case onclick fails)
|
||||||
|
themeToggle.addEventListener('click', toggleTheme);
|
||||||
|
});
|
||||||
")
|
")
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
Loading…
Reference in a new issue