medsdoor-expressrx / script.js
datads's picture
i want a app for health care branding of medsdoor company colour is red and blue but you can use white or black also the motive of company is to deliver medicine in minutes and lab test in it and all working is multivendor its mean delivery panel admin panel and user panelalso intregated
579f9e1 verified
Raw History Blame Contribute Delete
1.53 kB
// Theme toggle functionality
document.addEventListener('DOMContentLoaded', () => {
// Check for saved theme preference or use system preference
const savedTheme = localStorage.getItem('theme') ||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
document.documentElement.classList.add(savedTheme);
// Update theme toggle button state
const themeToggle = document.getElementById('theme-toggle');
if (themeToggle) {
themeToggle.checked = savedTheme === 'dark';
}
});
function toggleTheme() {
const html = document.documentElement;
const isDark = html.classList.contains('dark');
if (isDark) {
html.classList.remove('dark');
localStorage.setItem('theme', 'light');
} else {
html.classList.add('dark');
localStorage.setItem('theme', 'dark');
}
}
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
// Initialize panel animations
document.addEventListener('DOMContentLoaded', () => {
const panels = document.querySelectorAll('.panel-card');
panels.forEach((panel, index) => {
panel.style.setProperty('--order', index);
});
// Initialize Feather icons
if (window.feather) {
feather.replace();
}
});