Skip to content

Commit

Permalink
fix: slider vertical align
Browse files Browse the repository at this point in the history
  • Loading branch information
noyyyy committed Sep 28, 2024
1 parent 97128e9 commit b6b9c3f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion cspell.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"words":["attackable","Chupacabra","Ettin","Jiangshi","Kitsune","loadash","Rakshasa","Tarrasque","zustand","autochessia","starknet","Zeroable","syscall","struct","Serde","coor","dojoengine","anims","animationcomplete","Tweens","yoyo","despawn","Dogica","despawn","Tileset","tilesets","Tilemap","Tilemaps","audiosprite","holwer","Gameover","dogicapixelbold","dogicapixel","tailwindcss","ahooks","countup","Occu","vercel","amondnet","katana","sozo","dojoup"]}
{"words":["attackable","Chupacabra","Ettin","Jiangshi","Kitsune","loadash","Rakshasa","Tarrasque","zustand","autochessia","starknet","Zeroable","syscall","struct","Serde","coor","dojoengine","anims","animationcomplete","Tweens","yoyo","despawn","Dogica","despawn","Tileset","tilesets","Tilemap","Tilemaps","audiosprite","holwer","Gameover","dogicapixelbold","dogicapixel","tailwindcss","ahooks","countup","Occu","vercel","amondnet","katana","sozo","dojoup","procs"]}
2 changes: 1 addition & 1 deletion mprocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ procs:
katana:
shell: katana --disable-fee --invoke-max-steps 4500000
torii:
shell: test -e "indexer.db" && rm indexer.db; torii --world "0x645cb3e9b4d7ae1afd34d64085e61519e431c39d4811f4e6bbc5f16b66fb0" --database indexer.db
shell: test -e "indexer.db" && rm indexer.db; pnpm wait-port 5050; torii --world "0x645cb3e9b4d7ae1afd34d64085e61519e431c39d4811f4e6bbc5f16b66fb0" --database indexer.db
38 changes: 23 additions & 15 deletions packages/client/src/ui/features/misc/SpeedSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,29 @@ export const SpeedSlider = () => {

return (
<div className="fixed top-1 z-20 left-4 w-60">
<input
type="range"
min={0}
max={allowedValues.length - 1}
step={1}
value={index}
onChange={handleChange}
className="w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
/>
<div className="flex justify-between text-xs mt-1">
{allowedValues.map((value, i) => (
<span key={i} className={i === index ? "font-bold" : ""}>
{value}
</span>
))}
<div className="relative pb-6">
<input
type="range"
min={0}
max={allowedValues.length - 1}
step={1}
value={index}
onChange={handleChange}
className="w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
/>
<div className="absolute w-full flex justify-between text-xs mt-1">
{allowedValues.map((value, i) => (
<span
key={i}
className={`${i === index ? "font-bold" : ""} absolute -translate-x-1/2`}
style={{
left: `${(i / (allowedValues.length - 1)) * 100}%`,
}}
>
{value}
</span>
))}
</div>
</div>
<div className="text-center mt-1 text-[0.5rem]">
Animation Speed: {allowedValues[index]}
Expand Down

0 comments on commit b6b9c3f

Please sign in to comment.