+
-
-
-
-
- Hiraku @hirakujira · 1m
-
- {{ message }}
-
-
-
+
+
+
+
+ Hiraku @hirakujira · 1m
+
+ {{ message }}
+
+
+
+
-
-
+
+
-
\ No newline at end of file
+
diff --git a/statics/hiraku.jpeg b/public/hiraku.jpeg
similarity index 100%
rename from statics/hiraku.jpeg
rename to public/hiraku.jpeg
diff --git a/statics/hiraku.txt b/public/hiraku.txt
similarity index 87%
rename from statics/hiraku.txt
rename to public/hiraku.txt
index ee826e0..317c1c2 100644
--- a/statics/hiraku.txt
+++ b/public/hiraku.txt
@@ -1,7 +1,7 @@
我買的每一個垃圾 domain 都至少放個 index.html ┌(┌^o^)┐,
因為我都找 Apple 麻煩所以 (´・ω・`),
就我笨啊,
-笑死,每個人都質疑你沒SSL @Shawn_N,
+笑死,每個人都質疑你沒 SSL @Shawn_N,
咬我啊,
怕爆,
Ubuntu 20.04 刷爆了,耶 ( ✌️‘ω’)✌️,
@@ -15,4 +15,4 @@ Ubuntu 20.04 刷爆了,耶 ( ✌️‘ω’)✌️,
原來我才辣雞,
兩隻 iPhone SE 四萬而已比一隻 11 Pro Max 便宜,
那是我做的 bot 叫做唐鳳。,
-你以為這個群有 4448 人?其實裡面都是我,不信我等下發一樣訊息給你看看,
+你以為這個群有 4448 人?其實裡面都是我,不信我等下發一樣訊息給你看看
diff --git a/public/main.js b/public/main.js
new file mode 100644
index 0000000..786633a
--- /dev/null
+++ b/public/main.js
@@ -0,0 +1,25 @@
+/* global Vue */
+(async () => {
+ const hiraku = await fetch('public/hiraku.txt')
+ const saying = await hiraku.text()
+ const hirakuSaying = saying.split(',').slice().map(x => x.trim())
+ new Vue({ // eslint-disable-line no-new
+ el: '#app',
+ data: {
+ hiraku: hirakuSaying,
+ message: ''
+ },
+ methods: {
+ updateHiraku () {
+ const idx = Math.floor(Math.random() * this.hiraku.length)
+ this.message = this.hiraku[idx]
+ }
+ },
+ created () {
+ (function f () {
+ this.updateHiraku()
+ return setTimeout(f.bind(this), 5000)
+ }).bind(this)()
+ }
+ })
+})()
diff --git a/statics/main.js b/statics/main.js
deleted file mode 100644
index 9ea9428..0000000
--- a/statics/main.js
+++ /dev/null
@@ -1,15 +0,0 @@
-function fetcher() {
- return axios.get('./statics/hiraku.txt').then(response => {
- return response.data.split(',').slice(0, -1)
- })
-}
-
-fetcher().then(data => {
- var random_string = Math.floor(Math.random() * data.length);
- var vm = new Vue({
- el: "#exhibition",
- data: {
- message: data[random_string]
- }
- });
-})
\ No newline at end of file