Files
PC-Light-Forum/css/edit.less
A1300399510 f7af6d4046 feat(editor): 实现自定义居中按钮并优化媒体上传处理
- 添加自定义居中按钮功能,替换原生的居中实现
- 修改图片和视频上传后的URL格式,附加aid参数
- 优化媒体资源提取逻辑,处理URL中的查询参数
- 调整编辑器工具栏的z-index样式
- 移除不必要的position属性
2025-11-27 02:50:45 +08:00

483 lines
15 KiB
Plaintext

#edit {
margin: 0 auto;
a {
text-decoration: none;
}
.edit-head {
width: 100%;
height: 60px;
background: linear-gradient(180deg, rgba(255, 255, 255, 1) -41%, rgba(238, 248, 249, 1) 96%);
margin-bottom: 20px;
.edit-head-container {
width: 1200px;
margin: 0 auto;
.icon {
width: 135px;
height: 33px;
margin-right: 20px;
}
.dot {
width: 6px;
height: 6px;
background-color: #d35110;
border-radius: 50%;
margin-right: 20px;
}
.title {
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
font-weight: 650;
font-style: normal;
font-size: 18px;
color: #000000;
margin-right: 20px;
}
.hint {
font-size: 13px;
color: #aaaaaa;
}
.avatar {
width: 32px;
height: 32px;
border-radius: 50%;
}
}
}
.edit-container {
width: 890px;
background-color: rgba(255, 255, 255, 1);
border: 1px solid rgba(233, 238, 242, 1);
border-radius: 10px;
margin: 0 auto;
.title-box {
position: relative;
.title-input {
width: 100%;
height: 100px;
border: none;
outline: none;
border-radius: 10px 10px 0 0;
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
font-weight: 650;
font-style: normal;
font-size: 24px;
padding: 0 36px;
border-bottom: 1px solid #ebebeb;
}
.sum {
position: absolute;
bottom: 5px;
right: 5px;
color: #555;
font-size: 14px;
}
}
#editor—wrapper {
z-index: 100;
.bold {
font-weight: bold;
}
.editor-toolbar {
height: 36px;
line-height: 36px;
background-color: rgba(251, 251, 251, 1);
padding-left: 25px;
position: sticky;
top: 0;
// z-index: 10;
z-index: 1;
.w-e-panel-content-emotion {
width: 490px;
}
.w-e-bar-item-group .w-e-bar-item-menus-container {
margin-top: 30px;
}
> .w-e-bar {
background-color: transparent;
}
.w-e-toolbar {
padding: 0;
// .w-e-bar-item {
// padding: 0 10px;
// }
> .w-e-bar-item {
margin-right: 40px;
> button {
color: #000000;
padding: 0 10px;
}
}
}
.toolbar-item {
.icon {
width: 16px;
height: 16px;
margin-right: 5px;
}
cursor: pointer;
height: 30px !important;
line-height: 30px !important;
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
font-weight: 400;
font-style: normal;
font-size: 14px;
color: #000000;
line-height: 23px;
margin-right: 40px;
// position: relative;
padding: 0;
> button {
padding: 0 10px;
border-radius: 50px;
&.active {
background-color: rgba(246, 246, 189, 1);
}
}
.file {
opacity: 0; /* 隐藏输入框 */
background: transparent;
border: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
cursor: pointer;
&::after {
content: "";
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
}
&.expression.pitch {
.emoji-box-mask {
display: block;
}
.emoji-box {
display: flex;
}
}
.link-box-mask,
.emoji-box-mask {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
// background-color: rgba(0, 0, 0, 0.20392157);
display: none;
}
.link-box-mask {
background: transparent;
}
.emoji-box {
width: 582px;
border-radius: 8px;
background-color: #fff;
filter: drop-shadow(0 0 11px rgba(0, 0, 0, 0.1));
top: 45px;
position: absolute;
z-index: 1;
left: 50%;
transform: translateX(-50%);
border: 1px solid #ebebeb;
display: none;
flex-wrap: wrap;
font-size: 22px;
padding: 8px;
&::after {
content: "";
width: 0;
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-bottom: 8px solid #ffffff;
position: absolute;
top: -8px;
left: 50%;
transform: translateX(-50%);
}
.emoji-icon {
margin: 5px;
cursor: pointer;
}
}
&.link {
&.pitch {
.link-box-mask {
display: block;
}
.link-box {
display: flex;
}
}
.link-box {
background-color: rgba(255, 255, 255, 1);
border-radius: 6px;
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.168627450980392);
width: 336px;
height: 282px;
position: absolute;
top: 30px;
left: 0%;
z-index: 1;
border: 1px solid #ebebeb;
display: none;
flex-direction: column;
padding: 18px 20px 0;
.item {
margin-bottom: 22px;
flex-direction: column;
.name {
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
font-weight: 400;
font-style: normal;
font-size: 14px;
color: #555555;
line-height: 26px;
margin-bottom: 8px;
}
.input {
height: 36px;
border: 1px solid rgba(215, 215, 215, 1);
border-radius: 7px;
padding: 0 10px;
font-size: 14px;
color: #000000;
}
}
.btn {
width: 72px;
height: 40px;
line-height: 40px;
background-color: rgba(80, 227, 194, 1);
border-radius: 8px;
margin-left: auto;
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
font-weight: 650;
font-style: normal;
font-size: 16px;
color: #000000;
margin-top: 8px;
&:hover {
background-color: rgb(35, 224, 182);
}
}
}
}
&.h2 {
&.pitch {
background-color: rgba(246, 246, 189, 1);
}
}
&.active {
> button {
background-color: rgba(246, 246, 189, 1);
}
}
}
}
#editor-container {
min-height: 500px;
max-height: 80vh;
font-size: 18px;
line-height: 26px;
color: #333333;
a {
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
text-decoration: underline;
color: #04b0d5;
}
}
}
.content-input {
min-height: 509px;
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
font-size: 15px;
color: #555555;
line-height: 26px;
outline: none;
padding: 36px 36px 20px;
white-space: break-spaces;
position: relative;
max-height: 80vh;
overflow: auto;
&.empty:before {
content: "输入正文";
pointer-events: none;
position: absolute;
top: 36px;
left: 36px;
color: rgba(117, 117, 117, 1);
}
img {
display: block;
max-width: 100%;
height: 220px;
}
h2 {
color: #000000;
font-size: 18px;
line-height: 30px;
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
font-weight: 650;
}
.blue {
color: #026277;
margin: 0 4px;
}
.fill {
width: 100%;
height: 26px;
}
a {
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
font-size: 15px;
text-decoration: underline;
color: #04b0d5;
}
}
.tags-list {
padding: 0 36px;
margin-bottom: 10px;
flex-wrap: wrap;
.tag-item {
margin-bottom: 10px;
height: 32px;
line-height: 32px;
background-color: rgba(246, 246, 246, 1);
border-radius: 73px;
padding: 0 14px;
font-size: 14px;
color: #606060;
margin-right: 10px;
cursor: pointer;
}
}
.action-buttons {
border-top: 1px solid #ebebeb;
padding: 0 36px;
justify-content: space-between;
.left-section {
.icon-pitch {
width: 16px;
height: 16px;
margin-right: 5px;
}
.icon {
width: 16px;
height: 16px;
border: 1px solid #797979;
margin-right: 5px;
}
font-size: 14px;
color: #333;
cursor: pointer;
}
.right-section {
height: 102px;
.draft-btn,
.publish-btn {
font-size: 14px;
border-radius: 8px;
cursor: pointer;
}
.draft-btn {
width: 100px;
height: 42px;
line-height: 42px;
background-color: rgba(242, 242, 242, 0.698039215686274);
color: #7f7f7f;
font-size: 14px;
margin-right: 15px;
transition: background-color 0.3s ease;
.icon {
width: 20px;
height: 20px;
margin-right: 6px;
}
&:hover {
background-color: rgb(235, 235, 235);
}
}
.publish-btn {
width: 150px;
height: 40px;
line-height: 40px;
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
font-weight: 650;
font-style: normal;
font-size: 16px;
color: #000000;
background-color: rgba(80, 227, 194, 1);
transition: background-color 0.3s ease;
&:hover {
background-color: rgba(64, 209, 170, 1);
}
}
}
}
}
}