Skip to content

Commit cbf38c3

Browse files
committed
fix:pull conflict
2 parents 753934f + 094c4e9 commit cbf38c3

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
99
### Fixed
1010

1111
- 平板開啟萬用遙控器時,訊息傳送輸入框消失
12+
- 平板或手機旋轉後,刷新萬用遙控器
1213

1314
### Added
1415

15-
- 實作萬用遙控器 i18n
16+
- 實作萬用遙控器 i18n
1617

1718
### Changed
1819

index.html

Lines changed: 1 addition & 1 deletion
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

js/main-en.js

Lines changed: 19 additions & 0 deletions
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
}();

js/main.js

Lines changed: 19 additions & 0 deletions
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)