Scp Hover Box 造型設計

您現在最好給我停下來

本頁面內包含基金會維基內部使用的模板

嚴禁任何人員在未經站點行政人員
之授權下修訂本頁面


[[module css]]
 @import url("https://use.typekit.net/fmm4kex.css");

.scp-hover-box {
    width: 85%;
    margin: 0 auto;
    position: relative;
}

.scp-hover-box::before {
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    content: " ";
    box-sizing: content-box;
    top: 0;
    left: 0;
    transition: 
        border 1s 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
        top 1s 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
        left 1s 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        background 1s 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.scp-hover-box:hover::before {
    box-sizing: content-box;
}

.scp-hover-box::before,
.scp-hover-box div.container, 
.scp-hover-box div.header {
    clip-path: polygon(
        0% var(--notch-size), 
        var(--notch-size) 0%, 
        calc(100% - var(--notch-size)) 0%, 
        100% var(--notch-size), 
        100% calc(100% - var(--notch-size)), 
        calc(100% - var(--notch-size)) 100%, 
        var(--notch-size) 100%, 
        0% calc(100% - var(--notch-size))
    );
}

div.scp-hover-box * {
    box-sizing: border-box;
}

div.scp-hover-box .container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    max-width: var(--body-width-on-desktop, 65rem) !important;
    box-sizing: border-box;
    transition: background-color 0.8s cubic-bezier(0.4, 0, 0.2, 1), color 1s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 4rem;
}

div.scp-hover-box .container::before,
div.scp-hover-box .container::after {
    content: "";
    position: absolute;
    left: 0;
    height: 0.125rem;
    width: 100%;
    max-width: var(--body-width-on-desktop, 65rem) !important;
    z-index: -1;
}

div.scp-hover-box .container::before {
    top: 0;
}

div.scp-hover-box .container::after {
    bottom: 0;
}

div.scp-hover-box .container:hover > * > *::before,
div.scp-hover-box .container:hover > * > *::after {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

div.scp-hover-box .container:hover > * > * > *::before,
div.scp-hover-box .container:hover > * > * > *::after {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

div.scp-hover-box .container > *::before,
div.scp-hover-box .container > *::after {
    content: "";
    position: absolute;
    top: 0;
    height: 100%;
    width: 0.125rem;
    z-index: -1;
}

div.scp-hover-box .container > *::before {
    left: 0;
}

div.scp-hover-box .container > *::after {
    right: 0;
}

div.scp-hover-box .container > * > *::before,
div.scp-hover-box .container > * > *::after {
    content: "";
    position: absolute;
    left: 0;
    z-index: 9;
    height: 0.125rem;
    width: 100%;
}

div.scp-hover-box .container > * > *::before {
    top: 0;
    -webkit-transform: translate3d(-105%, 0, 0);
    transform: translate3d(-105%, 0, 0);
    transition: -webkit-transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

div.scp-hover-box .container > * > *::after {
    bottom: 0;
    -webkit-transform: translate3d(105%, 0, 0);
    transform: translate3d(105%, 0, 0);
    transition: -webkit-transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

div.scp-hover-box .container > * > * > *::before,
div.scp-hover-box .container > * > * > *::after {
    content: "";
    position: absolute;
    top: 0;
    z-index: 9;
    height: 100%;
    width: 0.125rem;
}

div.scp-hover-box .container > * > * > *::before {
    left: 0;
    -webkit-transform: translate3d(0, 105%, 0);
    transform: translate3d(0, 105%, 0);
    transition: -webkit-transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

div.scp-hover-box .container > * > * > *::after {
    right: 0;
    -webkit-transform: translate3d(0, -105%, 0);
    transform: translate3d(0, -105%, 0);
    transition: -webkit-transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

div.scp-hover-box div.container div:not(.sub-title):not(.title) {
    width: 100%;
}

div.scp-hover-box div.header {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    letter-spacing: 0.05em;
}

div.scp-hover-box div.title > a, 
div.scp-hover-box div.sub-title > a,
div.scp-hover-box div.title,
div.scp-hover-box div.sub-title {
    display: flex;
    margin: 0;
    flex-basis: 50%;
    flex-grow: 1;
    flex-shrink: 1;
    padding: 0;
    box-sizing: border-box;
}

div.scp-hover-box div.title > a,
div.scp-hover-box div.sub-title > a {
    font-size: 150%;
    font-family: var(--title-font, proxima-nova-extra-condensed);
    width: 100%;
    padding: 0.5em;
    line-height: 1em;
    align-items: center;
}

div.scp-hover-box div.title > a:hover,
div.scp-hover-box div.sub-title > a:hover {
    text-decoration: none;
}

div.scp-hover-box div.title > a {
    justify-content: flex-start;
    text-align: left;
}

div.scp-hover-box div.sub-title > a {
    justify-content: flex-end;
    text-align: right;
}

div.scp-hover-box div.blerb {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-basis: 100%;
    flex-shrink: 0;
    min-height: 4em;
    padding: 0.75em;
    text-align: center;
}

.blerb br {
    display: none;
}

.blerb *:not(:last-child) {
    margin-bottom: 0.25em;
}
[[/module]]
除非特別註明,本頁內容採用以下授權方式: Creative Commons Attribution-ShareAlike 3.0 License