fix: 字体大小

This commit is contained in:
unanmed 2024-03-12 20:09:06 +08:00
parent d23d1bb82f
commit 7d21701c5f
12 changed files with 32 additions and 36 deletions

View File

@ -165,7 +165,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
}, },
"firstData": { "firstData": {
"title": "魔塔样板", "title": "魔塔样板",
"name": "template", "name": "templateV2A",
"author": "Annoymous", "author": "Annoymous",
"version": "Ver 2.A", "version": "Ver 2.A",
"floorId": "sample0", "floorId": "sample0",

View File

@ -425,7 +425,7 @@ mainSetting
.register('itemDetail', '宝石血瓶显伤', true, COM.Boolean) .register('itemDetail', '宝石血瓶显伤', true, COM.Boolean)
.register('transition', '界面动画', false, COM.Boolean) .register('transition', '界面动画', false, COM.Boolean)
.register('antiAlias', '抗锯齿', false, COM.Boolean) .register('antiAlias', '抗锯齿', false, COM.Boolean)
.register('fontSize', '字体大小', 16, COM.Number, [8, 28, 1]) .register('fontSize', '字体大小', isMobile ? 12 : 16, COM.Number, [8, 28, 1])
.register('fontSizeStatus', '状态栏字体', 100, COM.Number, [20, 300, 10]) .register('fontSizeStatus', '状态栏字体', 100, COM.Number, [20, 300, 10])
.register('smoothView', '平滑镜头', true, COM.Boolean) .register('smoothView', '平滑镜头', true, COM.Boolean)
.register('criticalGem', '临界显示方式', false, COM.Boolean) .register('criticalGem', '临界显示方式', false, COM.Boolean)
@ -484,7 +484,7 @@ loading.once('coreInit', () => {
'screen.itemDetail': !!storage.getValue('screen.itemDetail', true), 'screen.itemDetail': !!storage.getValue('screen.itemDetail', true),
'screen.transition': !!storage.getValue('screen.transition', false), 'screen.transition': !!storage.getValue('screen.transition', false),
'screen.antiAlias': !!storage.getValue('screen.antiAlias', false), 'screen.antiAlias': !!storage.getValue('screen.antiAlias', false),
'screen.fontSize': storage.getValue('screen.fontSize', 16), 'screen.fontSize': storage.getValue('screen.fontSize', isMobile ? 12 : 16),
'screen.fontSizeStatus': storage.getValue('screen.fontSizeStatus', 100), 'screen.fontSizeStatus': storage.getValue('screen.fontSizeStatus', 100),
'screen.smoothView': !!storage.getValue('screen.smoothView', true), 'screen.smoothView': !!storage.getValue('screen.smoothView', true),
'screen.criticalGem': !!storage.getValue('screen.criticalGem', false), 'screen.criticalGem': !!storage.getValue('screen.criticalGem', false),

View File

@ -273,8 +273,6 @@ onMounted(() => {
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
#now-damage { #now-damage {
font-size: 100%;
div { div {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -80,15 +80,6 @@ const format = core.formatBigNumber;
} }
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
#critical-des,
.critical {
font-size: 70%;
}
#special {
font-size: 70%;
}
#special-main { #special-main {
top: 25vh; top: 25vh;
width: 90vw; width: 90vw;

View File

@ -74,12 +74,5 @@ function mark() {
} }
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
#enemy-desc {
font-size: 70%;
}
#mark-target {
font-size: 100%;
}
} }
</style> </style>

View File

@ -699,7 +699,7 @@ onUnmounted(() => {
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
#equipbox-main { #equipbox-main {
flex-direction: column-reverse; flex-direction: column-reverse;
font-size: 100%; font-size: 225%;
} }
#equip-now-div { #equip-now-div {

View File

@ -771,7 +771,7 @@ onUnmounted(() => {
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
#fly { #fly {
padding: 5%; padding: 5%;
font-size: 100%; font-size: 225%;
} }
#fly-main { #fly-main {

View File

@ -317,7 +317,7 @@ onUnmounted(() => {
} }
.setting-main { .setting-main {
font-size: 120%; font-size: 225%;
.setting-container { .setting-container {
flex-direction: column; flex-direction: column;

View File

@ -459,7 +459,7 @@ onUnmounted(() => {
#shop { #shop {
width: 90vw; width: 90vw;
padding-top: 5vh; padding-top: 5vh;
font-size: 100%; font-size: 225%;
} }
#item-list { #item-list {

View File

@ -154,14 +154,14 @@ function onmove(e: MouseEvent) {
const dx = (offsetX - cx) / cx; const dx = (offsetX - cx) / cx;
const dy = (offsetY - cy) / cy; const dy = (offsetY - cy) / cy;
const matrix = new Matrix4(); // const matrix = new Matrix4();
matrix.scale(1.2, 1.2, 1); // matrix.scale(1.2, 1.2, 1);
matrix.rotate((dy * 10 * Math.PI) / 180, -(dx * 10 * Math.PI) / 180); // matrix.rotate((dy * 10 * Math.PI) / 180, -(dx * 10 * Math.PI) / 180);
const end = Array.from(matrix.transpose()).flat().join(','); // const end = Array.from(matrix.transpose()).flat().join(',');
background.style.transform = `perspective(${ // background.style.transform = `perspective(${
1000 * core.domStyle.scale // 1000 * core.domStyle.scale
}px)matrix3d(${end})`; // }px)matrix3d(${end})`;
} }
function bgm() { function bgm() {

View File

@ -178,7 +178,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref, shallowReactive, watch } from 'vue'; import { onMounted, onUnmounted, ref, shallowReactive, watch } from 'vue';
import Box from '../components/box.vue'; import Box from '../components/box.vue';
import Scroll from '../components/scroll.vue'; import Scroll from '../components/scroll.vue';
import { status } from '../plugin/ui/statusBar'; import { status } from '../plugin/ui/statusBar';
@ -199,7 +199,7 @@ const format = core.formatBigNumber;
watch(width, n => (updateStatus.value = !updateStatus.value)); watch(width, n => (updateStatus.value = !updateStatus.value));
watch(height, n => (updateStatus.value = !updateStatus.value)); watch(height, n => (updateStatus.value = !updateStatus.value));
watch(fontSize, n => (main.style.fontSize = `${n}%`)); watch(fontSize, n => (main.style.fontSize = `${isMobile ? n * 1.5 : n}%`));
const hero = shallowReactive<Partial<HeroStatus>>({}); const hero = shallowReactive<Partial<HeroStatus>>({});
const keys = shallowReactive<number[]>([]); const keys = shallowReactive<number[]>([]);
@ -253,9 +253,23 @@ function update() {
up.value = core.getNextLvUpNeed() ?? 0; up.value = core.getNextLvUpNeed() ?? 0;
} }
function resize() {
requestAnimationFrame(() => {
main.style.fontSize = `${
isMobile ? fontSize.value * 1.5 : fontSize.value
}%`;
});
}
onMounted(() => { onMounted(() => {
update(); update();
main = document.getElementById('status-main') as HTMLDivElement; main = document.getElementById('status-main') as HTMLDivElement;
window.addEventListener('resize', resize);
});
onUnmounted(() => {
window.removeEventListener('resize', resize);
}); });
</script> </script>
@ -351,7 +365,7 @@ onMounted(() => {
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
.status-item { .status-item {
font-size: 100%; font-size: v-bind(fontSize);
max-width: 28vw; max-width: 28vw;
} }
} }

View File

@ -390,7 +390,7 @@ onUnmounted(() => {
#toolbox-main { #toolbox-main {
flex-direction: column-reverse; flex-direction: column-reverse;
height: 90%; height: 90%;
font-size: 100%; font-size: 225%;
margin-top: 10%; margin-top: 10%;
} }