@ -0,0 +1,4 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
not dead
|
||||
not ie 11
|
||||
@ -0,0 +1,17 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
node: true
|
||||
},
|
||||
'extends': [
|
||||
'plugin:vue/vue3-essential',
|
||||
'eslint:recommended'
|
||||
],
|
||||
parserOptions: {
|
||||
parser: '@babel/eslint-parser'
|
||||
},
|
||||
rules: {
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
@ -0,0 +1,24 @@
|
||||
# demo
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "esnext",
|
||||
"baseUrl": "./",
|
||||
"moduleResolution": "node",
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"scripthost"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "demo",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.7.7",
|
||||
"core-js": "^3.8.3",
|
||||
"element-plus": "^2.8.6",
|
||||
"vite": "^5.4.10",
|
||||
"vue": "^3.2.13",
|
||||
"vue-router": "^4.4.5",
|
||||
"vue-virtual-scroller": "^1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.16",
|
||||
"@babel/eslint-parser": "^7.12.16",
|
||||
"@vue/cli-plugin-babel": "~5.0.0",
|
||||
"@vue/cli-plugin-eslint": "~5.0.0",
|
||||
"@vue/cli-service": "~5.0.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-vue": "^8.0.3",
|
||||
"unplugin-auto-import": "^0.18.3",
|
||||
"unplugin-vue-components": "^0.27.4"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 212 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,20 @@
|
||||
<template>
|
||||
|
||||
<router-view/>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup></script>
|
||||
|
||||
<style>
|
||||
/* 让页面铺满整个屏幕,不出现滚动条 */
|
||||
html,
|
||||
body,
|
||||
#app {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,27 @@
|
||||
/* 给圆形定义关键帧 */
|
||||
@keyframes switch {
|
||||
0% {
|
||||
left: calc(4px * 0.2);
|
||||
}
|
||||
60% {
|
||||
left:calc(4px * 0.2);
|
||||
width: calc(112px * 0.2);
|
||||
}
|
||||
100%{
|
||||
left: calc(104px * 0.2);
|
||||
}
|
||||
}
|
||||
@keyframes reverse_switch {
|
||||
0% {
|
||||
left: calc(104px * 0.2);
|
||||
|
||||
}
|
||||
60%{
|
||||
left: calc(74px * 0.2);
|
||||
width: calc(112px * 0.2);
|
||||
}
|
||||
100%{
|
||||
left: calc(4px * 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,80 @@
|
||||
|
||||
.communitybase
|
||||
{
|
||||
height: 100vh;
|
||||
background-image: url("../../pictures/communityback.png");
|
||||
background-size: 90%;
|
||||
background-attachment: fixed; /* 背景固定 */
|
||||
background-position: -600px; /* 向左移动背景图像 50px */
|
||||
background-position: center; /* 可以选择让背景居中 */
|
||||
z-index: -1;
|
||||
}
|
||||
.touxiang
|
||||
{
|
||||
position: absolute;
|
||||
top:50%;
|
||||
left:5%;
|
||||
border-radius: 10px;
|
||||
width: 50px;
|
||||
height:50px;
|
||||
transform: translateY(-50%)
|
||||
}
|
||||
.leftinfo
|
||||
{
|
||||
background-color: rgba(255,255,255,0.8);
|
||||
width: 15%;
|
||||
position: fixed;
|
||||
left:0%;
|
||||
border: 3px solid orchid;
|
||||
height:100%;
|
||||
|
||||
}
|
||||
.rightheat
|
||||
{
|
||||
|
||||
background-color: rgba(255,255,255,0.8);
|
||||
position: fixed;
|
||||
right:0%;
|
||||
width: 15%;
|
||||
border: 3px solid orchid;
|
||||
height:100%;
|
||||
|
||||
}
|
||||
.familytitle
|
||||
{
|
||||
position: absolute;
|
||||
top:8%;
|
||||
left:35%;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
|
||||
}
|
||||
.familycontent
|
||||
{
|
||||
position: absolute;
|
||||
bottom:12%;
|
||||
left:35%;
|
||||
font-size: 13px;
|
||||
|
||||
}
|
||||
.Hotsearchnum{
|
||||
border-radius: 50%;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.middle
|
||||
{
|
||||
position: absolute;
|
||||
left:50%;
|
||||
transform: translateX(-50%);
|
||||
width: 65%;
|
||||
border: 3px solid orchid;
|
||||
height:100%;
|
||||
z-index:1;
|
||||
}
|
||||
.post-list {
|
||||
|
||||
}
|
||||
@ -0,0 +1,147 @@
|
||||
.base{
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-image: url("@/assets/pictures/background.png");
|
||||
background-size: 100%;
|
||||
}
|
||||
.loginAndRegist{
|
||||
position: absolute;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
right:6%;
|
||||
top:35%;
|
||||
|
||||
|
||||
}
|
||||
.loginArea{
|
||||
background-color: rgba(255,255,255,0.8);
|
||||
opacity: 0.8;
|
||||
border-top-left-radius: 15px;
|
||||
border-bottom-left-radius: 15px;
|
||||
height: 400px;
|
||||
width: 400px;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
.registArea{
|
||||
opacity: 0.8;
|
||||
border-top-right-radius: 15px;
|
||||
border-bottom-right-radius: 15px;
|
||||
height: 400px;
|
||||
width: 400px;
|
||||
background-color: rgba(255,255,255,0.8);
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content:center ;
|
||||
align-items: center;
|
||||
}
|
||||
.showInfo{
|
||||
border-top-right-radius: 15px;
|
||||
border-bottom-right-radius: 15px;
|
||||
position: absolute;
|
||||
height: 400px;
|
||||
width: 400px;
|
||||
z-index:2;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background-image: url("@/assets/pictures/welcome.png");
|
||||
background-size: 90%;
|
||||
}
|
||||
.showInfo:hover{
|
||||
background-size: 100%;
|
||||
background-position: -50px -50px;
|
||||
}
|
||||
.title{
|
||||
width: 80%;
|
||||
flex:1;
|
||||
border-bottom: 1px solid #E44B9D;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #E44B9D;
|
||||
font-weight: bold;
|
||||
font-size: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
#aaa{
|
||||
transition: 0.3s linear;
|
||||
}
|
||||
.pwdArea{
|
||||
width: 100%;
|
||||
flex:2;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
color: #E44B9D;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.pwdArea input{
|
||||
height: 30px;
|
||||
border-radius:15px ;
|
||||
padding-left: 10px;
|
||||
font-size: 13px;
|
||||
}
|
||||
/* 移除输入框边框 */
|
||||
.el-input__inner {
|
||||
border: none !important;
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.pwdArea input:focus{
|
||||
border: 2px solid #E44B9D;
|
||||
}
|
||||
.btnArea{
|
||||
flex:1;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
}
|
||||
.rigestTitle{
|
||||
width: 70%;
|
||||
flex: 1;
|
||||
color: #E44B9D;
|
||||
font-weight: bold;
|
||||
font-size: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #E44B9D;
|
||||
}
|
||||
.registForm{
|
||||
flex: 2;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
color: #E44B9D;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.registForm input{
|
||||
outline: none;
|
||||
height: 30px;
|
||||
border-radius:13px ;
|
||||
padding-left: 10px;
|
||||
font-size: 12px;
|
||||
border: 1px solid gray;
|
||||
}
|
||||
.registForm input:focus{
|
||||
border: 2px solid #E44B9D;
|
||||
}
|
||||
#elselect:focus{
|
||||
border: 2px solid #E44B9D;
|
||||
}
|
||||
.registBtn{
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
After Width: | Height: | Size: 601 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 631 B |
|
After Width: | Height: | Size: 354 KiB |
|
After Width: | Height: | Size: 2.6 MiB |
|
After Width: | Height: | Size: 243 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 643 B |
|
After Width: | Height: | Size: 294 KiB |
|
After Width: | Height: | Size: 118 KiB |
|
After Width: | Height: | Size: 811 B |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 212 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 829 B |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 761 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 180 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 196 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<div class="comment-input">
|
||||
<textarea v-model="commentText" placeholder="输入评论..." rows="3"></textarea>
|
||||
<button @click="submitComment">发布评论</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
commentText: '', // 存储用户输入的评论
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
submitComment() {
|
||||
if (this.commentText.trim()) {
|
||||
this.$emit('submitComment', this.commentText); // 向父组件传递评论文本
|
||||
this.commentText = ''; // 清空输入框
|
||||
this.$emit('updateLikeCount', this.likeCount + 1);
|
||||
} else {
|
||||
alert("评论不能为空!");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.comment-input {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
textarea {
|
||||
margin-bottom: 10px;
|
||||
padding: 10px;
|
||||
font-size: 14px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
button {
|
||||
align-self: flex-end;
|
||||
padding: 8px 15px;
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
<template>
|
||||
|
||||
|
||||
<div class="main-content">
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<<<<<<< HEAD
|
||||
<style scoped>
|
||||
=======
|
||||
<style>
|
||||
>>>>>>> a6b76ef7f39f0d43fb6b42d4a7d62d28e3f1da78
|
||||
.main-content {
|
||||
/* 设置背景为渐变色 */
|
||||
|
||||
background:
|
||||
url('@/assests/pictures/backtree.png') no-repeat center center,linear-gradient(to bottom, rgba(252, 220, 215, 1) 0%, rgba(252, 220, 215, 1) 5%, rgba(255, 249, 161, 1) 25%, rgba(255, 249, 161, 1) 100%);
|
||||
box-sizing: border-box; /* 使内边距计算在总高度内 */
|
||||
|
||||
background-size:auto 90% 60%;
|
||||
background-position: center; /* 使背景图居中 */
|
||||
height: 100vh; /* 使主界面高度占满整个视口 */
|
||||
padding: 20px; /* 添加一些内边距 */
|
||||
box-sizing: border-box; /* 使内边距计算在总高度内 */
|
||||
}
|
||||
|
||||
</style>
|
||||
<script>
|
||||
export default
|
||||
{
|
||||
name: 'BackGround', // 添加组件名称
|
||||
// 其他组件选项
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1,16 @@
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
||||
|
||||
|
||||
const app = createApp(App)
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
app.component(key, component)
|
||||
}
|
||||
|
||||
app.use(ElementPlus)
|
||||
app.use(router)
|
||||
app.mount('#app')
|
||||
@ -0,0 +1,64 @@
|
||||
import login from '@/views/login/login.vue'
|
||||
import main from '../views/Main.vue'
|
||||
import recommend from '@/views/recommend/index.vue'
|
||||
import community from '@/views/community/trends.vue'
|
||||
import chat from '@/views/chat/chat.vue'
|
||||
import informationPage from '@/views/space/informationPage.vue'
|
||||
import spacePage from '@/views/space/spacePage.vue'
|
||||
import familyTree from '@/views/space/familyTree.vue'
|
||||
import spaceTest from '@/views/space/spaceTest.vue'
|
||||
|
||||
|
||||
import {createRouter ,createWebHashHistory} from 'vue-router'
|
||||
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path : '/',
|
||||
redirect:'/main/recommend',
|
||||
component : spaceTest,
|
||||
},
|
||||
{
|
||||
path:'/main',
|
||||
component : main,
|
||||
children:[
|
||||
{
|
||||
path:'recommend',
|
||||
component: recommend
|
||||
},
|
||||
{
|
||||
path:'community',
|
||||
component: community
|
||||
},
|
||||
{
|
||||
path:'chat',
|
||||
component: chat
|
||||
},
|
||||
{
|
||||
path:'login',
|
||||
component:login
|
||||
},
|
||||
{
|
||||
path:'informationPage',
|
||||
component:informationPage
|
||||
},
|
||||
{
|
||||
path:'spacePage',
|
||||
component:spacePage
|
||||
},
|
||||
{
|
||||
path:'familyTree',
|
||||
component:familyTree
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
routes,
|
||||
history:createWebHashHistory()
|
||||
})
|
||||
|
||||
export default router
|
||||
@ -0,0 +1,18 @@
|
||||
// 存储、获取、删除token的文件
|
||||
// 定义 setToken 函数,用于将 token 存储到 localStorage
|
||||
export function setToken(token) {
|
||||
localStorage.setItem('authToken', token);
|
||||
}
|
||||
|
||||
// 定义 getToken 函数,用于从 localStorage 获取 token
|
||||
export function getToken() {
|
||||
return localStorage.getItem('authToken');
|
||||
}
|
||||
|
||||
// 定义 removeToken 函数,用于从 localStorage 删除 token
|
||||
export function removeToken() {
|
||||
localStorage.removeItem('authToken');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<heade/>
|
||||
<div></div>
|
||||
|
||||
<router-view/>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import heade from '../components/header.vue'
|
||||
// import background from '../components/background.vue'
|
||||
</script>
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'MainView', // 添加组件名称
|
||||
// 其他组件选项
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1,77 @@
|
||||
<template>
|
||||
<div v-if="name == yours" class="card-layout-1">
|
||||
<img id="card-icon-1" :src="your_icon" alt="" style="width: 50px;height:50px">
|
||||
<div class="card-color-size-1">{{ content }} {{ console.log(content) }}</div>
|
||||
</div>
|
||||
<div v-else class="card-layout-2">
|
||||
<div class="card-color-size-2">{{ content }} {{ console.log(content) }}</div>
|
||||
<img id="card-icon-2" :src="my_icon" alt="" style="width: 50px;height:50px">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
msg: ''
|
||||
}
|
||||
},
|
||||
props:{
|
||||
yours: String,
|
||||
content: String,
|
||||
name: String,
|
||||
your_icon: String,
|
||||
my_icon: String,
|
||||
},
|
||||
computed:{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.card-layout-1{
|
||||
display: flex;
|
||||
margin: 10px;
|
||||
margin-left: 30px;
|
||||
margin-top: 30px;
|
||||
/* max-width: 70%; */
|
||||
}
|
||||
.card-layout-2{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin: 10px;
|
||||
margin-right: 30px;
|
||||
margin-top: 30px;
|
||||
/* max-width: 70%; */
|
||||
}
|
||||
.card-color-size-1{
|
||||
white-space: pre-line;
|
||||
background-color: rgb(248, 248, 248);
|
||||
margin-left: 10px;
|
||||
border-radius: 10px;
|
||||
border-bottom-left-radius: 0px;
|
||||
padding: 10px;
|
||||
}
|
||||
#card-icon-1{
|
||||
align-self: flex-end;
|
||||
border: 2px solid #ff68b8;
|
||||
border-radius: 100%;
|
||||
}
|
||||
#card-icon-2{
|
||||
align-self: flex-end;
|
||||
border: 2px solid #ff68b8;
|
||||
border-radius: 100%;
|
||||
}
|
||||
.card-color-size-2{
|
||||
white-space: pre-line;
|
||||
background-color: #fcb7dc;
|
||||
margin-right: 10px;
|
||||
border-radius: 10px;
|
||||
border-bottom-right-radius: 0px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<div class="container" :style="{height: containerHeight}" @scroll="scroll_event">
|
||||
<div class="list" :style="{top: listTop}">
|
||||
<slot :show_list="getShowList" :show_height="one_height"></slot>
|
||||
<div :style="{height: barHeight}"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
start : 0,
|
||||
end : this.shownum,
|
||||
}
|
||||
},
|
||||
props:{
|
||||
shownum: Number,
|
||||
items: Array,
|
||||
one_height: Number,
|
||||
},
|
||||
computed:{
|
||||
containerHeight(){
|
||||
return this.shownum*this.one_height + 'px'
|
||||
},
|
||||
getShowList(){
|
||||
console.log(this.items.slice(this.start,this.end))
|
||||
return this.items.slice(this.start,this.end)
|
||||
},
|
||||
barHeight(){
|
||||
return this.one_height * (this.items.length-this.start-this.shownum+1) + 'px'
|
||||
},
|
||||
listTop(){
|
||||
console.log(this.items,this.shownum,this.one_height)
|
||||
return this.one_height * this.start + 'px'
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
scroll_event(e){
|
||||
const top = e.target.scrollTop
|
||||
this.start = Math.floor(top / this.one_height)
|
||||
this.end = this.start + this.shownum
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.container{
|
||||
overflow-y: scroll;
|
||||
align-items: center;
|
||||
background-color: transparent;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
scrollbar-color:#F3ABB6 #FFFF;
|
||||
/* text-align: center; */
|
||||
|
||||
/* height: 100px; */
|
||||
}
|
||||
.list{
|
||||
position: relative;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<!-- <h4>我是动效滚动</h4> -->
|
||||
<div>
|
||||
<input type="checkbox" class="honneyBtn" v-model="status" :id="cnt">
|
||||
<label for="honneyBtn" class="test">{{ status }}</label>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
status: false,
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
// 后端接口获取好友状态
|
||||
this.status = this.Status
|
||||
},
|
||||
props:{
|
||||
Status:Boolean,
|
||||
cnt:String,
|
||||
ReviseStatus2Father: Function
|
||||
// Status2:String
|
||||
},
|
||||
watch:{
|
||||
status(newvalue){
|
||||
this.status = newvalue
|
||||
this.ReviseStatus2Father(this.status)
|
||||
console.log(this.newvalue)
|
||||
},
|
||||
Status(){
|
||||
this.status = this.Status
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
:root{
|
||||
--honey-width:200px;
|
||||
--honey-height:100px;
|
||||
}
|
||||
input{
|
||||
/* display: none; */
|
||||
opacity: 0;
|
||||
width: calc(200px * 0.2);
|
||||
height: calc(100px * 0.2);
|
||||
}
|
||||
label{
|
||||
/* 圆角矩形组件 */
|
||||
display: block;
|
||||
position: relative;
|
||||
background-color:#979797;
|
||||
width: calc(200px * 0.2);
|
||||
height: calc(100px * 0.2);
|
||||
border-radius: 200px;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
transition: all 0.37s ease-in;
|
||||
|
||||
position: inherit;
|
||||
top: -50%;
|
||||
z-index: -1;
|
||||
}
|
||||
label::before{
|
||||
/* 圆角矩形里面的按钮 */
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: calc(82px * 0.2);
|
||||
height: calc(82px * 0.2);
|
||||
border-radius: 50%;
|
||||
border: calc(2px * 0.2) solid #b0b0b0;
|
||||
background-color: white;
|
||||
top: calc(7px * 0.2);
|
||||
left: calc(5px * 0.2);
|
||||
transition: all 1s ease-in;
|
||||
animation: reverse_switch 0.35s forwards;
|
||||
}
|
||||
.honneyBtn:checked + label{
|
||||
background-color: #FE4E96;
|
||||
}
|
||||
.honneyBtn:checked + label::before{
|
||||
border:calc(2px * 0.2) solid #fc5ea0;
|
||||
animation: switch 0.35s forwards;
|
||||
}
|
||||
|
||||
/* 给圆形定义关键帧 */
|
||||
@keyframes switch {
|
||||
0% {
|
||||
left: calc(4px * 0.2);
|
||||
}
|
||||
60% {
|
||||
left:calc(4px * 0.2);
|
||||
width: calc(112px * 0.2);
|
||||
}
|
||||
100%{
|
||||
left: calc(104px * 0.2);
|
||||
}
|
||||
}
|
||||
@keyframes reverse_switch {
|
||||
0% {
|
||||
left: calc(104px * 0.2);
|
||||
|
||||
}
|
||||
60%{
|
||||
left: calc(74px * 0.2);
|
||||
width: calc(112px * 0.2);
|
||||
}
|
||||
100%{
|
||||
left: calc(4px * 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
@ -0,0 +1,9 @@
|
||||
<template>
|
||||
智能推荐
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'RecommendIndex', // 添加组件名称
|
||||
// 其他组件选项
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<div class="background">
|
||||
<div class="tree">
|
||||
<TreeChart :json="treeData">
|
||||
<template v-slot:node="{ node }">
|
||||
<div class="node-info">
|
||||
<img :src="node.image_url" alt="image" class="node-image" />
|
||||
<div class="info">
|
||||
<div class="name">{{ node.name }}</div>
|
||||
<button @click="toggleNode(node)">
|
||||
{{ node.expanded ? '隐藏下一代' : '显示下一代' }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="node.expanded" class="children">
|
||||
<!-- 子节点展示 -->
|
||||
<TreeChart :json="node.children" v-if="node.children && node.children.length"/>
|
||||
</div>
|
||||
</template>
|
||||
</TreeChart>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TreeChart from "vue-tree-chart-3";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
TreeChart
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
treeData: {
|
||||
name: '爸爸',
|
||||
image_url: require('@/assets/pictures/Inbase.png'),
|
||||
expanded: true, // 默认展开
|
||||
children: [
|
||||
{
|
||||
name: 'children1',
|
||||
image_url: "https://static.refined-x.com/avat1.jpg",
|
||||
expanded: true,
|
||||
},
|
||||
{
|
||||
name: 'children2',
|
||||
image_url: "https://static.refined-x.com/avat2.jpg",
|
||||
expanded: true,
|
||||
mate: [{
|
||||
name: 'mate',
|
||||
image_url: "https://static.refined-x.com/avat3.jpg"
|
||||
}],
|
||||
children: [
|
||||
{
|
||||
name: 'grandchild',
|
||||
image_url: "https://static.refined-x.com/avat.jpg"
|
||||
},
|
||||
{
|
||||
name: 'grandchild2',
|
||||
image_url: "https://static.refined-x.com/avat1.jpg",
|
||||
expanded: true,
|
||||
children:[
|
||||
{
|
||||
name:'dd',
|
||||
image_url: "https://static.refined-x.com/avat1.jpg",
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'grandchild3',
|
||||
image_url: "https://static.refined-x.com/avat2.jpg"
|
||||
},
|
||||
{
|
||||
name:'hh',
|
||||
image_url: "https://static.refined-x.com/avat2.jpg"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'children3',
|
||||
image_url: "https://static.refined-x.com/avat.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
toggleNode(node) {
|
||||
node.expanded = !node.expanded; // 切换展开/收起
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.background {
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
background-image: url("../../assets/pictures/Inbase3.png");
|
||||
background-size: cover;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
height: 100vh;
|
||||
width: 100%;
|
||||
}
|
||||
.tree {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
width: 1100px;
|
||||
height: 700px;
|
||||
border-radius: 30px;
|
||||
margin-top: 30px;
|
||||
margin-left: 240px;
|
||||
padding-top: 100px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.node-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.node-image {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.info {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.children {
|
||||
margin-top: 20px;
|
||||
padding-left: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,9 @@
|
||||
<template>
|
||||
个人空间
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'spaceIndex', // 添加组件名称
|
||||
// 其他组件选项
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 使用组件 -->
|
||||
<Header></Header>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 导入组件
|
||||
import Header from '@/components/header.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
// 注册组件
|
||||
Header
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -0,0 +1,4 @@
|
||||
const { defineConfig } = require('@vue/cli-service')
|
||||
module.exports = defineConfig({
|
||||
transpileDependencies: true
|
||||
})
|
||||