Skip to content

Commit

Permalink
fix(移动端): 修复移动端ui视觉问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Encaik committed Sep 14, 2024
1 parent d0b029a commit f73a1c9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<nz-layout class="h-screen w-screen overflow-hidden">
<nz-content class="w-full h-full grid-content overflow-auto">
<nz-layout class="h-auto sm:h-screen w-screen overflow-hidden">
<nz-content class="w-full h-full flex-1 grid-content overflow-auto">
<app-header class="env" />
<app-character class="character overflow-auto" />
<div class="main min-w-min overflow-auto p-2 bg-white rounded shadow-md shadow-gray-200">
<app-character class="character overflow-hidden sm:overflow-auto" />
<div class="main min-w-min min-h-96 sm:min-h-full overflow-hidden sm:overflow-auto p-2 bg-white rounded shadow-md shadow-gray-200">
<div class="flex flex-col h-full gap-2">
<nz-segmented
class="w-full"
Expand Down
2 changes: 0 additions & 2 deletions src/app/app.component.less
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
:host {
.grid-content {
display: grid;
flex: 1 1 100vh;
grid-template:
'env' auto
'character' auto
'main' 1fr / auto;
gap: 8px;
min-width: 300px;
height: 0;
padding: 12px;

}
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/init-modal/init-modal.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

<div class="my-4">
@if (current === 0) {
<div class="h-full grid grid-cols-2 sm:grid-cols-4 gap-4 overflow-auto border rounded p-4 bg-slate-100">
<div class="h-full grid grid-cols-2 md:grid-cols-4 gap-4 overflow-auto border rounded p-4 bg-slate-100">
@for (item of characters; track $index) {
<div
[ngClass]="[item.baseInfo.gender === '男' ? ' border-blue-300 bg-blue-100' : ' border-red-300 bg-red-100']"
class="flex flex-col justify-center items-center text-center p-4 rounded cursor-pointer hover:shadow-lg w-full border"
(click)="onCharacterClick(item)"
>
<nz-descriptions [nzColumn]="2">
<nz-descriptions [nzColumn]="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 2, xs: 1 }">
<nz-descriptions-item nzTitle="姓名" [nzSpan]="2">{{ item.baseInfo.name }}</nz-descriptions-item>
<nz-descriptions-item nzTitle="性别">{{ item.baseInfo.gender }}</nz-descriptions-item>
<nz-descriptions-item nzTitle="年龄">{{ item.baseInfo.age }}</nz-descriptions-item>
Expand Down
16 changes: 8 additions & 8 deletions src/app/layouts/character/character.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="h-full overflow-auto p-2 bg-white rounded shadow-md shadow-gray-200">
<h5 nz-typography class="underline hidden sm:block decoration-sky-500">人物信息</h5>
<h5 nz-typography class="underline decoration-sky-500">人物信息</h5>
<nz-descriptions nzSize="small" [nzColumn]="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 2, xs: 3 }">
<nz-descriptions-item nzTitle="姓名" [nzSpan]="2">{{ character.baseInfo.name }}</nz-descriptions-item>
<nz-descriptions-item nzTitle="性别">{{ character.baseInfo.gender }}</nz-descriptions-item>
Expand All @@ -10,7 +10,7 @@ <h5 nz-typography class="underline hidden sm:block decoration-sky-500">人物信
}
</nz-descriptions-item>
</nz-descriptions>
<h5 nz-typography class="underline hidden sm:block decoration-sky-500">状态信息</h5>
<h5 nz-typography class="underline decoration-sky-500">状态信息</h5>
<nz-descriptions nzSize="small" [nzColumn]="1">
<nz-descriptions-item nzTitle="当前血量">
<div class="w-full flex flex-col">
Expand All @@ -37,13 +37,13 @@ <h5 nz-typography class="underline hidden sm:block decoration-sky-500">状态信
</div>
</nz-descriptions-item>
</nz-descriptions>
<h5 nz-typography class="underline hidden sm:block decoration-sky-500">修炼属性</h5>
<nz-descriptions class="hidden sm:block" nzSize="small" [nzColumn]="{ xxl: 1, xl: 1, lg: 1, md: 1, sm: 2, xs: 2 }">
<h5 nz-typography class="underline decoration-sky-500">修炼属性</h5>
<nz-descriptions nzSize="small" [nzColumn]="{ xxl: 1, xl: 1, lg: 1, md: 1, sm: 2, xs: 2 }">
<nz-descriptions-item nzTitle="能量">{{ character.levelInfo.energy }}</nz-descriptions-item>
<nz-descriptions-item nzTitle="境界">{{ getLevelByEnergy() }}</nz-descriptions-item>
</nz-descriptions>
<h5 nz-typography class="underline hidden sm:block decoration-sky-500">战斗属性</h5>
<nz-descriptions class="hidden sm:block" nzSize="small" [nzColumn]="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 2, xs: 3 }">
<h5 nz-typography class="underline decoration-sky-500">战斗属性</h5>
<nz-descriptions nzSize="small" [nzColumn]="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 2, xs: 3 }">
<nz-descriptions-item nzTitle="生命">{{ character.attrInfo.hp }}</nz-descriptions-item>
<nz-descriptions-item nzTitle="灵力">{{ character.attrInfo.mp }}</nz-descriptions-item>
<nz-descriptions-item nzTitle="攻击">{{ character.attrInfo.attack }}</nz-descriptions-item>
Expand All @@ -52,8 +52,8 @@ <h5 nz-typography class="underline hidden sm:block decoration-sky-500">战斗属
<nz-descriptions-item nzTitle="暴击">{{ character.attrInfo.critRate }}%</nz-descriptions-item>
<nz-descriptions-item nzTitle="爆伤">{{ character.attrInfo.critDamage }}%</nz-descriptions-item>
</nz-descriptions>
<h5 nz-typography class="underline hidden sm:block decoration-sky-500">天资属性</h5>
<nz-descriptions class="hidden sm:block" nzSize="small" [nzColumn]="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 2, xs: 3 }">
<h5 nz-typography class="underline decoration-sky-500">天资属性</h5>
<nz-descriptions nzSize="small" [nzColumn]="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 2, xs: 3 }">
<nz-descriptions-item nzTitle="生命">{{ character.skillInfo.hp }}</nz-descriptions-item>
<nz-descriptions-item nzTitle="灵力">{{ character.skillInfo.mp }}</nz-descriptions-item>
<nz-descriptions-item nzTitle="攻击">{{ character.skillInfo.attack }}</nz-descriptions-item>
Expand Down

1 comment on commit f73a1c9

@vercel
Copy link

@vercel vercel bot commented on f73a1c9 Sep 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

wanjie – ./

wanjie-git-main-encaiks-projects.vercel.app
wanjie-encaiks-projects.vercel.app
wanjie.vercel.app

Please sign in to comment.