这是什么?
该组件是对聊天软件微信的手机端的聊天区域的仿制,修改自 Dr Hormress 的 >>群聊的聊天记录<<。
使用方法:
可在任意页面中使用本组件,请仔细阅读以下使用说明。
你需要填入所有未标记为“(可选)”的参数。缺少参数将会导致组件无法正常运作。
首先插入组件头。组件头包含了整个组件的样式部分以及顶部的标题栏。
[[include :scp-wiki-cn:component:wechat inc-top=--]
title=相亲相爱一家人
darkmode=true
]]
然后是聊天部分。以下为左对话框的全部参数说明。
[[include :scp-wiki-cn:component:wechat inc-left=--]
name=username1
**##var(--c-keyword)||####var(--c-builtin)|icon####var(--c-keyword)|=##**##var(--c-string)|@@http://urlhere.com@@##
color=white
content=content1
image=true
**##var(--c-keyword)||####var(--c-builtin)|image-url####var(--c-keyword)|=##**##var(--c-string)|@@http://urlhere.com@@##
reply=true
reply-name=username2
reply-content=content2
blacklist=true
]]
以下为右对话框的全部参数说明。右对话框的大部分参数均与左对话框相同,仅辨识符有区别。
[[include :scp-wiki-cn:component:wechat inc-right=--]
name=username1
**##var(--c-keyword)||####var(--c-builtin)|icon####var(--c-keyword)|=##**##var(--c-string)|@@http://urlhere.com@@##
color=white
content=content1
image=true
**##var(--c-keyword)||####var(--c-builtin)|image-url####var(--c-keyword)|=##**##var(--c-string)|@@http://urlhere.com@@##
reply=true
reply-name=username2
reply-content=content2
blacklist=true
]]
在对话的中间可以插入时间或拍一拍之类的提示语。以下为提示语的参数说明。
[[include :scp-wiki-cn:component:wechat inc-tip=--]
content=消息已发出,但被对方拒收了。
]]
最后插入组件尾。组件尾包含了聊天时的文本框。
[[include :scp-wiki-cn:component:wechat inc-end=--]
content=none
]]
示例:
多点关心多点爱
示例代码:
+ 展开代码
[[include :scp-wiki-cn:component:wechat inc-top=--]
|title=多点关心多点爱
]]
[[include :scp-wiki-cn:component:wechat inc-tip=--]
|content=20:31
]]
[[include :scp-wiki-cn:component:wechat inc-left=--]
|name=name1
|content=这是一个示例
]]
[[include :scp-wiki-cn:component:wechat inc-right=--]
|name=name2
|content=这是另一个示例
]]
[[include :scp-wiki-cn:component:wechat inc-left=--]
|name=name1
|content=😮
]]
[[include :scp-wiki-cn:component:wechat inc-right=--]
|name=name2
|content=👍
]]
[[include :scp-wiki-cn:component:wechat inc-right=--]
|name=name2
|content=这个组件好玩吧?
]]
[[include :scp-wiki-cn:component:wechat inc-left=--]
|name=name1
|content=嘿你别说,还真不错
|reply=true
|reply-name=Kcorena
|reply-content=这个组件好玩吧?
]]
[[include :scp-wiki-cn:component:wechat inc-tip=--]
|content=我拍了拍“H-Storm Z”
]]
[[include :scp-wiki-cn:component:wechat inc-tip=--]
|content=**“H-Storm Z”拍了拍我
]]
[[include :scp-wiki-cn:component:wechat inc-right=--]
|name=name2
|image=true
|image-url=@@http://darry.wikidot.com/local--files/upload/%E7%A1%AB%E9%85%B8%E9%93%9C%E6%9C%8B%E5%8F%8B@@
]]
[[include :scp-wiki-cn:component:wechat inc-tip=--]
|content=20:47
]]
[[include :scp-wiki-cn:component:wechat inc-right=--]
|name=name2
|content=看我画的像素画
]]
[[include :scp-wiki-cn:component:wechat inc-tip=--]
|content=我拍了拍“H-Storm Z”
]]
[[include :scp-wiki-cn:component:wechat inc-tip=--]
|content=21:30
]]
[[include :scp-wiki-cn:component:wechat inc-left=--]
|name=name1
|icon=@@http://scp-wiki-cn.wikidot.com/local--files/kcorena-s-artwork/netzach@@
|content=爬
]]
[[include :scp-wiki-cn:component:wechat inc-right=--]
|name=name2
|content=啥?
|blacklist=true
]]
[[include :scp-wiki-cn:component:wechat inc-tip=--]
|content=消息已发出,但被对方拒收了。
]]
[[include :scp-wiki-cn:component:wechat inc-right=--]
|name=name2
|icon=@@http://scp-wiki-cn.wikidot.com/local--files/kcorena-s-artwork/chess@@
|content=???
|blacklist=true
]]
[[include :scp-wiki-cn:component:wechat inc-tip=--]
|content=消息已发出,但被对方拒收了。
]]
[[include :scp-wiki-cn:component:wechat inc-end=--]
|content=none
]]
组件样式代码
+ 展开代码
/*
* 修改自 Dr Hormress 的信息栏组件
* http://ah-sandbox.wikidot.com/message
*/
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC&display=swap');
.sl {
position: relative;
padding: 0.5rem;
-webkit-border-radius: 0.2rem;
-moz-border-radius: 0.2rem;
border-radius: 0.2rem;
margin: 0.5rem 0 1rem 0;
width: fit-content;
width: -o-fit-content;
width: -ms-fit-content;
width: -moz-fit-content;
width: -webkit-fit-content;
color: #111111;
}
.sll {
margin-left: 0.5rem;
background-color: #ffffff;
}
.mn-container.true .sll {
background-color: #2c2c2c;
color: #d1d1d1;
}
.slr {
margin-right: 0.5rem;
text-align: left;
background-color: #9eea6a;
}
.mn-container.true .slr {
background-color: #3eb477;
color: #061d03;
}
.sl > *:nth-child(1) {
margin-top: 0;
}
.sl > *:nth-last-child(1) {
margin-bottom: 0;
}
.sl::before {
content: "";
display: block;
top: 1em;
position: absolute;
width: 0.5rem;
height: 0.5rem;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.sll::before {
left: -0.25rem;
background-color: #ffffff;
}
.mn-container.true .sll::before {
background-color: #2c2c2c;
}
.slr::before {
right: -0.25rem;
background-color: #9eea6a;
}
.mn-container.true .slr::before {
background-color: #3eb477;
}
.sl-image,
.sl-image.true+.sl {
display: none;
}
.sl-image.true {
display: block;
}
#page-content .sl-image img {
position: relative;
padding: 0.5rem;
-webkit-border-radius: 0.2rem;
-moz-border-radius: 0.2rem;
border-radius: 0.2rem;
margin: -0.25rem 0 1rem 0;
width: fit-content;
width: -o-fit-content;
width: -ms-fit-content;
width: -moz-fit-content;
width: -webkit-fit-content;
max-width: 40%;
}
.sl-reply {
background-color: #e1e1e1;
color: #626262;
text-align: left;
padding: 0.25rem 0.5rem;
margin: -0.625rem 0.5rem 1rem 0.5rem;
display: none;
width: fit-content;
width: -o-fit-content;
width: -ms-fit-content;
width: -moz-fit-content;
width: -webkit-fit-content;
}
.sl-reply.true {
display: block;
}
.sl-reply p {
margin: 0;
}
.mn-container.true .sl-reply {
background-color: #252525;
color: #929292;
}
.message {
max-width: -webkit-calc(100% - 6.5rem) !important;
max-width: -moz-calc(100% - 6.5rem) !important;
max-width: calc(100% - 6.5rem) !important;
}
.sl-container {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
}
.sl-container.alignr {
text-align: right;
-webkit-box-pack: end;
-webkit-justify-content: flex-end;
-moz-box-pack: end;
-ms-flex-pack: end;
justify-content: flex-end;
}
.sl-container.alignr .sl.slr {
margin-left: auto;
}
#page-content .user {
width: 2.5rem;
height: 2.5rem;
min-width: 2.5rem;
max-width: 2.5rem;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background-color: #ffffff;
margin-top: 0.25rem;
}
.alignl .user {
margin-left: 15px;
}
.alignr .user {
margin-right: 15px;
}
.message > p {
margin: 0;
margin-left: 0.5rem;
white-space: nowrap;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
overflow: hidden;
}
.placeholder {
width: 3.5rem;
min-width: 3.5rem;
}
.placeholder.true::before {
content: '!';
color: #ffffff;
background-color: #f43430;
font-size: 16px;
padding: 0.125rem 0.5rem;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
position: relative;
top: 1rem;
}
.alignl .placeholder.true::before {
left: 0.75rem;
}
.alignr .placeholder.true::before {
right: 0.75rem;
}
.mn-container {
background-color: #ededed;
}
.mn-container.true {
background-color: #111111;
color: #cccccc;
}
.title-container {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-moz-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
}
.title-container.hide {
display: none;
}
.titleQuit::before {
content: "\f053";
font-family: FontAwesome;
font-size: 20px;
position: relative;
left: 1rem;
top: 1rem;
}
.titleMore::before {
content: "\f141";
font-family: FontAwesome;
font-size: 20px;
position: relative;
right: 1rem;
top: 1rem;
}
.titleSelf {
font-size: 16px;
font-weight: bold;
font-family: 'Noto Sans SC', sans-serif;
}
.input-container {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
background-color: #f5f5f5;
height: 3rem;
}
.input-container.hide {
display: none;
}
.mn-container.true .input-container {
background-color: #1f1f1f;
}
.inputVoice::before {
content: "\f09e";
font-family: FontAwesome;
border: 2px solid #111111;
color: #111111;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
position: relative;
padding: 1px 3px;
margin: 1rem;
top: 1rem;
font-size: 14px;
}
.mn-container.true .inputVoice::before,
.mn-container.true .inputEmoji::before,
.mn-container.true .inputMore::before{
border-color: #f1f1f1;
color: #f1f1f1;
}
.inputVoice {
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.inputText {
background-color: #ffffff;
width: 100%;
height: 1.5rem;
margin: 0.5rem 0;
padding: 0.25rem;
font-size: 16px;
cursor: text;
}
.mn-container.true .inputText {
background-color: #282828;
}
.inputText.none {
font-size: 0;
}
.inputEmoji::before {
content: "\f118";
font-family: FontAwesome;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
position: relative;
padding: 3px;
margin: 0 0.5rem 0 1rem;
top: 0.75rem;
font-size: 24px;
}
.inputMore::before {
content: "发送";
background-color: #07bf5f;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
color: #ffffff;
position: relative;
white-space: nowrap;
padding: 0.5rem 1rem;
margin: 0 1rem 0 0.5rem;
top: 0.83rem;
font-size: 16px;
}
.inputMore.none::before {
content: "\f067";
font-family: FontAwesome;
border: 2px solid #111111;
background-color: transparent;
color: #111111;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
padding: 1px 3px;
top: 1.125rem;
font-size: 14px;
}
.tip-container {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
-moz-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
color: #8c8c8c;
margin-bottom: 1.5rem;
}
.mn-container.true .tip-container {
color: #585858;
}






