From d526457ef2f68cc3eb0e9993964991c1f497ec58 Mon Sep 17 00:00:00 2001 From: Denis Thiessen Date: Fri, 7 Jun 2024 13:58:24 +0200 Subject: [PATCH] fix: Fixed Scrollable tab styling. --- src/components/ScrollableTab.jsx | 26 +++++++++++++++++++++++--- src/index.css | 5 ++++- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/components/ScrollableTab.jsx b/src/components/ScrollableTab.jsx index 9408802..d6456b6 100644 --- a/src/components/ScrollableTab.jsx +++ b/src/components/ScrollableTab.jsx @@ -3,6 +3,8 @@ import { Tabs, Tab } from "react-tabs-scrollable"; import "react-tabs-scrollable/dist/rts.css"; import { getHeatmapData } from "./webpage_container/StudySite"; import { pushToMouseLog } from "../core/log/SensorLogger"; +import { playTabModelSonification } from "../core/audio/AudioHandler"; +import { Divider } from "@geist-ui/core"; var amountTabs = 0; var reachedEndValue = false; @@ -19,7 +21,6 @@ function ScrollableTab({ onActiveTabChange, children }) { // define a onClick function to bind the value on tab click const onTabClick = (e, index) => { const buttonAttributes = e.target.attributes; - console.log(buttonAttributes); const actionType = buttonAttributes["actionType"] ? buttonAttributes.getNamedItem("actionType").value : ""; @@ -62,6 +63,8 @@ function ScrollableTab({ onActiveTabChange, children }) { reachedEndValue = true; } + playTabModelSonification(); + if (reachedEndValue && endValueVisible) { //this.playChordEndSound(); if (rightSideEnd) { @@ -114,10 +117,27 @@ function ScrollableTab({ onActiveTabChange, children }) { ); }); - const tabsStyle = { position: "absolute", bottom: "0", width: "100vw" }; + const tabsStyle = { + position: "fixed", + bottom: "0", + width: "100vw", + zIndex: "998", + backgroundColor: "white", + }; return ( -
+
{}} + onTouchStart={(event) => { + const eventElement = event.target; + + if (eventElement.nodeName === "BUTTON") { + onHoverTab(eventElement.id); + } + }} + > + onHoverElement()} activeTab={activeTab} diff --git a/src/index.css b/src/index.css index d601ddb..1094313 100644 --- a/src/index.css +++ b/src/index.css @@ -21,14 +21,17 @@ code { width: 100%; height: 100%; pointer-events: none; /* Ensure it doesn't interfere with page interaction */ + z-index: 999; } .heatmap-canvas { pointer-events: none; + z-index: 999; } canvas { - opacity: 0; + opacity: 1; + z-index: 999; } #studySiteContainer {