diff --git a/app/src/App.js b/app/src/App.js index d77b105..7c233e3 100644 --- a/app/src/App.js +++ b/app/src/App.js @@ -18,7 +18,7 @@ HBO Now and HBO Max logos are trademark and intellectual property of WarnerMedia ************************************************************************/ import React, { useState, useEffect } from 'react'; import Router from 'route-lite'; -import { Fab, createMuiTheme, ThemeProvider, Snackbar } from '@material-ui/core'; +import { Fab, createMuiTheme, ThemeProvider, Snackbar, Tooltip } from '@material-ui/core'; import Create from './Create'; import Loading from './Loading'; import firebase from 'firebase/app'; @@ -47,6 +47,28 @@ const Routes = (props) => ( ); +const resetResize = () => { + const checkedX = 400; + document.documentElement.style.setProperty('--party-width', `${checkedX}px`); + document.documentElement.style.setProperty('--neg-party-width', `-${checkedX}px`); +} + +const doResize = (ev) => { + const checkedX = window.innerWidth - Math.min(window.innerWidth-300, Math.max((window.innerWidth*0.5), ev.clientX )); + document.documentElement.style.setProperty('--party-width', `${checkedX}px`); + document.documentElement.style.setProperty('--neg-party-width', `-${checkedX}px`); +} + +const stopResize = (ev) => { + document.documentElement.removeEventListener('mousemove', doResize, false); + document.documentElement.removeEventListener('mouseup', stopResize, false); +} + +const startResize = (ev) => { + document.documentElement.addEventListener('mousemove', doResize, false); + document.documentElement.addEventListener('mouseup', stopResize, false); +} + const App = () => { const closedNotification = { open: false, message: '' }; @@ -114,6 +136,13 @@ const App = () => { />
+ +
||
+
{loading && } {status[APP_VERSION_STRING] && status[APP_VERSION_STRING].active === true ? ( window.innerWidth - 400){if(ev.target.tagName==='INPUT'||ev.target.tagName==='TEXTAREA'){ev.target.focus();}ev.preventDefault();ev.stopPropagation();ev.stopImmediatePropagation();}}};document.addEventListener("mousedown",hboClickFix,{capture:true});`; + const hboClickInject = `var hboInputFix=function(ev){if(ev.target.tagName==='INPUT'||ev.target.tagName==='TEXTAREA'){ev.target.focus();}ev.stopImmediatePropagation();ev.stopPropagation();};document.addEventListener('keydown',hboInputFix,{capture:true});var hboClickFix=function(ev){if(document.querySelector('body.visible')){if(ev.clientX > window.innerWidth - (parseInt(document.documentElement.style.getPropertyValue('--party-width').slice(0,-2)) + 50) ){if(ev.target.tagName==='INPUT'||ev.target.tagName==='TEXTAREA'){ev.target.focus();}ev.preventDefault();ev.stopPropagation();ev.stopImmediatePropagation();}}};document.addEventListener("mousedown",hboClickFix,{capture:true});`; const hboClickInjectScript = document.createElement('script'); hboClickInjectScript.text = hboClickInject; document.head.appendChild(hboClickInjectScript);