Advertisement
Guest User

Untitled

a guest
Mar 21st, 2016
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Duolingo Flag background
  3. // @namespace   a34c0ac7aca179b6312214a6e1697b5a
  4. // @description  Adds more duo to the website!
  5. // @author       You
  6. // @match        *://www.duolingo.com/*
  7. // @grant        none
  8. // @copyright    2015, Thomas de Roo
  9. // @updateURL   https://monkeyguts.com/828.meta.js?c
  10. // @downloadURL https://monkeyguts.com/828.user.js?c
  11. // ==/UserScript==
  12. function doFlag(){
  13.     var languagestring = duo.user.get("learning_language");
  14.     var backgroundurl = "notset";
  15.     switch(languagestring){
  16.         default:
  17.             //INSERT YOUR IMAGE HERE
  18.             backgroundurl = "http://www.psdgraphics.com/file/green-hexagons-background.png";
  19.             break;
  20.     }
  21.     $("body").css("background", "url("+backgroundurl+")");
  22.     $("body").css("background-size", "100%");
  23.     $("body").css("background-repeat", "no-repeat");
  24.     $("body").css("background-attachment", "fixed");
  25.     $(".nav-footer").css("text-shadow", "1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000");
  26.     $(".nav-footer a").css("color", "white");
  27.     //$("#app").css("background", "url('http://i.imgur.com/W6psVNL.png') no-repeat bottom center fixed");
  28. }
  29.  
  30. function inject(f) { //Inject the script into the document
  31.     var script;
  32.     script = document.createElement('script');
  33.     script.type = 'text/javascript';
  34.     script.textContent = f.toString();
  35.     document.head.appendChild(script);
  36. }
  37. console.log('Userscript loaded: Duolingo Flag Background');
  38. function inject(f) { //Inject the script into the document
  39.     var script;
  40.     script = document.createElement('script');
  41.     script.type = 'text/javascript';
  42.     script.textContent = f.toString();
  43.     document.head.appendChild(script);
  44. }
  45. inject(doFlag);
  46. $(document).ready(function() {
  47.  doFlag();
  48. });
  49. //Meh...
  50. window.setInterval(function(){
  51.        doFlag();
  52. }, 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement