
[[div style="display: none"]]
[[/div]]这是什么?
这是社交平台风格文本框组件。它的创意来源于 Kankan 和 7happy7 设计的 Twitter 组件,使用现代 CSS 布局彻底重构了内部结构,并面向 The Backrooms JP Wiki 重新设计了功能和显示效果。
以下为本组件的相关页面。
使用方法
首先,在你页面中的某个位置(建议放在页面顶部,方便查看)插入以下内容。
常规使用
[[include :backrooms-wiki-cn:component:sns-settings]]
在深色页面中使用
[[include :backrooms-wiki-cn:component:sns-settings darkmode=a]]
在除 The Ourrooms 以外的社交平台风格页面中使用
点赞()和点踩()按钮会相应变成转发()和喜欢()按钮,更像 𝕏(原推特)的界面。
[[include :backrooms-wiki-cn:component:sns-settings common-sns=a]]
在除 The Ourrooms 以外的深色社交平台风格页面中使用
[[include :backrooms-wiki-cn:component:sns-settings darkmode=a|common-sns=a]]
这样就引入了社交平台的相关样式。在此基础上,只需要插入以下代码:
[[include :backrooms-wiki-cn:component:sns-post
|account-id=@i2wot
|account-image=http://japan-backrooms-storage.wdfiles.com/local--files/file%3A3358370-72-7b3u/sns01_icon_outlet.jpg
|time=1 day
|locate-link=level-110-n
|locate-name=Level 110 N
|content=文本01
|attached-image= https://japan-backrooms-storage.wdfiles.com/local--files/file%3A3358370-74-6ay2/discount_01.jpg
]]
[[div style="display: none"]]
[[/div]]
就能以社交平台帖子的风格显示文本了。
选项一览
必填选项
| account-id: | 输入发帖者的账号 ID(也就是类似 @aaaaaaaaa 这样的部分)。 |
| content: | 帖子的内容。 |
可能会经常用到的选项(可留空)
| intro: | 在此处输入合适的值(比如 a 就可以), _ |
就能让帖子显示在独特的黑色渐变背景上,适合在文章开头使用。
| reply: | 在此处输入合适的值(比如 a 就可以), _ |
文本框的左侧就会留出一些空间,就像回帖的效果。
| account-image: | 在此输入作为账号头像的图片 URL。 _ |
图片需要先上传至沙盒或图床。 _
若留空,则头像会显示为纯灰色。
| account-name: | 输入发帖者的账号名称。 _ |
若留空,则不显示此内容。
| account-color: | 输入发帖者账号 ID 的显示颜色。 _ |
有效值包括 rgb(var(--general-account-color))、 _
rgb(var(--administrator-account-color)) 等。 _
若留空,则默认使用 rgb(var(--general-account-color))。
| time: | 输入发帖者的发布时间 _ |
若留空,则不显示此内容。
| locate-name: | 输入发帖者的位置信息。 _ |
若留空,则不显示此内容。
| locate-link: | 设置点击 locate-name 时跳转的页面链接。 _ |
仅可设置为 backrooms-wiki-cn 站内的页面。 _
若留空,则 locate-name 不会成为可点击的链接。
| attached-image: | 在此输入附加在帖文中的图片 URL。 _ |
若留空,则不显示此内容。
进一步自定义布局的方法
本组件相关的所有显示设置都已整理在页面中。如果只是更换颜色之类的简单修改,那么只需要编辑上述页面中的变量部分即可完成。
帖子底部的 5 个按钮可以更换为 Fontawesome ver4.3.0 所支持的任意图标。可用图标列表见此(需要注意,该页面包含了部分 ver4.7 才支持的图标,它们目前无法使用)1。
使用例
[[include :backrooms-wiki-cn:component:sns-post
|account-id=@general
|account-image=http://japan-backrooms-storage.wdfiles.com/local--files/file%3A3358370-72-7b3u/sns01_icon_outlet.jpg
|time=1 day
|locate-link=level-0
|locate-name=Level 0
|content=文本01
]]
[[include :backrooms-wiki-cn:component:sns-post
|account-color=rgb(var(--general-account-color))
|account-id=@post-test-test-test-test-test-test-test-test-test-test-test-test-test-test-test-test
|account-image=https://japan-backrooms-storage.wdfiles.com/local--files/file%3A3358370-74-6ay2/discount_01.jpg
|time=1 day
|locate-name=后室维基
|content=需要注意,过长的账号名在某些环境下会被省略显示
大尺寸图片也可以正常设置为头像
可以选择不给位置信息添加任何链接
可以附加图片
[# #这种] [# #带井号标签的] [# #帖文] [# #也做得出来]
可以在帖子底部的按钮旁添加数字
|attached-image= https://japan-backrooms-storage.wdfiles.com/local--files/file%3A3358370-74-6ay2/discount_01.jpg
|button-number-a=2
|button-number-b=17
|button-number-c=991
]]
[[include :backrooms-wiki-cn:component:sns-post
|account-color=rgb(var(--administrator-account-color))
|account-id=@administrator
|content=可以改成管理员账号一样的专用颜色
可以隐藏时间
可以隐藏位置信息
可以让按钮处于“被按下”的状态
|button-press-a=true
|button-number-a=100
|button-press-b=true
|button-number-b=100
|button-press-c=true
|button-number-c=100
|button-press-d=true
|button-press-e=true
]]
[[include :backrooms-wiki-cn:component:sns-post
|account-id=@general
|account-image=http://japan-backrooms-storage.wdfiles.com/local--files/file%3A3358370-72-7b3u/sns01_icon_outlet.jpg
|time=1 day
|locate-link=level-0
|locate-name=Level 0
|content=两个帖子放在一起就会自动连起来
]]
[[include :backrooms-wiki-cn:component:sns-post
|reply=a
|account-id=@general
|account-image=http://japan-backrooms-storage.wdfiles.com/local--files/file%3A3358370-72-7b3u/sns01_icon_outlet.jpg
|time=1 day
|locate-link=level-0
|locate-name=Level 0
|content=也可以做成回帖一样的效果
]]
[[include :backrooms-wiki-cn:component:sns-post
|intro=a
|account-color=rgb(var(--administrator-account-color))
|account-id=@the_ourrooms
|account-image=https://japan-backrooms-storage.wdfiles.com/local--files/file%3A3358370-73-bwdz/ourrooms
|locate-name=后室维基 宣传员
|content=欢迎来到后室维基附属社交平台“The Ourrooms”。
这里定将成为各位放松身心的全新天地。
——把这样的文本框放在文章开头,可以很好地引入世界观,营造沉浸式氛围。
]]
[[include :backrooms-wiki-cn:component:sns-settings darkmode=a]]



