tangled
alpha
login
or
join now
flo-bit.dev
/
blento
your personal website on atproto - mirror
blento.app
16
fork
atom
overview
issues
pulls
pipelines
Compare changes
Choose any two refs to compare.
base:
various-fixes
updated-blentos
update-docs
timer-card-tiny-fix
theme-colors
switch-map
switch-grid-layout
statusphere-fix
small-fixes
signup
show-login-error
section-settings
section-fix-undo
remove-extra-buttons
refactor-cards
record-visualizer-card
qr-codes
profile-stuff-2
profile-stuff
product-hunt
polijn/main
next
new-og-image-wip
move-qr-click
mobile-editing
map
main-favicon
main
mail-icon
kickstarter-card
invalid-handle-fix
improve-saving
improve-oauth
improve-link-card
improve-fluid-text
image-fixes
hide-friends
github-contribs
gifs-heypster
funding
fuck-another-fix
floating-button
fixes
fix-xss
fix-timer-stuff
fix-signup-pds
fix-package-manager
fix-invalid-site.standard.documents
fix-formatting
fix-favicon
fix-build
event-card
edit-profile
drawing-card
custom-domains-editing
custom-domains
copy-page
card-label
card-command-bar-v2
card-command-bar
button
bluesky-post-nsfw-labels
bluesky-post-card
bluesky-feed-card
apple-music-playlist
no tags found
compare:
various-fixes
updated-blentos
update-docs
timer-card-tiny-fix
theme-colors
switch-map
switch-grid-layout
statusphere-fix
small-fixes
signup
show-login-error
section-settings
section-fix-undo
remove-extra-buttons
refactor-cards
record-visualizer-card
qr-codes
profile-stuff-2
profile-stuff
product-hunt
polijn/main
next
new-og-image-wip
move-qr-click
mobile-editing
map
main-favicon
main
mail-icon
kickstarter-card
invalid-handle-fix
improve-saving
improve-oauth
improve-link-card
improve-fluid-text
image-fixes
hide-friends
github-contribs
gifs-heypster
funding
fuck-another-fix
floating-button
fixes
fix-xss
fix-timer-stuff
fix-signup-pds
fix-package-manager
fix-invalid-site.standard.documents
fix-formatting
fix-favicon
fix-build
event-card
edit-profile
drawing-card
custom-domains-editing
custom-domains
copy-page
card-label
card-command-bar-v2
card-command-bar
button
bluesky-post-nsfw-labels
bluesky-post-card
bluesky-feed-card
apple-music-playlist
no tags found
go
+29
-6
2 changed files
expand all
collapse all
unified
split
.gitignore
src
lib
components
qr
qrOverlay.svelte.ts
+1
-1
.gitignore
···
22
22
vite.config.js.timestamp-*
23
23
vite.config.ts.timestamp-*
24
24
25
25
-
react-grid-layout
25
25
+
references
+28
-5
src/lib/components/qr/qrOverlay.svelte.ts
···
18
18
const LONG_PRESS_DURATION = 500;
19
19
let longPressTimer: ReturnType<typeof setTimeout> | null = null;
20
20
let isLongPress = false;
21
21
+
let touchActive = false;
22
22
+
23
23
+
// Prevent iOS link preview on long-press
24
24
+
const originalCallout = node.style.getPropertyValue('-webkit-touch-callout');
25
25
+
node.style.setProperty('-webkit-touch-callout', 'none');
21
26
22
27
function getHref() {
23
28
return params.href || (node as HTMLAnchorElement).href || '';
24
29
}
25
30
26
26
-
function startLongPress() {
31
31
+
function startLongPress(e: PointerEvent) {
27
32
if (params.disabled) return;
33
33
+
// Only start long press for primary button (touch/left-click), not right-click
34
34
+
if (e.button !== 0) return;
35
35
+
touchActive = e.pointerType === 'touch';
28
36
isLongPress = false;
29
37
longPressTimer = setTimeout(() => {
30
38
isLongPress = true;
···
37
45
clearTimeout(longPressTimer);
38
46
longPressTimer = null;
39
47
}
48
48
+
touchActive = false;
40
49
}
41
50
42
51
function handleClick(e: MouseEvent) {
43
52
if (isLongPress) {
44
53
e.preventDefault();
45
54
isLongPress = false;
55
55
+
return;
56
56
+
}
57
57
+
58
58
+
// Shift-click opens QR modal
59
59
+
if (e.shiftKey && !params.disabled) {
60
60
+
e.preventDefault();
61
61
+
openModal?.(getHref(), params.context ?? {});
46
62
}
47
63
}
48
64
49
49
-
function handleContextMenu(e: MouseEvent) {
50
50
-
if (params.disabled) return;
51
51
-
e.preventDefault();
52
52
-
openModal?.(getHref(), params.context ?? {});
65
65
+
function handleContextMenu(e: Event) {
66
66
+
// Prevent context menu during touch to avoid iOS preview
67
67
+
if (touchActive || isLongPress) {
68
68
+
e.preventDefault();
69
69
+
}
53
70
}
54
71
55
72
node.addEventListener('pointerdown', startLongPress);
···
71
88
node.removeEventListener('click', handleClick);
72
89
node.removeEventListener('contextmenu', handleContextMenu);
73
90
cancelLongPress();
91
91
+
// Restore original style
92
92
+
if (originalCallout) {
93
93
+
node.style.setProperty('-webkit-touch-callout', originalCallout);
94
94
+
} else {
95
95
+
node.style.removeProperty('-webkit-touch-callout');
96
96
+
}
74
97
}
75
98
};
76
99
}