🎨 代码格式化

This commit is contained in:
BTMuli
2023-07-03 14:30:03 +08:00
parent ed2a99c0e2
commit 8f9cc43db8
7 changed files with 72 additions and 70 deletions

View File

@@ -48,10 +48,12 @@ const emits = defineEmits<HtaOverlayOverviewEmits>();
const visible = computed({ const visible = computed({
get: () => props.modelValue, get: () => props.modelValue,
set: (value) => emits("update:modelValue", value), set: (value) => {
emits("update:modelValue", value);
},
}); });
function onCancel() { function onCancel(): void {
visible.value = false; visible.value = false;
emits("cancel"); emits("cancel");
} }
@@ -69,31 +71,31 @@ function onCancel() {
} }
.hta-oob-title { .hta-oob-title {
border-bottom: 1px solid #393b40;
color: #393b40;
font-family: var(--font-title); font-family: var(--font-title);
font-size: 20px; font-size: 20px;
color: #393b40;
border-bottom: 1px solid #393b40;
} }
.hta-oob-item { .hta-oob-item {
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 5px;
justify-content: space-between;
align-items: center; align-items: center;
justify-content: space-between;
grid-gap: 5px;
grid-template-columns: repeat(2, 1fr);
} }
.hta-oob-item :nth-child(2n-1) { .hta-oob-item :nth-child(2n-1) {
text-align: left;
font-family: var(--font-title);
color: var(--common-color-blue); color: var(--common-color-blue);
font-family: var(--font-title);
font-size: 16px; font-size: 16px;
text-align: left;
} }
.hta-oob-item :nth-child(2n) { .hta-oob-item :nth-child(2n) {
text-align: right;
color: var(--common-color-white); color: var(--common-color-white);
text-shadow: 0 0 10px rgb(0 0 0/50%);
font-size: 14px; font-size: 14px;
text-align: right;
text-shadow: 0 0 10px rgb(0 0 0/50%);
} }
</style> </style>

View File

@@ -40,11 +40,11 @@ const props = defineProps<HtaTabHoldProps>();
.hta-th-box { .hta-th-box {
width: calc(100% - 10px); width: calc(100% - 10px);
height: 100%; height: 100%;
max-height: calc(100vh - 120px);
padding: 10px;
border: 1px inset var(--common-bg-1); border: 1px inset var(--common-bg-1);
border-radius: 5px; border-radius: 5px;
max-height: calc(100vh - 120px);
overflow-y: auto; overflow-y: auto;
padding: 10px;
} }
.hta-th-table { .hta-th-table {
@@ -59,11 +59,11 @@ const props = defineProps<HtaTabHoldProps>();
} }
.hta-th-td { .hta-th-td {
display: flex;
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 10px;
display: flex;
justify-content: center;
align-items: center; align-items: center;
justify-content: center;
padding: 10px;
} }
</style> </style>

View File

@@ -72,11 +72,11 @@ watch(tab, () => {
</script> </script>
<style lang="css" scoped> <style lang="css" scoped>
.hta-tt-box { .hta-tt-box {
margin: 5px;
width: calc(100% - 10px); width: calc(100% - 10px);
height: 100%; height: 100%;
border: 1px inset var(--common-bg-1); border: 1px inset var(--common-bg-1);
border-radius: 5px; border-radius: 5px;
margin: 5px;
} }
.hta-tt-tab { .hta-tt-tab {
@@ -87,67 +87,67 @@ watch(tab, () => {
} }
.hta-tt-window { .hta-tt-window {
margin-left: 100px; overflow: auto;
width: calc(100% - 100px); width: calc(100% - 100px);
height: 100%; height: 100%;
max-height: calc(100vh - 130px); max-height: calc(100vh - 130px);
overflow: auto; margin-left: 100px;
} }
.hta-tt-flex { .hta-tt-flex {
position: relative; position: relative;
overflow: auto;
display: flex; display: flex;
overflow: auto;
align-items: flex-start; align-items: flex-start;
justify-content: center; justify-content: center;
column-gap: 10px;
padding: 10px; padding: 10px;
column-gap: 10px;
} }
.hta-tuf-box { .hta-tuf-box {
display: flex;
width: 100%; width: 100%;
max-height: 100%; max-height: 100%;
overflow-y: auto;
overflow-x: hidden;
display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
row-gap: 10px;
border-radius: 5px; border-radius: 5px;
overflow-x: hidden;
overflow-y: auto;
row-gap: 10px;
} }
.hta-tuf-title { .hta-tuf-title {
width: 100%;
font-family: var(--font-title); font-family: var(--font-title);
font-size: 18px; font-size: 18px;
text-align: left; text-align: left;
width: 100%;
} }
.hta-tuf-item { .hta-tuf-item {
width: 100%;
display: flex; display: flex;
width: 100%;
height: 100px; height: 100px;
padding: 5px;
justify-content: flex-start;
background: var(--common-bg-1);
border-radius: 5px;
column-gap: 10px;
align-items: center; align-items: center;
justify-content: flex-start;
padding: 5px;
border-radius: 5px;
background: var(--common-bg-1);
column-gap: 10px;
} }
.hta-tuf-item-icons { .hta-tuf-item-icons {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr);
column-gap: 10px; column-gap: 10px;
grid-template-columns: repeat(4, 1fr);
} }
.hta-tuf-item-rate { .hta-tuf-item-rate {
width: calc(100% - 360px);
display: flex; display: flex;
width: calc(100% - 360px);
height: 100%;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 100%;
font-family: var(--font-title); font-family: var(--font-title);
} }
</style> </style>

View File

@@ -46,11 +46,11 @@ watch(tab, () => {
</script> </script>
<style lang="css" scoped> <style lang="css" scoped>
.hta-tu-box { .hta-tu-box {
margin: 5px;
width: calc(100% - 10px); width: calc(100% - 10px);
height: 100%; height: 100%;
border: 1px inset var(--common-bg-1); border: 1px inset var(--common-bg-1);
border-radius: 5px; border-radius: 5px;
margin: 5px;
} }
.hta-tu-tab { .hta-tu-tab {
@@ -61,20 +61,20 @@ watch(tab, () => {
} }
.hta-tu-window { .hta-tu-window {
margin-left: 100px;
width: calc(100% - 100px); width: calc(100% - 100px);
height: 100%; height: 100%;
margin-left: 100px;
} }
.hta-tu-grid { .hta-tu-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); overflow: auto;
grid-gap: 5px;
padding: 5px;
justify-content: center;
align-items: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: auto; align-items: center;
justify-content: center;
padding: 5px;
grid-gap: 5px;
grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
} }
</style> </style>

View File

@@ -46,11 +46,11 @@ watch(tab, () => {
</script> </script>
<style lang="css" scoped> <style lang="css" scoped>
.hta-tu-box { .hta-tu-box {
margin: 5px;
width: calc(100% - 10px); width: calc(100% - 10px);
height: 100%; height: 100%;
border: 1px inset var(--common-bg-1); border: 1px inset var(--common-bg-1);
border-radius: 5px; border-radius: 5px;
margin: 5px;
} }
.hta-tu-tab { .hta-tu-tab {
@@ -61,20 +61,20 @@ watch(tab, () => {
} }
.hta-tu-window { .hta-tu-window {
margin-left: 100px;
width: calc(100% - 100px); width: calc(100% - 100px);
height: 100%; height: 100%;
margin-left: 100px;
} }
.hta-tu-grid { .hta-tu-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); overflow: auto;
grid-gap: 5px;
padding: 5px;
justify-content: center;
align-items: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: auto; align-items: center;
justify-content: center;
padding: 5px;
grid-gap: 5px;
grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
} }
</style> </style>

View File

@@ -107,7 +107,7 @@ onMounted(async () => {
} }
}); });
function getAvatarName() { function getAvatarName(): string {
return props.modelValue.cid === 10000005 return props.modelValue.cid === 10000005
? "旅行者-空" ? "旅行者-空"
: props.modelValue.cid === 10000007 : props.modelValue.cid === 10000007
@@ -117,8 +117,8 @@ function getAvatarName() {
// 销毁 // 销毁
onUnmounted(() => { onUnmounted(() => {
talents.value.map((talent) => { talents.value.forEach((talent) => {
return URL.revokeObjectURL(talent.icon); URL.revokeObjectURL(talent.icon);
}); });
}); });
</script> </script>
@@ -153,8 +153,8 @@ onUnmounted(() => {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 5px; padding: 5px;
border-radius: 5px;
border: 1px inset var(--common-bg-1); border: 1px inset var(--common-bg-1);
border-radius: 5px;
font-family: var(--font-title); font-family: var(--font-title);
font-size: 12px; font-size: 12px;
} }
@@ -237,8 +237,8 @@ onUnmounted(() => {
justify-content: center; justify-content: center;
padding: 5px; padding: 5px;
border-radius: 50%; border-radius: 50%;
background: rgb(0 0 0 /0.4); background: rgb(0 0 0 /40%);
box-shadow: 0 0 10px rgb(255 255 255/0.4); box-shadow: 0 0 10px rgb(255 255 255/40%);
} }
.tuc-rbb-talent :nth-child(2) { .tuc-rbb-talent :nth-child(2) {

View File

@@ -60,10 +60,10 @@ const overview = ref<TGApp.Plugins.Hutao.Abyss.OverviewData>(
<TGApp.Plugins.Hutao.Abyss.OverviewData>{}, <TGApp.Plugins.Hutao.Abyss.OverviewData>{},
); );
const tab = ref<string>("use"); const tab = ref<string>("use");
const avatarUse = ref<Array<TGApp.Plugins.Hutao.Abyss.AvatarUse>>([]); const avatarUse = ref<TGApp.Plugins.Hutao.Abyss.AvatarUse[]>([]);
const avatarUp = ref<Array<TGApp.Plugins.Hutao.Abyss.AvatarUp>>([]); const avatarUp = ref<TGApp.Plugins.Hutao.Abyss.AvatarUp[]>([]);
const teamCombination = ref<Array<TGApp.Plugins.Hutao.Abyss.TeamCombination>>([]); const teamCombination = ref<TGApp.Plugins.Hutao.Abyss.TeamCombination[]>([]);
const avatarHold = ref<Array<TGApp.Plugins.Hutao.Abyss.AvatarHold>>([]); const avatarHold = ref<TGApp.Plugins.Hutao.Abyss.AvatarHold[]>([]);
onMounted(async () => { onMounted(async () => {
loadingTitle.value = "正在获取深渊数据"; loadingTitle.value = "正在获取深渊数据";
@@ -81,13 +81,13 @@ onMounted(async () => {
loading.value = false; loading.value = false;
}); });
function getUpdated() { function getUpdated(): string {
return new Date(overview.value.timestamp) return new Date(overview.value.timestamp)
.toLocaleString("zh-CN", { hour12: false }) .toLocaleString("zh-CN", { hour12: false })
.replace(/\//g, "-"); .replace(/\//g, "-");
} }
function getShareTitle() { function getShareTitle(): string {
switch (tab.value) { switch (tab.value) {
case "use": case "use":
return `【胡桃】${overview.value.scheduleId}-角色使用`; return `【胡桃】${overview.value.scheduleId}-角色使用`;
@@ -101,7 +101,7 @@ function getShareTitle() {
return `【胡桃】${overview.value.scheduleId}-深渊数据`; return `【胡桃】${overview.value.scheduleId}-深渊数据`;
} }
async function shareWiki() { async function shareWiki(): Promise<void> {
const div = <HTMLDivElement>document.querySelector(".hta-tab-item"); const div = <HTMLDivElement>document.querySelector(".hta-tab-item");
const title = getShareTitle(); const title = getShareTitle();
loadingTitle.value = "正在生成分享图"; loadingTitle.value = "正在生成分享图";
@@ -114,11 +114,11 @@ async function shareWiki() {
</script> </script>
<style lang="css" scoped> <style lang="css" scoped>
.hta-box { .hta-box {
overflow: auto;
width: 100%; width: 100%;
max-height: calc(100vh - 30px); max-height: calc(100vh - 30px);
padding: 10px;
overflow: auto;
box-sizing: border-box; box-sizing: border-box;
padding: 10px;
border-radius: 5px; border-radius: 5px;
box-shadow: 0 0 10px var(--common-shadow-4); box-shadow: 0 0 10px var(--common-shadow-4);
} }
@@ -126,24 +126,24 @@ async function shareWiki() {
.hta-top { .hta-top {
display: flex; display: flex;
width: 100%; width: 100%;
justify-content: flex-start;
align-items: center; align-items: center;
column-gap: 10px; justify-content: flex-start;
color: var(--common-text-title); color: var(--common-text-title);
column-gap: 10px;
font-family: var(--font-title); font-family: var(--font-title);
} }
.hta-tab { .hta-tab {
margin-bottom: 10px;
height: 50px; height: 50px;
margin-bottom: 10px;
} }
.hta-title { .hta-title {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
font-size: 20px;
column-gap: 10px; column-gap: 10px;
font-size: 20px;
} }
.hta-title :nth-child(2) { .hta-title :nth-child(2) {