Skip to content

Commit 0cf524c

Browse files
committed
fix: 🐛 fix img position after screen rotate and update placeholder in index-en.html
1 parent c2d0608 commit 0cf524c

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

index-en.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
/>
8686
</svg>
8787
</div>
88-
<footer >
88+
<footer>
8989
<div id="monsterBlock">
9090
<div id="svgGreen" class="monster-btn">
9191
<svg viewBox="0 0 249.6 251.4">
@@ -421,7 +421,12 @@
421421
rx="4.8"
422422
ry="4.8"
423423
/>
424-
<circle style="fill: #ffffff" cx="129.5" cy="65.1" r="1.1" />
424+
<circle
425+
style="fill: #ffffff"
426+
cx="129.5"
427+
cy="65.1"
428+
r="1.1"
429+
/>
425430
</g>
426431
</g>
427432
</svg>
@@ -716,7 +721,7 @@
716721
type="text"
717722
class="input-group-input"
718723
id="customMessage"
719-
placeholder="輸入文字"
724+
placeholder="Input text"
720725
/>
721726
<button class="input-group-button">Send</button>
722727
</div>

js/main-en.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@
381381
}
382382

383383
// 處理中間圖片跟隨視窗大小移動位置
384-
window.addEventListener('resize', imgPosition);
384+
window.addEventListener('resize', () => {
385+
kebbi.classList.remove('reset');
386+
imgPosition();
387+
});
385388

386389
}();

js/main.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,12 +350,13 @@
350350
console.log('reset');
351351
mqttPush(list.topic1, list.kebbiReset);
352352
}
353-
sendCheck();
353+
354354
drag = false;
355355
kebbi.classList.remove('target');
356356
kebbi.classList.add('reset');
357357
kebbi.style.left = `${(content.offsetWidth - kebbi.offsetWidth) / 2}px`;
358358
kebbi.style.top = `${(content.offsetHeight * 0.8 - kebbi.offsetHeight) / 2}px`;
359+
sendCheck();
359360
}
360361

361362
function updateCarSize() {
@@ -380,6 +381,9 @@
380381
}
381382

382383
// 處理中間圖片跟隨視窗大小移動位置
383-
window.addEventListener('resize', imgPosition);
384+
window.addEventListener('resize', () => {
385+
kebbi.classList.remove('reset');
386+
imgPosition();
387+
});
384388

385389
}();

0 commit comments

Comments
 (0)