This commit is contained in:
rsgltzyd 2024-10-05 20:35:41 +08:00
parent 602d11f85b
commit ca0cac99c8
7 changed files with 145 additions and 131 deletions

View File

@ -11,6 +11,8 @@
"format": "prettier --write src/" "format": "prettier --write src/"
}, },
"dependencies": { "dependencies": {
"@ant-design/icons-vue": "^7.0.1",
"ant-design-vue": "^4.2.5",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"vue": "^3.4.29", "vue": "^3.4.29",
"vue-router": "^4.3.3" "vue-router": "^4.3.3"

View File

@ -1,82 +1,51 @@
<script setup> <script setup lang="js">
import { RouterLink, RouterView } from 'vue-router' import { RouterView } from 'vue-router'
</script> import { h, ref } from 'vue'
import { AppstoreOutlined, MailOutlined } from '@ant-design/icons-vue'
import CustomCard from '@/components/CustomCard.vue'
const current = ref(['mail'])
const items = ref([
{
key: 'home',
icon: () => h(MailOutlined),
label: h('a', { href: '/' }, '首页'),
title: '首页'
},
{
key: 'about',
icon: () => h(AppstoreOutlined),
label: h('a', { href: '/about' }, '关于'),
title: '关于'
}
])
</script>
import CustomCard from '@/components/CustomCard.vue'
<template> <template>
<header> <header>
<img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />
<div class="wrapper"> <div class="wrapper">
<nav> <nav>
<RouterLink to="/">Home</RouterLink> <a-menu v-model:selectedKeys="current" mode="horizontal" :items="items" />
<RouterLink to="/about">About</RouterLink>
</nav> </nav>
</div> </div>
</header> </header>
<RouterView /> <main>
<article>
<RouterView />
</article>
<aside>
<CustomCard :style="{margin: 'auto', padding: '10px'}" />
</aside>
</main>
</template> </template>
<style scoped> <style scoped>
header { article {
line-height: 1.5; flex: 5;
max-height: 100vh;
} }
.logo { aside {
display: block; flex: 2;
margin: 0 auto 2rem;
} }
</style>
nav {
width: 100%;
font-size: 12px;
text-align: center;
margin-top: 2rem;
}
nav a.router-link-exact-active {
color: var(--color-text);
}
nav a.router-link-exact-active:hover {
background-color: transparent;
}
nav a {
display: inline-block;
padding: 0 1rem;
border-left: 1px solid var(--color-border);
}
nav a:first-of-type {
border: 0;
}
@media (min-width: 1024px) {
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
}
.logo {
margin: 0 2rem 0 0;
}
header .wrapper {
display: flex;
place-items: flex-start;
flex-wrap: wrap;
}
nav {
text-align: left;
margin-left: -1rem;
font-size: 1rem;
padding: 1rem 0;
margin-top: 1rem;
}
}
</style>

View File

@ -5,6 +5,21 @@
margin: 0 auto; margin: 0 auto;
padding: 2rem; padding: 2rem;
font-weight: normal; font-weight: normal;
display: flex;
flex-direction: column;
}
header {
margin: 0 auto;
}
main {
/*width: 80%;*/
width: 1080px;
display: flex;
justify-content: center;
flex: 2 800px;
margin: 0 auto;
} }
a, a,
@ -22,11 +37,6 @@ a,
} }
@media (min-width: 1024px) { @media (min-width: 1024px) {
body {
display: flex;
place-items: center;
}
#app { #app {
padding: 0 2rem; padding: 0 2rem;
} }

View File

@ -7,9 +7,7 @@ const customCard = ref(new CustomCard())
<template> <template>
<div class="card"> <div class="card">
<div class="avatar"> <div class="avatar">
<!-- <img :src="require(customCard.avatar)" alt="avatar" />--> <img :src="customCard.avatar" alt="avatar" height="100px" width="100px" />
<!-- <img src="./images/avatar.jpg" alt="avatar" />-->
<img :src="customCard.avatar" alt="avatar">
</div> </div>
<div class="name"> <div class="name">
@ -25,15 +23,15 @@ const customCard = ref(new CustomCard())
<style scoped> <style scoped>
.card { .card {
display: flex; display: flex;
flex-wrap: wrap; flex-direction: column;
text-align: center;
align-items: center;
box-sizing: border-box; box-sizing: border-box;
width: 200px;
.avatar { .avatar {
width: 50%; width: 50%;
img { img {
width: 80%; border-radius: 50%;
height: 80%;
} }
} }
@ -45,4 +43,16 @@ const customCard = ref(new CustomCard())
width: 100%; width: 100%;
} }
} }
@media screen and (max-width: 800px) {
.card {
width: 160px;
}
}
@media screen and (min-width: 800px) {
.card {
width: 200px;
}
}
</style> </style>

View File

@ -5,10 +5,11 @@ import { createPinia } from 'pinia'
import App from './App.vue' import App from './App.vue'
import router from './router' import router from './router'
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'
const app = createApp(App) const app = createApp(App)
app.use(createPinia()) app.use(createPinia())
app.use(router) app.use(router)
app.use(Antd).mount('#app')
app.mount('#app')

View File

@ -7,7 +7,6 @@
<style> <style>
@media (min-width: 1024px) { @media (min-width: 1024px) {
.about { .about {
min-height: 100vh;
display: flex; display: flex;
align-items: center; align-items: center;
} }

View File

@ -1,58 +1,81 @@
<script setup> <script setup>
import CustomCard from '@/components/CustomCard.vue' const cardStyle = {
width: '200px'
}
const moduleList_1 = [
{
title: 'Gitea',
url: 'http://10.120.20.137:3000/'
},
{
title: 'Pve',
url: 'https://10.120.20.15:8006/'
}
]
const moduleList_2 = [
{
title: 'zero tier',
url: 'https://zerotier.yulinling.asia/'
},
{
title: 'gitea',
url: 'https://gitea.yulinling.asia/'
}
]
</script> </script>
<template> <template>
<main> <div>
<article> <h2>Zero tier</h2>
<h1>An Exciting Blog Post</h1> <ul>
<p> <a-card
Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth v-for="(item, index) in moduleList_1"
tatsoi tomatillo melon azuki bean garlic. :key="index"
</p> :style="cardStyle"
:body-style="{ padding: 0, overflow: 'hidden' }"
<p> >
Gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts <a-flex justify="space-between">
fava bean collard greens dandelion okra wakame tomato. Dandelion cucumber earthnut pea <a-flex vertical align="flex-end" justify="space-between" :style="{ padding: '32px' }">
peanut soko zucchini. <a-typography>
</p> <a-typography-title :level="3"> {{ item.title }}</a-typography-title>
</a-typography>
<p> <a-button type="primary" :href="item.url" target="_blank">Get Start</a-button>
Turnip greens yarrow ricebean rutabaga endive cauliflower sea lettuce kohlrabi amaranth </a-flex>
water spinach avocado daikon napa cabbage asparagus winter purslane kale. Celery potato </a-flex>
scallion desert raisin horseradish spinach carrot soko. Lotus root water spinach fennel </a-card>
kombu maize bamboo shoot green bean swiss chard seakale pumpkin onion chickpea gram corn </ul>
pea. Brussels sprout coriander water chestnut gourd swiss chard wakame kohlrabi beetroot </div>
carrot watercress. Corn amaranth salsify bunya nuts nori azuki bean chickweed potato bell <div>
pepper artichoke. <h2>aliyun</h2>
</p> <ul>
<a-card
<p> v-for="(item, index) in moduleList_2"
Nori grape silver beet broccoli kombu beet greens fava bean potato quandong celery. Bunya :key="index"
nuts black-eyed pea prairie turnip leek lentil turnip greens parsnip. Sea lettuce lettuce :style="cardStyle"
water chestnut eggplant winter purslane fennel azuki bean earthnut pea sierra leone bologi :body-style="{ padding: 0, overflow: 'hidden' }"
leek soko chicory celtuce parsley jícama salsify. >
</p> <a-flex justify="space-between">
<a-flex vertical align="flex-end" justify="space-between" :style="{ padding: '32px' }">
<p> <a-typography>
Celery quandong swiss chard chicory earthnut pea potato. Salsify taro catsear garlic gram <a-typography-title :level="3"> {{ item.title }}</a-typography-title>
celery bitterleaf wattle seed collard greens nori. Grape wattle seed kombu beetroot </a-typography>
horseradish carrot squash brussels sprout chard. <a-button type="primary" :href="item.url" target="_blank">Get Start</a-button>
</p> </a-flex>
</article> </a-flex>
</a-card>
<aside> </ul>
<h2>Photography</h2> </div>
<CustomCard />
<ul class="photos"></ul>
</aside>
</main>
</template> </template>
<style> <style scoped>
main { ul {
width: 80%;
display: flex; display: flex;
flex: 3 1; flex-direction: row;
}
ul > div {
margin: 10px;
} }
</style> </style>