Vue3+vite2 博客前端开发

news2024/10/4 3:20:38

Vue3+vite2 博客前端开发

文章目录

  • Vue3+vite2 博客前端开发
    • 前言
    • 页面展示
    • 代码设计
      • 卡片设计
      • 背景(Particles.js粒子效果)
      • 右侧个人信息与公告
      • 内容页
      • 友链
    • 总结

前言

大家是否也想拥有一个属于自己的博客?但是如何去开发博客,怎样去开发一个好看的博客,这应该就是大家思考的问题!下面,我为大家带来了我的博客前端项目,CYBlogView|德尔佐盖特

项目地址https://github.com/itcyy/vueBlog

页面展示

主页
主页
内容页
在这里插入图片描述
友链页
在这里插入图片描述
音乐挂件
在这里插入图片描述

代码设计

卡片设计

在这里插入图片描述
html

<template>
<div>
  <div v-for="(item, index) in Data" :key="index" @select="toCardbog(item.url)" style="margin-left: 50px;">
    <RouterLink :to="item.url" target="_blank">
     <el-card class="box-card" shadow="always" >
                    <template #header>
                      <div class="card-header">
                        <span style="color: white;">{{item.title}}</span>
                      </div>
                    </template>
                    <div class="text item">{{ item.data }}</div>
                    <div class="r">
                        <div class="r">
                            <div class="text "><el-icon><View style="width: 24px;height: 24px;"/></el-icon></div>
                             <div class="num">{{ item.number }}</div>
                        </div>
                        <div class="r" style="margin-left: 400px;">
                                <div class="text"><el-icon><Clock style="width: 24px;height: 24px;"/></el-icon></div>
                                 <div class="num">{{ item.time }}</div>
                        </div>
                    </div>
                  </el-card>
    </RouterLink>
                   </div>
                    <el-pagination background layout="prev, pager, next" :total="7" style="margin-top: 20px;margin-left: 45%;"/>
</div>
</template>

js

const toCardbog = (url : string) =>{
 
}
const Data = [{
  title: "欢迎来到德尔佐盖特",
  data: "欢迎来到德尔佐盖特",
  number: "562",
  time: "2021-10-05",
  url: "/gdufe?id=4"
},
  {
    title: "如何用Vue开发前端和网站",
    data: "如何用Vue开发前端和网站...",
    number: "463",
    time: "2022-11-05",
    url:"/article?id=1"
}, {
  title: "HarmonyOS APP 开发入门",
  data: "鸿蒙并不是一个单纯的手机操作系统...",
  number: "9313",
  time: "2022-04-13",
  url: "/article?id=2",
}, {
  title: "HarmonyOS APP Text 组件",
  data: "鸿蒙并不是一个单纯的手机操作系统...",
  number: "463",
  time: "2022-11-05",
  url: "/article?id=3"
}]

css

.c{
    display: flex;
    flex-direction: column;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
  user-select: none;
}

.text {
  font-size: 14px;
  height: 20px;
  color: white;
  user-select: none;
}

.item {
  margin-bottom: 18px;
}

.box-card {
  width: 680px;
  margin-top: 20px;
  background-color: #3021211d;
  border-color: #1f1f1f;
  z-index: 33;
}
.eye-box{
    display: flex;
    flex-direction: row;
    user-select: none;
}
.num{
    margin-top: -5px;
  color: white;
  user-select: none;
}
.r{
    display: flex;
    flex-direction: row;
}

背景(Particles.js粒子效果)

html

<div>
        <Particles id="tsparticles" 
        :particlesInit="particlesInit" 
        :particlesLoaded="particlesLoaded" 
        :options="options"
        style="z-index: -1;" />
    </div>

js

import { reactive } from 'vue'
import { loadFull } from "tsparticles"
import type { Engine } from 'tsparticles-engine'

const particlesInit = async (engine: Engine) => {
    await loadFull(engine)
}

const particlesLoaded = async (container: any) => {
    console.log('Particles container loaded', container)
}

const options = reactive({
    background: {
        color: {
            value: '#111014' // 粒子颜色
        }
    },
    fpsLimit: 60,
    interactivity: {
        events: {
            onClick: {
                enable: true,
                mode: 'push' // 可用的click模式有: "push", "remove", "repulse", "bubble"。
            },
            onHover: {
                enable: true,
                mode: 'grab' // 可用的hover模式有: "grab", "repulse", "bubble"。
            },
            resize: true
        },
        modes: {
            bubble: {
                distance: 400,
                duration: 2,
                opacity: 0.8,
                size: 40
            },
            push: {
                quantity: 4
            },
            repulse: {
                distance: 200,
                duration: 0.4
            }
        }
    },
    particles: {
        color: {
            value: '#ffffff'
        },
        links: {
            color: '#ffffff', // '#dedede'。线条颜色。
            distance: 150, // 线条长度
            enable: true, // 是否有线条
            opacity: 0.5, // 线条透明度。
            width: 1 // 线条宽度。
        },
        collisions: {
            enable: false
        },
        move: {
            direction: 'none',
            enable: true,
            outMode: 'bounce',
            random: false,
            speed: 4, // 粒子运动速度。
            straight: false
        },
        number: {
            density: {
                enable: true,
                area: 800
            },
            value: 80 // 粒子数量。
        },
        opacity: {
            value: 0.5 // 粒子透明度。
        },
        shape: {
            type: 'circle' // 可用的粒子外观类型有:"circle","edge","triangle", "polygon","star"
        },
        size: {
            random: true,
            value: 5
        }
    },
    detectRetina: true
})

右侧个人信息与公告

html

<div class="app">
    <el-card class="box-card" shadow="always">
            <div><img style="width:180px;height: 180px;" src="./../assets/img/5.png"></div>
            <div><p class="text">阿诺斯·福尔迪哥德</p></div>
            <div>
            <p class="bar_text">心之所向,皆为华夏</p>
            </div>
        </el-card>
        <el-card class="box-card" shadow="always" style="height: 180px;">
                <div><p style="color: aliceblue;font-family: 华文行楷;font-size: 25px;">公告</p></div>
                <div><p style="color: white;">有问题可添加QQ咨询,QQ:2817179154</p></div>
            </el-card>
    </div>

css

.app{
   display: flex;
   flex-direction: column;
   margin-left: 50px;
}
.text {
   font-size: 14px;
}

.item {
   padding: 18px 0;
}

.box-card {
   width: 210px;
   margin-left: 20px;
   background-color: #3021211d;
   margin-top: 20px;
   height: 280px;
   display: flex;
   border-color:#1f1f1f;
   justify-content: space-around;
}
.text{
   font-size: 18px;
   font-family:华文行楷;
   text-align: center;
   color: white;
}
.textpo{
   font-family: 楷体;
   text-align: center;
}
.bar_text{
   font-family: 华文楷体;
   text-align: center;
   margin-top: 20px;
   color: white;
   user-select: none;
}

内容页

html

    <div id="md">

        <div class="tarmd">
            <MdEditor v-model="text" previewOnly :previewTheme="theme"
                style="padding: 20px 20px 20px 20px;background-color: #55000000;border-radius: 20px;" />
                <UserView></UserView>
        </div>

    </div>

js

import { onMounted } from 'vue';
import { useRouter } from 'vue-router';
import UserView from '../../tool/UserView.vue'
import MdEditor from 'md-editor-v3';
import 'md-editor-v3/lib/style.css';
import {setmd} from "../../static/index.ts"
const router = useRouter();
let fileid = router.currentRoute.value.query.id
console.log(fileid)
const File = ''
const theme = "mk-cute"
const text = setmd(fileid)
</script>
<style>
#md {
    width: 1200px;
    position: relative;
    top: 80px;
}
.tarmd{
    display: flex;
    flex-direction: row;

}
img > p{
    width: 200%;
    height: 200%;
}

友链

html

 <div class="top_1">
      <div class="row_f"> 

        <div class="card_g">
            <h1 style="font-family: 华文琥珀;">友情链接</h1>
            <h2 style="font-family: 华文琥珀;margin-top: 20px;margin-bottom: 20px;">框架(1)</h2>
     
            <div class="boxv">
                <div class="box1 v2"><a href="https://cn.vuejs.org/" target="_blank"><img style="opacity: 0.5;width: 210px;height: 140px;border-radius: 10px;z-index: 1;" src="https://img2.baidu.com/it/u=2167395474,3773933499&fm=253&fmt=auto&app=138&f=PNG?w=1018&h=500" ></a>
               </div>
               <p style="text-align: center;font-size: 15px;">Vue3</p>
            </div>
            <h2 style="font-family: 华文琥珀;margin-top: 20px;margin-bottom: 20px;">推荐博客(2)</h2>
            <div class="r_f">
                 <div class="boxv">
                        <div class="box1"><a href="https://www.itcyy.cn" target="_blank"><img style="opacity: 0.5;width: 210px;height: 140px;border-radius: 10px;z-index: 1;" src="https://img1.baidu.com/it/u=731412532,1390130133&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500" ></a>
                       </div>
                       <p style="text-align: center;font-size: 15px;">德尔佐盖特</p>
                    </div>
                    <div class="boxv">
                            <div class="box1"><a href="https://miaoyoh.github.io/" target="_blank"><img style="opacity: 0.5;width: 210px;height: 140px;border-radius: 10px;z-index: 1;" src="https://i.postimg.cc/NM6JZhJh/QQ-20230318213213.png" ></a>
                           </div>
                           <p style="text-align: center;font-size: 15px;" target="_blank">Winghau's Blog</p>
                        </div>
            </div>
        <h2 style="font-family: 华文琥珀;margin-top: 20px;margin-bottom: 20px;">我的友链</h2>
        <div >
            <MdEditor v-model="text1" previewOnly :previewTheme="theme" style="padding: 20px 20px 20px 20px;background-color: #55000000;"/>
        </div>
        </div>
      </div>
    </div>

css

.box1{
    border-radius: 10px;
    width: 100%;
    height: 160px;
}
.urlText{
    font-size:13px;
    color: #fff;
}
.v1{
    display: none;
}
.v2:hover+div{
    display: block;
}
.boxv{
    border-radius: 10px;
    width: 210px;
    height: 160px;
    margin-left: 20px;
}
.top_1{
  position: relative;

  top: 80px;

}
.row_f{
    display: flex;
    flex-direction: column;
    width: 1200px;
    border-radius: 8px;

}
.r_f{
    display: flex;
    flex-direction: row;
}
.card_Bar{
     display: flex;
    justify-content: space-around;
    align-items: center;
}
.card_g{
    height: 900px;
    background-color: #00000000;
     width: 100%;
     margin-top: 30px;
}
.len_g{
    height: 40px;
    margin-top: 20px;
    border-radius: 30px;
    width: 350px;
    background-color: #3316161a;
    display: flex;
    justify-content: space-around;
    align-items: center;
    
}
.text_dogg{
    color: white;
    text-align: center;
    user-select: none;
    fon

js

import { ElMessage } from 'element-plus'
import { ref } from 'vue';
import MdEditor from 'md-editor-v3';
import 'md-editor-v3/lib/style.css';
import data from "../../static/friends.md?raw"
const theme = "mk-cute"
const text1 = data
const components = {name: "Friends"}
var text = "1"

总结

篇幅有限,只能分享到这里,更多可以在github中获得。推荐文章:程序员
再见

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/421956.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

新一代AI带来更大想象空间!上海将打造元宇宙超级场景!

引子 上海市经信委主任吴金城4月12日在“2023上海民生访谈”节目表示&#xff0c;上海将着力建设元宇宙智慧医院、前滩东体元宇宙、张江数字孪生未来之城等元宇宙超级场景。 吴金城说&#xff0c;新一代人工智能将带来更大的想象空间。比如&#xff0c;人工智能和元宇宙数字人的…

实验7---myBatis和Spring整合

实验七 myBatis和Spring整合 一、实验目的及任务 通过该实验&#xff0c;掌握mybatis和spring整合方法&#xff0c;掌握生成mapper实现类的两种生成方式。 二、实验环境及条件 主机操作系统为Win10&#xff0c;Tomcat,j2sdk1.6或以上版本。 三、实验实施步骤 略 四、实验报告内…

wait()、sleep()、notify()的解析

wait()、sleep()、notify()的解析 【&#x1f388;问题1】&#xff1a;wait()、sleep()、notify()有什么作用&#xff1f;【&#x1f388;问题2】&#xff1a;wait()、sleep()的区别&#xff1f;【&#x1f388;问题3】&#xff1a;为什么 wait() 方法不定义在 Thread 中&…

九龙证券|今年最贵新股来了,本周还有超低价新股可申购

本周&#xff08;4月17日—4月21日&#xff09;&#xff0c;截至现在&#xff0c;共有3只新股将进行申购&#xff0c;别离为科创板的晶合集成、创业板的三博脑科、北交所的华原股份。其间华原股份将于周一申购&#xff0c;发行价为3.93元/股&#xff0c;晶合集成将于周四申购&a…

全国青少年软件编程(Scratch)等级考试一级考试真题2023年3月——持续更新.....

一、单选题(共25题&#xff0c;共50分) 1. 下列说法不正确的是&#xff1f;&#xff08; &#xff09; A.可以从声音库中随机导入声音 B.可以录制自己的声音上传 C.可以修改声音的大小 D.不能修改声音的速度 试题解析&#xff1a;针对声音可以进行导入&#xff0c;上传&…

Android 不同分辨率下的Drawable尺寸资源设置

启动器图标 36x36 (0.75x) 用于低密度48x48&#xff08;1.0x 基线&#xff09;用于中密度72x72 (1.5x) 用于高密度96x96 (2.0x) 用于超高密度144x144 (3.0x) 用于超超高密度192x192 (4.0x) 用于超超超高密度&#xff08;仅限启动器图标&#xff1b;请参阅上面的 注&#xff09…

redis 主从模式、哨兵模式、cluster模式的区别

参考&#xff1a; ​https://blog.csdn.net/qq_41071876/category_11284995.html https://blog.csdn.net/weixin_45821811/article/details/119421774 https://blog.csdn.net/weixin_43001336/article/details/122816402 Redis有三种模式&#xff0c;分别是&#xff1a;主…

【C++】STL——用一个哈希表封装出unordered_map和unordered_set

用一个哈希表(桶)封装出unordered_map和unordered_set 文章目录用一个哈希表(桶)封装出unordered_map和unordered_set一、哈希表源码二、哈希函数模板参数的控制三、对上层容器构建仿函数便于后续映射四、string类型无法取模问题五、哈希表默认成员函数实现1.构造函数2.拷贝构造…

【JavaEE】ConcurrentHashMap与Hashtable有什么区别?

博主简介&#xff1a;努力的打工人一枚博主主页&#xff1a;xyk:所属专栏: JavaEE初阶Hashtable、ConcurrentHashMap是使用频率较高的数据结构&#xff0c;它们都是以key-value的形式来存储数据&#xff0c;且都实现了Map接口&#xff0c;日常开发中很多人对其二者之间的区别并…

Jmeter实验

Jmeter实验 启动Jmeter 点击bin目录下的&#xff0c;jmeter进行启动 修改界面语言为中文 发起一个最基本的请求 线程组&#xff0c;Http请求&#xff0c;察看结果树 察看结果树的作用范围 设置请求跟随重定向 响应断言-响应文本 判断响应文本中是否有"百度一…

Scala大数据开发

版权声明 本文原创作者&#xff1a;谷哥的小弟作者博客地址&#xff1a;http://blog.csdn.net/lfdfhl Scala简述 在此&#xff0c;简要介绍 Scala 的基本信息和情况。 Scala释义 Scala 源自于英语单词scalable&#xff0c;表示可伸缩的、可扩展的含义。 Scala作者 Scala编…

UDS介绍

首先要有网络网络七层的概念&#xff1a; 学习链接&#xff1a; 七层网络模型-CSDN博客 UDS网络层/TP层&#xff08;ISO 15765-2&#xff09;的解读 - 知乎 (zhihu.com) 概念&#xff1a; UDS&#xff08;Unified Diagnostic Services&#xff0c;统一的诊断服务。 标准名是《…

【栈和队列高频考点题】

目录 1 与栈有关的考题 1.1 最小栈 1.2 栈的弹出压入序列 1.3 逆波兰表达式求值 1.4 二叉树的最近公共祖先 1.5 单调栈 2 与队列有关的考题 2.1 二叉树的分层遍历 2.2 滑动窗口 1 与栈有关的考题 1.1 最小栈 题目描述&#xff1a; 解题思路&#xff1a; 要想在O(1…

微信小程序引入 vant ui组件

1.初始化 在小程序根目录&#xff08;app.js所在目录&#xff09;&#xff0c;打开cmd命令窗口 npm init -y参数 -y 表示对 npm 要求提供的信息&#xff0c;都自动按下回车键&#xff0c;表示接受默认值。 2.下载miniprogram依赖 通过 npm 安装: npm i vant/weapp -S --p…

京东开源RaftKeeper性能超越ZooKeeper!

一、背景介绍 成百上千台服务器组成的分布式系统中&#xff0c;服务器故障或网络抖动会随时发生&#xff0c;有时会导致严重的系统崩溃&#xff0c;为解决如上问题&#xff0c;雅虎开源了ZooKeeper分布式协调服务并在2010年成为Apache顶级项目&#xff0c;是Hadoop、HBase和Cl…

为什么FTP会随着时间的过去而变慢?

有人问&#xff1a;我在XP上有FZ客户端3.5.3&#xff0c;在Vista上有0.9.41服务器。通过已经很慢的连接传输大文件时&#xff0c;我注意到速度开始时约为40kb / s&#xff0c;但逐渐趋于稳定&#xff0c;约为20kb / s&#xff0c;并保持这种状态。如果我退出客户端并重新启动它…

夜天之书 #81 大厂开源之殇

本轮开源之风吹起迄今数年&#xff0c;最大的影响还是越来越多的商业公司开始探索开源方法能够如何改变自己的经营策略。开源策略循序渐进分成使用、参与和发起。在发起开源项目实践一线的&#xff0c;一个是打着开源旗号的创业公司&#xff0c;另一个就是大型企业尤其互联网企…

JUC并发编程之AQS原理

1. AQS 原理 1.1 概述 全称是 AbstractQueuedSynchronizer&#xff0c;是阻塞式锁和相关的同步器工具的框架 特点&#xff1a; 用 state 属性来表示资源的状态&#xff08;分独占模式和共享模式&#xff09;&#xff0c;子类需要定义如何维护这个生态&#xff0c;控制如何获…

剪枝与重参第六课:基于VGG的模型剪枝实战

目录基于VGG的模型剪枝实战前言1.Intro2.Prune实战2.1 说明2.2 test()2.3 加载稀疏训练模型2.4 前处理2.5 建立新模型并存储信息2.6 BatchNorm层的剪枝2.7 Conv2d的剪枝2.8 Linear的剪枝3.基于VGG的模型剪枝总结基于VGG的模型剪枝实战 前言 手写AI推出的全新模型剪枝与重参课程…

快排的递归实现

快速排序是一种时间复杂度低&#xff0c;但会虽随着数组的顺序变化&#xff0c;因为其效率之高被称为快速排序&#xff0c;而 且其不稳定性也可以同过优化进行解决。 快速排序的实现有三种方法&#xff1a; 1.hoare版 其基本思想为&#xff1a;任取待排序元素序列中 的某元…