JavDB Dynamic Title Expander

Expands video title boxes to fit translated text without truncation.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         JavDB Dynamic Title Expander
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Expands video title boxes to fit translated text without truncation.
// @author       You
// @match        https://javdb.com/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // 1. Inject CSS to override truncation and fixed heights
    const style = document.createElement('style');
    style.textContent = `
        /* Remove the 2-line limit and allow wrapping */
        .video-item .title, .video-title, .grid-item .title {
            display: block !important;
            -webkit-line-clamp: unset !important;
            -webkit-box-orient: unset !important;
            overflow: visible !important;
            white-space: normal !important;
            height: auto !important;
            min-height: 2.8em !important; /* Keeps some uniformity */
            margin-bottom: 5px;
        }

        /* Adjust the parent container to grow with the title */
        .item, .video-item, .grid-item {
            height: auto !important;
            padding-bottom: 10px !important;
            display: flex !important;
            flex-direction: column !important;
        }

        /* Fix image/meta alignment inside the expanded box */
        .video-item .meta {
            margin-top: auto; /* Pushes ratings/dates to the bottom of the card */
        }
    `;
    document.head.appendChild(style);

    // 2. Optional: Logic to re-calculate if you are translating on-the-fly
    // If your script translates text after the page loads, the 'height: auto'
    // above will handle it automatically.
})();