DuckDuckVader

Adds a Star Wars theme to DDG.

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

  1. // ==UserScript==
  2. // @name DuckDuckVader
  3. // @namespace PXgamer
  4. // @version 0.4
  5. // @description Adds a Star Wars theme to DDG.
  6. // @author PXgamer
  7. // @include *duckduckgo.com/*
  8. // @grant none
  9. // ==/UserScript==
  10. /*jshint multistr: true */
  11.  
  12. (function() {
  13. 'use strict';
  14. // Set dark theme
  15. var darktheme = true;
  16.  
  17. var icons = {
  18. ddv_icon: 'https://pxstat.us/img/ddg.ico',
  19. duckduckvader: 'https://pximg.xyz/images/b5161751e12e8dd67e9ebd32b9c59cb3.png',
  20. death_star: 'https://pximg.xyz/images/5e17830c92c9d424583562f325e14993.png',
  21. clone_trooper: 'https://pximg.xyz/images/d0459862f22a4da2783dd2873351adac.png',
  22. r2d2: 'https://pximg.xyz/images/8cd897d7a3464adb858d547ddec4a54d.png',
  23. darth_vader: 'https://pximg.xyz/images/c7f81673c184766261c0f77140cf8b0f.png',
  24. c3po: 'https://pximg.xyz/images/1ebfbf15dac7c30c4c37110e2a7b089f.png',
  25. yoda: 'https://pximg.xyz/images/684f7e5651bd8b671c1b5b42c656680a.png',
  26. ls_green: 'https://pximg.xyz/images/dc89a67fd6b7074d00799a36b9e02d5a.png',
  27. ls_red: 'https://pximg.xyz/images/887f1b0100f57b2f2ac0d9da1f05f9f7.png',
  28. xwing: 'https://pximg.xyz/images/7f6dfab841f61e9744d74c8e66603146.png',
  29. leia: 'https://pximg.xyz/images/24c537b1303fb80d4a42d743bdb416de.png',
  30. boba_fett: 'https://pximg.xyz/images/07a5a5d8b7559d27a50f2313cb8ffbea.png',
  31. atat: 'https://pximg.xyz/images/041bd728f8bd7ad0be3d0ab1ea784731.png',
  32. m_falcon: 'https://pximg.xyz/images/d00c8361eacbbe5f82c39f5da482cefa.png',
  33. chewbacca: 'https://pximg.xyz/images/fbecac70beb699e1f25308a21f96e148.png',
  34. tie_fighter: 'https://pximg.xyz/images/c3cb241d0f8d48b65542701d8a857d9d.png',
  35. admiral_ackbar: 'https://pximg.xyz/images/832b2714f14236164cdc2756a930497b.png'
  36. };
  37.  
  38. // All pages set favicon
  39. (function() {
  40. var link = document.createElement('link');
  41. link.type = 'image/x-icon';
  42. link.rel = 'shortcut icon';
  43. link.href = icons.ddv_icon;
  44. document.getElementsByTagName('head')[0].appendChild(link);
  45. }());
  46.  
  47. // For Home
  48. if (location.href == 'https://duckduckgo.com/' || location.href == 'https://duckduckgo.com/?q=') {
  49. $('.logo-wrap--home').html('');
  50. $('.logo-wrap--home').css('background-image', 'url('+icons.duckduckvader+')');
  51. $('.logo-wrap--home').css('width', '187px');
  52. $('.logo-wrap--home').css('height', '103px');
  53. if (darktheme) {
  54. $('body').css('background-color', 'black');
  55. $('.logo-wrap--home').css('-webkit-filter', 'invert(100%)');
  56. }
  57. $('.tag-home').html('<span>May the force be with you</span>');
  58. $('.search__button').val('');
  59. $('.search__button').css('background-image', 'url('+icons.death_star+')');
  60. $('.search__button').css('background-size', 'contain');
  61. }
  62. })();

QingJ © 2025

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