{ "id": "gsap-0d9ff9f86ee3", "sourceId": "gsap", "title": "Toggle Direction", "sourceUrl": "https://demos.gsap.com/demo/toggle-direction", "demoUrl": "https://codepen.io/GreenSock/pen/yyByMar", "sourceStatus": "unresolved", "sourceReason": "Public page unavailable through web browsing", "sourceRevision": null, "sourceLicense": null, "originalDemoAcquired": false, "disposition": "ready_for_independent_study", "evidenceBasis": "catalog_linked_api", "studyId": "gsap-0d9ff9f86ee3", "sharedStudyCanonicalId": null, "label": "Independently authored documentation study; original Pen unavailable", "catalogEvidence": { "localPath": "artifacts/full-import/gsap/remaining-docs/catalog-evidence.json", "sha256": "4f2a4f9aa64456b85b905b562b60d7733629b41026787b3057cba29e8b10de69", "bytes": 30117, "recordId": "gsap-0d9ff9f86ee3" }, "sourceInputs": [ { "kind": "authored-study-specification", "localPath": "artifacts/full-import/gsap/remaining-docs/study-specs.json", "sha256": "cbb89331eda8783b5cf2f173b326b9195eeabfb223374fb60019161d9f46d4a6", "bytes": 52279, "recordId": "gsap-0d9ff9f86ee3" }, { "kind": "official-catalog-metadata", "localPath": "artifacts/full-import/gsap/remaining-docs/catalog-evidence.json", "sha256": "4f2a4f9aa64456b85b905b562b60d7733629b41026787b3057cba29e8b10de69", "bytes": 30117, "recordId": "gsap-0d9ff9f86ee3" }, { "kind": "official-documentation-evidence", "localPath": "artifacts/full-import/gsap/remaining-docs/official-documentation-evidence.json", "sha256": "bfa25f561e61c597569cf1bc0b3538e6dce4b9985a932775ceab41e665ca24a2", "bytes": 11430, "recordIds": [ "reversed" ] }, { "kind": "original-library-source", "localPath": "artifacts/full-import/gsap/library/src/gsap-core.js", "sha256": "8063816e0e7c3e6c07970fb06feafb06146fd266db5d8346419176b3d496e284", "gitBlob": "c673b9e2e0ee04832afb13cb892ae75f503e268c", "revision": "13e2b790546426a1a2e0e9b409f3f8dc6d6611f2", "sourcePath": "src/gsap-core.js", "ranges": [ { "id": "direction-controls", "startLine": 1354, "endLine": 1391, "rangeSha256": "8e2f36127b2fc568686d2d934ad3b74a21274c78bf1045d210e376260598819f" } ] } ], "studiedPrinciple": "Toggle one existing tween's playback direction using its reversed getter/setter while handling paused state explicitly.", "namedApis": [ { "name": "tween.reversed(!tween.reversed())", "purpose": "Invert the existing animation's direction without creating a new tween.", "libraryEvidence": [ "direction-controls" ], "documentationEvidence": [ "reversed" ] }, { "name": "tween.resume()", "purpose": "Unpause after setting direction; reversed alone does not start a paused animation.", "libraryEvidence": [ "direction-controls" ], "documentationEvidence": [ "reversed" ] } ], "implementationBrief": { "scene": "One authored marker traveling along a labeled start/end track. Show current direction, paused state, and normalized progress next to native controls.", "controls": [ { "label": "Toggle direction", "type": "button", "action": "Set reversed to its inverse, then resume the same tween." }, { "label": "Pause / Resume", "type": "button", "action": "Change paused state without changing direction." }, { "label": "Progress", "type": "range", "action": "Pause and seek to a selected progress; the next direction toggle must resume from that point." }, { "label": "Reset", "type": "button", "action": "Restore progress zero, reversed true, and paused true so the next toggle runs forward." } ], "mechanismSteps": [ "Create one paused tween from a known starting x to an authored destination. Initialize reversed(true) while progress remains zero and paused.", "The first Toggle direction sets reversed(false) and calls resume(), so movement begins forward from zero.", "Later toggles call reversed(!reversed()).resume() on the same instance. Do not restart or rebuild on each click, because that would hide mid-flight reversal.", "Use direct progress seeking for inspection and keep it separate from direction state; display both values so a paused reversed tween is understandable.", "At either endpoint a direction pointing outside the playable range cannot travel farther. The next toggle points inward and resumes movement; explain this as endpoint behavior." ] }, "authoredDefaults": { "startX": 0, "endX": 160, "markerSizePixels": 28, "durationSeconds": 1.2, "ease": "power1.inOut", "initialProgress": 0, "initialReversed": true, "initialPaused": true }, "verificationRequired": [ "The first toggle moves forward; the second toggle midway returns toward the start without a position reset.", "One tween instance is retained across repeated toggles.", "After pausing and seeking to 0.5, toggling both changes direction and resumes from the current position.", "Reset recreates the declared progress/direction/paused state, and endpoint toggles move inward correctly.", "All controls work with keyboard input; static mode provides labeled endpoints without continuous animation." ], "unsupportedClaims": [ "Original composition, assets, timing, breakpoint behavior, and live interaction are not observable in captured frames. This brief does not establish visual fidelity or recover original code.", "The catalog supplies the reversed() API link but no original scene, endpoints, duration, or control implementation. All those details are newly authored.", "Setting reversed does not itself unpause a paused tween; the explicit resume call is required by this study's interaction contract." ], "dependencies": { "package": "gsap", "version": "3.15.0", "revision": "13e2b790546426a1a2e0e9b409f3f8dc6d6611f2", "repository": "https://github.com/greensock/GSAP", "plugins": [], "registration": "Core includes CSSPlugin; no separate plugin registration required.", "runtimeCandidates": [ { "path": "dist/gsap.js", "localPath": "artifacts/full-import/gsap/library/dist/gsap.js", "gitBlob": "ec5ffee3f099bc454f2f1c79cee6a55ba97e7400", "sha256": "01effe0e121c22ba0f885a3f091f3dc6d1f0d445c4fba37dcb298e314eca5cfb", "bytes": 179557 } ], "license": { "name": "GSAP Standard 'No Charge' License (custom, not MIT)", "localPath": "artifacts/full-import/gsap/licenses/gsap-standard-license.html", "sha256": "bf8536e67b77db780f7db0c14a645f184f554bb19e938d1e52d58986e2f10528", "bytes": 6988, "url": "https://gsap.com/community/standard-license/" }, "originalDependencyVersionKnown": false }, "runtimeVerified": false, "implementationWritten": false }