Better Gallections alt

Some visual updates to galleries and collections.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Better Gallections alt
// @version     2.2.0
// @description Some visual updates to galleries and collections.
// @author      Valognir (https://www.deviantart.com/valognir)
// @namespace   https://greasyfork.org/en/scripts/404189-better-gallections
// @grant       GM_addStyle
// @run-at      document-start
// @match       https://www.deviantart.com/*
// ==/UserScript==


let css = `

    [data-hook^="gallection_folder_"] {
        padding: 0 !important;
        margin-bottom: 30px !important;
        height: 200px !important;
    }

    .theme-dark [data-hook^="gallection_folder_"] {
        color: var(--D8) !important;
    }

    .theme-light [data-hook^="gallection_folder_"] {
        color: var(--L8) !important;
    }

    [data-hook^="gallection_folder_"]>div:first-child,
    [data-hook^="gallection_folder_"]>div:first-child>div:first-child>div:nth-child(3),
    [data-hook^="gallection_folder_"]>div:first-child>div:first-child>div:nth-child(3)>img,
    [data-hook^="gallection_folder_"]>div:first-child>div:first-child>div:first-child,
    [data-hook^="gallection_folder_"]>div:first-child>div:first-child>div:first-child img,
    [data-hook^="gallection_folder_"]>div:first-child>div:first-child>section{
        width: 100% !important;
        height: 200px !important;
    }

    [data-hook^="gallection_folder_"]>div:last-child{
        position: absolute;
        padding: 0;
        margin-top: -70px !important;
        margin-left:-4px;
        width: 274px;
        background: none;
        transition: background .2s;
        transition-timing-function: ease;
    }

    [data-hook^="gallection_folder_"]>div:last-child:after{
        position: absolute;
        content: "";
        width: 0;
        height: 0;
        top: 100%;
        left: 0;
        border-style: solid;
        border-width: 0 4px 4px 0;
        border-color: transparent;
        border-right-color: var(--D5);
    }

    .theme-light [data-hook^="gallection_folder_"]>div:last-child{
        background-color: rgba(242,242,242,.2);
    }

    .light-green [data-hook^="gallection_folder_"]>div:last-child{
        background-color: rgba(230,237,228,.2);
    }

    .theme-dark [data-hook^="gallection_folder_"]:hover>div:last-child{
        background-color: rgba(6,7,13,.5);
    }

    .theme-light [data-hook^="gallection_folder_"]:hover>div:last-child{
        background-color: rgba(242,242,242,.7);
    }

    .light-green [data-hook^="gallection_folder_"]:hover>div:last-child{
        background-color: rgba(230,237,228,.7);
    }

    [data-hook^="gallection_folder_"]>div:last-child>div{
        margin: 0;
        padding: 5px;
    }

    [data-hook^="gallection_folder_"]>div:last-child>div:after{
        position: absolute;
        content: "";
        width: 274px;
        height: 1px;
        top: calc(100% - 1px);
        left: 0;
        background-image: linear-gradient(90deg,#5d5d6c, transparent)
    }

    .theme-dark [data-hook^="gallection_folder_"]>div:last-child>div{
        background-image: linear-gradient(90deg,#161a1f, transparent)
    }

    .theme-light [data-hook^="gallection_folder_"]>div:last-child>div{
        background-image: linear-gradient(90deg,#fff, transparent)
    }

    .light-green [data-hook^="gallection_folder_"]>div:last-child>div{
        background-image: linear-gradient(270deg,transparent,rgb(230,237,228));
    }

    #sub-folder-gallery {
        margin-top: -25px;
    }

    #sub-folder-gallery>div:first-child>div:first-child>div:first-child>div:first-child     {
        margin-top: -1px;
    }

    /* sub galleries */
    #sub-folder-gallery>div:first-child>div:first-child>div:first-child>div:nth-child(2) >div:nth-child(2)>div>div {
        height: 120px !Important;
        width: 100% !Important;
    }

    #sub-folder-gallery>div:first-child>div:first-child>div:first-child>div:nth-child(2) >div:nth-child(2)>div>div>div:first-child,
    #sub-folder-gallery>div:first-child>div:first-child>div:first-child>div:nth-child(2) >div:nth-child(2)>div>div>div:first-child>div:first-child,
    #sub-folder-gallery>div:first-child>div:first-child>div:first-child>div:nth-child(2) >div:nth-child(2)>div>div>div:first-child>div:first-child>img {
        height: 100px !Important;
        width: 140px !Important;
    }

    #sub-folder-gallery>div:first-child>div:first-child>div:first-child>div:nth-child(2) >div:nth-child(2)>div>div>div:first-child {
        width: 140px;
        justify-content: center;
        margin-top: 10px;
        margin-bottom: 0;
    }

    #sub-folder-gallery>div:first-child>div:first-child>div:first-child>div:nth-child(2) >div:nth-child(2)>div>div>div:first-child>div+div {
        display:none;
    }

    #sub-folder-gallery>div:first-child>div:first-child>div:first-child>div:nth-child(2) >div:nth-child(2)>div>div>div:last-child {
        width: 140px;
        justify-content: center;
        margin-top: -120px;
    }
`;

  let styleNode = document.createElement("style");
  styleNode.appendChild(document.createTextNode(css));
  (document.querySelector("head") || document.documentElement).appendChild(styleNode);