Покращені виноски

СТОРІНКА ШАБЛОНУ

Це сторінка шаблону, який використовується у цієї Wiki.

Будь ласка, не редагуйте цю сторінку
без дозволу адміністрації сайту


Звичайно, що є краще — питання суб’єктивне, але те, що ви бачите, те й отримуєте.

Це компонент, який імітує виноски, приклад дивись в SCP-4485.

Приклади:

Текст.Текст у виносці.
Текст.Текст у виносці. та ще текст.
Текст.Текст у виносці.. Іще текст.
Текст без виноски.

Як цим користуватись:

Додайте це один раз:

[[include :scp-ukrainian:component:betterfootnotes]]

Копіюйте це туди, де повинна бути певна виноска:

[[span class="fnnum"]].[[/span]][[span class="fncon"]]Текст у виносці.[[/span]]

Примітка:

- Сам span-блок fnnum містить період, та в ньому повинен знаходитись хоча б один символ, який не є пробілом за ради коректного парсингу.

- Колір верхнього індексу виноски можна налаштувати за допомогою наступного коду:

[[module CSS]]
:root {
--fnColor: ПИШИ КОЛІР СУДИ;
}
[[/module]]

Значення за замовчуванням: #E6283C.

- Нижнього списку виносок немає.

- Працює з темою Sigma-9, але може бути не таким бездоганним.

- Особлива подяка WoedenazWoedenaz за створення бездоганного дизайну та Placeholder McDPlaceholder McD за приставання заохочуючи мене зробити це.


Джерельний код:

:root {
    --posX: calc(50% - 358px - 12rem);
    --fnTransition: 0.3s;
    --fnLinger: 0.15s;
    --fnInteract: calc(var(--fnTransition) + var(--fnLinger));
}
 
/*--- Footnote Auto-counter --*/
#main-content {
    counter-reset: megacount;
}
 
/*--- Footnote Superscript Number --*/
.fnnum {
    display: inline-block;
    width: max-content;
    text-indent: -0.475ex;
    vertical-align: super;
    line-height: 80%;
    word-break: initial;
    text-decoration: none;
    font-weight: bold;
    font-style: initial;
    color: transparent;
    position: relative;
    font-size: 80%;
    padding: .15em .05em;
    margin-right: -0.25em;
    counter-increment: megacount;
    -webkit-user-select: none;
    user-select: none;
}
.fnnum::after {
    content: "" counter(megacount);
    color: var(--fnColor, #E6283C);
}
.fnnum:hover {
    text-decoration: none;
    cursor: pointer;
    background-color: var(--fnColor, #E6283C);
}
.fnnum:hover::after { color: white; }
 
/*--- Footnote Content Wrapper --*/
.fncon {
    position: absolute;
    right: calc(var(--posX) + 80px);
    line-height: 1.25;
    padding: 0.8125rem;
    width: 12.5rem;
    box-sizing: border-box;
    background: white;
    border: .125rem solid black;
    font-size: .9125rem;
    font-weight: initial;
    font-style: normal;
    text-align: initial;
    visibility: hidden;
    opacity: 0;
    z-index: 9;
    transition:
        opacity 0.15s linear var(--fnLinger),
        right var(--fnTransition) cubic-bezier(.08,.72,.5,.94) var(--fnLinger),
        visibility 0.01s linear var(--fnInteract);
}
.fnnum:hover + .fncon, .fncon:hover {
    opacity: 1;
    z-index: 10;
    right: var(--posX);
    visibility: visible;
    transition:
        opacity 0.15s linear,
        right var(--fnTransition) cubic-bezier(.08,.72,.5,.94);
}
 
.fncon::before {
    position: absolute;
    top: 0; left: 0;
    transform: translateX(-52%) translateY(-55%) scale(1.15);
    background-color: var(--fnColor, #E6283C);
    color: white;
    content: counter(megacount);
    font-size: initial;
    font-weight: bold;
    font-style: initial;
    padding: 0.18rem 0.32em 0.08rem;
}
 
/*--- Mobile Query --*/
@media only screen and (max-width: 1279px) {
    .fncon {
        position: fixed;
        bottom: 1.5rem;
        left: calc(15% - 50px);
        width: 70%;
        transition:
            opacity 0.15s linear var(--fnLinger),
            left var(--fnTransition) cubic-bezier(.08,.72,.5,.94) var(--fnLinger),
            visibility 0.01s linear var(--fnInteract);
    }
    .fnnum:hover + .fncon, .fncon:hover {
        left: 15%;
        transition:
            opacity 0.15s linear,
            left var(--fnTransition) cubic-bezier(.08,.72,.5,.94);
    }
}
Якщо не зазначено інше, вміст цієї сторінки доступний на умовах ліцензії Creative Commons Attribution-ShareAlike 3.0 License