Greasy Fork is available in English.

Synchronized Bau Bau

The script to enable synchronized Bau Baus once and for all!

  1. // ==UserScript==
  2. // @name Synchronized Bau Bau
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @author You
  6. // @description The script to enable synchronized Bau Baus once and for all!
  7. // @match https://fwmcbaubau.com/
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=fwmcbaubau.com
  9. // @grant GM_addStyle
  10. // @run-at document-start
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. GM_addStyle ( `
  15. .button-container {
  16. display: flex;
  17. flex-direction: column;
  18. align-items: center;
  19. }
  20.  
  21. .dog-heads {
  22. display: flex;
  23. }
  24.  
  25. .baubaubutton {
  26. background: linear-gradient(90deg, rgba(128,231,255,1) 0%, rgba(240,224,255,1) 50%, rgba(255,140,188,1) 100%);
  27. opacity: 0.8;
  28. font: inherit;
  29. width: 100%;
  30. margin-top: 10px;
  31. padding: 15px;
  32. border: none;
  33. border-radius: 12px;
  34. }
  35.  
  36. .overlay {
  37. position:absolute;
  38. top:0;
  39. left:0;
  40. width: 100%;
  41. height: 100%;
  42. background-color: #000000;
  43. opacity: 0.1;
  44. z-index: -1;
  45. }
  46. ` );
  47.  
  48. window.addEventListener('load', function() {
  49. 'use strict';
  50.  
  51. const buttonContainer = document.querySelector('.button-container');
  52. const fuwawa = document.querySelector('#fuwawa');
  53. const mococo = document.querySelector('#mococo');
  54.  
  55. function init() {
  56. if (!fuwawa || !mococo) return(console.error('The dogs are missing.'));
  57. if (!buttonContainer) return(console.error('Button container not found'));
  58. addOverlay();
  59. groupDogHeads();
  60. addBauBauButton();
  61. }
  62.  
  63. // Adds the double Bau Bau Button!!!
  64. function addBauBauButton() {
  65. let theButton = document.createElement('button');
  66. theButton.textContent = 'Bau Bau Together!';
  67. theButton.classList.add('baubaubutton');
  68. theButton.addEventListener('click', () => fuwawa.click());
  69. theButton.addEventListener('click', () => mococo.click());
  70. buttonContainer.appendChild(theButton);
  71. }
  72.  
  73. function groupDogHeads() {
  74. let dogHeads = document.createElement('div');
  75. dogHeads.classList.add('dog-heads');
  76. buttonContainer.appendChild(dogHeads);
  77. dogHeads.appendChild(fuwawa);
  78. dogHeads.appendChild(mococo);
  79. }
  80.  
  81. // Makes the background slightly darker. Can be changed to other colors/opacity using CSS.
  82. function addOverlay() {
  83. let overlay = document.createElement('overlay');
  84. overlay.classList.add('overlay');
  85. document.body.appendChild(overlay);
  86. }
  87.  
  88. init();
  89. }, false)();