PJPSS组件

注意


此页为于 SCP 维基内部使用的“组件”页。用于在其他页面中引用。

未经组件作者或工作人员允许,请勿修改此页的内容。


这是什么

一个能够让页面上的所有东西平滑渐显而不是立即在页面加载之后出现的组件。

渐变可以是交错的,也就是页面上的每一件东西都一个接一个地出现而不是全都一次性出现。

⚠️ 警告:此组件可能会给一些用户带来不友好的阅读体验,尤其是在交错时。我建议不要使用此组件,并建议其他作者也这样做。

⛔️ 不适用于:任何读者可能不会从页面顶部开始的页面,例如中心页或任何带有目录的页面。

用法

在任意维基上:

[[include :scp-wiki-cn:component:fade-in speed=1]]

speed=1:所有东西都同时显现
speed=2:所有东西都在上一个东西显现后0.5s显现
speed=3:所有东西都在上一个东西显现后0.25s显现

说明

渐显效果只会应用在是#page-content的直系子元素上。它不会应用到嵌套元素(例如在blockquote(引用框)或div中的东西)或者页面的其它部分(比如侧边栏)中。

(如果你的页面上有其它元素会与此冲突(比如ACS动画)你可以简单地将不确定的动画元素包裹在一个div里面)。

它也只能应用到页面的前15个元素中,且在此以后的所有东西都会同时出现。这对于读者打开页面后的平滑加载阅读体验已经足够了,但如果他们想直接滚动到页面底部的话,也同样可以无需等待太长时间。

从其他版式中移除

一些CSS版式默认包含渐显(空白风格 CSS, Flop风格:浅色, 狐步舞 版式 以及 theme:queerstyle,写这行字的时候)。如果你想要使用这些版式但不带渐显,你可以用下面这个代码禁用它:

[[module CSS]]
:root {
--fade-in: none;
}
[[/module]]


源代码

:where(:root) {
  --fade-in: fadeIn;
  --fade-in-delay: 0s;
}
 
/* 中心页禁用,因为读者可能想从页面顶部以外的其他地方开始阅读 */
:root:has(#page-tags a[href*=中心]),
/* 带有目录的页面禁用,因为用户可能会直接跳转到他们想要开始阅读的地方 */
:root:has(#toc) {
  --fade-in: none !important;
}
 
@media (prefers-reduced-motion: no-preference) {
  :where(#page-title, #breadcrumbs, #page-content > *) {
    animation-name: var(--fade-in);
    animation-duration: 0.8s;
    animation-iteration-count: 1;
    animation-timing-function: ease-out;
    animation-fill-mode: backwards;
  }
}
 
:where(#page-title) { animation-delay: 0s; }
 
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(0,30px);
  }
  to {
    opacity: 1;
    transform: translate(0,0);
  }
}
 
:where(#page-content > :nth-child(1)) { animation-delay: calc(1 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(2)) { animation-delay: calc(2 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(3)) { animation-delay: calc(3 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(4)) { animation-delay: calc(4 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(5)) { animation-delay: calc(5 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(6)) { animation-delay: calc(6 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(7)) { animation-delay: calc(7 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(8)) { animation-delay: calc(8 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(9)) { animation-delay: calc(9 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(10)) { animation-delay: calc(10 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(11)) { animation-delay: calc(11 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(12)) { animation-delay: calc(12 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(13)) { animation-delay: calc(13 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(14)) { animation-delay: calc(14 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(15)) { animation-delay: calc(15 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(n+15)) { animation-delay: calc(16 * var(--fade-in-delay)); }
:where(:root) {
   --fade-in-delay: 0.2s;
}
:where(:root) {
  --fade-in-delay: 0.1s;
}

在任何维基上:

[[include :scp-wiki-cn:component:pjpss]]

这是我在所有文章中使用的各种自定义CSS的仓库。随着我的口味改变,我会对其进行编辑,所以请谨慎使用。目前包括:

  • 较细的水平线。
  • 自定义访谈、引用和附录框。
  • 隐藏页面标题。
  • 为无序列表添加缩进。
    • 就像这样!

特点

附录框

访谈框


带有细水平线的引用方块


同时还有

黑色标记笔 主题版式

黑标暗色与隐藏侧边栏

居中页眉

ACS动画

#page-title {
    display: none;
}
 
#page-content hr {
  border: solid 0.02em #000000 !important;
  background: #000000 !important;
  height: 0.02em !important;
  display: block !important;
  box-shadow: none !important;
  margin: 1em 0 !important;
}
 
#page-content > .collapsible-block {
    display: block;
    text-align: left;
    padding: 1px;
    margin: 5px auto;
    border: none;
}
 
#page-content > .collapsible-block .collapsible-block-content {
    text-align: left;
}
 
.info-container .collapsible-block-folded a,
.info-container .collapsible-block-unfolded-link a {
    color: #FFF;
}
 
blockquote,
div.blockquote {
    border: 0.125rem solid #d4d4d4;
    background-color: #F5F5F5;
}
 
.interview {
    border: solid 2px #d4d4d4;
    background: #F5F5F5;
    width: 90%;
    padding: 1px 15px;
    margin: 10px auto;
    box-shadow: 1px 1px 4px #5e5e5e82;
}
 
.addendum {
    border-left: solid 5px #642c2c;
    background: #ffffff;
    box-shadow: 1px 1px 4px #5e5e5e82;
    width: 90%;
    padding: 1px 15px;
    margin: 10px auto;
}
 
#page-content ul:not(.yui-nav) {
  list-style-position: outside;
  margin: .25em 0 1em 2em;
  padding: 0;
}
 
#page-content ul:not(.yui-nav) > li {
  line-height: 1.4;
  margin: .25em 0;
}
 
#page-content ul:not(.yui-nav) > li:last-child {
  padding-bottom: .25em;
}
 
#page-content ul ul:not(.yui-nav) {
  margin: .35em 0 .6em 1.5em;
}
 
#page-content ul ul:not(.yui-nav) > li {
  margin: .15em 0;
}
 
#page-content ul ul:not(.yui-nav) > li:first-child { margin-top: 0; }
#page-content ul ul:not(.yui-nav) > li:last-child  { padding-bottom: 0; }
 
@media (max-width: 768px) {
  #page-content ul:not(.yui-nav) { margin-left: 2.4em; }
  #page-content ul:not(.yui-nav) > li { line-height: 1.3; }
  #page-content ul ul:not(.yui-nav) { margin-left: 1.2em; }
}
 
:root {
    --logo-image: url("https://nu-scptheme.github.io/Black-Highlighter/img/logo.svg");
}

这是一个给ACS版头加上加载动画的组件。

如何使用:

把这个放在文章的任意位置:

[[include :scp-wiki-cn:component:acs-animation]]

然后就完成了!

例子:SCP-5935


注意

- 有两个变量,--timeScale--timeDelay,控制着动画的时序。举例:

[[module CSS]]
:root {
--timeScale: 2;
--timeDelay: 0.5s;
}
[[/module]]

--timeScale能把整个动画速度放慢至原来的½,而--timeDelay会将动画的起始点延迟半秒。默认的值分别为1和0秒。

若需改变默认值,需将以上的代码放到[[include]]的后面。若ACS不是第一个页面元素,或者你想要与其它动画模组(仿照渐显)一同使用,则推荐设置一个--timeDelay

- 似乎与其它种类的ACS版头*不兼容。

*若要与PeppersGhostPeppersGhost小型化ACS一同使用,在[[include]]后面加上如下补丁:

[[module CSS]]
/*-- 小型化ACS动画适应性补丁 --*/
.anom-bar > .bottom-box::before { display: none; }
.anom-bar > .bottom-box { box-shadow: none!important; }
div.diamond-part { clip-path: none; animation: none; box-shadow: none!important; }
@media (max-width: 480px) {
div.top-right-box { clip-path: polygon(0% -30%, 100% -30%, 100% 130%, 0% 130%); }
}
[[/module]]

- 作品灵感来自于AnAnomalousWriterAnAnomalousWriter


源代码:

:root {
    --timeScale: 1;
    --timeDelay: 0s;
}
 
/* Converting middle divider from box-shadow to ::before pseudo-element */
.anom-bar > div.bottom-box { box-shadow: none; position: relative; }
.anom-bar > div.bottom-box::before {
    position: absolute;
    content: " ";
    width: 100%;
    height: 0.5rem;
    bottom: 100%; left: 0;
    background-color: rgb(var(--swatch-menubg-black-color, 12, 12, 12));
}
 
/* DIVIDER */
.anom-bar > .bottom-box::before {
    animation-name: divider;
    animation-duration: calc(0.74s * var(--timeScale));
    animation-delay: calc(0.1s * var(--timeScale) + var(--timeDelay));
    animation-iteration-count: 1;
    animation-timing-function: cubic-bezier(.32,.38,.39,.94);
    animation-fill-mode: backwards;
}
 
/* CLASSIFIED LEVEL BARS */
div.top-center-box  > * {
    animation-name: bar;
    animation-duration: calc(0.45s * var(--timeScale));
    animation-iteration-count: 1;
    animation-timing-function: ease-out;
    animation-fill-mode: backwards;
}
div.top-center-box > :nth-child(1) { animation-delay: calc(0.2s * var(--timeScale) + var(--timeDelay)); }
div.top-center-box > :nth-child(2) { animation-delay: calc(0.32s * var(--timeScale) + var(--timeDelay)); }
div.top-center-box > :nth-child(3) { animation-delay: calc(0.45s * var(--timeScale) + var(--timeDelay)); }
div.top-center-box > :nth-child(4) { animation-delay: calc(0.61s * var(--timeScale) + var(--timeDelay)); }
div.top-center-box > :nth-child(5) { animation-delay: calc(0.75s * var(--timeScale) + var(--timeDelay)); }
div.top-center-box > :nth-child(6) { animation-delay: calc(0.95s * var(--timeScale) + var(--timeDelay)); }
 
/* TOP TEXT */
div.top-left-box, div.top-right-box {
    clip-path: polygon( 0% -50%, 150% -50%, 150% 100%, 0% 100%);
}
 
div.top-left-box > *, div.top-right-box > * {
    position: relative;
    animation-name: bottomup;
    animation-duration: calc(0.65s * var(--timeScale));
    animation-delay: calc(0.5s * var(--timeScale) + var(--timeDelay));
    animation-iteration-count: 1;
    animation-timing-function: ease-out;
    animation-fill-mode: backwards;
}
 
/*-----------------------------------*/
/*-----------------------------------*/
 
/* CONTAINMENT, DISRUPTION, RISK CLASSES */
div.text-part > * {
    clip-path: polygon( 0% 0%, 100% 0%, 100% 100%, 0% 100%);
    animation-name: expand2;
    animation-duration: calc(0.5s * var(--timeScale));
    animation-iteration-count: 1;
    animation-timing-function: cubic-bezier(.12,.41,.27,.99);
    animation-fill-mode: backwards;
}
div.text-part > :nth-child(1) {
    animation-name: expand1;
}
div.text-part > :nth-child(1) { animation-delay: calc(0.6s * var(--timeScale) + var(--timeDelay)); }
div.text-part > :nth-child(2) { animation-delay: calc(0.75s * var(--timeScale) + var(--timeDelay)); }
div.text-part > :nth-child(3) { animation-delay: calc(0.86s * var(--timeScale) + var(--timeDelay)); }
 
div.main-class::before, div.main-class::after {
    animation-name: iconslide;
    animation-duration: calc(0.45s * var(--timeScale));
    animation-delay: calc(0.8s * var(--timeScale) + var(--timeDelay));
    animation-iteration-count: 1;
    animation-timing-function: cubic-bezier(.12,.41,.27,.99);
    animation-fill-mode: backwards;
}
 /* BOTTOM TEXT */
div.main-class > *,  div.disrupt-class > *, div.risk-class > * {
    white-space: nowrap;
    animation-name: flowIn;
    animation-duration: calc(0.42s * var(--timeScale));
    animation-delay: calc(0.75s * var(--timeScale) + var(--timeDelay));
    animation-iteration-count: 1;
    animation-timing-function: ease-out;
    animation-fill-mode: backwards;
}
 
/*-----------------------------------*/
/*-----------------------------------*/
 
/* DIAMOND */
div.arrows {
    animation-name: arrowspin;
    animation-duration: calc(0.65s * var(--timeScale));
    animation-delay: calc(0.55s * var(--timeScale) + var(--timeDelay));
    animation-iteration-count: 1;
    animation-timing-function: cubic-bezier(.12,.41,.27,.99);
    animation-fill-mode: backwards;
}
 
div.quadrants > * {
    animation-name: fade;
    animation-duration: calc(0.3s * var(--timeScale));
    animation-delay: calc(1.4s * var(--timeScale) + var(--timeDelay));
    animation-iteration-count: 1;
    animation-timing-function: cubic-bezier(.12,.41,.27,.99);
    animation-fill-mode: backwards;
}
 
div.top-icon, div.right-icon, div.left-icon, div.bottom-icon {
    animation-name: nodegrow;
    animation-duration: calc(0.4s * var(--timeScale));
    animation-delay: calc(1.4s * var(--timeScale) + var(--timeDelay));
    animation-iteration-count: 1;
    animation-timing-function: cubic-bezier(.12,.41,.27,.99);
    animation-fill-mode: backwards;
}
.bottom-box > div.diamond-part {
    box-shadow: none;
}
.bottom-box > div.diamond-part::before {
    content: "";
    position: absolute;
    width: 0.5rem; height: 100%;
    top: 0; right: 100%;
    background-color: rgb(var(--swatch-menubg-black-color, 12, 12, 12));
    animation-name: diamondBorder;
    animation-duration: calc(0.475s * var(--timeScale));
    animation-delay: calc(0.775s * var(--timeScale) + var(--timeDelay));
    animation-iteration-count: 1;
    animation-timing-function: cubic-bezier(.28,.72,.55,.91);
    animation-fill-mode: backwards;
}
 
/* MOBILE QUERY */
@media (max-width: 480px ) {
    .anom-bar > div.bottom-box { position: initial; }
    .anom-bar > div.bottom-box::before { bottom: initial; top: 40vw; }
    div.top-center-box  > * {
        animation-name: bar-mobile;
        animation-duration: calc(0.9s * var(--timeScale));
    }
    div.top-center-box > :nth-child(1) { animation-delay: calc(0.1s * var(--timeScale) + var(--timeDelay)); }
    div.top-center-box > :nth-child(2) { animation-delay: calc(0.2s * var(--timeScale) + var(--timeDelay)); }
    div.top-center-box > :nth-child(3) { animation-delay: calc(0.3s * var(--timeScale) + var(--timeDelay)); }
    div.top-center-box > :nth-child(4) { animation-delay: calc(0.4s * var(--timeScale) + var(--timeDelay)); }
    div.top-center-box > :nth-child(5) { animation-delay: calc(0.5s * var(--timeScale) + var(--timeDelay)); }
    div.top-center-box > :nth-child(6) { animation-delay: calc(0.6s * var(--timeScale) + var(--timeDelay)); }
 
}
 
/*--- Motion Accessibility ---*/
@media screen and (prefers-reduced-motion: reduce) {
    div.anom-bar-container { --timeScale: 0!important; }
}
 
/*-------------------------*/
 
@keyframes divider {
    from { max-width: 0%;  }
    to { max-width: 100%; }
}
 
@keyframes bar {
    from { max-width: 0%; }
    to { max-width: 100%; }
}
@keyframes bar-mobile {
    from { max-height: 0%; }
    to { max-height: 100%; }
}
 
@keyframes bottomup {
    from { top: 100px; }
    to { top: 0; }
}
 
@keyframes expand1 {
    from { opacity: 0; clip-path: inset(0 calc(100% - 0.75rem) 0 0); }
    to { opacity: 1; clip-path: inset(0); }
}
@keyframes iconslide {
    from { opacity: 0; transform: translateX(-5rem); }
    to { opacity: 1; transform: translateX(0); }
}
 
@keyframes expand2 {
    from { opacity: 0; width: 1%; }
    to { opacity: 1; width: calc(100% - 0.25rem); }
}
@keyframes fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
 
@keyframes flowIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
 
@keyframes arrowspin {
    from { clip-path: circle(0%); transform: rotate(135deg); }
    to { clip-path: circle(75%); transform: rotate(0deg); }
}
@keyframes nodegrow {
    from { transform: scale(0);}
    to {  transform: scale(1);}
}
@keyframes diamondBorder {
    from { height: 0; }
    to { height: 100%; }
}

这是什么

一个能够让页面上的所有东西平滑渐显而不是立即在页面加载之后出现的组件。

渐变可以是交错的,也就是页面上的每一件东西都一个接一个地出现而不是全都一次性出现。

⚠️ 警告:此组件可能会给一些用户带来不友好的阅读体验,尤其是在交错时。我建议不要使用此组件,并建议其他作者也这样做。

⛔️ 不适用于:任何读者可能不会从页面顶部开始的页面,例如中心页或任何带有目录的页面。

用法

在任意维基上:

[[include :scp-wiki-cn:component:fade-in speed=1]]

speed=1:所有东西都同时显现
speed=2:所有东西都在上一个东西显现后0.5s显现
speed=3:所有东西都在上一个东西显现后0.25s显现

说明

渐显效果只会应用在是#page-content的直系子元素上。它不会应用到嵌套元素(例如在blockquote(引用框)或div中的东西)或者页面的其它部分(比如侧边栏)中。

(如果你的页面上有其它元素会与此冲突(比如ACS动画)你可以简单地将不确定的动画元素包裹在一个div里面)。

它也只能应用到页面的前15个元素中,且在此以后的所有东西都会同时出现。这对于读者打开页面后的平滑加载阅读体验已经足够了,但如果他们想直接滚动到页面底部的话,也同样可以无需等待太长时间。

从其他版式中移除

一些CSS版式默认包含渐显(空白风格 CSS, Flop风格:浅色, 狐步舞 版式 以及 theme:queerstyle,写这行字的时候)。如果你想要使用这些版式但不带渐显,你可以用下面这个代码禁用它:

[[module CSS]]
:root {
--fade-in: none;
}
[[/module]]


源代码

:where(:root) {
  --fade-in: fadeIn;
  --fade-in-delay: 0s;
}
 
/* 中心页禁用,因为读者可能想从页面顶部以外的其他地方开始阅读 */
:root:has(#page-tags a[href*=中心]),
/* 带有目录的页面禁用,因为用户可能会直接跳转到他们想要开始阅读的地方 */
:root:has(#toc) {
  --fade-in: none !important;
}
 
@media (prefers-reduced-motion: no-preference) {
  :where(#page-title, #breadcrumbs, #page-content > *) {
    animation-name: var(--fade-in);
    animation-duration: 0.8s;
    animation-iteration-count: 1;
    animation-timing-function: ease-out;
    animation-fill-mode: backwards;
  }
}
 
:where(#page-title) { animation-delay: 0s; }
 
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(0,30px);
  }
  to {
    opacity: 1;
    transform: translate(0,0);
  }
}
 
:where(#page-content > :nth-child(1)) { animation-delay: calc(1 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(2)) { animation-delay: calc(2 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(3)) { animation-delay: calc(3 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(4)) { animation-delay: calc(4 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(5)) { animation-delay: calc(5 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(6)) { animation-delay: calc(6 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(7)) { animation-delay: calc(7 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(8)) { animation-delay: calc(8 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(9)) { animation-delay: calc(9 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(10)) { animation-delay: calc(10 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(11)) { animation-delay: calc(11 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(12)) { animation-delay: calc(12 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(13)) { animation-delay: calc(13 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(14)) { animation-delay: calc(14 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(15)) { animation-delay: calc(15 * var(--fade-in-delay)); }
:where(#page-content > :nth-child(n+15)) { animation-delay: calc(16 * var(--fade-in-delay)); }
:where(:root) {
   --fade-in-delay: 0.2s;
}
:where(:root) {
  --fade-in-delay: 0.1s;
}
除非特别注明,本页内容采用以下授权方式: Creative Commons Attribution-ShareAlike 3.0 License