summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2017-08-03 00:44:26 +0200
committerneodarz <neodarz@neodarz.net>2017-08-03 00:44:26 +0200
commitdba56cfa028e2feaaa34a4dc0e2489afcc4dc9ad (patch)
tree228fae250c5d7fffe24f24a3ffe449add5ee4e82
parent1404f4ef36a63e2a493eceaa81abdd8a2980ef9a (diff)
downloadyolorandom.cat-dba56cfa028e2feaaa34a4dc0e2489afcc4dc9ad.zip
yolorandom.cat-dba56cfa028e2feaaa34a4dc0e2489afcc4dc9ad.tar.xz
Add js script for random image backaground
-rw-r--r--index.html22
1 files changed, 21 insertions, 1 deletions
diff --git a/index.html b/index.html
index 366d7f0..824499f 100644
--- a/index.html
+++ b/index.html
@@ -1,8 +1,25 @@
<!DOCTYPE html>
-<html style="background-color: black">
+<html>
<head>
+ <script type="text/javascript">
+ var totalCount = 10;
+ function ChangeIt()
+ {
+ var num = Math.ceil( Math.random() * totalCount );
+ document.body.style.background = 'black url("images/back'+num+'.jpg") no-repeat center center fixed';
+ document.body.style.backgroundSize = "cover";// Background repeat
+ }
+ </script>
<title>yolorandom.cat</title>
<style>
+ body {
+ /*background: no-repeat center center fixed;*/
+ -webkit-background-size: cover;
+ -moz-background-size: cover;
+ -o-background-size: cover;
+ background-size: cover;
+ }
+
a {
color: white;
}
@@ -81,6 +98,9 @@
</head>
<body>
+ <script type="text/javascript">
+ ChangeIt();
+ </script>
<div class="links">
<a class="div_link" href="https://shaarli.yolorandom.cat"><div class="el">
<div class="img_rotate"></div>