Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Duolingo Flag background
- // @namespace a34c0ac7aca179b6312214a6e1697b5a
- // @description Adds more duo to the website!
- // @author You
- // @match *://www.duolingo.com/*
- // @grant none
- // @copyright 2015, Thomas de Roo
- // @updateURL https://monkeyguts.com/828.meta.js?c
- // @downloadURL https://monkeyguts.com/828.user.js?c
- // ==/UserScript==
- function doFlag(){
- var languagestring = duo.user.get("learning_language");
- var backgroundurl = "notset";
- switch(languagestring){
- default:
- //INSERT YOUR IMAGE HERE
- backgroundurl = "http://www.psdgraphics.com/file/green-hexagons-background.png";
- break;
- }
- $("body").css("background", "url("+backgroundurl+")");
- $("body").css("background-size", "100%");
- $("body").css("background-repeat", "no-repeat");
- $("body").css("background-attachment", "fixed");
- $(".nav-footer").css("text-shadow", "1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000");
- $(".nav-footer a").css("color", "white");
- //$("#app").css("background", "url('http://i.imgur.com/W6psVNL.png') no-repeat bottom center fixed");
- }
- function inject(f) { //Inject the script into the document
- var script;
- script = document.createElement('script');
- script.type = 'text/javascript';
- script.textContent = f.toString();
- document.head.appendChild(script);
- }
- console.log('Userscript loaded: Duolingo Flag Background');
- function inject(f) { //Inject the script into the document
- var script;
- script = document.createElement('script');
- script.type = 'text/javascript';
- script.textContent = f.toString();
- document.head.appendChild(script);
- }
- inject(doFlag);
- $(document).ready(function() {
- doFlag();
- });
- //Meh...
- window.setInterval(function(){
- doFlag();
- }, 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement