Greasy Fork

Greasy Fork is available in English.

DuckDuckVader

Adds a Star Wars theme to DDG.

当前为 2016-06-02 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         DuckDuckVader
// @namespace    PXgamer
// @version      0.1
// @description  Adds a Star Wars theme to DDG.
// @author       PXgamer
// @include      *duckduckgo.com/*
// @grant        none
// ==/UserScript==
/*jshint multistr: true */

(function() {
    'use strict';

    var icons = {
        duckduckvader:  'https://pximg.xyz/images/b5161751e12e8dd67e9ebd32b9c59cb3.png',
        death_star:     'https://pximg.xyz/images/5e17830c92c9d424583562f325e14993.png',
        clone_trooper:  'https://pximg.xyz/images/d0459862f22a4da2783dd2873351adac.png',
        r2d2:           'https://pximg.xyz/images/8cd897d7a3464adb858d547ddec4a54d.png',
        darth_vader:    'https://pximg.xyz/images/c7f81673c184766261c0f77140cf8b0f.png',
        c3po:           'https://pximg.xyz/images/1ebfbf15dac7c30c4c37110e2a7b089f.png',
        yoda:           'https://pximg.xyz/images/684f7e5651bd8b671c1b5b42c656680a.png',
        ls_green:       'https://pximg.xyz/images/dc89a67fd6b7074d00799a36b9e02d5a.png',
        ls_red:         'https://pximg.xyz/images/887f1b0100f57b2f2ac0d9da1f05f9f7.png',
        xwing:          'https://pximg.xyz/images/7f6dfab841f61e9744d74c8e66603146.png',
        leia:           'https://pximg.xyz/images/24c537b1303fb80d4a42d743bdb416de.png',
        boba_fett:      'https://pximg.xyz/images/07a5a5d8b7559d27a50f2313cb8ffbea.png',
        atat:           'https://pximg.xyz/images/041bd728f8bd7ad0be3d0ab1ea784731.png',
        m_falcon:       'https://pximg.xyz/images/d00c8361eacbbe5f82c39f5da482cefa.png',
        chewbacca:      'https://pximg.xyz/images/fbecac70beb699e1f25308a21f96e148.png',
        tie_fighter:    'https://pximg.xyz/images/c3cb241d0f8d48b65542701d8a857d9d.png',
        admiral_ackbar: 'https://pximg.xyz/images/832b2714f14236164cdc2756a930497b.png'
    };

    // For Home
    if (location.href == 'https://duckduckgo.com/') {
        $('.logo-wrap--home').html('');
        $('.logo-wrap--home').css('background-image', 'url('+icons.duckduckvader+')');
        $('.logo-wrap--home').css('width', '187px');
        $('.logo-wrap--home').css('height', '103px');
        $('.tag-home').html('<span>May the force be with you</span>');
    }
})();