2023-01-15 05:22:30 +00:00
|
|
|
<template>
|
|
|
|
<div class="links">
|
|
|
|
<div class="line">
|
|
|
|
<Icon size="20">
|
|
|
|
<Link />
|
|
|
|
</Icon>
|
|
|
|
<span class="title">网站列表</span>
|
|
|
|
</div>
|
2023-06-12 03:39:06 +00:00
|
|
|
<!-- 网站列表 -->
|
|
|
|
<Swiper
|
|
|
|
v-if="siteLinks[0]"
|
|
|
|
:modules="[Pagination, Mousewheel]"
|
|
|
|
:slides-per-view="1"
|
|
|
|
:space-between="40"
|
|
|
|
:pagination="{
|
|
|
|
el: '.swiper-pagination',
|
|
|
|
clickable: true,
|
|
|
|
bulletElement: 'div',
|
|
|
|
}"
|
|
|
|
:mousewheel="true"
|
|
|
|
>
|
|
|
|
<SwiperSlide v-for="site in siteLinks" :key="site">
|
|
|
|
<el-row class="link-all" :gutter="20">
|
|
|
|
<el-col
|
|
|
|
:span="8"
|
|
|
|
v-for="(item, index) in site"
|
|
|
|
:key="item"
|
|
|
|
@click="jumpLink(item)"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
class="item cards"
|
|
|
|
:style="index < 3 ? 'margin-bottom: 20px' : null"
|
|
|
|
>
|
|
|
|
<Icon size="26">
|
|
|
|
<component :is="siteIcon[item.icon]" />
|
|
|
|
</Icon>
|
|
|
|
<span class="name">{{ item.name }}</span>
|
|
|
|
</div>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</SwiperSlide>
|
|
|
|
<div class="swiper-pagination" />
|
|
|
|
</Swiper>
|
2023-01-15 05:22:30 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
2023-06-12 03:39:06 +00:00
|
|
|
import { onMounted } from "vue";
|
2023-01-15 05:22:30 +00:00
|
|
|
import { Icon } from "@vicons/utils";
|
2023-06-15 02:05:47 +00:00
|
|
|
// 可前往 https://www.xicons.org 自行挑选并在此处引入
|
2023-01-15 05:22:30 +00:00
|
|
|
import {
|
|
|
|
Link,
|
|
|
|
Blog,
|
|
|
|
CompactDisc,
|
|
|
|
Cloud,
|
|
|
|
Compass,
|
|
|
|
Book,
|
2023-03-10 06:59:09 +00:00
|
|
|
Fire,
|
2023-06-12 03:39:06 +00:00
|
|
|
LaptopCode,
|
2023-01-15 05:22:30 +00:00
|
|
|
} from "@vicons/fa";
|
2023-04-21 08:37:08 +00:00
|
|
|
import { mainStore } from "@/store";
|
2023-06-12 03:39:06 +00:00
|
|
|
import { Swiper, SwiperSlide } from "swiper/vue";
|
|
|
|
import { Pagination, Mousewheel } from "swiper";
|
|
|
|
import siteLinks from "@/assets/siteLinks.json";
|
|
|
|
import "swiper/scss";
|
|
|
|
import "swiper/scss/pagination";
|
|
|
|
|
2023-04-21 08:37:08 +00:00
|
|
|
const store = mainStore();
|
2023-01-15 05:22:30 +00:00
|
|
|
|
2023-06-12 03:39:06 +00:00
|
|
|
// 网站链接图标
|
|
|
|
const siteIcon = {
|
|
|
|
Blog,
|
|
|
|
Cloud,
|
|
|
|
CompactDisc,
|
|
|
|
Compass,
|
|
|
|
Book,
|
|
|
|
Fire,
|
|
|
|
LaptopCode,
|
|
|
|
};
|
|
|
|
|
2023-01-15 05:22:30 +00:00
|
|
|
// 链接跳转
|
2023-04-21 08:37:08 +00:00
|
|
|
const jumpLink = (data) => {
|
|
|
|
if (data.name === "音乐" && store.musicClick) {
|
2023-06-12 03:39:06 +00:00
|
|
|
if (typeof $openList === "function") $openList();
|
2023-04-21 08:37:08 +00:00
|
|
|
} else {
|
|
|
|
window.open(data.link, "_blank");
|
|
|
|
}
|
2023-01-15 05:22:30 +00:00
|
|
|
};
|
2023-06-12 03:39:06 +00:00
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
console.log(siteLinks);
|
|
|
|
});
|
2023-01-15 05:22:30 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.links {
|
|
|
|
.line {
|
|
|
|
margin: 2rem 0.25rem 1rem;
|
|
|
|
font-size: 1.1rem;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
animation: fade;
|
|
|
|
-webkit-animation: fade 0.5s;
|
|
|
|
.title {
|
|
|
|
margin-left: 8px;
|
|
|
|
font-size: 1.15rem;
|
|
|
|
text-shadow: 0 0 5px #00000050;
|
|
|
|
}
|
|
|
|
}
|
2023-06-12 03:39:06 +00:00
|
|
|
.swiper {
|
|
|
|
left: -10px;
|
|
|
|
width: calc(100% + 20px);
|
|
|
|
padding: 5px 10px 0;
|
|
|
|
z-index: 0;
|
|
|
|
.swiper-slide {
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
.swiper-pagination {
|
|
|
|
position: static;
|
|
|
|
margin-top: 4px;
|
|
|
|
:deep(.swiper-pagination-bullet) {
|
|
|
|
background-color: #fff;
|
|
|
|
width: 18px;
|
|
|
|
height: 4px;
|
|
|
|
border-radius: 4px;
|
|
|
|
transition: opacity 0.3s;
|
|
|
|
&:hover {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-01-15 05:22:30 +00:00
|
|
|
.link-all {
|
|
|
|
.item {
|
|
|
|
height: 100px;
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: center;
|
|
|
|
animation: fade;
|
|
|
|
-webkit-animation: fade 0.5s;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
transform: scale(1.02);
|
|
|
|
background: rgb(0 0 0 / 40%);
|
|
|
|
transition: 0.3s;
|
|
|
|
}
|
2023-04-21 08:37:08 +00:00
|
|
|
|
|
|
|
&:active {
|
|
|
|
transform: scale(1);
|
|
|
|
}
|
|
|
|
|
2023-01-15 05:22:30 +00:00
|
|
|
.name {
|
|
|
|
font-size: 1.1rem;
|
|
|
|
margin-left: 8px;
|
|
|
|
}
|
|
|
|
@media (min-width: 720px) and (max-width: 820px) {
|
|
|
|
.name {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@media (max-width: 720px) {
|
|
|
|
height: 80px;
|
|
|
|
}
|
|
|
|
@media (max-width: 460px) {
|
|
|
|
flex-direction: column;
|
|
|
|
.name {
|
|
|
|
font-size: 1rem;
|
|
|
|
margin-left: 0;
|
|
|
|
margin-top: 8px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-04-21 08:37:08 +00:00
|
|
|
</style>
|