瀏覽代碼

randomly show gb cam avatar on index

Thomas B 2 月之前
父節點
當前提交
29b2786304
共有 2 個檔案被更改,包括 14 行新增0 行删除
  1. 14
    0
      input/index.md
  2. 二進制
      static/img/gb_cam.png

+ 14
- 0
input/index.md 查看文件

@@ -22,3 +22,17 @@ printRecentMenu(10)
22 22
 %-->
23 23
 
24 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>

二進制
static/img/gb_cam.png 查看文件


Loading…
取消
儲存