• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Themes & Styles Dynamic library background image

     
    • 0 Vote(s) - 0 Average

    Dynamic library background image

    Animated background thumbnail
    SethBacon
    Offline

    Member

    Posts: 66
    Threads: 7
    Joined: 2023 Nov
    Reputation: 8
    Country:Canada
    #2
    2025-07-12, 08:39 PM
    I liked Nanos post too, heres the code they had originally: .card[data-id='0c31907140d8021217e2cd79e123']:hover .cardImageContainer, .card.show-animation[data-id='0c31907140d8021217e2cd79e123 ']:focus .cardImageContainer { background-image: url("/Items/0c31907140d8021217e2cd79e123 /Images/Logo?maxWidth=480&tag=0c31907140d8021217e2cd79e123 &quality=90") !important;}



    To fix your concerns:
    Preload the image (to avoid flicker on first hover)
    <img src="/Items/0c31907140d8021217e2cd79e123/Images/Logo?maxWidth=480&tag=0c31907140d8021217e2cd79e123&quality=90" style="display:none;" />



    Use a pseudo-element overlay instead of reloading the image: keep the image always loaded in CSS, and animate opacity or transform on top instead of replacing the background.

    .card[data-id='0c31907140d8021217e2cd79e123'] .cardImageContainer {
        position: relative; /* Make sure it can contain the pseudo-element absolutely */
    }

    .card[data-id='0c31907140d8021217e2cd79e123'] .cardImageContainer::after {
        content: "";
        background-image: url("/Items/0c31907140d8021217e2cd79e123/Images/Logo?maxWidth=480&tag=0c31907140d8021217e2cd79e123&quality=90");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        opacity: 0;
        transition: opacity 0.3s ease, transform 0.3s ease;
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
        pointer-events: none;
    }

    .card[data-id='0c31907140d8021217e2cd79e123']:hover .cardImageContainer::after,
    .card.show-animation[data-id='0c31907140d8021217e2cd79e123']:focus .cardImageContainer::after {
        opacity: 1;
        transform: scale(1.05);
    }
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    Messages In This Thread
    Dynamic library background image - by Cronus - 2025-07-12, 01:57 PM
    RE: Dynamic library background image - by SethBacon - 2025-07-12, 08:39 PM
    RE: Dynamic library background image - by Cronus - 2025-07-13, 11:15 AM

    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode