Skip to content

Commit

Permalink
add motion one
Browse files Browse the repository at this point in the history
  • Loading branch information
renaholic committed Jul 20, 2023
1 parent 72dcbca commit ccc569d
Show file tree
Hide file tree
Showing 5 changed files with 319 additions and 13 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Animation
[Motion One](https://motion.dev/) will be used to handle component transition

[View Transitions API](https://developer.chrome.com/docs/web-platform/view-transitions/) will be used between page transition


# Tested Library / Functionality
## UI
- [x] Tailwind
Expand Down
273 changes: 273 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"focus-visible": "^5.2.0",
"heroicons": "^2.0.13",
"lodash": "^4.17.21",
"motion": "^10.16.2",
"postcss-focus-visible": "^7.1.0",
"prettier-plugin-tailwindcss": "^0.2.1",
"tailwind-merge": "^1.8.1",
Expand Down
37 changes: 37 additions & 0 deletions src/integrations/motionOne.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { component$, useVisibleTask$ } from '@builder.io/qwik'
import { animate } from 'motion'

export default component$(() => {
useVisibleTask$(() => {
animate(
'#animation-target',
{
scale: [1, 2, 2, 1, 1],
rotate: [0, 0, 270, 270, 0],
borderRadius: ['20%', '20%', '50%', '50%', '20%'],
backgroundColor: [
'#ff008c',
'#d309e1',
'#9c1aff',
'#7700ff',
'#ff008c',
],
},
{
duration: 2,
easing: 'ease-in-out',
repeat: 2,
direction: 'alternate',
}
)
})
return (
<div
id="animation-target"
// Some tailwind styling for sizing and initial color
class="m-auto mt-24 h-52 w-52 bg-slate-500"
></div>
)
})

function yuval() {}
Loading

0 comments on commit ccc569d

Please sign in to comment.