Greasy Fork is available in English.

colore barra facebook ramdom figuccio

cambia colori random

  1. // ==UserScript==
  2. // @name colore barra facebook ramdom figuccio
  3. // @namespace https://greasyfork.org/users/237458
  4. // @version 1.1
  5. // @author figuccio
  6. // @description cambia colori random
  7. // @match https://*.facebook.com/*
  8. // @match https://*.facebook.com/me/*
  9. // @grant GM_addStyle
  10. // @grant GM_setValue
  11. // @grant GM_getValue
  12. // @grant GM_registerMenuCommand
  13. // @run-at document start
  14. // @icon https://www.google.com/s2/favicons?domain=facebook.com
  15. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
  16. // @license MIT
  17. // @noframes
  18. // ==/UserScript==
  19. (function() {
  20. 'use strict';
  21. ////////////////////////////////////
  22. var Button = document.createElement('button');
  23. document.getElementsByTagName('body')[0].appendChild(Button);
  24. Button.setAttribute ('id', 'prova');
  25. Button.setAttribute ('title', 'cambio colore');
  26. Button.setAttribute('class', 'test');
  27. Button.style = "position:absolute;top:370px;right:0px;z-index:9999999999999999999999;background-color:yellow;color:black;padding:5px;border-radius: 5px;border-color:green;";
  28. Button.innerHTML = "cambia colore fb random";
  29. ////////////////////////////////////////////////////body,
  30. const colors = document.getElementById('prova');
  31. let index = 0;
  32.  
  33. $(document).ready(function() {
  34. $('button').click(function() {
  35. const colors = ["blue","salmon", "green", "violet", "red","orange","purple","pink","Yellow","Cyan","#0099cc","#587b2e","#990000","#000000","#1C8200","#987baa","#981890","#AA8971","#1987FC","#99081E"];
  36. GM_setValue('lista', colors[index]);
  37. ///////////////////////////////////barra facebook
  38. $('body,#blueBarDOMInspector>div, #blueBarDOMInspector div[role="banner"], #fb2k_pagelet_bluebar>#blueBarDOMInspector>div>div, div[aria-label="Facebook"][role="navigation"]').css("background",GM_getValue("lista"));
  39. //////////////////////////////////////////
  40. var body = Math.floor(Math.random() * colors.length);
  41. var selectedcolor = colors[index];
  42. $('body,#blueBarDOMInspector>div, #blueBarDOMInspector div[role="banner"], #fb2k_pagelet_bluebar>#blueBarDOMInspector>div>div, div[aria-label="Facebook"][role="navigation"]').css("background",selectedcolor);
  43. Button.innerHTML = "&nbsp;cambio colore <br/>&nbsp;" + selectedcolor;
  44. //button dello stesso colore pagina
  45. Button.style.backgroundColor = selectedcolor;
  46. //colore testo button
  47. Button.style.color = 'white';
  48. index = index >= colors.length - 1 ? 0 : index + 1;
  49. });
  50. });
  51.  
  52. ////////////////////////////////
  53. })();
  54.  
  55. function myFunctionnasc() {
  56. if(prova.style.display = (prova.style.display!='none') ? 'none' : 'block');}
  57.  
  58. GM_registerMenuCommand("mostra pulsante/nascondi",myFunctionnasc);
  59. /////////////////////////////////////////////////
  60. if(GM_getValue('lista')){
  61. $('#Button').val(GM_getValue('lista'));
  62. document.getElementById('prova').value =GM_getValue('lista');
  63. document.body.style.backgroundColor=GM_getValue('lista');
  64. //barra facebook
  65. $('body,#blueBarDOMInspector>div, #blueBarDOMInspector div[role="banner"], #fb2k_pagelet_bluebar>#blueBarDOMInspector>div>div, div[aria-label="Facebook"][role="navigation"]').css("background",GM_getValue("lista"));
  66.  
  67. }