Skip to content

Commit

Permalink
refactor: Adjust the home page layout with inner router view
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed May 3, 2023
1 parent 993507d commit f786c33
Show file tree
Hide file tree
Showing 88 changed files with 3,144 additions and 1,270 deletions.
15 changes: 15 additions & 0 deletions xmcl-keystone-ui/locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ HomeSyncDialogPush:
SettingMigrationDialog:
selectRootDirectory: Select Root Directory
add: Add
ago:
day: '{duration} day ago | {duration} days ago'
hour: '{duration} hour ago | {duration} hours ago'
minute: '{duration} minute ago | {duration} minutes ago'
second: '{duration} second ago | {duration} seconds ago'
authProfileAddedNotification: Auth Profile {name} Added
author: Author
back: Back
Expand Down Expand Up @@ -223,6 +228,11 @@ disk:
used: Used
download: Download
downloadCount: '{count} downloads'
duration:
day: '{duration} day | {duration} days'
hour: '{duration} hour | {duration} hours'
minute: '{duration} minute | {duration} minutes'
second: '{duration} second | {duration} seconds'
edit: Edit
error:
name: Error | Errors
Expand Down Expand Up @@ -354,6 +364,7 @@ installVersion:
json: Install Version Json
name: Install Minecraft Client {version}
instance:
addMod: Add Mod to instance
addServer: Add Server
current: Current Instance
delete: Delete Profile
Expand All @@ -363,13 +374,16 @@ instance:
fileApiHint: The url to synchronize instance files from a remote config server.
gameVersion: Game Version
includeVersion: Include Version | Include Versions
lastPlayed: Last Played
launchArguments: Launch Arguments Preview
mcOptions: Minecraft Options
mcOptionsHint: Additional Minecraft launch arugments
name: Profile Name
nameHint: The name used to identify the game
neverPlayed: Never Played
openCrashReportFolder: Open Crash Report Folder
openLogFolder: Open Log Folder
playtime: Playtime
requireName: The name is required
showInstance: Show instance folder
versionHint: The Minecraft version of this game
Expand Down Expand Up @@ -559,6 +573,7 @@ minecraftVersion:
showAlpha: Show Snapshot
snapshot: Snapshot
mod:
showDirectory: Show mods directory
acceptVersion: Accept {version}
backToAllMods: Back to All Mods
compatible: Compatible Mod.
Expand Down
15 changes: 15 additions & 0 deletions xmcl-keystone-ui/locales/zh-CN.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ MultiplayerDialogInitiate:
SettingMigrationDialog:
selectRootDirectory: 选择新的根目录
add: 添加
ago:
day: '{duration} 天前'
hour: '{duration} 小时前'
minute: '{duration} 分钟前'
second: '{duration} 秒前'
authProfileAddedNotification: 已添加第三方验证 {name}
author: 作者
back: 返回
Expand Down Expand Up @@ -253,6 +258,11 @@ disk:
used: 已用
download: 下载
downloadCount: '{count} 次下载'
duration:
day: '{duration} 天'
hour: '{duration} 小时'
minute: '{duration} 分钟'
second: '{duration} 秒'
edit: 编辑
errors:
BadForgeInstallerJarError: 无法解析 Forge 安装包 jar 文件。也许 Forge 有了新的安装包格式?如果经常遇到这个问题,请联系开发团队。
Expand Down Expand Up @@ -370,6 +380,7 @@ installVersion:
json: 安装游戏JSON文件
name: 安装%{id}的游戏本体
instance:
addMod: 添加 Mod
addServer: 添加服务器
current: 当前实例
delete: 删除游戏
Expand All @@ -379,12 +390,15 @@ instance:
fileApiHint: 用于远程同步实例文件的链接
gameVersion: 游戏版本
includeVersion: 包含游戏版本
lastPlayed: 上次游玩
launchArguments: 启动命令预览
mcOptions: Minecraft 启动选项
mcOptionsHint: 额外的 Minecraft 启动参数
name: 名称
nameHint: 名称便于以后识别
neverPlayed: 从未游玩
openLogFolder: 打开日志文件夹
playtime: 游玩时间
requireName: 必须填写名称
showInstance: 显示文件夹
versionHint: 这个游戏使用的Minecraft版本
Expand Down Expand Up @@ -593,6 +607,7 @@ mod:
searchOnMcWiki: 在 MC 百科中查找 {name}
searchOnModrinth: 在 Modrinth 中搜索 {name}
selected: 已选 Mods
showDirectory: 显示 Mod 文件夹
showFile: 打开 Mod 所在位置 {file}
showInCurseforge: 在 Curseforge 上显示该 Mod
showInModrinth: 在 Modrinth 中显示 {name}
Expand Down
59 changes: 19 additions & 40 deletions xmcl-keystone-ui/src/assets/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ input::-webkit-inner-spin-button {
--warning-color: #e65100;
--warning-color-decent: #c45920;
--common-color: #424242;
--border-dark: hsla(0,0%,100%,.12);
--border-light: hsla(0,0%,100%,.12);
}

p {
Expand Down Expand Up @@ -43,30 +45,40 @@ p {
transition: all 0.01s;
}

.transition-list-move,
.transition-list-enter-active,
.transition-list-leave-active {
transition: all 0.7s !important;
transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
/* transition: all 0.7s !important; */
}

.transition-list-enter,
.transition-list-leave-to {
opacity: 0 !important;
transition: all 0.7s !important;
transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
transform: scaleY(0.01) translate(30px, 0);
/* transition: all 0.7s !important; */
/* transform: translateY(30px); */
}

.transition-list-move {
transition: transform 0.7s !important;
.transition-list-leave-active {
position: absolute;
}

/* .transition-list-move {
transition: transform 0.7s !important;
} */


html ::-webkit-scrollbar {
display: none;
z-index: 1000;
}

::-webkit-scrollbar {
width: 8px;
cursor: pointer;
z-index: 1000;
}

::-webkit-scrollbar-thumb {
Expand All @@ -75,6 +87,7 @@ html ::-webkit-scrollbar {
background: rgba(155, 155, 155, 0.5);
transition: all 1s;
border-radius: 2px;
z-index: 1000;
}

::-webkit-scrollbar-thumb:hover {
Expand Down Expand Up @@ -106,40 +119,6 @@ html ::-webkit-scrollbar {
/* background: transparent; */
}

/* .card-list {
max-width: 100%;
padding: 0 10px 10px 10px;
margin: 0px 0px 0px 0px;
min-height: 80vh;
max-height: 80vh;
}
.card-list .list {
overflow: auto;
min-height: 73vh;
max-height: 73vh;
}
.card-list .v-input__slot {
box-shadow: none !important;
transition: background 0.3s cubic-bezier(0.25, 0.8, 0.5, 1),
box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.5, 1) !important;
transition-property: background;
transition-duration: 0.3s;
transition-timing-function: cubic-bezier(0.25, 0.8, 0.5, 1);
transition-delay: 0s;
}
.card-list .v-input__slot:hover {
box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2),
0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12) !important;
}
.card-list .v-input--is-focused .v-input__control .v-input__slot {
box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2),
0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12) !important;
} */

.dark .v-dialog .v-card {
background-color: #424242 !important;
border-color: #424242 !important;
Expand Down Expand Up @@ -221,8 +200,8 @@ html ::-webkit-scrollbar {
/* Draggable card */

.draggable-card {
transition: all !important;
transition-duration: 0.2s !important;
/* transition: all !important; */
/* transition-duration: 0.2s !important; */
}

.draggable-card.dragged {
Expand Down
67 changes: 67 additions & 0 deletions xmcl-keystone-ui/src/components/AvatarItem.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<template>
<div
class="flex flex-grow-0 items-center text-sm rounded pr-2"
@click="emit('click', $event)"
>
<v-avatar
:left="true"
class="w-[34px] h-[34px]"
:class="{ responsive }"
>
<img
v-if="avatar"
:src="avatar"
>
<v-icon v-else-if="icon">
{{ icon }}
</v-icon>
</v-avatar>

<div
v-if="text"
class="whitespace-nowrap overflow-hidden overflow-ellipsis text"
>
<div
class="text-gray-300 font-semibold"
:style="{
color: bgColor
}"
>
{{ title }}
</div>
{{ text }}
</div>
</div>
</template>
<script lang="ts" setup>
import { useVuetifyColor } from '@/composables/vuetify'
const props = defineProps<{
color?: string
avatar?: string
icon?: string
title?: string
text?: string
responsive?: boolean
}>()
const { getColorCode } = useVuetifyColor()
const bgColor = computed(() => props.color ? getColorCode(props.color) : undefined)
const emit = defineEmits(['click'])
</script>
<style scoped>
.responsive {
display: none !important;
}
.text {
padding-left: 0.5rem;
}
@media (min-width: 1000px) {
.responsive {
display: block !important;
}
.text {
padding-left: 0rem;
}
}
</style>
35 changes: 35 additions & 0 deletions xmcl-keystone-ui/src/components/AvatarItemList.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<template>
<div
class="flex flex-row items-center gap-1 flex-grow-0 justify-center"
>
<template
v-for="(i) of items"
>
<AvatarItem
:key="i.title"
:icon="i.icon"
:title="i.title"
:text="i.text"
:color="i.color"
:avatar="i.avatar"
/>
<v-divider
v-if="i !== items[items.length - 1]"
:key="i.title + 'divider'"
vertical
/>
</template>
</div>
</template>
<script lang="ts" setup>
import AvatarItem from './AvatarItem.vue'
defineProps<{ items: {
small?: boolean
color?: string
avatar?: string
icon?: string
title?: string
text?: string
}[] }>()
</script>

0 comments on commit f786c33

Please sign in to comment.