diff --git a/src/components/blogs/HomePage.vue b/src/components/blogs/HomePage.vue index 46eb2a8..5649dd2 100644 --- a/src/components/blogs/HomePage.vue +++ b/src/components/blogs/HomePage.vue @@ -29,7 +29,6 @@
- @@ -47,8 +46,8 @@ - - + @@ -62,18 +61,41 @@

{{ text }}

- - - -
- -
+ + + + + +
@@ -89,11 +111,14 @@ import { onMounted } from 'vue' import { CaretRightOutlined } from '@ant-design/icons-vue'; import 'APlayer/dist/APlayer.min.css'; import APlayer from 'APlayer'; +import { createEcharts } from "@/hooks/intex" +import { SettingOutlined, EditOutlined, EllipsisOutlined } from '@ant-design/icons-vue'; -const activeKey = ref(['1']); +const heat = ref(null); +const activeKey = ref(['']); const text = `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`; const customStyle = - 'background: #f7f7f7;border-radius: 4px;margin-bottom: 12px;border: 0;overflow: hidden'; + 'background: #f7f7f7;border-radius: 4px;margin-bottom: 12px;border: 0;overflow: hidden'; onMounted(() => { // 定义home页的博客标题名 new Typed('.salon-light-text', { @@ -106,7 +131,7 @@ onMounted(() => { }); // 定义个人座右铭 new Typed('.cardtext', { - strings: ['品瀚霖人生'], + strings: ['做三流测试,品瀚霖人生!'], typeSpeed: 200, backSpeed: 150, loop: true, // 开启循环 @@ -114,37 +139,127 @@ onMounted(() => { showCursor: false // 取消光标 }); new APlayer({ - container: document.getElementById('aplayer'), - mini: false, - autoplay: false, - theme: '#FADFA3', - loop: 'all', - order: 'random', - preload: 'auto', - volume: 0.7, - mutex: true, - listFolded: true, - listMaxHeight: 90, - lrcType: 3, - audio: [ - { - name: 'name1', - artist: 'artist1', - url: 'url1.mp3', - cover: 'cover1.jpg', - lrc: 'lrc1.lrc', - theme: '#ebd0c2' - }, - { - name: 'name2', - artist: 'artist2', - url: 'url2.mp3', - cover: 'cover2.jpg', - lrc: 'lrc2.lrc', - theme: '#46718b' + container: document.getElementById('aplayer'), + mini: false, + autoplay: false, + theme: '#FADFA3', + loop: 'all', + order: 'random', + preload: 'auto', + volume: 0.7, + mutex: true, + listFolded: true, + listMaxHeight: 90, + lrcType: 3, + audio: [ + { + name: 'name1', + artist: 'artist1', + url: 'url1.mp3', + cover: 'cover1.jpg', + lrc: 'lrc1.lrc', + theme: '#ebd0c2' + }, + { + name: 'name2', + artist: 'artist2', + url: 'url2.mp3', + cover: 'cover2.jpg', + lrc: 'lrc2.lrc', + theme: '#46718b' + } + ] + }); + function generateDates(numDays: number) { + const dates = []; + const currentDate = new Date(); + for (let i = 0; i < numDays; i++) { + const date = new Date(currentDate); + date.setDate(currentDate.getDate() + i); + dates.push( + { date: date.toISOString().split('T')[0], blogCount: 0 } + ); // 包含日期和评论数 } - ] -}); + + return dates; + } + + // 初始化60天的数据 + const data = generateDates(60); + data[3].blogCount = 5; + data[15].blogCount = 10; + data[25].blogCount = 3; + + const formattedData = data.map((value, index) => [index % 15, Math.floor(index / 15), value.blogCount]); + + const heatMapData = { + tooltip: { + position: 'top', + formatter: function (params) { + const item = data[params.dataIndex]; + if (item.blogCount > 0) { + return `${item.date}
COMMENTS: ${item.blogCount}`; + } else { + return `${item.date}`; + } + } + }, + grid: { + left: '0', // 左边距 + right: '0', // 右边距 + top: '0', // 上边距 + bottom: '0', + }, + xAxis: { + type: 'category', + data: Array.from({ length: 15 }, (_, i) => `Col ${i + 1}`), + splitArea: { + show: true + }, + show: false + }, + yAxis: { + type: 'category', + data: ['Row 1', 'Row 2', 'Row 3', 'Row 4'], + splitArea: { + show: false + }, + show: false + }, + visualMap: { + min: 0, + max: 10, + calculable: true, + orient: 'horizontal', + left: 'center', + bottom: '15%', + itemGap: 5, + show: false, + inRange: { + color: ['#ffffff', '#000000'] // 0评论是白色, 非0评论是黑色 + } + }, + series: [{ + type: 'heatmap', + data: formattedData, + itemStyle: { + borderColor: 'rgba(0, 0, 0, 0.4)', // 设置边框颜色 + borderWidth: 0.5, // 设置边框宽度 + }, + label: { + show: false, + }, + emphasis: { + itemStyle: { + shadowBlur: 10, + shadowColor: 'rgba(0, 0, 0, 0.5)', + borderColor: '#fff', // 鼠标悬停时的边框颜色 + borderWidth: 2 // 鼠标悬停时的边框宽度 + } + } + }] + }; + createEcharts(heat, heatMapData) }) const current = ref(['mail']); const show_menu = ref(false); @@ -311,8 +426,20 @@ const img = ref("https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png") .button-container button { margin: 24px 6px; } -.custom-collapse{ + +.custom-collapse { margin: 24px 0px; background: rgb(255, 255, 255) } + +.aplayer { + margin: 0 0 24px 0; +} + +.heatmap { + margin: 24px 0; +} +.statistic{ + text-align: center; +} \ No newline at end of file diff --git a/src/components/blogs/ceshi.vue b/src/components/blogs/ceshi.vue index 8b2cf8c..3ce51b5 100644 --- a/src/components/blogs/ceshi.vue +++ b/src/components/blogs/ceshi.vue @@ -1,40 +1,60 @@ - \ No newline at end of file +