11
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
/* 首页 hero 区域高度和间距 */
|
||||
--hero-height: 600px;
|
||||
/* hero 默认高度 */
|
||||
--hero-height-small: 200px;
|
||||
--hero-height-small: 150px;
|
||||
/* hero 收缩后高度 */
|
||||
--hero-margin-top: 5%;
|
||||
/* hero 顶部外边距 */
|
||||
@@ -68,11 +68,14 @@
|
||||
/* 菜单字体大小 */
|
||||
--font-weight-menu: bold;
|
||||
/* 菜单字体加粗 */
|
||||
--body-background-img: url('../img/8.21.1.jpg');
|
||||
/* 页面背景图片 */
|
||||
}
|
||||
|
||||
/* 页面背景设置 */
|
||||
body {
|
||||
background-image: url('../img/8.21.1.jpg');
|
||||
background-image: var(--body-background-img);
|
||||
/* 背景图片 */
|
||||
background-size: 120% 120%;
|
||||
/* 背景图片缩放比例 */
|
||||
background-repeat: no-repeat;
|
||||
@@ -180,11 +183,13 @@ p {
|
||||
display: flex;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
/* 内容通用背景区样式 */
|
||||
#allstyle {
|
||||
background-color: rgba(255, 255, 255, 0.85);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
/* 内容区样式 */
|
||||
#content-section {
|
||||
min-height: 100vh;
|
||||
@@ -300,7 +305,11 @@ p {
|
||||
--content-margin: 0;
|
||||
--leftmodlue-width: 100%;
|
||||
--nonsense-title-width: 95%;
|
||||
--nonsense-title-margin-bottom: 15px;
|
||||
--nav-padding-small: 0 8px;
|
||||
--nonsenset-margin-top: 10px;
|
||||
--body-background-img: url();
|
||||
/* 移动端不显示背景图片 */
|
||||
}
|
||||
|
||||
.elrow-top {
|
||||
@@ -349,11 +358,11 @@ p {
|
||||
|
||||
.RouterViewpage {
|
||||
width: 100%;
|
||||
margin: 5% 0 0 0;
|
||||
}
|
||||
|
||||
.nonsensetitle {
|
||||
width: var(--nonsense-title-width);
|
||||
position: relative;
|
||||
margin-top: 10%;
|
||||
padding: 10px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
<div id="content-section" :class="{ 'visible': isconts }">
|
||||
<div class="nonsensetitle" v-if="classnonsenset">
|
||||
<div class="nonsensetitleconst" v-if="windowwidth">
|
||||
<div class="nonsensetitleconst">
|
||||
<h1>发癫中QAQ</h1>
|
||||
</div>
|
||||
</div>
|
||||
@@ -105,7 +105,10 @@ const handleSelect = (key: string) => {
|
||||
*/
|
||||
const updatePageState = (url: string) => {
|
||||
classhero.value = url !== '/:type';
|
||||
classnonsenset.value = url === '/nonsense';
|
||||
console.log("当前路径是:"+url);
|
||||
classnonsenset.value = url == '/nonsense';
|
||||
console.log( classnonsenset.value);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -151,12 +154,14 @@ const handleScroll = () => {
|
||||
isconts.value = true;
|
||||
isScrollingleftmodlue.value = true;
|
||||
}
|
||||
console.log("好耶滚动了");
|
||||
};
|
||||
|
||||
/**
|
||||
* 添加滚动监听
|
||||
*/
|
||||
const addScrollListener = () => {
|
||||
console.log("添加滚动监听");
|
||||
window.addEventListener('scroll', handleScroll);
|
||||
};
|
||||
|
||||
@@ -164,6 +169,7 @@ const addScrollListener = () => {
|
||||
* 移除滚动监听
|
||||
*/
|
||||
const removeScrollListener = () => {
|
||||
console.log("移除滚动监听");
|
||||
window.removeEventListener('scroll', handleScroll);
|
||||
};
|
||||
|
||||
@@ -178,10 +184,10 @@ const handleResize = () => {
|
||||
isScrollingleftmodlue.value = true;
|
||||
classnonsenset.value = false;
|
||||
isconts.value = true;
|
||||
removeScrollListener();
|
||||
// removeScrollListener();
|
||||
} else {
|
||||
windowwidth.value = true;
|
||||
addScrollListener();
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -194,7 +200,7 @@ const setActiveIndex = (locationpathname) => {
|
||||
|
||||
// 生命周期钩子
|
||||
onMounted(() => {
|
||||
handleResize();
|
||||
handleResize(); addScrollListener();
|
||||
window.addEventListener('resize', handleResize);
|
||||
// 初始进入时如果是首页,启动打字机
|
||||
if (window.location.pathname === '/:type') {
|
||||
@@ -203,10 +209,9 @@ onMounted(() => {
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
removeScrollListener();
|
||||
// removeScrollListener();
|
||||
window.removeEventListener('resize', handleResize);
|
||||
if (heroTimer) clearInterval(heroTimer);
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
<style></style>
|
||||
@@ -5,9 +5,11 @@
|
||||
</div>
|
||||
<p>通过传来的{{ urls }}向服务器发送请求获取相关文章的链接</p>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<script setup>
|
||||
import { useRoute } from 'vue-router';
|
||||
const urls = useRoute().query
|
||||
</script>
|
||||
<style></style>
|
||||
<style>
|
||||
</style>
|
||||
@@ -13,6 +13,7 @@
|
||||
<p>{{ item.publishedAt }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
@@ -1,21 +1,65 @@
|
||||
<template>
|
||||
<div id="message_all">
|
||||
<!-- 上:标题区 -->
|
||||
<div class="message-header">
|
||||
<h1>留言板</h1>
|
||||
</div>
|
||||
<!-- 中:留言内容区 -->
|
||||
<div class="message-board">
|
||||
<!-- 留言内容区 -->
|
||||
<div class="message-list">
|
||||
<div class="message-item" v-for="msg in messages" :key="msg.id">
|
||||
<div class="message-nickname">{{ msg.nickname }}</div>
|
||||
<div class="message-content">{{ msg.content }}</div>
|
||||
<div class="message-time">{{ msg.time }}</div>
|
||||
<h3>留言板</h3>
|
||||
<div class="message-item" v-for="msg in messages" :key="msg.id" @mouseenter="hoverId = msg.id"
|
||||
@mouseleave="hoverId = null">
|
||||
<div>
|
||||
<!-- 头像 -->
|
||||
<img src="https://www.gravatar.com/avatar?d=mp&s=40" alt="头像" class="message-avatar" />
|
||||
</div>
|
||||
<div>
|
||||
<!-- 评论内容 -->
|
||||
<div class="message-item-top">
|
||||
<div class="message-nickname">{{ msg.nickname }}</div>
|
||||
<div class="message-time">{{ msg.time }}</div>
|
||||
</div>
|
||||
<div class="message-content">{{ msg.content }}</div>
|
||||
<!-- 回复按钮 -->
|
||||
<div class="message-item-bottom">
|
||||
<button class="reply-btn" @click="message_click(msg)"
|
||||
:class="{ visible: hoverId === msg.id }">回复</button>
|
||||
</div>
|
||||
<!-- 回复列表 -->
|
||||
<div v-if="msg.replies && msg.replies.length" class="replies">
|
||||
<div class="reply-item" v-for="reply in msg.replies" :key="reply.id">
|
||||
|
||||
<div>
|
||||
<!-- 头像 -->
|
||||
<img src="https://www.gravatar.com/avatar?d=mp&s=40" alt="头像" class="message-avatar" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="message-item-top ">
|
||||
<div class="message-nickname">{{ reply.nickname }}</div>
|
||||
<div class="message-time">{{ reply.time }}</div>
|
||||
</div>
|
||||
<div class="message-content">{{ reply.content }}</div>
|
||||
<!-- 回复按钮 -->
|
||||
<div class="message-item-bottom">
|
||||
<button class="reply-btn" @click="message_click(msg)"
|
||||
:class="{ visible: hoverId === msg.id }">回复</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="messages.length === 0" class="message-empty">还没有留言,快来抢沙发吧!</div>
|
||||
</div>
|
||||
<!-- 下:留言输入区 -->
|
||||
<!-- 留言输入区 -->
|
||||
<div class="message-form-section">
|
||||
<h2>发送评论(请正确填写邮箱地址,否则将会当成垃圾评论处理)</h2>
|
||||
<div v-if="message_all.id" class="reply-preview">
|
||||
<span>
|
||||
正在回复 <b>{{ message_all.nickname }}</b> 的评论 :
|
||||
</span>
|
||||
<div class="reply-preview-content">
|
||||
{{ message_all.content }}
|
||||
</div>
|
||||
<button class="reply-cancel-btn" @click="post_comment_reply_cancel">取消回复</button>
|
||||
</div>
|
||||
<el-form :model="form" label-width="0">
|
||||
<el-form-item>
|
||||
<el-input v-model="form.content" placeholder="评论内容" type="textarea" rows="4" clearable />
|
||||
@@ -31,9 +75,11 @@
|
||||
<el-input v-model="form.captcha" placeholder="验证码" clearable />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">发送</el-button>
|
||||
</el-form-item>
|
||||
<div class="form-input-row">
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">发送</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,14 +87,41 @@
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue'
|
||||
|
||||
const message_all = ref({})
|
||||
const hoverId = ref(null)
|
||||
const messages = ref([
|
||||
{ id: 1, nickname: 'A', content: '这里是A!', time: '2025-09-26 10:00' },
|
||||
{ id: 2, nickname: 'B', content: '这里是B!', time: '2025-09-26 10:05' },
|
||||
{ id: 3, nickname: 'C', content: '这里是C!', time: '2025-09-26 10:10' }
|
||||
{
|
||||
id: 1,
|
||||
nickname: 'A',
|
||||
content: '这里是A!',
|
||||
time: '2025-09-26 10:00',
|
||||
replies: [
|
||||
{
|
||||
id: 4,
|
||||
nickname: 'B',
|
||||
content: 'A,我来回复你!',
|
||||
time: '2025-09-26 10:20'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
nickname: 'B',
|
||||
content: '这里是B!',
|
||||
time: '2025-09-26 10:05',
|
||||
replies: []
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
nickname: 'C',
|
||||
content: '这里是C!',
|
||||
time: '2025-09-26 10:10',
|
||||
replies: []
|
||||
}
|
||||
])
|
||||
|
||||
const form = reactive({
|
||||
replyid: null,
|
||||
content: '',
|
||||
nickname: '',
|
||||
email: '',
|
||||
@@ -57,27 +130,51 @@ const form = reactive({
|
||||
|
||||
const onSubmit = () => {
|
||||
if (!form.content || !form.nickname) return
|
||||
messages.value.push({
|
||||
id: messages.value.length + 1,
|
||||
nickname: form.nickname,
|
||||
content: form.content,
|
||||
time: new Date().toLocaleString()
|
||||
})
|
||||
if (form.replyid) {
|
||||
// 回复模式
|
||||
const parent = messages.value.find(msg => msg.id === form.replyid)
|
||||
if (parent) {
|
||||
parent.replies = parent.replies || []
|
||||
parent.replies.push({
|
||||
id: Date.now(),
|
||||
nickname: form.nickname,
|
||||
content: form.content,
|
||||
time: new Date().toLocaleString()
|
||||
})
|
||||
}
|
||||
} else {
|
||||
// 普通留言
|
||||
messages.value.push({
|
||||
id: Date.now(),
|
||||
nickname: form.nickname,
|
||||
content: form.content,
|
||||
time: new Date().toLocaleString(),
|
||||
replies: []
|
||||
})
|
||||
}
|
||||
form.replyid = null
|
||||
form.content = ''
|
||||
form.nickname = ''
|
||||
form.email = ''
|
||||
form.captcha = ''
|
||||
message_all.value = {}
|
||||
}
|
||||
const message_click = (msg) => {
|
||||
message_all.value = msg
|
||||
form.replyid = msg.id
|
||||
// 可选:填充回复内容到输入框
|
||||
form.content = `@${msg.nickname} `
|
||||
}
|
||||
const post_comment_reply_cancel = () => {
|
||||
message_all.value = {}
|
||||
form.content = ''
|
||||
form.replyid = null
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#message_all {
|
||||
width: var(--content-width);
|
||||
margin: var(--content-margin);
|
||||
}
|
||||
|
||||
.message-header {
|
||||
background: rgba(102, 161, 216, 0.9);
|
||||
border-radius: 12px;
|
||||
padding: 20px 0;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
.message-board {
|
||||
padding: 24px 0;
|
||||
}
|
||||
|
||||
.message-list {
|
||||
@@ -88,23 +185,46 @@ const onSubmit = () => {
|
||||
min-height: 120px;
|
||||
}
|
||||
|
||||
.replies {
|
||||
margin-left: 40px;
|
||||
border-top: 2px solid #eee;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.message-item {
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 14px 18px;
|
||||
margin-bottom: 12px;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
position: relative;
|
||||
margin-left: 1%;
|
||||
}
|
||||
|
||||
.message-avatar {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
margin-right: 12px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.message-item-top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.message-nickname {
|
||||
font-weight: bold;
|
||||
color: #409eff;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.message-content {
|
||||
margin-bottom: 4px;
|
||||
color: #333;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.message-time {
|
||||
@@ -113,6 +233,30 @@ const onSubmit = () => {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.message-item-bottom {
|
||||
height: 45px;
|
||||
/* 固定高度以防跳动 */
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.reply-btn {
|
||||
background: #409eff;
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
padding: 4px 12px;
|
||||
margin-top: 4px;
|
||||
transition: background 0.2s;
|
||||
float: right;
|
||||
visibility: hidden;
|
||||
/* 默认隐藏但占位 */
|
||||
}
|
||||
|
||||
.message-item:hover .reply-btn,
|
||||
.reply-btn.visible {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.message-empty {
|
||||
color: #bbb;
|
||||
text-align: center;
|
||||
@@ -132,6 +276,38 @@ const onSubmit = () => {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.reply-preview {
|
||||
background: #f0f9ff;
|
||||
border-left: 4px solid #409eff;
|
||||
padding: 10px 16px;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 16px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.reply-preview-content {
|
||||
margin-top: 6px;
|
||||
color: #666;
|
||||
font-size: 0.98rem;
|
||||
}
|
||||
|
||||
.reply-cancel-btn {
|
||||
background: #fff;
|
||||
color: #409eff;
|
||||
border: 1px solid #409eff;
|
||||
border-radius: 6px;
|
||||
padding: 2px 10px;
|
||||
cursor: pointer;
|
||||
margin-top: 8px;
|
||||
font-size: 0.95rem;
|
||||
transition: background 0.2s, color 0.2s;
|
||||
}
|
||||
|
||||
.reply-cancel-btn:hover {
|
||||
background: #409eff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.form-input-row {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
@@ -149,7 +325,7 @@ const onSubmit = () => {
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
#message_all {
|
||||
.message-board {
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,23 +22,8 @@ import { ref } from 'vue'
|
||||
const aericleList = ref([
|
||||
{
|
||||
id: 1,
|
||||
content: '今天写代码写到怀疑人生,bug像是无穷无尽的海洋……',
|
||||
content: '嘿嘿 嘿嘿嘿(流口水ing)',
|
||||
time: '2025-09-26 09:30'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
content: '前端样式调到崩溃,为什么不同浏览器都不一样!',
|
||||
time: '2025-09-26 10:12'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
content: 'AI 说得都对,但我还是想摸鱼。',
|
||||
time: '2025-09-26 11:00'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
content: '有时候觉得自己像个 bug 生产机。',
|
||||
time: '2025-09-26 13:14'
|
||||
}
|
||||
])
|
||||
</script>
|
||||
@@ -102,7 +87,6 @@ const aericleList = ref([
|
||||
@media (max-width: 768px) {
|
||||
#aericle-style {
|
||||
padding: 14px 4px 10px 4px;
|
||||
margin: 10px 0 0 0;
|
||||
}
|
||||
.aericle-header h1 {
|
||||
font-size: 1.4rem;
|
||||
|
||||
@@ -1,336 +0,0 @@
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
||||
color: #e6e6e6;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 进度条样式 */
|
||||
.progress-container {
|
||||
width: 50px;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20px 0;
|
||||
position: relative;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
width: 20px;
|
||||
height: 70vh;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.progress-fill {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background: linear-gradient(to top, #ff416c, #ff4b2b);
|
||||
height: 0%;
|
||||
transition: height 0.3s ease;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.progress-text {
|
||||
writing-mode: vertical-rl;
|
||||
text-orientation: mixed;
|
||||
margin-top: 20px;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
font-size: 14px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
/* 内容区域样式 */
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 40px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: 20px;
|
||||
color: #ff4b2b;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 1.1rem;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 15px;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.warning {
|
||||
color: #ff416c;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 崩坏效果 */
|
||||
.corruption-effect {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
z-index: 50;
|
||||
}
|
||||
|
||||
.glitch-text {
|
||||
animation: glitch 1s infinite;
|
||||
}
|
||||
|
||||
@keyframes glitch {
|
||||
0% {
|
||||
text-shadow: 2px 2px #ff416c, -2px -2px #2bffc2;
|
||||
}
|
||||
|
||||
25% {
|
||||
text-shadow: -2px 2px #2bffc2, 2px -2px #ff416c;
|
||||
}
|
||||
|
||||
50% {
|
||||
text-shadow: 2px -2px #2bffc2, -2px 2px #ff416c;
|
||||
}
|
||||
|
||||
75% {
|
||||
text-shadow: -2px -2px #ff416c, 2px 2px #2bffc2;
|
||||
}
|
||||
|
||||
100% {
|
||||
text-shadow: 2px 2px #2bffc2, -2px -2px #ff416c;
|
||||
}
|
||||
}
|
||||
/*内容消融 */
|
||||
.dissolve {
|
||||
animation: dissolve 3s forwards;
|
||||
}
|
||||
|
||||
@keyframes dissolve {
|
||||
to {
|
||||
opacity: 0;
|
||||
transform: translateY(20px) rotate(5deg);
|
||||
}
|
||||
}
|
||||
|
||||
/* 模态框样式 */
|
||||
.modal {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
z-index: 1000;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
||||
padding: 30px;
|
||||
border-radius: 10px;
|
||||
text-align: center;
|
||||
max-width: 500px;
|
||||
width: 90%;
|
||||
border: 2px solid #ff416c;
|
||||
box-shadow: 0 0 25px #ff416c;
|
||||
}
|
||||
|
||||
.modal h2 {
|
||||
color: #ff4b2b;
|
||||
margin-bottom: 20px;
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.modal p {
|
||||
margin-bottom: 25px;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.btn {
|
||||
background: linear-gradient(to right, #ff416c, #ff4b2b);
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 12px 30px;
|
||||
border-radius: 30px;
|
||||
font-size: 1rem;
|
||||
cursor: pointer;
|
||||
transition: transform 0.3s, box-shadow 0.3s;
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
transform: translateY(-3px);
|
||||
box-shadow: 0 5px 15px rgba(255, 75, 43, 0.4);
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<!-- 进度条 -->
|
||||
<div class="progress-container">
|
||||
<div class="progress-bar">
|
||||
<div class="progress-fill" id="progressFill"></div>
|
||||
</div>
|
||||
<div class="progress-text">系统稳定性进度</div>
|
||||
</div>
|
||||
|
||||
<!-- 内容区域 -->
|
||||
<div class="content">
|
||||
<h1>系统稳定性控制面板</h1>
|
||||
<p>欢迎访问系统控制中心。本面板用于监控和维持系统稳定性。</p>
|
||||
<p class="warning">警告:系统目前处于高度不稳定状态。请勿进行任何关键操作。</p>
|
||||
<p>当前状态:<span id="statusText">监控中...</span></p>
|
||||
<p>系统完整性:<span id="integrityText">98%</span></p>
|
||||
<p>如果系统开始出现异常,请立即保存您的工作并准备撤离。</p>
|
||||
<p>倒计时直到可能的不稳定事件:<span id="countdown">00:30</span></p>
|
||||
</div>
|
||||
|
||||
<!-- 崩坏效果层 -->
|
||||
<div class="corruption-effect" id="corruptionEffect"></div>
|
||||
|
||||
<!-- 模态框 -->
|
||||
<div class="modal" id="modal">
|
||||
<div class="modal-content">
|
||||
<h2>系统崩溃</h2>
|
||||
<p>系统稳定性已降至临界水平。为防止数据丢失,系统将自动关闭。</p>
|
||||
<p>请返回主页并重新登录。</p>
|
||||
<button class="btn" id="homeBtn">返回主页</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const progressFill = document.getElementById('progressFill');
|
||||
const statusText = document.getElementById('statusText');
|
||||
const integrityText = document.getElementById('integrityText');
|
||||
const countdown = document.getElementById('countdown');
|
||||
const corruptionEffect = document.getElementById('corruptionEffect');
|
||||
const modal = document.getElementById('modal');
|
||||
const homeBtn = document.getElementById('homeBtn');
|
||||
const content = document.querySelector('.content');
|
||||
|
||||
let progress = 0;
|
||||
let countdownTime = 30;
|
||||
let corruptionActive = false;
|
||||
|
||||
// 更新倒计时显示
|
||||
function updateCountdown() {
|
||||
const minutes = Math.floor(countdownTime / 60);
|
||||
const seconds = countdownTime % 60;
|
||||
countdown.textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
|
||||
|
||||
if (countdownTime > 0) {
|
||||
countdownTime--;
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化倒计时
|
||||
setInterval(updateCountdown, 1000);
|
||||
|
||||
// 更新进度条
|
||||
const progressInterval = setInterval(() => {
|
||||
progress += 1;
|
||||
progressFill.style.height = `${progress}%`;
|
||||
|
||||
if (progress >= 70) {
|
||||
statusText.textContent = "稳定性下降";
|
||||
statusText.classList.add('warning');
|
||||
}
|
||||
|
||||
if (progress >= 85) {
|
||||
integrityText.textContent = "75%";
|
||||
}
|
||||
|
||||
if (progress >= 100) {
|
||||
clearInterval(progressInterval);
|
||||
startCorruption();
|
||||
}
|
||||
}, 100);
|
||||
|
||||
// 开始崩坏效果
|
||||
function startCorruption() {
|
||||
corruptionActive = true;
|
||||
statusText.textContent = "系统崩溃中!";
|
||||
integrityText.textContent = "23%";
|
||||
|
||||
// 添加崩坏效果
|
||||
document.body.classList.add('glitch-text');
|
||||
|
||||
// 文字颜色随机变化
|
||||
const textElements = document.querySelectorAll('p, h1, span');
|
||||
const colorInterval = setInterval(() => {
|
||||
textElements.forEach(el => {
|
||||
el.style.color = `rgb(${Math.random() * 255}, ${Math.random() * 255}, ${Math.random() * 255})`;
|
||||
});
|
||||
}, 200);
|
||||
|
||||
// 内容逐渐消融
|
||||
content.classList.add('dissolve');
|
||||
|
||||
// 显示模态框
|
||||
setTimeout(() => {
|
||||
modal.style.display = 'flex';
|
||||
clearInterval(colorInterval);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
// 返回主页按钮事件
|
||||
homeBtn.addEventListener('click', function () {
|
||||
alert('返回主页');
|
||||
// 实际应用中这里可能是 window.location.href = '/';
|
||||
});
|
||||
|
||||
// 添加一些随机崩坏效果
|
||||
function addCorruptionEffects() {
|
||||
if (!corruptionActive) return;
|
||||
|
||||
// 创建随机闪烁元素
|
||||
const effect = document.createElement('div');
|
||||
effect.style.position = 'absolute';
|
||||
effect.style.left = Math.random() * 100 + 'vw';
|
||||
effect.style.top = Math.random() * 100 + 'vh';
|
||||
effect.style.width = Math.random() * 100 + 50 + 'px';
|
||||
effect.style.height = Math.random() * 10 + 2 + 'px';
|
||||
effect.style.background = `linear-gradient(90deg,
|
||||
rgba(255, 75, 43, ${Math.random() * 0.7}),
|
||||
rgba(255, 65, 108, ${Math.random() * 0.5}))`;
|
||||
effect.style.boxShadow = '0 0 10px rgba(255, 65, 108, 0.7)';
|
||||
effect.style.opacity = Math.random() * 0.7;
|
||||
effect.style.transform = `rotate(${Math.random() * 360}deg)`;
|
||||
effect.style.pointerEvents = 'none';
|
||||
|
||||
corruptionEffect.appendChild(effect);
|
||||
|
||||
// 移除元素
|
||||
setTimeout(() => {
|
||||
if (effect.parentNode) {
|
||||
effect.parentNode.removeChild(effect);
|
||||
}
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
// 当崩坏激活时,定期添加效果
|
||||
setInterval(() => {
|
||||
if (corruptionActive) {
|
||||
for (let i = 0; i < 3; i++) {
|
||||
addCorruptionEffects();
|
||||
}
|
||||
}
|
||||
}, 300);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user