重构 Download tailwind

This commit is contained in:
2024-09-29 19:36:49 +08:00
parent fa88148a9a
commit 0333ba54c0

View File

@@ -21,242 +21,47 @@ onMounted(async () => {
} }
}) })
</script> </script>
<template> <template>
<div class="main-container"> <div class="mx-auto flex flex-col items-center">
<div class="bcc"></div> <div class="bg-default-bg fixed inset-0 w-full h-full -z-10"></div>
<div class="title">一些可以直接下载的工具</div> <div class="mt-[30px] sm:mt-[80px] text-[30px] sm:text-[42px] cursor-default transition-all duration-500">一些可以直接下载的工具
<div class="subtitle" v-if="loadStatus != 2">请在浏览此部分内容前阅读并同意<a </div>
@click="showAgreement = true">网站使用协议</a>继续使用或浏览表示您接受协议条款</div> <div class="mt-[20px] text-[#666] cursor-default text-[12px] px-[20px]" v-if="loadStatus != 2">请在浏览此部分内容前阅读并同意
<div class="load-fail" v-if="loadStatus == 2">加载失败请刷新界面重试</div> <a class="text-[#222] cursor-pointer underline]" @click="showAgreement = true">网站使用协议</a>继续使用或浏览表示您接受协议条款
<div class="load-fail" v-if="loadStatus == 0">加载中请稍后...</div> </div>
<div class="content-container" v-if="loadStatus == 1"> <div class="mt-[80px] cursor-default mb-[380px] text-center" v-if="loadStatus == 2">加载失败请刷新界面重试</div>
<div class="mt-[80px] cursor-default mb-[380px] text-center" v-if="loadStatus == 0">加载中请稍后...</div>
<div
class="mt-[25px] sm:mt-[50px] mx-auto flex justify-center items-start flex-wrap max-w-[1000px] transition-all duration-500"
v-if="loadStatus == 1">
<!-- 资源项 --> <!-- 资源项 -->
<a class="content" v-for="item of ResourceDatas" :href="item.src" target="_blank"> <a class="w-full xs:w-[380px] lg:w-[420px] sm:mb-[40px] mb-[20px] mx-0 xs:mx-[30px] p-[30px] bg-white rounded-0 xs:rounded-[15px] flex justify-between shadow-xl hover:shadow-2xl transition-all duration-500 overflow-hidden"
<div class="icon-container"> v-for="item of ResourceDatas" :href="item.src" target="_blank">
<img :src="item.icon_src" alt="" class="icon"> <!-- 左侧图标 -->
<div class="w-[80px] h-[80px] overflow-hidden shadow-md rounded-[10px] transition-all duration-300">
<img :src="item.icon_src" alt="" class="w-[80px] h-[80px]">
</div> </div>
<div class="describe-container"> <!-- 右侧描述 -->
<div class="title">{{ item.title }}</div> <div class="ml-[20px] flex-1 cursor-default">
<div class="describe">{{ item.describe }}</div> <div class="text-[23px] font-semibold">{{ item.title }}</div>
<div class="lable-container"> <div class="text-[14px] text-[#666] mt-[5px]">{{ item.describe }}</div>
<div class="lable" :class="{ 'lable-OS': lable.type === 'OS' }" v-for="lable of item.addition.lables">{{ <!-- 下方的标签 -->
lable.text }}</div> <div class="flex gap-[5px] mt-[10px] flex-wrap">
<div class="text-[10px] font-semibold text-[#666] bg-[#eceef1] py-[1px] px-[6px] rounded-[20px]"
:class="[{ 'bg-[#d6eeff]': lable.type === 'OS' }]" v-for="lable of item.addition.lables">{{
lable.text }}</div>
</div> </div>
</div> </div>
<div class="lable-relative" v-if="item.addition.lable.text"> <!-- 右上方的标签 -->
<div class="lable" :class="{ 'lable-2': (item.addition.lable.class.indexOf('lable-2') != -1) }">{{ <div class="relative w-0 h-0 bottom-[18px] right-[38px] text-center" v-if="item.addition.lable.text">
item.addition.lable.text }}</div> <div class="w-[100px] h-[18px] bg-[#ff1900b3] text-white text-[12px] font-semibold rotate-[45deg]"
:class="{ 'bg-[#ff8000b2]': (item.addition.lable.class.indexOf('lable-2') != -1) }">{{
item.addition.lable.text }}</div>
</div> </div>
</a> </a>
<div class="content content-hidden"></div> <div class="xs:w-[380px] w-0 lg:w-[420px] mx-[30px] transition-all duration-300"></div>
</div> </div>
</div> </div>
<Agreement v-if="showAgreement" @closeAgreement="showAgreement = false" /> <Agreement v-if="showAgreement" @closeAgreement="showAgreement = false" />
</template> </template>
<style scoped>
.main-container {
margin: 0 auto;
display: flex;
flex-direction: column;
align-items: center;
}
.bcc {
position: fixed;
z-index: -1;
background-color: #f6f8f9;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.main-container>.title {
margin-top: 80px;
font-size: 42px;
cursor: default;
transition: all 0.4s;
}
.main-container>.subtitle {
margin-top: 20px;
color: #666;
cursor: default;
font-size: 12px;
padding: 0 20px;
}
.main-container>.subtitle>a {
color: #222;
cursor: pointer;
transition: all 0.3s;
border-bottom: 1px solid #f7f8f9;
}
.main-container>.subtitle>a:hover {
border-bottom: 1px solid #222;
}
.load-fail {
text-align: center;
margin-top: 80px;
cursor: default;
margin-bottom: 380px;
transition: all 0.4s;
}
.content-container {
display: flex;
justify-content: center;
align-items: flex-start;
flex-wrap: wrap;
max-width: 1000px;
margin: 50px auto;
}
.content {
width: 380px;
/* height: 135px; */
margin: 20px 30px;
padding: 30px;
background-color: #fff;
border-radius: 15px;
display: flex;
justify-content: space-between;
box-sizing: border-box;
box-shadow: 0px 2px 5px 0px #ccc;
transition: all 0.4s;
overflow: hidden;
}
.content>.lable-relative {
position: relative;
width: 0;
height: 0;
bottom: 18px;
right: 38px;
text-align: center;
}
.content>.lable-relative>.lable {
width: 100px;
height: 18px;
line-height: 18px;
background-color: rgba(255, 25, 0, 0.7);
color: #fff;
font-size: 12px;
font-weight: 600;
transform: rotate(45deg);
}
.content>.lable-relative>.lable-2 {
background-color: rgba(255, 128, 0, 0.7);
}
.content-hidden {
opacity: 0;
height: 1px;
margin: 0 30px;
padding: 0 30px;
}
.content:hover {
box-shadow: 0px 5px 12px 0px #ccc;
}
.content .icon-container .icon {
width: 80px;
height: 80px;
margin-left: 10px;
margin-top: 10px;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
box-shadow: 0px 1px 4px 1px #ccc;
border-radius: 10px;
transition: all 0.4s;
}
.content .describe-container {
margin-left: 20px;
/* width: 200px; */
flex: 1;
cursor: default;
}
.describe-container .title {
font-size: 23px;
font-weight: 600;
}
.describe-container .describe {
font-size: 14px;
color: #666;
margin-top: 5px;
}
.describe-container .lable-container {
display: flex;
gap: 5px;
margin-top: 10px;
flex-wrap: wrap;
}
.describe-container .lable-container .lable {
font-size: 10px;
font-weight: 500;
color: #666;
background-color: #eceef1;
padding: 1px 6px;
border-radius: 20px;
}
.describe-container .lable-container .lable-OS {
background-color: #d6eeff;
}
@media screen and (min-width: 1200px) {
.content {
width: 410px;
margin-left: 40px;
margin-right: 40px;
}
}
@media screen and (max-width: 550px) {
.main-container>.title {
font-size: 28px;
margin-top: 50px;
}
.content-container {
flex-direction: column;
margin: 20px 0;
}
.load-fail {
margin-top: 40px;
margin-bottom: 450px;
}
}
@media screen and (max-width: 450px) {
.content {
width: 100%;
margin-left: 0;
margin-right: 0;
border-radius: 0;
margin-top: 5px;
}
.content .icon-container .icon {
width: 70px;
height: 70px;
}
.describe-container .title {
font-size: 20px;
}
}
</style>