diff --git a/application.py b/application.py index a886cd2..fc63942 100644 --- a/application.py +++ b/application.py @@ -212,8 +212,8 @@ async def main_page(credentials: Annotated[HTTPBasicCredentials, Depends(securit global client_data if not is_authorized(credentials): return Response("Get outta here män :(", status_code=401) - ui.add_head_html(f"") ui.add_head_html(f"") + ui.add_head_html(f"") container = ui.column().classes('w-full h-[calc(100vh-2rem)] items-center justify-center') @@ -223,8 +223,8 @@ async def main_page(credentials: Annotated[HTTPBasicCredentials, Depends(securit cd.container = container label = ui.label('Checking if the server is online...').classes('text-xl mb-20 whitespace-nowrap text-[3vw]') cd.text_above = label - with ui.element().classes('w-[50vw] max-h-[75%] aspect-square rounded-full bg-grey text-white flex items-center justify-center whitespace-nowrap text-[3vw] active:scale-95 transition-transform').props("id=recordbutton disabled") as button: - ui.image('/static/microphone.png').classes('h-[75%] w-[75%] object-contain').props("id=recordbuttonimage") + button = ui.element().classes('w-[50vw] max-h-[75%] aspect-square rounded-full bg-gray-300 text-white flex items-center justify-center whitespace-nowrap text-[3vw] active:scale-95 transition-transform z-10 bg-[url(/static/microphone.png)] bg-center bg-no-repeat bg-contain').props("id=recordbutton disabled") + # ui.image('').classes('h-[75%] w-[75%] object-contain').props("id=recordbuttonimage draggable=false") button.on('mousedown', lambda: start_recording(client.id)) button.on('mouseup', lambda: stop_recording(client.id)) button.on('touchstart', lambda: start_recording(client.id)) diff --git a/static/record.js b/static/record.js index 0a88004..1071ae3 100644 --- a/static/record.js +++ b/static/record.js @@ -11,13 +11,6 @@ window.addEventListener("load", async (event) => { await navigator.mediaDevices.getUserMedia({ audio: true }); }); -document.getElementById('recordbuttonimage').oncontextmenu = function(event) { - event.preventDefault(); - event.stopPropagation(); // not necessary in my case, could leave in case stopImmediateProp isn't available? - event.stopImmediatePropagation(); - return false; -}; - function startButtonPulse(analyser) { const button = document.querySelector('#recordbutton');