-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: π attempt to fix layout animations and update deps
layout animations fix and update deps also fully remove tslib BREAKING CHANGE: 𧨠none β Closes: none
- Loading branch information
1 parent
3076c6d
commit d145ccc
Showing
9 changed files
with
86 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<script> | ||
import { motion } from "$lib/motion-start"; | ||
const spring = { | ||
type: "spring", | ||
stiffness: 700, | ||
damping: 30, | ||
}; | ||
let active = false; | ||
function toggleSwitch() { | ||
active = !active; | ||
} | ||
</script> | ||
|
||
<button class="switch" data-active={active} onclick={toggleSwitch}> | ||
<motion.div layout class="handle" transition={spring} /> | ||
</button> | ||
|
||
<p>This should animate on click</p> | ||
|
||
<style> | ||
.switch { | ||
all: unset; | ||
width: 8rem; | ||
height: 3rem; | ||
background-color: gainsboro; | ||
display: flex; | ||
justify-content: flex-start; | ||
border-radius: 50px; | ||
padding: 0.5rem; | ||
cursor: pointer; | ||
} | ||
.switch[data-active="true"] { | ||
justify-content: flex-end; | ||
} | ||
:global(.handle) { | ||
width: 3rem; | ||
height: 3rem; | ||
background-color: white; | ||
border-radius: 40px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters