mirror of
https://github.com/zeldaret/website.git
synced 2026-09-26 13:33:07 -04:00
23 lines
756 B
JavaScript
23 lines
756 B
JavaScript
|
|
var imgSrc = "img/vrbox_cur.png";
|
|
|
|
// background scroll animation
|
|
var bgImg = new Image();
|
|
bgImg.onload = function()
|
|
{
|
|
var factor = (window.innerHeight/this.height);
|
|
var style = document.createElement('style');
|
|
style.type = 'text/css';
|
|
document.getElementsByTagName('head')[0].appendChild(style);
|
|
|
|
var bodyStyle = document.getElementsByTagName("body")[0].style;
|
|
bodyStyle.backgroundImage = "url(" + imgSrc + ")";
|
|
bodyStyle.backgroundRepeat = "repeat-x";
|
|
bodyStyle.backgroundAttachment = "fixed";
|
|
bodyStyle.backgroundSize = "cover";
|
|
bodyStyle.animationName = "bg_anim";
|
|
bodyStyle.animationIterationCount = "infinite";
|
|
bodyStyle.animationTimingFunction = "linear";
|
|
}
|
|
bgImg.src = imgSrc;
|