mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-04 02:45:04 +08:00
修改字体大小
This commit is contained in:
1 parent
70672349fe
commit
993ff3c669
25 files changed
+194
-240
No files matched your search
@@ -3,6 +3,7 @@ import { ref } from 'vue';
|
||||
import { getDamageColor } from '../utils';
|
||||
import { ToShowEnemy, detailInfo } from './book';
|
||||
import { DamageEnemy } from '../game/enemy/damage';
|
||||
import { isMobile } from '../use';
|
||||
|
||||
export const showFixed = ref(false);
|
||||
|
||||
@@ -87,9 +88,10 @@ export function getDetailedEnemy(
|
||||
s[2] as string
|
||||
];
|
||||
});
|
||||
const l = isMobile ? 1 : 2;
|
||||
const showSpecial =
|
||||
special.length > 2
|
||||
? special.slice(0, 2).concat(['...', '', '#fff'])
|
||||
special.length > l
|
||||
? special.slice(0, l).concat([['...', '', '#fff']])
|
||||
: special.slice();
|
||||
|
||||
const damageColor = getDamageColor(dam) as string;
|
||||
|
||||
+9
-9
@@ -1,3 +1,5 @@
|
||||
import { debounce } from 'lodash-es';
|
||||
|
||||
export default function init() {
|
||||
return { useDrag, useWheel, useUp, isMobile };
|
||||
}
|
||||
@@ -18,6 +20,7 @@ const dragFnMap = new Map<DragFn, DragMap>();
|
||||
*/
|
||||
export let isMobile = matchMedia('(max-width: 600px)').matches;
|
||||
|
||||
let alerted = false;
|
||||
window.addEventListener('resize', () => {
|
||||
requestAnimationFrame(() => {
|
||||
isMobile = matchMedia('(max-width: 600px)').matches;
|
||||
@@ -27,8 +30,9 @@ window.addEventListener('resize', () => {
|
||||
checkMobile();
|
||||
|
||||
function checkMobile() {
|
||||
if (isMobile) {
|
||||
if (isMobile && !alerted) {
|
||||
alert('手机端建议使用自带的浏览器进行游玩,并在进入游戏后开启全屏游玩');
|
||||
alerted = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,13 +51,13 @@ export function useDrag(
|
||||
global: boolean = false
|
||||
) {
|
||||
const touchFn = (e: TouchEvent) => {
|
||||
const ele = global ? document : e.target;
|
||||
if (ele) {
|
||||
(ele as HTMLElement).removeEventListener('touchmove', touchFn);
|
||||
}
|
||||
fn(e.touches[0].clientX, e.touches[0].clientY, e);
|
||||
};
|
||||
|
||||
const mouseFn = (e: MouseEvent) => {
|
||||
fn(e.clientX, e.clientY, e);
|
||||
};
|
||||
|
||||
const mouseUp = (e: MouseEvent) => {
|
||||
const ele = global ? document : e.target;
|
||||
if (ele) {
|
||||
@@ -89,10 +93,6 @@ export function useDrag(
|
||||
|
||||
const target = global ? document : ele;
|
||||
|
||||
const mouseFn = (e: MouseEvent) => {
|
||||
fn(e.clientX, e.clientY, e);
|
||||
};
|
||||
|
||||
const touchUp = (e: TouchEvent) => {
|
||||
onup && onup(e);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user