wikimedia/mediawiki-extensions-TwnMainPage

View on GitHub
resources/css/ext.translate.mainpage.css

Summary

Maintainability
Test Coverage
/* High specificity to override skin styles */
body.mediawiki {
    background-color: #f6f6f6;
}

.twn-mainpage {
    background-color: #fff;
    color: #252525;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    font-size: medium;
}

.twn-mainpage-header {
    background: transparent url( https://translatewiki.net/static/logo.svg ) no-repeat scroll left 10px center;
    background-size: 50px;
    padding-left: 65px;
    padding-bottom: 5px;
    height: 75px;
    line-height: 1.5em;
    box-shadow: 0 0 4px;
    border-bottom: 4px solid #36b;
}

.twn-mainpage-header .twn-mainpage-personal-actions {
    padding-right: 20px;
    text-align: right;
}

.twn-mainpage-header .uls-trigger {
    background-position: center left;
    padding-left: 30px;
    color: #36b;
    margin-top: 8px;
    cursor: pointer;
    display: inline-block;
}

.twn-mainpage-title .twn-brand-name {
    padding-top: 12px;
    font-size: 28px;
}

.twn-mainpage-title .twn-brand-motto {
    padding-top: 5px;
    font-size: 16px;
    color: #555;
}

.twn-mainpage-header .login,
.twn-mainpage-header .logout {
    color: #36b;
    padding-top: 50px;
    padding-left: 20px;
}

.twn-mainpage-banner {
    /* Actual image is added in php */
    background: transparent none no-repeat scroll left center;
    background-size: 100%;
    position: relative;
    box-shadow: 0 0 4px, inset 0 0 40px;
    border-top: 1px solid #5787e5;
}

.banner-attribution {
    color: #fff;
    clear: left;
    font-size: 10px;
    padding: 10px 10px 20px 10px;
    position: absolute;
    opacity: 0.8;
    bottom: 0;
}

.banner-attribution a,
.banner-attribution a:visited {
    color: #fff;
}

.twn-mainpage-search {
    background-color: #252525;
    box-shadow: 0 2px 4px;
    height: 50px;
    padding: 10px 10px 10px 60px;
    position: relative;
}

.twn-mainpage-stats-tiles {
    margin: 10px 0 50px 5px;
}

.stats-tile-row {
    height: 140px;
}

.stats-tile {
    background-color: #36b;
    background-color: rgba( 51, 102, 187, 0.7 );
    color: #fff;
    height: 130px;
    margin: auto;
    width: 80%;
    padding: 10px;
    cursor: pointer;
    -webkit-animation: fadein 1.5s backwards;
    animation: fadein 1.5s backwards;
}

@media screen and ( prefers-reduced-motion: reduce ) {
    .stats-tile {
        animation: none;
    }
}

.stats-tile-row:nth-child( 1 ) > div:nth-child( 2 ) .stats-tile,
.stats-tile-row:nth-child( 2 ) > div:nth-child( 1 ) .stats-tile {
    animation-delay: 0.2s;
}

.stats-tile-row:nth-child( 1 ) > div:nth-child( 3 ) .stats-tile,
.stats-tile-row:nth-child( 2 ) > div:nth-child( 2 ) .stats-tile {
    animation-delay: 0.4s;
}

.stats-tile-row:nth-child( 2 ) > div:nth-child( 3 ) .stats-tile {
    animation-delay: 0.6s;
}

@-webkit-keyframes fadein {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadein {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.unused.stats-tile {
    background-color: rgba( 51, 102, 187, 0.3 );
    cursor: auto;
}

.stats-number {
    font-size: 42px;
    opacity: 0.9;
    line-height: 1.2em;
}

.stats-text {
    font-size: 1em;
    opacity: 0.85;
    font-weight: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.main-widget {
    background-color: #f8f8f8;
    background-color: rgba( 248, 248, 248, 0.85 );
    color: #252525;
    max-height: 580px;
    margin-left: 4%;
    overflow: auto;
    margin-top: 10px;
    box-shadow: inset 0 0 4px #fff;
}

/* Signup styles start here. */
.grid .row .login-widget {
    padding: 0 40px 0 15px;
}

.grid .row .login-widget > div {
    margin-bottom: 10px;
}

.grid .row .login-widget > div:last-child {
    margin-bottom: 0;
}

.grid .login-widget input,
.grid .login.widget textarea {
    padding: 6px;
    font-size: 16px;
    outline: 0;
    border-style: solid;
    border-width: 1px;
    border-color: #c9c9c9;
    color: #252525;
}

.login-widget h1,
.login-widget h2 {
    padding-top: 10px;
    border-bottom: 0;
}

.login-widget .dev-signup {
    border-top: 1px solid #ddd;
    padding: 10px 0;
}

.login-widget .signup-language-selector {
    font-size: 12pt;
    background-color: #f8f8f8;
    cursor: pointer;
    padding: 5px 12px;
}

.login-widget .signup-language-selector:hover {
    background-color: #e5e5e5;
}

.login-widget .signup-languages {
    list-style-type: none;
    list-style-image: none;
    padding-top: 5px;
}

.login-widget input.invalid {
    border: 1px solid #e85355;
}

/* Signup styles end here. */

.user-stats-title {
    padding-left: 100px;
    background: transparent url( ../images/user-small.svg ) no-repeat scroll bottom left;
    background-size: 75px;
    min-height: 75px;
}

.main-widget h2 {
    border: 0;
    font-weight: lighter;
    color: #252525;
    font-size: 20px;
    line-height: 23px;
    padding: 0.5em 0 0 0;
    margin: 0 0 0.6em 0;
}

.subtitle {
    line-height: 18px;
}

.ranking {
    background-color: #fff;
    border-top: 1px solid #eee;
    padding: 10px;
}

.ranking .count {
    font-size: 29px;
    font-weight: bold;
}

.ranking .count-description {
    font-size: 18px;
}

.ranking .rank-description {
    color: #555;
    font-size: 15px;
}

.langstats-link,
.sandbox-message {
    padding: 10px 15px;
}

.sandbox-message {
    color: #333;
    background-color: #fbf9ce;
    font-size: 14px;
}

.langstats-link {
    border-top: 1px solid #ddd;
}

a.langstats-link {
    font-size: 16px;
    padding: 10px;
}

/* Increase specificity by adding .twn-mainpage to override skin CSS */
.twn-mainpage .twn-mainpage-search input,
.twn-mainpage .twn-mainpage-search button {
    padding: 5px;
    font-size: 16px;
    height: 32px;
    margin: 0;
    box-sizing: border-box;
}

.twn-mainpage-search button {
    width: 12%;
}

.twn-mainpage-footer {
    background-color: #f0f0f0;
    height: 50px;
    font-size: 16px;
    padding: 10px;
    margin: 10px;
    border-bottom: 1px solid #aaa;
    line-height: 30px;
}

.twn-mainpage-poweredby {
    background-color: #f0f0f0;
    font-size: 18px;
    height: 50px;
    margin: 10px;
    padding: 10px;
    text-align: center;
}

.project-tile {
    border: 1px solid #aaa;
    box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.25 );
    background: #fcfcfc;
    margin: 10px;
    height: 180px;
}

.project-tile.linked {
    cursor: pointer;
}

.project-tile:hover {
    border-color: #777;
    box-shadow: 0 2px 3px rgba( 0, 0, 0, 0.25 );
}

.project-actions {
    display: none;
}

.project-tile:focus-within .project-actions,
.project-tile:hover .project-actions {
    display: block;
}

.project-tile.more {
    font-size: 26px;
    padding: 15px;
    cursor: pointer;
    color: #555;
}

.project-icon div {
    width: 100%;
    height: 100%;
    background-size: 90%;
    background-repeat: no-repeat;
    background-position: left 5px top 10px;
}

.project-name {
    font-size: 18px;
    height: 100px;
    padding: 25px 5px 0 0;
}

.tux-statsbar,
.tux-statsbar span {
    height: 5px;
}

.project-statsbar {
    height: 5px;
    padding: 0 10px 10px 15px;
}

.project-statstext {
    height: 25px;
    opacity: 0.7;
    padding-left: 15px;
}

.project-content,
.project-icon {
    height: 130px;
}

.project-top {
    height: 140px;
}

.twn-mainpage-project-tiles {
    padding-top: 10px;
    padding-bottom: 15px;
}

.twn-mainpage-project-tiles .twn-mainpage-project-tile .project-tile .project-actions {
    text-align: left;
    height: 40px;
    line-height: 40px;
    background-color: #252525;
    margin: 0;
    overflow: hidden;
}

.twn-mainpage-project-tiles .twn-mainpage-project-tile .action {
    border-right: 1px solid #333;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    font-size: 14px;
    padding: 0 5px 0 0;
}

.twn-mainpage-project-tile .action:last-child {
    border: 0;
}

.project-actions a,
.project-actions a:visited {
    color: #fff;
    text-decoration: none;
    padding-left: 24px;
    cursor: pointer;
}

.project-tile span.translate {
    padding-left: 20px;
    padding-right: 5px;
    background: transparent url( ../images/view-list.svg ) no-repeat left top;
}

.project-tile span.proofread {
    padding-left: 20px;
    background: transparent url( ../images/view-proofread.svg ) no-repeat left top;
}

.project-actions a.translate {
    background: transparent url( ../images/view-list-hi.svg ) no-repeat left top;
}

.project-actions a.proofread {
    background: transparent url( ../images/view-proofread-hi.svg ) no-repeat left top;
}

.searchbox {
    border: 1px solid #777;
    height: 32px;
    margin: 0 5px;
    -webkit-appearance: none;
    background-color: #fff;
}

.twn-mainpage-search::before {
    display: inline-block;
    content: '';
    background: #252525 url( ../images/search.svg ) no-repeat scroll left center;
    background-size: 30px;
    height: 30px;
    width: 30px;
    position: absolute;
    left: 25px;
}

.twn-mainpage-project-selector-title {
    font-size: 22px;
    line-height: 40px;
    padding: 25px 15px 10px 15px;
}

.twn-mainpage-add-project {
    display: block;
    font-size: 12pt;
    padding: 15px 10px 25px 15px;
}

.twn-mainpage-footer a,
.twn-mainpage-footer a:visited {
    text-align: center;
    color: #36b;
}

@media all and ( max-width: 1200px ) {
    .stats-tile {
        width: 100%;
    }
}

@media all and ( max-width: 800px ) {
    .twn-mainpage-banner.row .six.columns,
    .twn-mainpage-banner.row .five.columns {
        width: 100%;
        margin: 5px 0;
    }

    .twn-mainpage .row.twn-mainpage-project-tiles .twn-mainpage-project-tile {
        width: 50%;
    }

    .twn-mainpage-stats-tiles {
        margin-bottom: 10px;
    }

    .banner-attribution {
        position: relative;
    }

    .main-widget {
        background-color: #f8f8f8;
    }

    .twn-mainpage-banner {
        background-position: top left;
    }
}

@media all and ( max-width: 650px ) {
    .grid.twn-mainpage .row {
        min-width: initial;
    }

    .twn-mainpage .row.twn-mainpage-project-tiles .twn-mainpage-project-tile {
        width: 100%;
    }

    .grid.twn-mainpage .twn-mainpage-footer {
        height: auto;
    }
}

/* Non-JS cleanups */

.client-nojs .uls-trigger {
    visibility: hidden;
}

.client-nojs .grid .project-actions {
    display: block;
}

/* button is here to make this rule more specific than .mw-ui-button */
button.same-language-uls-trigger {
    font-size: 16px;
    float: right;
}

.same-language-uls-trigger::after {
    content: '';
    border-top: 4px solid #aaa;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.5em;
}

/* Override group selector css to avoid pointing triangle */
div.ext-translate-msggroup-selector-menu::after,
div.ext-translate-msggroup-selector-menu::before {
    display: none;
}

/* Override the statsbar on-hover info for TWN Mainpage */
.tux-statsbar-info {
    display: none;
}

.twn-mainpage-banner .main-widget .twnmp-signup-error,
.twn-mainpage-banner .main-widget .twnmp-signup-generic-error {
    background-color: #cf1c1f;
    padding: 6px;
    color: #fff;
    position: relative;
    top: -2px;
    font-size: 14px;
    border-bottom: 2px solid #a90000;
    border-radius: 2px;
}

.twnmp-signup-error::before {
    content: '';
    display: inline-block;
    border-bottom: 5px solid #cf1c1f;
    border-right: 5px solid transparent;
    border-left: 5px solid transparent;
    position: absolute;
    top: -5px;
}

.twn-mainpage-banner .main-widget .twnmp-signup-generic-error {
    margin: 0 -5px;
}

.twn-mainpage-banner .main-widget .twn-mainpage-loading-indicator {
    display: inline-block;
    vertical-align: middle;
    margin-left: 5px;
}

.twn-mainpage-banner .main-widget .twn-mainpage-loading-indicator.hide {
    display: none;
}

.twn-mainpage-loading-indicator {
    background-image: url( ../images/loading.svg );
    background-size: 100%;
    animation-name: tux-loading-indicator-spin;
    animation-duration: 1.5s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    height: 34px;
    width: 34px;
    backface-visibility: hidden;
}

@keyframes tux-loading-indicator-spin {
    from {
        transform: rotate( 0deg );
    }

    to {
        transform: rotate( 360deg );
    }
}