Skip to content

Commit 56007fe

Browse files
committed
commit
1 parent df0e13f commit 56007fe

25 files changed

+1729
-155
lines changed

components.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ declare module '@vue/runtime-core' {
2626
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
2727
ElTabPane: typeof import('element-plus/es')['ElTabPane']
2828
ElTabs: typeof import('element-plus/es')['ElTabs']
29+
ElTag: typeof import('element-plus/es')['ElTag']
2930
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
3031
MenuItem: typeof import('./src/components/MenuItem.vue')['default']
3132
PlainCard: typeof import('./src/components/PlainCard.vue')['default']

public/index.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
rel="icon"
1515
href="<%= BASE_URL %>favicon.ico"
1616
/>
17-
<link
18-
rel="stylesheet"
19-
href="./gitalk/gitalk.css"
20-
/>
21-
<script src="./gitalk/gitalk.min.js"></script>
2217
<title>Hibichann</title>
2318
</head>
2419

src/App.vue

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
<template>
22
<div>
33
<layout-body-vue>
4-
<router-view v-slot="{ Component }">
5-
<transition
6-
name="slide-fade"
7-
appear
8-
>
9-
<keep-alive>
10-
<component :is="Component"></component>
11-
</keep-alive>
12-
</transition>
13-
</router-view>
4+
<transition name="slide-fade">
5+
<router-view v-slot="{ Component }">
6+
<component
7+
:is="Component"
8+
:key="route.fullPath"
9+
></component>
10+
</router-view>
11+
</transition>
1412
</layout-body-vue>
1513
</div>
1614
</template>
1715
<script lang="ts" setup>
1816
import layoutBodyVue from './views/layout/layout-body.vue'
19-
import { onMounted, ref } from 'vue'
17+
import { onMounted } from 'vue'
2018
import store from '@/store'
19+
import { useRoute } from 'vue-router'
20+
const route = useRoute()
2121
const isMobile = () => {
2222
let flag = navigator.userAgent.match(/(phone|pod|iPhone|iPod|ios|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
2323
return flag
2424
}
25-
let a = ref(true)
2625
onMounted(() => {
2726
store.commit('isMobile', isMobile())
2827
})
@@ -33,16 +32,18 @@ onMounted(() => {
3332
font-weight: 500 !important;
3433
}
3534
.slide-fade-enter-active {
36-
transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1);
35+
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
3736
}
3837
39-
.slide-fade-leave-active {
40-
transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1);
38+
// .slide-fade-leave-active {
39+
// // transition: all 0 cubic-bezier(1, 0.5, 0.8, 1);
40+
// }
41+
.slide-fade-enter-to,
42+
.slide-fade-leave-from {
43+
opacity: 1;
4144
}
42-
4345
.slide-fade-enter-from,
4446
.slide-fade-leave-to {
45-
transform: translateY(30px);
4647
opacity: 0;
4748
}
4849
</style>
File renamed without changes.
File renamed without changes.

src/assets/thinking.png

54.8 KB
Loading

src/components/CardMD.vue

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class="left-body"
77
@click="toArticleDetail"
88
>
9-
<img src="https://blog.chevereto.com/photos/2022/pexels-prakash-aryal-38326.jpg" />
9+
<img :src="imgUrl || backImg" />
1010
</div>
1111
<div class="right-body">
1212
<div class="article-body">
@@ -31,14 +31,16 @@
3131
</div>
3232
<div
3333
class="detail"
34-
v-html="marked(article?.content.toString())"
34+
v-html="marked(article?.content)"
3535
></div>
3636
</div>
3737
</div>
3838
</div>
3939
</template>
4040

4141
<script lang="ts" setup>
42+
//@ts-ignore
43+
import backImg from '@/assets/thinking.png'
4244
import { onMounted, ref } from 'vue'
4345
import { marked } from 'marked'
4446
import router from '@/router'
@@ -55,12 +57,22 @@ const handleClick = (name, query?) => {
5557
query
5658
})
5759
}
60+
let imgUrl = ref('')
61+
const getImgUrl = () => {
62+
const regex = /!\[.*\]\((.*?)\)/g
63+
let match
64+
while ((match = regex.exec(article.value!.content))) {
65+
imgUrl.value = match[1]
66+
console.log('Found image URL:', imgUrl.value)
67+
}
68+
}
5869
const article = ref(props.article)
5970
const toArticleDetail = () => {
6071
console.log(123, article.value!.id)
61-
router.push({ name: 'articleDetail', query: { id: article.value!.id || 1 } })
72+
router.push({ name: 'articleDetail', params: { id: article.value!.id || 1 } })
6273
}
6374
onMounted(async () => {
75+
getImgUrl()
6476
// article?.value = (await getarticle?({ id: props.id || 1 })) as any
6577
})
6678
</script>
@@ -82,13 +94,15 @@ onMounted(async () => {
8294
overflow: hidden;
8395
img {
8496
width: 100%;
97+
filter: brightness(0.95);
8598
// height: 150px;
8699
object-fit: cover;
87100
transition: all 0.5s;
88101
}
89102
img:hover {
90103
object-fit: cover;
91104
cursor: pointer;
105+
filter: brightness(1);
92106
transform: scale(1.2);
93107
transition: all 0.5s;
94108
}
@@ -147,6 +161,9 @@ onMounted(async () => {
147161
transition: color 0.3s;
148162
}
149163
.detail {
164+
:deep(img) {
165+
display: none;
166+
}
150167
position: relative;
151168
// white-space: pre;
152169
width: 100%;

src/components/HelloWorld.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<template>
22
<!-- 文章列表页 -->
33
<div class="Home">
4+
<!-- <div style="height: 50px; background-color: transparent"></div> -->
5+
<div class="shadow"></div>
46
<el-row>
57
<el-col :span="spanWidth[0]"></el-col>
68
<el-col :span="spanWidth[1]">
@@ -144,6 +146,10 @@ onMounted(() => {
144146
})
145147
</script>
146148
<style lang="scss" scoped>
149+
.shadow {
150+
width: 100%;
151+
box-shadow: 0 0 20px 20px lightslategray;
152+
}
147153
.title {
148154
width: 30%;
149155
color: rgb(97, 97, 97);

src/components/PlainCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const handleClick = (name, query?) => {
9898
})
9999
}
100100
const toArticleDetail = (id) => {
101-
router.push({ name: 'articleDetail', query: { id } })
101+
router.push({ name: 'articleDetail', params: { id } })
102102
}
103103
</script>
104104

src/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ import VMdEditor from '@kangc/v-md-editor';
2323
import '@kangc/v-md-editor/lib/style/base-editor.css';
2424
import githubTheme from '@kangc/v-md-editor/lib/theme/github.js';
2525
import '@kangc/v-md-editor/lib/theme/style/github.css';
26+
//gitalk
27+
// import '@/assets/gitalk/gitalk.css'
28+
// import '@/assets/gitalk/gitalk.min.js'
2629
VMdEditor.use(githubTheme, {
2730
Hljs: hljs,
2831
});

0 commit comments

Comments
 (0)