kun-galgame-vue/src/views/edit/Edit.vue

269 lines
6.7 KiB
Vue
Raw Normal View History

2023-05-01 15:58:54 +00:00
<script setup lang="ts">
2023-05-10 16:46:20 +00:00
import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
import WangEditor from '@/components/WangEditor.vue'
2023-05-01 15:58:54 +00:00
</script>
<template>
2023-06-07 06:15:14 +00:00
<div class="root">
2023-05-01 15:58:54 +00:00
<!-- 头部 -->
2023-05-10 16:46:20 +00:00
<KUNGalgameTopBar />
2023-05-01 15:58:54 +00:00
<!-- 内容区容器 -->
<div class="container">
<!-- 内容区容器 -->
<div class="content-wrapper">
<!-- 内容区的头部 -->
<div class="content-header">
<!-- 帖子的标题 -->
<div class="topic-title">
<input type="text" placeholder="请输入帖子的标题40字以内" />
</div>
</div>
<!-- 编辑器 -->
<WangEditor class="editor" />
2023-05-01 15:58:54 +00:00
</div>
<!-- 内容区的底部 -->
<div class="content-footer">
<!-- 标签的总容器 -->
<div class="tags-container">
<!-- 标签输入框 -->
<input
type="text"
2023-05-10 16:46:20 +00:00
placeholder="请输入帖子的关键词(单个关键词 10 个字符以内,至少选择一个、最多 7 个), 输入文字按下 ' Enter ' 创建关键词"
2023-05-01 15:58:54 +00:00
/>
2023-05-10 16:46:20 +00:00
<!-- 标签的提示词 -->
<div class="tags-info">热门关键词点击选择:</div>
2023-05-01 15:58:54 +00:00
<!-- 标签容器 -->
<div class="tags">
<span>啊这可海星</span>
<span>啊这可海星</span>
<span>啊这可海星</span>
<span>啊这可海星</span>
<span>啊这可海星</span>
<span>啊这可海星</span>
<span>啊这可海星</span>
<span>啊这可海星</span>
<span>啊这可海星</span>
<span>啊这可海星</span>
</div>
</div>
<!-- 话题分类的容器 -->
<div class="topic-group">
<div>点击选择帖子的分区可多选:</div>
<!-- 分类容器的按钮集合 -->
<div class="group-btn">
<button>galgame</button>
<button>技术交流</button>
<button>其它</button>
</div>
</div>
<!-- 按钮的容器 -->
<div class="btn-container">
<!-- 确认按钮 -->
<button class="confirm-btn">确认发布</button>
2023-05-10 16:46:20 +00:00
<!-- 预览编辑 -->
<button class="preview-btn">预览结果</button>
2023-05-01 15:58:54 +00:00
<!-- 保存按钮 -->
<button class="save-btn">保存草稿</button>
</div>
</div>
</div>
<!-- 版权 -->
<div class="copyright">
<span>Copyright © 2023 KUNgalgame</span>
<span>All rights reserved | Version 0.01</span>
</div>
</div>
</template>
2023-05-25 07:55:30 +00:00
<style lang="scss" scoped>
2023-05-01 15:58:54 +00:00
.content-wrapper {
margin: 0 auto;
}
.root {
height: 100vh;
min-height: 1100px;
2023-05-10 16:46:20 +00:00
min-width: 900px;
2023-05-01 15:58:54 +00:00
display: flex;
flex-direction: column;
}
/* 内容部分的总容器 */
.container {
2023-05-10 16:46:20 +00:00
width: 80%;
height: 100%;
2023-05-01 15:58:54 +00:00
margin: auto;
/* 容器的阴影 */
2023-06-05 06:32:08 +00:00
box-shadow: var(--shadow);
2023-06-06 09:44:11 +00:00
background-color: var(--kungalgame-trans-white-2);
2023-06-05 06:32:08 +00:00
color: var(--kungalgame-font-color-3);
2023-05-01 15:58:54 +00:00
}
/* 容器的顶部 */
.content-header {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
/* 顶部的固定高度 */
height: 90px;
}
/* 帖子的发布标题 */
.topic-title {
2023-05-10 16:46:20 +00:00
width: 97%;
2023-05-01 15:58:54 +00:00
}
/* 帖子标题的输入框 */
.topic-title input {
2023-06-05 06:32:08 +00:00
color: var(--kungalgame-font-color-2);
2023-05-01 15:58:54 +00:00
/* 距离外轮廓的距离 */
padding: 7px;
/* 内边距盒子 */
box-sizing: border-box;
width: 100%;
/* 标题输入字体大小 */
font-size: 40px;
2023-06-05 06:32:08 +00:00
border: 1px solid var(--kungalgame-blue-4);
background-color: var(--kungalgame-trans-white-9);
2023-05-01 15:58:54 +00:00
}
/* 标题输入框 focus 之后的样式 */
.topic-title input:focus {
2023-06-05 06:32:08 +00:00
box-shadow: 0px 0px 5px var(--kungalgame-blue-4);
2023-05-01 15:58:54 +00:00
}
/* 内容区的底部样式 */
.content-footer {
/* 距离内容区的距离 */
margin-top: 17px;
display: flex;
flex-direction: column;
2023-05-10 16:46:20 +00:00
align-items: center;
2023-05-01 15:58:54 +00:00
}
/* 标签的总容器 */
.tags-container {
2023-05-10 16:46:20 +00:00
width: 97%;
2023-05-01 15:58:54 +00:00
}
/* 标签输入框 */
.tags-container input {
2023-06-05 06:32:08 +00:00
background-color: var(--kungalgame-trans-white-9);
2023-05-01 15:58:54 +00:00
/* 输入标签的字体 */
font-size: 17px;
width: 100%;
box-sizing: border-box;
2023-06-05 06:32:08 +00:00
border: 1px solid var(--kungalgame-blue-4);
2023-05-01 15:58:54 +00:00
padding: 5px;
}
/* 标签输入框 focus */
.tags-container input:focus {
2023-06-05 06:32:08 +00:00
box-shadow: 0px 0px 3px var(--kungalgame-blue-4);
2023-05-01 15:58:54 +00:00
}
2023-05-10 16:46:20 +00:00
.tags-info {
margin: 10px 0;
}
2023-05-01 15:58:54 +00:00
/* 单个标签容器 */
.tags {
2023-05-10 16:46:20 +00:00
display: flex;
flex-wrap: wrap;
2023-05-01 15:58:54 +00:00
}
/* 单个标签的样式 */
.tags > span {
2023-05-10 16:46:20 +00:00
margin: 5px;
display: block;
white-space: nowrap;
2023-05-01 15:58:54 +00:00
font-size: 14px;
padding: 3px;
2023-06-05 06:32:08 +00:00
background-color: var(--kungalgame-trans-blue-1);
2023-05-01 15:58:54 +00:00
cursor: pointer;
}
.tags > span:hover {
2023-06-05 06:32:08 +00:00
background-color: var(--kungalgame-trans-red-1);
2023-05-01 15:58:54 +00:00
}
/* 话题分类的容器 */
.topic-group {
/* 相对于标签容器的占比 */
2023-05-10 16:46:20 +00:00
width: 97%;
margin: 10px 0;
2023-05-01 15:58:54 +00:00
}
/* 分类容器的按钮集合 */
.group-btn {
height: 100%;
display: flex;
justify-content: space-between;
2023-05-10 16:46:20 +00:00
margin: 20px 0;
2023-05-01 15:58:54 +00:00
}
/* 单个按钮的样式 */
.group-btn > button {
height: 30px;
width: 20%;
font-size: 17px;
cursor: pointer;
2023-06-05 06:32:08 +00:00
border: 1px solid var(--kungalgame-purple-4);
background-color: var(--kungalgame-trans-purple-1);
color: var(--kungalgame-purple-4);
2023-05-01 15:58:54 +00:00
}
/* 按钮的容器 */
.btn-container {
2023-05-10 16:46:20 +00:00
width: 97%;
2023-05-01 15:58:54 +00:00
display: flex;
justify-content: space-between;
align-items: center;
/* 距离最底端的距离 */
2023-05-10 16:46:20 +00:00
margin-bottom: 20px;
2023-05-01 15:58:54 +00:00
}
/* 单个按钮的样式 */
.btn-container button {
height: 40px;
width: 27%;
font-size: 20px;
white-space: nowrap;
overflow: hidden;
cursor: pointer;
2023-06-06 09:44:11 +00:00
&:hover {
color: var(--kungalgame-white);
}
2023-05-01 15:58:54 +00:00
}
/* 确认按钮的样式 */
.confirm-btn {
2023-06-05 06:32:08 +00:00
color: var(--kungalgame-blue-4);
background-color: var(--kungalgame-trans-blue-1);
border: 1px solid var(--kungalgame-blue-4);
2023-05-01 15:58:54 +00:00
}
.confirm-btn:hover {
2023-06-05 06:32:08 +00:00
background-color: var(--kungalgame-blue-4);
2023-05-01 15:58:54 +00:00
transition: 0.1s;
}
.confirm-btn:active {
2023-06-05 06:32:08 +00:00
background-color: var(--kungalgame-blue-2);
2023-05-10 16:46:20 +00:00
transform: scale(0.8);
}
/* 预览按钮的样式 */
.preview-btn {
2023-06-05 06:32:08 +00:00
color: var(--kungalgame-red-4);
background-color: var(--kungalgame-trans-red-1);
border: 1px solid var(--kungalgame-red-4);
2023-05-10 16:46:20 +00:00
}
.preview-btn:hover {
2023-06-05 06:32:08 +00:00
background-color: var(--kungalgame-red-4);
2023-05-10 16:46:20 +00:00
transition: 0.1s;
}
.preview-btn:active {
2023-06-05 06:32:08 +00:00
background-color: var(--kungalgame-red-2);
2023-05-10 16:46:20 +00:00
transform: scale(0.8);
2023-05-01 15:58:54 +00:00
}
/* 保存按钮的样式 */
.save-btn {
2023-06-05 06:32:08 +00:00
color: var(--kungalgame-orange-4);
background-color: var(--kungalgame-trans-orange-1);
border: 1px solid var(--kungalgame-orange-4);
2023-05-01 15:58:54 +00:00
}
.save-btn:hover {
2023-06-05 06:32:08 +00:00
background-color: var(--kungalgame-orange-4);
2023-05-01 15:58:54 +00:00
transition: 0.1s;
}
.save-btn:active {
2023-06-05 06:32:08 +00:00
background-color: var(--kungalgame-orange-2);
2023-05-10 16:46:20 +00:00
transform: scale(0.8);
2023-05-01 15:58:54 +00:00
}
/* 版权 */
.copyright {
margin: 0 auto;
margin-bottom: 17px;
}
</style>