making the background less cpu intensive
parent
9764b4441b
commit
9cc88603fc
|
@ -12,6 +12,11 @@
|
|||
}
|
||||
html,
|
||||
body {
|
||||
background: no-repeat fixed;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
font-family: 'Patrick Hand SC', sans-serif;
|
||||
font-size: 18px;
|
||||
overflow-x: hidden;
|
||||
|
|
|
@ -10,7 +10,6 @@ var t = new Trianglify(
|
|||
x_gradient: ["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"]
|
||||
}
|
||||
);
|
||||
var prevheight = height();
|
||||
|
||||
window.onresize = function() {
|
||||
redraw();
|
||||
|
@ -19,7 +18,7 @@ window.onresize = function() {
|
|||
redraw();
|
||||
|
||||
function redraw() {
|
||||
var pattern = t.generate(document.body.clientWidth, height());
|
||||
var pattern = t.generate(window.innerWidth, window.innerHeight);
|
||||
document.body.setAttribute('style', 'background-image: '+pattern.dataUrl);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue