diff --git a/hwe/b_myPage.php b/hwe/b_myPage.php index 270e945a..48a1ff09 100644 --- a/hwe/b_myPage.php +++ b/hwe/b_myPage.php @@ -119,6 +119,23 @@ $use_auto_nation_turn = $me->getAuxVar('use_auto_nation_turn') ?? 1;

+
+
500px/1000px 모드
(모바일 전용, 즉시 설정)
+
+
+ + + + + + + + +
+
+
+
+ 개인용 CSS
diff --git a/hwe/ts/defs.ts b/hwe/ts/defs.ts index d268f188..7572559a 100644 --- a/hwe/ts/defs.ts +++ b/hwe/ts/defs.ts @@ -144,4 +144,7 @@ export type ToastType = { content?: string, type?: Colors, delay?: number, -} \ No newline at end of file +} + +export const keyScreenMode = 'sam.screenMode'; +export type ScreenModeType = 'auto'|'500px'|'1000px'; \ No newline at end of file diff --git a/hwe/ts/myPage.ts b/hwe/ts/myPage.ts index 9b4b75d9..4facb9e4 100644 --- a/hwe/ts/myPage.ts +++ b/hwe/ts/myPage.ts @@ -1,12 +1,13 @@ import axios from 'axios'; import $ from 'jquery'; -import { InvalidResponse } from '@/defs'; +import { InvalidResponse, keyScreenMode } from '@/defs'; import { convertFormData } from '@util/convertFormData'; import { setAxiosXMLHttpRequest } from '@util/setAxiosXMLHttpRequest'; import { unwrap } from '@util/unwrap'; import { unwrap_any } from '@util/unwrap_any'; + type LogResponse = { result: true; log: Record; @@ -105,6 +106,13 @@ $(function ($) { initCustomCSSForm(); + const $screenModeRadios = $('input:radio[name=screenMode]'); + $screenModeRadios.prop('checked', false).filter(`[value="${localStorage.getItem(keyScreenMode)??'auto'}"]`).prop('checked', true); + $screenModeRadios.on('click', function(e){ + localStorage.setItem(keyScreenMode, (e.target as HTMLInputElement).value); + }); + + $('#die_immediately').on('click', async function (e) { e.preventDefault(); diff --git a/hwe/ts/util/auto500px.ts b/hwe/ts/util/auto500px.ts index 38a99f8c..eef67011 100644 --- a/hwe/ts/util/auto500px.ts +++ b/hwe/ts/util/auto500px.ts @@ -1,5 +1,6 @@ import { htmlReady } from "@util/htmlReady"; import { unwrap } from "@util/unwrap"; +import { keyScreenMode, ScreenModeType } from "@/defs"; export function auto500px(targetHeight = 700): void { let deviceWidth = -1; @@ -29,6 +30,17 @@ export function auto500px(targetHeight = 700): void { const innerHeight = window.innerHeight; const selectorHeight = targetHeight; + const screenMode = (localStorage.getItem(keyScreenMode) as ScreenModeType)??'auto'; + if(screenMode == '500px'){ + viewportMeta.content = 'width=500'; + return; + } + + if(screenMode == '1000px'){ + viewportMeta.content = 'width=1000'; + return; + } + if (deviceWidth < 500) { viewportMeta.content = 'width=500'; return;