Skip to content

Commit 094c4e9

Browse files
authored
Merge pull request #13 from webduinoio/improvement/5901
improvement/5901
2 parents 820e012 + 7628cc9 commit 094c4e9

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

Diff for: CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## 2022.11.1
88

9+
### Fixed
10+
11+
- 平板或手機旋轉後,刷新萬用遙控器
12+
913
### Added
1014

11-
- 實作萬用遙控器 i18n
15+
- 實作萬用遙控器 i18n
1216

1317
### Changed
1418

Diff for: index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="zh-Hant-Tw">
2+
<html lang="zh-Hant-TW">
33
<head>
44
<meta charset="UTF-8" />
55
<meta

Diff for: js/main.js

+19
Original file line numberDiff line numberDiff line change
@@ -378,4 +378,23 @@
378378
kebbi.addEventListener('touchstart', target);
379379
}
380380

381+
// 處理中間圖片跟隨視窗大小移動位置
382+
function screenRotate() {
383+
const kebbi = document.getElementById('svgKebbi');
384+
const circle = document.querySelector('.circle');
385+
const ww = content.offsetWidth;
386+
const wh = content.offsetHeight;
387+
const ox = (ww - kebbi.offsetWidth) / 2;
388+
const oy = (wh * 0.8 - kebbi.offsetHeight) / 2;
389+
kebbi.style.left = `${ox}px`;
390+
kebbi.style.top = `${oy}px`;
391+
circle.style.width = `${ww * 0.4}px`;
392+
circle.style.height = `${ww * 0.4}px`;
393+
circle.style.left = `${(ww - circle.offsetWidth) / 2}px`;
394+
circle.style.top = `${(wh * 0.8 - circle.offsetHeight) / 2}px`;
395+
}
396+
397+
window.addEventListener('resize', screenRotate);
398+
screenRotate();
399+
381400
}();

0 commit comments

Comments
 (0)