|
84 | 84 | }); |
85 | 85 | saveBtn.addEventListener('click', async function () { |
86 | 86 | let t = new Date(); |
87 | | - list.time = `${t.getFullYear()}/${t.getMonth()*1+1}/${t.getDate()} ${t.getHours()}:${t.getMinutes()}:${t.getSeconds()}`; |
| 87 | + list.time = `${t.getFullYear()}/${t.getMonth() * 1 + 1}/${t.getDate()} ${t.getHours()}:${t.getMinutes()}:${t.getSeconds()}`; |
88 | 88 | let write = await database.ref('/').push(list); |
89 | 89 | popup.classList.add('show'); |
90 | 90 | let url = `${urlOrigin}${urlPath}#${write.key}`; |
|
97 | 97 | const copy = document.getElementById('copy'); |
98 | 98 | new ClipboardJS('#copy'); |
99 | 99 | copy.addEventListener('click', () => { |
100 | | - copy.innerText = '複製成功'; |
| 100 | + copy.innerText = 'Copy Successfully!'; |
101 | 101 | copy.classList.add('copied'); |
102 | 102 | setTimeout(() => { |
103 | | - copy.innerText = '複製連結'; |
| 103 | + copy.innerText = 'Copy link'; |
104 | 104 | copy.classList.remove('copied'); |
105 | 105 | }, 1000); |
106 | 106 | }); |
|
290 | 290 |
|
291 | 291 | // 注意,小車一開始的中心點 y 座標,不等於畫面的中心點 y 座標。 |
292 | 292 | // 邊界在中心的周圍 1/3 小車寬/高的距離 |
293 | | - const kxCenter = kx + carSize.width/2; // 車子中心點 x 座標 |
294 | | - const kyCenter = ky + carSize.height/2; // 車子中心點 y 座標 |
295 | | - const leftSide = ww * 0.5 - carSize.width/3; // 左邊界,小於這個值,判定車子移動到左邊 |
296 | | - const rightSide = ww * 0.5 + carSize.width/3; // 右邊界,大於這個值,判定車子移動到右邊 |
297 | | - const topSide = oy + carSize.height/6; // 上邊界,小於這個值,判定車子移動到上面 |
298 | | - const bottomSide = oy + 5 * carSize.height/6; // 下邊界,小於這個值,判定車子移動到下面 |
| 293 | + const kxCenter = kx + carSize.width / 2; // 車子中心點 x 座標 |
| 294 | + const kyCenter = ky + carSize.height / 2; // 車子中心點 y 座標 |
| 295 | + const leftSide = ww * 0.5 - carSize.width / 3; // 左邊界,小於這個值,判定車子移動到左邊 |
| 296 | + const rightSide = ww * 0.5 + carSize.width / 3; // 右邊界,大於這個值,判定車子移動到右邊 |
| 297 | + const topSide = oy + carSize.height / 6; // 上邊界,小於這個值,判定車子移動到上面 |
| 298 | + const bottomSide = oy + 5 * carSize.height / 6; // 下邊界,小於這個值,判定車子移動到下面 |
299 | 299 |
|
300 | 300 | if (kxCenter < leftSide) { |
301 | 301 | if (!send.left) { |
|
0 commit comments