diff --git a/DnDBeyond Full Game Log.user.js b/DnDBeyond Full Game Log.user.js new file mode 100644 index 0000000..fe29c2e --- /dev/null +++ b/DnDBeyond Full Game Log.user.js @@ -0,0 +1,34 @@ +// ==UserScript== +// @name D&D Beyond Full Screen Roll Log +// @namespace https://bullercodeworks.com +// @version 0.1 +// @description Make the Game Log in DnDBeyond Full Screen +// @author Brian Buller +// @match https://www.dndbeyond.com/campaigns/* +// @icon https://www.google.com/s2/favicons?domain=dndbeyond.com +// @grant none +// ==/UserScript== + +(function() { + 'use strict'; + + function fullScreenLog() { + var sidebar = document.querySelector('.sidebar__pane-content'); + document.body.prepend(sidebar); + } + + function addFullScreenButton() { + var newButtonSpan = document.createElement('span'); + newButtonSpan.classList.add('sidebar__control-group', 'sidebar__control-group--fullscreen'); + var newButton = document.createElement('button'); + newButton.id = 'fullscreen'; + newButton.classList.add('sidebar__control'); + newButton.innerHTML = ''; + + newButtonSpan.appendChild(newButton); + document.querySelector('div.sidebar__controls').appendChild(newButtonSpan); + newButton.onclick = fullScreenLog; + } + + document.querySelector('.sidebar__control-group--visibility').onclick = addFullScreenButton; +})();