feat: Improve mobile experience by enabling card size sliders and long-press card previews.

This commit is contained in:
2025-12-17 01:54:31 +01:00
parent 97276979bf
commit aeab15eb9c
5 changed files with 41 additions and 6 deletions

View File

@@ -192,8 +192,10 @@ export const CardHoverWrapper: React.FC<{ card: DraftCard; children: React.React
onTouchEnd={handleTouchEnd}
onTouchMove={handleTouchMove}
onContextMenu={(e) => {
// Prevent context menu if we are long pressing to view card
if (isLongPressing) {
// Prevent context menu to allow long-press preview without browser menu
// We block it if we are on mobile (trying to open preview)
// OR if we are already in long-press state.
if ((isMobile && hasImage) || isLongPressing) {
e.preventDefault();
e.stopPropagation();
}

View File

@@ -671,13 +671,13 @@ export const CubeManager: React.FC<CubeManagerProps> = ({ packs, setPacks, onGoT
</button>
{/* Size Slider */}
<div className="flex items-center gap-2 bg-slate-800 rounded-lg px-2 py-1 border border-slate-700 h-9 mr-2 hidden sm:flex">
<div className="flex items-center gap-2 bg-slate-800 rounded-lg px-2 py-1 border border-slate-700 h-9 mr-2 flex">
<div className="w-3 h-4 rounded border border-slate-500 bg-slate-700" title="Small Cards" />
<input
type="range"
min="100"
max="300"
step="10"
step="1"
value={cardWidth}
onChange={(e) => setCardWidth(parseInt(e.target.value))}
className="w-24 accent-purple-500 cursor-pointer h-1.5 bg-slate-600 rounded-lg appearance-none"

View File

@@ -113,13 +113,13 @@ export const DraftView: React.FC<DraftViewProps> = ({ draftState, currentPlayerI
</div>
{/* Card Scalar */}
<div className="hidden md:flex flex-col gap-1 w-32">
<div className="flex flex-col gap-1 w-24 md:w-32">
<label className="text-[10px] text-slate-500 uppercase font-bold tracking-wider">Card Size</label>
<input
type="range"
min="0.5"
max="1.5"
step="0.1"
step="0.01"
value={cardScale}
onChange={(e) => setCardScale(parseFloat(e.target.value))}
className="w-full h-1 bg-slate-700 rounded-lg appearance-none cursor-pointer accent-emerald-500"