Pepper image enlarger

Pepper is a Dutch dating website, but all images are microscopically small. This script makes the images larger on hover. You're welcome.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Pepper image enlarger
// @namespace    https://app.pepper.nl
// @version      0.1
// @description  Pepper is a Dutch dating website, but all images are microscopically small. This script makes the images larger on hover. You're welcome.
// @author       Rick van der Staaij
// @include      https://app.pepper.nl/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function addPreviewPane(){
        $('body').append('<div style="position:fixed; z-index:9999; min-width: 200px; min-height: 200px; background-image: url(https://loading.io/spinners/lava-lamp/index.lava-lamp-preloader.svg); background-color: #FFFFFF; background-repeat: no-repeat; background-position: center center; border: 5px solid #FB1D6C; bottom: 20px; right: 20px; display: none; border-radius: 10px;" id="preview-pane"><img src="" style="border-radius: 3px;" id="preview-image" /></a>');
    }

    function setImageHovers() {
        $('img:not([pimped="true"])').attr('pimped', 'true').hover(function() {
            var URL = $(this).attr('src');

            var widthRegex = /width=([\d]+)/gi;
            var heightRegex = /height=([\d]+)&crop=true/gi;

            URL = URL.replace(widthRegex, 'width=600');
            URL = URL.replace(heightRegex, 'height=600');

            if (event.clientX > Math.round($(window).width() / 2)) {
                $('#preview-pane').css('left', '20px');
                $('#preview-pane').css('right', 'auto');
            } else {
                $('#preview-pane').css('right', '20px');
                $('#preview-pane').css('left', 'auto');
            }

            $('#preview-pane').css('display', 'block');
            $('#preview-image').attr('src', URL);

        }, function() {
            $('#preview-pane').css('display', 'none');
        });
    }

    $(document).ready(function(){
        addPreviewPane();
    });

    setInterval(function(){
        setImageHovers();
    }, 1000);

    console.log('[PepperPimper] All images will be enlarged, kthnxbai');
})();