major lander upgrades and somme udpates to documentionat
This commit is contained in:
37
mkdocs/site/javascripts/home.js
Normal file
37
mkdocs/site/javascripts/home.js
Normal file
@@ -0,0 +1,37 @@
|
||||
// Changemaker Lite - Minimal Interactions
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Terminal copy functionality
|
||||
const terminals = document.querySelectorAll('.terminal-box');
|
||||
terminals.forEach(terminal => {
|
||||
terminal.addEventListener('click', function() {
|
||||
const code = this.textContent.trim();
|
||||
navigator.clipboard.writeText(code).then(() => {
|
||||
// Quick visual feedback
|
||||
this.style.background = '#0a0a0a';
|
||||
setTimeout(() => {
|
||||
this.style.background = '#000';
|
||||
}, 200);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Smooth scroll for anchors
|
||||
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
||||
anchor.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
const target = document.querySelector(this.getAttribute('href'));
|
||||
if (target) {
|
||||
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Reduced motion support
|
||||
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
||||
document.documentElement.style.scrollBehavior = 'auto';
|
||||
const style = document.createElement('style');
|
||||
style.textContent = '*, *::before, *::after { animation: none !important; transition: none !important; }';
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user