Initial commit
This commit is contained in:
27
landingPage/script.js
Normal file
27
landingPage/script.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// 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';
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user