Skip to content

Commit 823720f

Browse files
authored
Normalize on pointer events since they should work for both mobile and desktop (#1253)
* Normalize on pointer events since they should work for both mobile and desktop * Try making version number explicit * Set node version for skin museum Netlify deploy * Revert some changes that depended upon touch events * Prevent highlighting text when tapping double size mode button
1 parent dd6c388 commit 823720f

File tree

9 files changed

+36
-40
lines changed

9 files changed

+36
-40
lines changed

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ status = 301
3636
force = true
3737

3838
[build.environment]
39-
NODE_VERSION = "20"
39+
NODE_VERSION = "20.9.0"

packages/skin-museum-client/netlify.toml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,35 @@ ID = "be420a16-4ef3-43b1-ac62-35869bdf8679"
66
# Settings in the [build] context are global and are applied to all contexts
77
# unless otherwise overridden by more specific contexts.
88
[build]
9-
# Directory (relative to root of your repo) that contains the deploy-ready
10-
# HTML files and assets generated by the build.
11-
publish = "build/"
9+
# Directory (relative to root of your repo) that contains the deploy-ready
10+
# HTML files and assets generated by the build.
11+
publish = "build/"
1212

13-
# Default build command.
14-
command = "yarn build"
15-
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../webamp/"
13+
# Default build command.
14+
command = "yarn build"
15+
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../webamp/"
1616
[build.environment]
17-
NODE_VERSION = "16.17.1"
18-
NETLIFY_USE_YARN = "true"
19-
17+
NODE_VERSION = "20"
18+
NETLIFY_USE_YARN = "true"
2019

2120

2221
[[redirects]]
23-
from = "/sitemap*"
24-
to = "https://api.webampskins.org/sitemap:splat"
25-
status = 200
22+
from = "/sitemap*"
23+
to = "https://api.webampskins.org/sitemap:splat"
24+
status = 200
2625

2726
[[redirects]]
28-
from = "/"
29-
query = {query = ":query"}
30-
to = "https://winamp-skin-museum.jordan1320.workers.dev//"
31-
status = 200
27+
from = "/"
28+
query = { query = ":query" }
29+
to = "https://winamp-skin-museum.jordan1320.workers.dev//"
30+
status = 200
3231

3332
[[redirects]]
34-
from = "/skin/*"
35-
to = "https://winamp-skin-museum.jordan1320.workers.dev//skin/:splat"
36-
status = 200
33+
from = "/skin/*"
34+
to = "https://winamp-skin-museum.jordan1320.workers.dev//skin/:splat"
35+
status = 200
3736

3837
[[redirects]]
39-
from = "/*"
40-
to = "/index.html"
41-
status = 200
38+
from = "/*"
39+
to = "/index.html"
40+
status = 200

packages/webamp/js/components/Balance.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export default function Balance({ style, className, id }: Props) {
2626
value={balance}
2727
style={{ ...style, touchAction: "none" }}
2828
onChange={(e) => setBalance(Number(e.target.value))}
29-
onMouseDown={() => setFocus("balance")}
30-
onMouseUp={unsetFocus}
29+
onPointerDown={() => setFocus("balance")}
30+
onPointerUp={unsetFocus}
3131
title="Balance"
3232
/>
3333
);

packages/webamp/js/components/FocusTarget.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ function FocusTarget({ onKeyDown, windowId, children }: Props) {
6868
return (
6969
<div
7070
ref={setRef}
71-
onMouseDown={focusHandler}
72-
onTouchStart={focusHandler}
71+
onPointerDown={focusHandler}
7372
onFocus={focusHandler}
7473
tabIndex={-1}
7574
style={{ height: "100%", width: "100%" }}

packages/webamp/js/components/MainWindow/ClutterBar.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ const ClutterBar = memo(() => {
3434
title={"Toggle Doublesize Mode"}
3535
id="button-d"
3636
className={classnames({ selected: doubled })}
37-
onMouseUp={handleMouseUp}
38-
onMouseDown={handleMouseDown}
37+
onPointerUp={handleMouseUp}
38+
onPointerDown={(e) => {
39+
e.preventDefault();
40+
handleMouseDown();
41+
}}
3942
/>
4043
<div id="button-v" />
4144
</div>

packages/webamp/js/components/MainWindow/Marquee.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ const Marquee = React.memo(() => {
137137
<div
138138
id="marquee"
139139
className="text"
140-
onMouseDown={handleMouseDown}
141-
onTouchStart={handleMouseDown}
140+
onPointerDown={handleMouseDown}
142141
title="Song Title"
143142
>
144143
<div

packages/webamp/js/components/MainWindow/Position.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ const Position = memo(() => {
7171
onChange={
7272
() => {} /* React complains without this, can probably rename onInput to onChange */
7373
}
74-
onMouseUp={seekToPercentComplete}
75-
onMouseDown={setPosition}
74+
onPointerUp={seekToPercentComplete}
75+
onPointerDown={setPosition}
7676
title="Seeking Bar"
7777
/>
7878
);

packages/webamp/js/components/PlaylistWindow/PlaylistShade.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function PlaylistShade() {
5353
selected: focused === WINDOWS.PLAYLIST,
5454
})}
5555
style={{ width: `${WINDOW_WIDTH + addedWidth}px` }}
56-
onMouseDown={() => focusWindow("playlist")}
56+
onPointerDown={() => focusWindow("playlist")}
5757
onDoubleClick={toggleShade}
5858
>
5959
<div className="left">

packages/webamp/js/components/Volume.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@ export default function Volume({ id, style, className }: Props) {
2626
style={{ ...style, touchAction: "none" }}
2727
className={className}
2828
onChange={(e) => setVolume(Number(e.target.value))}
29-
onMouseDown={() => setFocus("volume")}
30-
onTouchStart={() => {
31-
setFocus("volume");
32-
}}
33-
onMouseUp={unsetFocus}
34-
onTouchEnd={unsetFocus}
29+
onPointerDown={() => setFocus("volume")}
30+
onPointerUp={unsetFocus}
3531
title="Volume Bar"
3632
/>
3733
);

0 commit comments

Comments
 (0)