Current File : /home/jeshor13/11bsouth.com/wedding3/index.js |
document.addEventListener('DOMContentLoaded', function() {
const body = document.getElementsByTagName('body')
const mel = document.getElementById('m')
const jes = document.getElementById('j')
const twoHeadsWidth = mel.width + jes.width
mel.style.position = 'absolute';
mel.style.left = '1px'
mel.width = `${window.innerWidth/3}`
body[0].append(mel)
let mcount = 0
let mvector = 1
setInterval(function(){
if (mcount > (window.innerWidth/2)-mel.width){
mvector = -1
} else if (mcount < 0) {
mvector = 1
}
mcount = mcount + mvector;
mel.style.left = `${mcount}px`;}, 6);
jes.style.position = 'absolute';
jes.style.right = '1px'
jes.width = `${window.innerWidth/3}`
body[0].append(jes)
let jcount = 0
let jvector = -1
setInterval(function(){
if (jcount > (window.innerWidth/2)-jes.width){
jvector = -1
} else if (jcount < 0) {
jvector = 1
}
jcount = jcount + jvector;
jes.style.right = `${jcount}px`;}, 6);
const comingSoon = document.createElement('div')
comingSoon.setAttribute('id','realsoon')
comingSoon.innerHTML = "<h4> Updates Coming Soon! <h4>"
body[0].append(comingSoon)
});