Browse Source

add news

master
panda 9 months ago
parent
commit
2df23056da
  1. 82
      src/components/blogs/HomePage.vue
  2. 9
      src/components/blogs/QQCode.vue
  3. 9
      src/components/blogs/WechatCode.vue
  4. 13
      src/router/blog.ts
  5. 11
      src/views/blog/AmountChartView.vue

82
src/components/blogs/HomePage.vue

@ -17,7 +17,7 @@
</a-carousel> </a-carousel>
</div> </div>
<!-- 操作按钮滚动 --> <!-- 操作按钮滚动 -->
<div class="anchorDown">
<div class="anchorDown" v-if="show_anchornDown">
<a-button type="link" shape="circle" size="large" @click="downScroll"> <a-button type="link" shape="circle" size="large" @click="downScroll">
<template #icon> <template #icon>
<DownCircleOutlined style="font-size: 35px;color: aliceblue;" spin /> <DownCircleOutlined style="font-size: 35px;color: aliceblue;" spin />
@ -38,16 +38,16 @@
<a-button shape="circle" size="large" @click="gravatarClick"> <a-button shape="circle" size="large" @click="gravatarClick">
<GravatarLined /> <GravatarLined />
</a-button> </a-button>
<a-button shape="circle" size="large">
<a-button shape="circle" size="large" @click="qqClick">
<QQLined /> <QQLined />
</a-button> </a-button>
<a-button shape="circle" size="large"> <a-button shape="circle" size="large">
<WechatLined /> <WechatLined />
</a-button> </a-button>
<a-button shape="circle" size="large">
<a-button shape="circle" size="large" @click="musicClick">
<MusicLined /> <MusicLined />
</a-button> </a-button>
<a-button shape="circle" size="large">
<a-button shape="circle" size="large" @click="githubClick">
<GitHubLined /> <GitHubLined />
</a-button> </a-button>
</div> </div>
@ -105,20 +105,27 @@
<a-card hoverable> <a-card hoverable>
<template #cover> <template #cover>
<div class="heatmap" style="border-right: rgba(0, 0, 0, 0.5);"> <div class="heatmap" style="border-right: rgba(0, 0, 0, 0.5);">
<div ref="heat" style="height: 100%;width: 100%;"></div>
<div ref="heat" style="height: 100%;"></div>
</div> </div>
</template> </template>
</a-card> </a-card>
<a-card hoverable> <a-card hoverable>
<template #cover> <template #cover>
<div style="width: 100%;">
<div id="aplayer" style="width: 25%;"></div>
</div>
<div id="aplayer"></div>
</template> </template>
</a-card> </a-card>
<a-card title="随机文章" :bordered="false" hoverable> <a-card title="随机文章" :bordered="false" hoverable>
sces
<div v-for="article in 3">
<a-image :preview="false" :width="300"
src="https://cdn.naccl.top/blog/blogHosting/2024/02/B01/f56c5bbe-469c-4eb7-a994-9281d6eed689.png" />
<div class="article-text">
<span>2021-02-01</span>
<span>操作系统</span>
</div>
</div>
</a-card> </a-card>
<a-card title="标签云" :bordered="false" hoverable> <a-card title="标签云" :bordered="false" hoverable>
@ -155,6 +162,9 @@ const customStyle =
const scrollbar = ref<Element | null>(null); const scrollbar = ref<Element | null>(null);
onMounted(() => { onMounted(() => {
// home // home
nextTick(() => {
const authorElement = document.querySelector('.author');
if (authorElement) {
new Typed('.author', { new Typed('.author', {
strings: ['SunFree.'], strings: ['SunFree.'],
typeSpeed: 200, typeSpeed: 200,
@ -163,6 +173,9 @@ onMounted(() => {
loopCount: Infinity, loopCount: Infinity,
showCursor: false showCursor: false
}); });
};
const cardTextElement = document.querySelector('.cardText');
if (cardTextElement) {
// //
new Typed('.cardText', { new Typed('.cardText', {
strings: ['做三流测试,品瀚霖人生!'], strings: ['做三流测试,品瀚霖人生!'],
@ -172,8 +185,11 @@ onMounted(() => {
loopCount: Infinity, // loopCount: Infinity, //
showCursor: false // showCursor: false //
}); });
};
const aplayerContainer = document.getElementById('aplayer');
if (aplayerContainer) {
new APlayer({ new APlayer({
container: document.getElementById('aplayer'),
container: aplayerContainer,
mini: false, mini: false,
autoplay: false, autoplay: false,
theme: '#FADFA3', theme: '#FADFA3',
@ -204,6 +220,11 @@ onMounted(() => {
} }
] ]
}); });
}
});
function generateDates(numDays: number) { function generateDates(numDays: number) {
const dates = []; const dates = [];
const currentDate = new Date(); const currentDate = new Date();
@ -274,17 +295,16 @@ onMounted(() => {
orient: 'horizontal', orient: 'horizontal',
left: 'center', left: 'center',
bottom: '15%', bottom: '15%',
itemGap: 5,
show: false, show: false,
inRange: { inRange: {
color: ['#ffffff', '#000000'] // 0, 0
color: ['rgba(182,181,178,0.01)', 'rgb(157,156,153,1)'] // 0, 0
} }
}, },
series: [{ series: [{
type: 'heatmap', type: 'heatmap',
data: formattedData, data: formattedData,
itemStyle: { itemStyle: {
borderColor: 'rgba(0, 0, 0, 0.1)', //
borderColor: 'rgb(231,229,225,0.5)', //
borderWidth: 0.5, // borderWidth: 0.5, //
}, },
label: { label: {
@ -326,6 +346,7 @@ onMounted(() => {
const show_menu = ref(false); const show_menu = ref(false);
const show_carousel = ref(true); const show_carousel = ref(true);
const show_author = ref(true) const show_author = ref(true)
const show_anchornDown = ref(true)
const mainCss = reactive({ const mainCss = reactive({
marginTop: "0px" marginTop: "0px"
}) })
@ -438,9 +459,17 @@ const onSearch = (searchValue: string) => {
const img = ref("https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png") const img = ref("https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png")
const gravatarClick = () => { const gravatarClick = () => {
window.open("https://www.baidu.com")
window.open("https://cn.gravatar.org/")
}
const qqClick=()=>{
window.open("/qqcode",'_blank')
}
const musicClick=()=>{
window.open("https://music.163.com/#/playlist?id=160266689")
}
const githubClick=()=>{
window.open("https://gitee.com/c_panda")
} }
const updateCarouselVisibility = (routeName) => { const updateCarouselVisibility = (routeName) => {
handleScrollEnabled.value = false; handleScrollEnabled.value = false;
if (scrollbar.value) { if (scrollbar.value) {
@ -454,6 +483,7 @@ const updateCarouselVisibility = (routeName) => {
show_menu.value = true; show_menu.value = true;
show_author.value = false; show_author.value = false;
show_carousel.value = false; show_carousel.value = false;
show_anchornDown.value = false;
mainCss.marginTop = '48px'; mainCss.marginTop = '48px';
} }
}; };
@ -595,16 +625,32 @@ router.beforeEach((to, from, next) => {
.rightBar { .rightBar {
width: 20%;
width: 15%;
} }
.rightBar>* { .rightBar>* {
margin-bottom: 24px; margin-bottom: 24px;
} }
.rightBar>:nth-child(4) div {
display: flex;
justify-content: center;
position: relative;
margin-bottom: 24px;
}
.rightBar>:nth-child(4) div .article-text{
display: flex;
flex-direction: column;
position: absolute;
bottom: 5%;
left: 10%;
color: rgb(187, 185, 187);
}
#aplayer {
margin: 0;
}
.statistic { .statistic {
text-align: center; text-align: center;
} }
</style> </style>

9
src/components/blogs/QQCode.vue

@ -0,0 +1,9 @@
<template>
<a-qrcode error-level="H" value="https://www.baidu.com" icon="https://www.antdv.com/assets/logo.1ef800a8.svg" />
</template>
<script setup lang='ts'>
</script>
<style></style>

9
src/components/blogs/WechatCode.vue

@ -0,0 +1,9 @@
<template>
<a-qrcode error-level="H" value="https://www.antdv.com" icon="https://www.antdv.com/assets/logo.1ef800a8.svg" />
</template>
<script setup lang='ts'>
</script>
<style></style>

13
src/router/blog.ts

@ -22,12 +22,23 @@ const blogRoute:Array<RouteRecordRaw>=[
name:"home", name:"home",
component:()=>import("@/views/blog/HomePageView.vue") component:()=>import("@/views/blog/HomePageView.vue")
}, },
] ]
}, },
{ {
path:"/ceshi", path:"/ceshi",
name:"ceshi", name:"ceshi",
component:()=>import("@/components/blogs/ceshi.vue") component:()=>import("@/components/blogs/ceshi.vue")
}
},
{
path:"/qqcode",
name:"qqcode",
component:()=>import("@/components/blogs/QQCode.vue")
},
{
path:"/wechatcode",
name:"wechatcode",
component:()=>import("@/components/blogs/WechatCode.vue")
},
] ]
export default blogRoute export default blogRoute

11
src/views/blog/AmountChartView.vue

@ -0,0 +1,11 @@
<template>
<div>测试</div>
</template>
<script setup lang='ts'>
</script>
<style>
</style>
Loading…
Cancel
Save