Skip to content

Instantly share code, notes, and snippets.

@rakinishraq
Last active November 8, 2023 01:21
Show Gist options
  • Save rakinishraq/96dc2c9fef19d82f6101dd4005c636b9 to your computer and use it in GitHub Desktop.
Save rakinishraq/96dc2c9fef19d82f6101dd4005c636b9 to your computer and use it in GitHub Desktop.
Adds a button to quickly hide and show everything in Miro
// ==UserScript==
// @name Minimal Miro
// @namespace Violentmonkey Scripts
// @match https://miro.com/*
// @grant GM_addStyle
// @version 1.0
// @author -
// @description 11/4/2023, 7:51:59 AM
// ==/UserScript==
var styleElement;
function toggleCSS() {
if (styleElement) {
styleElement.remove();
styleElement = null;
} else {
styleElement = GM_addStyle(`
.desktop-ui__header, .desktop-ui__body {
display: none !important;
}
.canvasContextMenu {
display: none !important;
}
`);
}
}
var button = document.createElement('button');
button.textContent = 'Toggle CSS';
button.style.position = 'fixed';
button.style.bottom = '10px';
button.style.left = '50%';
button.style.transform = 'translateX(-50%)';
button.addEventListener('click', toggleCSS);
document.body.appendChild(button);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment