Compare commits

...

2 Commits

Author SHA1 Message Date
semantic-release-bot
86357b3d7a chore(release): 4.61.0 [skip ci]
## [4.61.0](https://github.com/antialias/soroban-abacus-flashcards/compare/v4.60.0...v4.61.0) (2025-10-21)

### Features

* **flashcards:** enable unbounded drag and position persistence ([ad1ad69](ad1ad690f0))
2025-10-21 15:32:18 +00:00
Thomas Hallock
ad1ad690f0 feat(flashcards): enable unbounded drag and position persistence
Made interactive flashcards a fun easter egg by:
- Changed overflow from 'hidden' to 'visible' to allow cards to be
  thrown anywhere on the page, not just within container bounds
- Fixed position persistence: cards now stay exactly where dropped
  instead of snapping back to pickup location
- Updated currentPositionRef immediately on drop before applying
  momentum physics

Cards can now be dragged and tossed freely around the entire page
and will maintain their position after being dropped.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 10:31:08 -05:00
3 changed files with 16 additions and 5 deletions

View File

@@ -1,3 +1,10 @@
## [4.61.0](https://github.com/antialias/soroban-abacus-flashcards/compare/v4.60.0...v4.61.0) (2025-10-21)
### Features
* **flashcards:** enable unbounded drag and position persistence ([ad1ad69](https://github.com/antialias/soroban-abacus-flashcards/commit/ad1ad690f014257b5a3c3f599e794205a11d286f))
## [4.60.0](https://github.com/antialias/soroban-abacus-flashcards/compare/v4.59.1...v4.60.0) (2025-10-21)

View File

@@ -77,7 +77,7 @@ export function InteractiveFlashcards() {
maxW: '1200px',
mx: 'auto',
height: { base: '400px', md: '500px' },
overflow: 'hidden',
overflow: 'visible',
bg: 'rgba(0, 0, 0, 0.3)',
rounded: 'xl',
border: '1px solid rgba(255, 255, 255, 0.1)',
@@ -196,6 +196,10 @@ function DraggableCard({ card }: DraggableCardProps) {
// On release, reset transform origin to center
setTransformOrigin('center center')
// Update current position to where the card was dropped
currentPositionRef.current.x = currentPositionRef.current.x + mx
currentPositionRef.current.y = currentPositionRef.current.y + my
// On release, apply momentum with decay physics
const throwVelocityX = lastVelocityRef.current.vx * 1000
const throwVelocityY = lastVelocityRef.current.vy * 1000
@@ -205,12 +209,12 @@ function DraggableCard({ card }: DraggableCardProps) {
api.start({
x: {
from: currentPositionRef.current.x + mx,
from: currentPositionRef.current.x,
velocity: throwVelocityX,
decay: true,
},
y: {
from: currentPositionRef.current.y + my,
from: currentPositionRef.current.y,
velocity: throwVelocityY,
decay: true,
},
@@ -218,7 +222,7 @@ function DraggableCard({ card }: DraggableCardProps) {
rotation: throwAngle + 90, // Card aligns with throw direction
config: config.wobbly,
onChange: (result) => {
// Update current position as card settles
// Continue updating position as card settles with momentum
if (result.value.x !== undefined) {
currentPositionRef.current.x = result.value.x
}

View File

@@ -1,6 +1,6 @@
{
"name": "soroban-monorepo",
"version": "4.60.0",
"version": "4.61.0",
"private": true,
"description": "Beautiful Soroban Flashcard Generator - Monorepo",
"workspaces": [