Ver código fonte

randomly show gb cam avatar on index

Thomas B 2 meses atrás
pai
commit
29b2786304
2 arquivos alterados com 14 adições e 0 exclusões
  1. 14
    0
      input/index.md
  2. BIN
      static/img/gb_cam.png

+ 14
- 0
input/index.md Ver arquivo

22
 %-->
22
 %-->
23
 
23
 
24
 [Show all updates](updates.html).
24
 [Show all updates](updates.html).
25
+
26
+<script>
27
+    function getRandomInt(max) {
28
+        return Math.floor(Math.random() * max);
29
+    }
30
+    var img = document.getElementById("index-avatar");
31
+    if (getRandomInt(2) == 0) {
32
+        setTimeout(function() {
33
+            img.src = "img/gb_cam.png";
34
+            img.style.width = "150px"; // 128*1.17188
35
+            img.style.height = "131px"; // 112*1.17188
36
+        }, 500 + getRandomInt(10000));
37
+    }
38
+</script>

BIN
static/img/gb_cam.png Ver arquivo


Carregando…
Cancelar
Salvar