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.

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 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');
})();