|
@@ -0,0 +1,146 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div class="box">
|
|
|
|
|
+ <p class="head">
|
|
|
|
|
+ <span>Hot List</span>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <ul class="content">
|
|
|
|
|
+ <li
|
|
|
|
|
+ v-for="(item, index) in msg"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a
|
|
|
|
|
+ :href="item.url"
|
|
|
|
|
+ target="_blank"
|
|
|
|
|
+ >
|
|
|
|
|
+ <img
|
|
|
|
|
+ :src="item.imgSrc"
|
|
|
|
|
+ alt="图片"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span>{{ item.name }}</span>
|
|
|
|
|
+ <span :style="`color:${color(index)}`">{{ item.strnum }}</span>
|
|
|
|
|
+ </a>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+<script lang="ts" setup>
|
|
|
|
|
+import { ref } from 'vue'
|
|
|
|
|
+import axios from '@/utils/axios'
|
|
|
|
|
+const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))
|
|
|
|
|
+const msg: any = ref([])
|
|
|
|
|
+const uvList = ref()
|
|
|
|
|
+const getDB = async () => {
|
|
|
|
|
+ const data = await axios.get('/static/test.json')
|
|
|
|
|
+ msg.value = data || []
|
|
|
|
|
+ await sleep(10 * 1000)
|
|
|
|
|
+ getDB()
|
|
|
|
|
+}
|
|
|
|
|
+const getInfo = async () => {
|
|
|
|
|
+ const data = await axios.get('/static/info.json')
|
|
|
|
|
+ uvList.value = data || []
|
|
|
|
|
+ await sleep(10 * 1000)
|
|
|
|
|
+ getInfo()
|
|
|
|
|
+}
|
|
|
|
|
+const color = (num: number) => {
|
|
|
|
|
+ if (num < 10) {
|
|
|
|
|
+ return `rgba(255,152,18,${Math.abs(num - 10) / 20 + 0.5})`
|
|
|
|
|
+ }
|
|
|
|
|
+ return `rgba(145,149,163,${Math.abs(msg.value.length - num) / msg.value.length + 0.3})`
|
|
|
|
|
+}
|
|
|
|
|
+getDB()
|
|
|
|
|
+getInfo()
|
|
|
|
|
+</script>
|
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
|
+.box {
|
|
|
|
|
+ ul,
|
|
|
|
|
+ li {
|
|
|
|
|
+ list-style: none;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ padding: 0;
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ a {
|
|
|
|
|
+ display: inline-flex;
|
|
|
|
|
+ width: 350px;
|
|
|
|
|
+ color: #2c3e50;
|
|
|
|
|
+ text-decoration: none;
|
|
|
|
|
+ margin: 5px auto;
|
|
|
|
|
+ text-align: left;
|
|
|
|
|
+ letter-spacing: 1px;
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ img {
|
|
|
|
|
+ width: 64px;
|
|
|
|
|
+ height: 42px;
|
|
|
|
|
+ border-radius: 6px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ a:hover {
|
|
|
|
|
+ color: rgba(160, 179, 232, 0.9);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .head {
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+ line-height: 32px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .head span:first-child {
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ font-size: 25px;
|
|
|
|
|
+ margin: 5px 0;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ background-image: -webkit-linear-gradient(bottom, red, #ff5f60, #f0c41b);
|
|
|
|
|
+ background-clip: text;
|
|
|
|
|
+ -webkit-background-clip: text;
|
|
|
|
|
+ -webkit-text-fill-color: transparent;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ a>span:nth-child(2) {
|
|
|
|
|
+ width: 230px;
|
|
|
|
|
+ margin-left: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ a>span:last-child {
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .content {
|
|
|
|
|
+ height: 99vh;
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* 设置滚动条的样式 */
|
|
|
|
|
+::-webkit-scrollbar {
|
|
|
|
|
+ width: 5px;
|
|
|
|
|
+ height: 5px;
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ background: transparent;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* 滚动槽 */
|
|
|
|
|
+::-webkit-scrollbar-track {
|
|
|
|
|
+ background: transparent;
|
|
|
|
|
+ border-radius: 5px;
|
|
|
|
|
+ width: 5px;
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* 滚动条滑块 */
|
|
|
|
|
+::-webkit-scrollbar-thumb {
|
|
|
|
|
+ border-radius: 5px;
|
|
|
|
|
+ background: #ccc;
|
|
|
|
|
+ box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+::-webkit-scrollbar-thumb:window-inactive {
|
|
|
|
|
+ background: #ccc;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|