Skip to content

Commit 341974b

Browse files
author
Alex Front
committed
Enhance button interactions and styling for mobile
1 parent 451808d commit 341974b

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/App.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.button, .toggleButton, .githubLink {
22
cursor: pointer !important;
3-
z-index: 10;
3+
z-index: 100;
4+
position: relative;
45
}
56

67
.toggleButton, .githubLink {
@@ -44,10 +45,11 @@
4445
user-select: none;
4546
touch-action: manipulation;
4647
min-height: 36px;
48+
-webkit-tap-highlight-color: transparent;
4749
}
4850

49-
.button:hover {
50-
background: rgba(255,255,255,0.15);
51+
.button:active {
52+
background: rgba(255,255,255,0.2);
5153
transform: translateY(-2px);
5254
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
5355
}

src/App.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,16 @@ const App: React.FC = () => {
334334
return (
335335
<button
336336
key={key}
337-
onClick={() => setCurrentPreset(key)}
337+
onClick={(e) => {
338+
e.preventDefault();
339+
e.stopPropagation();
340+
setCurrentPreset(key);
341+
}}
342+
onTouchEnd={(e) => {
343+
e.preventDefault();
344+
e.stopPropagation();
345+
setCurrentPreset(key);
346+
}}
338347
className={`button ${currentPreset === key ? 'active' : ''}`}
339348
>
340349
{preset.name}

0 commit comments

Comments
 (0)