28 lines
897 B
JavaScript
28 lines
897 B
JavaScript
// Minimal interactions: year, smooth scroll, CTA
|
|
document.addEventListener('DOMContentLoaded', function(){
|
|
// Update year
|
|
var y = new Date().getFullYear();
|
|
var el = document.getElementById('year');
|
|
if(el) el.textContent = y;
|
|
|
|
// Smooth scroll for internal links
|
|
document.querySelectorAll('a[href^="#"]').forEach(function(a){
|
|
a.addEventListener('click', function(e){
|
|
var target = document.querySelector(this.getAttribute('href'));
|
|
if(target){
|
|
e.preventDefault();
|
|
target.scrollIntoView({behavior:'smooth', block:'start'});
|
|
}
|
|
});
|
|
});
|
|
|
|
// Buy button (placeholder action)
|
|
var buy = document.getElementById('buyBtn');
|
|
if(buy){
|
|
buy.addEventListener('click', function(){
|
|
// In a real site, replace with checkout link
|
|
window.location.href = 'https://example.com/checkout?product=mymobileagents&promo=launch20';
|
|
});
|
|
}
|
|
});
|