|
var back = $('body'), |
|
c = $('#c'), |
|
d = $('#d'); |
|
|
|
// Select a shape |
|
var shapes = ['▲','▼','◬','◈','◆','◇','⧫'], // '◀','▶' |
|
randomShape = Math.floor(Math.random()*shapes.length), |
|
triangle = shapes[randomShape]; |
|
|
|
// Add it |
|
c.append(triangle); |
|
|
|
// Select an image |
|
var imgList = [ |
|
'url(https://unsplash.imgix.net/uploads%2F141223808515744db9995%2F3361b5e1?q=75&fm=jpg&auto=format&s=a56c1bef666a56f257171ebfe6439226)', |
|
'url(https://unsplash.imgix.net/uploads%2F14114036359651bd991f1%2Fb3ed8fdf?q=75&fm=jpg&auto=format&s=48ce2bc496d68ba261521169af4f0624)', |
|
'url(https://unsplash.imgix.net/reserve/z7R1rjT6RhmZdqWbM5hg_R0001139.jpg?q=75&fm=jpg&auto=format&s=62cde4992508e70fdd44e16f1fe926fb)', |
|
'url(https://unsplash.imgix.net/reserve/J3URHssSQyqifuJVcgKu_Wald.jpg?q=75&fm=jpg&auto=format&s=1a8c268459129e81ef4b1dd5ad48e93a)', |
|
'url(https://unsplash.imgix.net/uploads%2F14115409319165441c030%2Fa1d0230a?q=75&fm=jpg&auto=format&s=b6975e3020e4ec063ec03250904506e0)' |
|
]; |
|
|
|
var randomImg = Math.floor(Math.random()*imgList.length), |
|
img = imgList[randomImg]; |
|
|
|
// Append the same img |
|
c.css('background-image', img); |
|
back.css('background-image', img); |
|
|
|
|
|
// Select an effect |
|
var filters = ['hue','invert','grayscale','saturate','tint','blur','sepia'], |
|
randomFilter = Math.floor(Math.random()*filters.length), |
|
effect = filters[randomFilter]; |
|
|
|
// Add it |
|
c.addClass(effect); |
|
|
|
|
|
// Select a decoration |
|
var dec = ['╳','⤫','⤬'], |
|
randomDecoration = Math.floor(Math.random()*dec.length), |
|
cross = dec[randomDecoration]; |
|
|
|
// Add it |
|
d.append(cross); |
|
|
|
|
|
// button stuff |
|
$('.runBtn').click(function () { |
|
window.location.href=window.location.href; |
|
}); |