Enhanced Thumbnail and Video Preview with 4K HD Enhancement

Enhance thumbnails and videos with high definition, 4K filter, and 3D effects

目前为 2024-10-20 提交的版本。查看 最新版本

// ==UserScript==
// @name         Enhanced Thumbnail and Video Preview with 4K HD Enhancement
// @namespace    http://tampermonkey.net/
// @version      1.5
// @description  Enhance thumbnails and videos with high definition, 4K filter, and 3D effects
// @author       Tae
// @license      MIT
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // Function to enhance images with 4K filter
    function enhanceImage(img) {
        img.style.filter = 'contrast(1.2) brightness(1.1) saturate(1.05)';
        img.style.transform = 'perspective(1000px) rotateY(25deg)';
        img.style.transition = 'all 0.3s ease-in-out';
    }

    // Function to enhance videos with 4K filter
    function enhanceVideo(video) {
        video.style.filter = 'contrast(1.2) brightness(1.1) saturate(1.05)';
        video.style.transform = 'perspective(1000px) rotateY(25deg)';
        video.style.transition = 'all 0.3s ease-in-out';
    }

    // Apply enhancements to all images and videos on the page
    function applyEnhancements() {
        const images = document.querySelectorAll('img');
        const videos = document.querySelectorAll('video');
        images.forEach(img => {
            img.onmouseover = () => {
                img.style.filter = 'contrast(1.0) brightness(1.0) saturate(1.0)';
                img.style.transform = 'perspective(1000px)';
            };
            img.onmouseout = () => enhanceImage(img);
            if (img.complete) {
                enhanceImage(img);
            }
        });
        videos.forEach(video => {
            video.onmouseover = () => {
                video.style.filter = 'contrast(1.0) brightness(1.0) saturate(1.0)';
                video.style.transform = 'perspective(1000px)';
            };
            video.onmouseout = () => enhanceVideo(video);
            if (video.readyState >= 3) {
                enhanceVideo(video);
            }
        });
    }

    // Run the enhancements when the page loads
    window.addEventListener('load', applyEnhancements);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址