Search found 4 matches for photo

[Userscript] 10wallpaper downloader

Diễn đàn: UserscriptTrả lời: 0Lượt xem: 666

 10.06.17 22:38

Tải hình nền từ 10wallpaper.com chỉ với 1-Click. Có thể chọn độ phân giải cố định để tải xuống.

Demo


Topics tagged under photo on DEVs forumvi 10wall10
Tải hình nền từ 10wallpaper

Cài đặt


Dùng một trong các link sau:

  1. https://greasyfork.org/vi/scripts/19854-10wallpaper-downloader
  2. https://openuserjs.org/scripts/baivong/10wallpaper_downloader
  3. https://github.com/baivong/Userscript/raw/master/10wallpaper_downloader/10wallpaper_downloader.user.js

Mã nguồn


Code:
// ==UserScript==
// @name        10wallpaper downloader
// @namespace    http://baivong.github.io/
// @version      2.1.2
// @description  1-Click download on 10wallpaper. You should select the resolution before downloading.
// @icon        http://i.imgur.com/08zfJez.png
// @author      Zzbaivong
// @oujs:author  baivong
// @license      MIT; https://baivong.mit-license.org/license.txt
// @match        http://10wallpaper.com/*
// @match        http://www.10wallpaper.com/*
// @match        https://10wallpaper.com/*
// @match        https://www.10wallpaper.com/*
// @require      https://unpkg.com/file-saver@1.3.8/FileSaver.min.js
// @require      https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js?v=a834d46
// @noframes
// @connect      self
// @supportURL  https://github.com/lelinhtinh/Userscript/issues
// @run-at      document-idle
// @grant        GM.xmlHttpRequest
// @grant        GM_xmlhttpRequest
// @grant        GM.openInTab
// @grant        GM_openInTab
// ==/UserScript==

(function () {
    'use strict';

    /**
    * Resolution config
    * @type {String} // Eg: 1920x1200, 1366x768, 1280x1024, ...
    */
    var resolution = '';


    // Do not change the code below this line, unless you know how.
    var list = document.querySelectorAll('a[href^="/view/"]'),
        res = location.pathname.match(/\d+x\d+/);
    if (!/\d+x\d+/.test(resolution)) resolution = screen.width + 'x' + screen.height;
    res = !res ? resolution : res[0];

    [].forEach.call(list, function (link) {
        var info = link.querySelector('span'),
            infoContent = info.innerHTML,
            img = link.querySelector('img'),
            imgName;

        if (!img) return;
        img = img.src.replace(/(\/|_)(small|medium)(\/|\.)/g, '$1' + res + '$3');
        imgName = img.replace(/.*\//, '');

        link.addEventListener('click', function (e) {
            e.preventDefault();
            info.innerHTML = 'Downloading...';

            GM.xmlHttpRequest({
                method: 'GET',
                url: img,
                responseType: 'blob',
                onprogress: function (e) {
                    var percent = Math.round((e.loaded / e.total) * 100);
                    info.innerHTML = percent + ' %';
                },
                onload: function (response) {
                    var blob = response.response;

                    info.innerHTML = infoContent;
                    link.setAttribute('href', URL.createObjectURL(blob));
                    link.setAttribute('download', imgName);

                    saveAs(blob, imgName);
                },
                onerror: function (err) {
                    console.error(err);
                }
            });
        });

        link.addEventListener('contextmenu', function (e) {
            e.preventDefault();
            GM.openInTab(img);
        });

        link.setAttribute('title', 'Click to download this image\nRight Click to open in new tab');
    });
})();


Hướng dẫn


Thông thường trang 10wallpaper sẽ tự thiết lập độ phân giải (resolution) tương ứng với thiết bị của bạn. Tuy nhiên, bạn có thể thay đổi bằng cách chỉnh tham số resolution trong mã nguồn, dòng 33.
Nhấn chuột vào ảnh để download.
Nhấn chuột phải để mở ảnh trong cửa sổ mới.
Tags: #userscript #download #photo #10wallpaper

[Userscript] Wallpaperscraft downloader

Diễn đàn: UserscriptTrả lời: 0Lượt xem: 649

 10.06.17 22:17

Tải hình nền từ wallpaperscraft.com chỉ với 1-Click. Có thể chọn độ phân giải cố định để tải xuống.

Demo


Topics tagged under photo on DEVs forumvi Wallpa10
Tải hình nền từ Wallpaperscraft

Cài đặt


Dùng một trong các link sau:

  1. https://greasyfork.org/vi/scripts/19843-wallpaperscraft-downloader
  2. https://openuserjs.org/scripts/baivong/Wallpaperscraft_downloader
  3. https://github.com/baivong/Userscript/raw/master/wallpaperscraft_downloader/wallpaperscraft_downloader.user.js

Mã nguồn


Code:
// ==UserScript==
// @name        Wallpaperscraft downloader
// @namespace    http://baivong.github.io/
// @version      2.1.2
// @description  1-Click download on Wallpaperscraft. You should select the resolution before downloading.
// @icon        http://i.imgur.com/NA96TWE.png
// @author      Zzbaivong
// @oujs:author  baivong
// @license      MIT; https://baivong.mit-license.org/license.txt
// @include      https://wallpaperscraft.com/*
// @exclude      https://wallpaperscraft.com/wallpaper/*
// @exclude      https://wallpaperscraft.com/download/*
// @require      https://unpkg.com/file-saver@1.3.8/FileSaver.min.js
// @require      https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js?v=a834d46
// @noframes
// @connect      self
// @supportURL  https://github.com/lelinhtinh/Userscript/issues
// @run-at      document-idle
// @grant        GM.xmlHttpRequest
// @grant        GM_xmlhttpRequest
// @grant        GM.openInTab
// @grant        GM_openInTab
// ==/UserScript==

(function () {
    'use strict';

    /**
    * Resolution config
    * @type {String} // Eg: 1920x1200, 1366x768, 1280x1024, ...
    */
    var resolution = '';


    // Do not change the code below this line, unless you know how.
    var list = document.querySelectorAll('.wallpapers__link');
    if (!/\d+x\d+/.test(resolution)) resolution = screen.width + 'x' + screen.height;

    [].forEach.call(list, function (link) {
        var info = link.querySelector('.wallpapers__info'),
            infoContent = info.innerHTML,
            img = link.querySelector('img'),
            imgName,
            res;

        res = !info ? resolution : info.textContent.match(/\d+x\d+/)[0];

        if (!img) return;
        img = img.src.replace(/\d+x\d+/, res);
        imgName = img.replace(/.*\//, '');

        link.addEventListener('click', function (e) {
            e.preventDefault();
            info.innerHTML = 'Downloading...';

            GM.xmlHttpRequest({
                method: 'GET',
                url: img,
                responseType: 'blob',
                onprogress: function (e) {
                    var percent = Math.round((e.loaded / e.total) * 100);
                    info.innerHTML = percent + ' %';
                },
                onload: function (response) {
                    var blob = response.response;

                    info.innerHTML = infoContent;
                    link.setAttribute('href', URL.createObjectURL(blob));
                    link.setAttribute('download', imgName);

                    saveAs(blob, imgName);
                },
                onerror: function (err) {
                    console.error(err);
                }
            });
        });

        link.addEventListener('contextmenu', function (e) {
            e.preventDefault();
            GM.openInTab(img);
        });

        link.setAttribute('title', 'Click to download this image\nRight Click to open in new tab');
    });
})();


Hướng dẫn


Chọn độ phân giải (resolution) từ menu bên phải trước khi download, hoặc chỉnh tham số resolution trong mã nguồn, dòng 32.
Nhấn chuột vào ảnh để download.
Nhấn chuột phải để mở ảnh trong cửa sổ mới.
Tags: #userscript #download #photo #wallpaperscraft

[Userscript] Download ảnh ở Worldcosplay

Diễn đàn: UserscriptTrả lời: 7Lượt xem: 5013

 31.01.15 11:00

Worldcosplay.net không cho phép download ảnh nên bạn không thể sử dụng cách thông thường để tải được. Userscript này sẽ tạo thêm nút download bên dưới ảnh để bạn có thể dễ dàng làm việc đó.

Demo


Topics tagged under photo on DEVs forumvi EiBHnCL
(Nút download ảnh đã thêm vào)
Download trong Album:


Cài đặt


Dùng một trong các link sau:

  1. https://greasyfork.org/vi/scripts/16114-worldcosplay-download
  2. https://openuserjs.org/scripts/baivong/Worldcosplay_download
  3. https://github.com/baivong/Userscript/raw/master/worldcosplay_downloader/worldcosplay_downloader.user.js

Mã nguồn


Code:
// ==UserScript==
// @name        Worldcosplay download
// @namespace    http://devs.forumvi.com/
// @description  Download photo(s) on worldcosplay.net
// @version      3.1.2
// @icon        http://i.imgur.com/gJLjIzb.png
// @author      Zzbaivong
// @oujs:author  baivong
// @license      MIT; https://baivong.mit-license.org/license.txt
// @match        https://worldcosplay.net/*/photos*
// @match        https://worldcosplay.net/*/favorites*
// @match        https://worldcosplay.net/photo/*
// @match        https://worldcosplay.net/tag/*
// @match        https://worldcosplay.net/search/photos?*
// @match        https://worldcosplay.net/collections/*
// @match        https://worldcosplay.net/character/*
// @match        https://worldcosplay.net/title/*
// @match        https://worldcosplay.net/photos
// @match        https://worldcosplay.net/popular
// @match        https://worldcosplay.net/ranking/good*
// @match        https://worldcosplay.net/*/photo/*
// @match        https://worldcosplay.net/*/tag/*
// @match        https://worldcosplay.net/*/search/photos?*
// @match        https://worldcosplay.net/*/collections/*
// @match        https://worldcosplay.net/*/character/*
// @match        https://worldcosplay.net/*/title/*
// @match        https://worldcosplay.net/*/photos
// @match        https://worldcosplay.net/*/popular
// @match        https://worldcosplay.net/*/ranking/good*
// @require      https://code.jquery.com/jquery-3.3.1.slim.min.js
// @require      https://unpkg.com/file-saver@1.3.8/FileSaver.min.js
// @require      https://greasyfork.org/scripts/6250-waitforkeyelements/code/waitForKeyElements.js?version=23756
// @require      https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js?v=a834d46
// @noframes
// @connect      self
// @connect      sakurastorage.jp
// @supportURL  https://github.com/lelinhtinh/Userscript/issues
// @run-at      document-idle
// @grant        GM.xmlHttpRequest
// @grant        GM_xmlhttpRequest
// @grant        GM.openInTab
// @grant        GM_openInTab
// ==/UserScript==

/* global waitForKeyElements */
(function ($, window) {
    'use strict';

    window.URL = window.URL || window.webkitURL;

    function downloadPhoto(el, url) {
        var photoName = url.replace(/.*\//g, ''),
            $icon = $(el).find('.fa');

        $icon.addClass('fa-spinner fa-spin');

        GM.xmlHttpRequest({
            method: 'GET',
            url: url,
            responseType: 'blob',
            onload: function (response) {
                var blob = response.response;

                $(el).attr({
                    href: window.URL.createObjectURL(blob),
                    download: photoName
                }).off('click');
                $icon.removeClass('fa-spinner fa-spin').addClass('fa-download');

                saveAs(blob, photoName);
            },
            onerror: function (err) {
                $icon.removeClass('fa-spinner fa-spin').addClass('fa-times');
                console.error(err);
            }
        });
    }

    function getImage3000(url) {
        var hasMax = url.match(/\/max-(\d+)\//);
        if (hasMax) return url.replace(/-[\dx]+\./, '-' + hasMax[1] + '.');

        return url.replace(/-[\dx]+\./, '-3000.');
    }

    if (/^(\/[a-z-]+)?\/photo\/\d+$/.test(location.pathname)) {

        var $btn = $('<a>', {
                href: '#download',
                class: 'download-this-photo',
                title: 'Click to download this image\nRight Click to open in new tab',
                html: '<div class="side_buttons" style="right: 250px;"><div class="like-this-photo button fave fa fa-download"><div class="effect-ripple"></div></div></div>'
            }),
            img = $('#photoContainer').find('.img').attr('src');
        $btn.on('click', function (e) {
            e.preventDefault();
            e.stopPropagation();
            downloadPhoto(this, getImage3000(img));
        }).on('contextmenu', function (e) {
            e.preventDefault();
            e.stopPropagation();
            GM.openInTab(getImage3000(img));
        });
        $btn.insertAfter('.side_buttons');

    } else {

        var addBtn = function () {
            $('.preview').not('.added-download-btn').each(function () {
                var $this = $(this),
                    $btn = $('<a>', {
                        href: '#download',
                        class: 'download-this-photo',
                        title: 'Click to download this image\nRight Click to open in new tab',
                        html: '<div class="item likes" style="top: 50px;"><span class="like-this-photo"><i class="fa fa-download"></i><span class="effect-ripple"></span></span></div>'
                    });
                $btn.on('click', function (e) {
                    e.preventDefault();
                    e.stopPropagation();
                    downloadPhoto(this, getImage3000($this.find('.photo_img').css('backgroundImage').slice(5, -2)));
                }).on('contextmenu', function (e) {
                    e.preventDefault();
                    e.stopPropagation();
                    GM.openInTab(getImage3000($this.find('.photo_img').css('backgroundImage').slice(5, -2)));
                });
                $this.find('.options').append($btn);
                $this.addClass('added-download-btn');
            });
        };
        addBtn();

        waitForKeyElements('.preview', addBtn);

    }

})(jQuery, window);

Tags: #userscript #download #photo #cosplay #cure #worldcosplay

 07.05.14 20:47

Userscript này sẽ thay nền xem ảnh dạng lưới, tác dụng của nó thể hiện rõ nhất khi xem ảnh trong suốt. Đối với ảnh lớn, script này hỗ trợ bạn cuộn ảnh thuận tiện hơn bằng cách giữ chuột phải và kéo.

Demo


Topics tagged under photo on DEVs forumvi YOBYNp4
Hiển thị rõ phần trong suốt của ảnh


Cài đặt


Dùng một trong các liên kết sau:

  1. https://openuserjs.org/scripts/baivong/Image_viewer
  2. https://greasyfork.org/vi/scripts/16113-image-viewer
  3. https://github.com/baivong/Userscript/raw/master/image_viewer/Image_viewer.user.js

Mã nguồn


Code:
// ==UserScript==
// @name        Image viewer
// @namespace    http://devs.forumvi.com/
// @description  Use grid wallpaper to highlight transparent image. Support to view the large image by holding the right mouse and drag.
// @version      2.1.0
// @icon        http://i.imgur.com/ItcjCPc.png
// @author      Zzbaivong
// @oujs:author  baivong
// @license      MIT; https://baivong.mit-license.org/license.txt
// @match        http://*/*
// @match        https://*/*
// @noframes
// @supportURL  https://github.com/lelinhtinh/Userscript/issues
// @run-at      document-start
// @grant        none
// ==/UserScript==

(function () {

    'use strict';

    /**
    * Background mode
    * @type {string} dark
    *                light
    */
    var theme = 'dark';


    // Do not change the code below this line, unless you know how.
    var doc = document,
        color = theme === 'light' ? ['#eee', 'white'] : ['gray', '#444'];

    if (doc.contentType.indexOf('image/') !== 0) return;

    function scrollByDragging(container, disableH, disableV) {

        function mouseUp(e) {
            if (e.which !== 3) return;

            window.removeEventListener('mousemove', mouseMove, true);
            container.style.cursor = 'default';
        }

        function mouseDown(e) {
            if (e.which !== 3) return;

            pos = {
                x: e.clientX,
                y: e.clientY
            };

            window.addEventListener('mousemove', mouseMove, true);
            container.style.cursor = 'move';
        }

        function mouseMove(e) {
            if (!disableH) container.scrollLeft -= (-pos.x + (pos.x = e.clientX));
            if (!disableV) container.scrollTop -= (-pos.y + (pos.y = e.clientY));
        }

        var pos = {
            x: 0,
            y: 0
        };

        container.oncontextmenu = function (e) {
            e.preventDefault();
        };

        container.addEventListener('mousedown', mouseDown, false);
        window.addEventListener('mouseup', mouseUp, false);

    }

    function addstyle(aCss) {
        var head = doc.getElementsByTagName('head')[0];
        if (!head) return null;
        var style = doc.createElement('style');
        style.setAttribute('type', 'text/css');
        style.textContent = aCss;
        head.appendChild(style);
        return style;
    }

    addstyle('body{background-attachment: fixed !important; background-position: 0px 0px, 10px 10px !important; background-size: 20px 20px !important; background-image: linear-gradient(45deg, ' + color[0] + ' 25%, transparent 25%, transparent 75%, ' + color[0] + ' 75%, ' + color[0] + ' 100%),linear-gradient(45deg, ' + color[0] + ' 25%, ' + color[1] + ' 25%, ' + color[1] + ' 75%, ' + color[0] + ' 75%, ' + color[0] + ' 100%) !important;} body > img {background-color: transparent !important; background-image: none !important; display: block; margin: auto; position: absolute; left: 0; top: 0; right: 0; bottom: 0;} body > img:hover {background: rgba(0, 0, 0, 0.4) !important; outline: 3px solid #333;} body > img[style*="cursor: zoom-out;"], body > img.overflowing {position: relative !important;}');

    scrollByDragging(doc.body);
    scrollByDragging(doc.documentElement);

}());




Ứng dụng xem ảnh trong forumotion


Demo


https://devs.forumvi.com/viewimage.forum?u=https://i.imgur.com/Yfl5NFO.gif

Hướng dẫn


Thêm vào CSS:
Code:
/* Image viewer - devs.forumvi.com */
p + center > a[href="javascript:window.close()"]{display:block;padding:15px;background:url('data:image/gif;base64,R0lGODlhCgAKAIAAAAAAAP///yH5BAEAAAAALAAAAAAKAAoAAAIRhB2ZhxoM3GMSykqd1VltzxQAOw==') repeat scroll #dddddd;}
p + center > a[href="javascript:window.close()"] img{border:1px solid transparent}
p + center > a[href="javascript:window.close()"] img:hover{border:1px dotted #c0c0c0;background-color:rgba(0,0,0,0.05)}

Tags: #userscript #photo #viewer


Back to top