Skip to content

Commit

Permalink
chore: code format
Browse files Browse the repository at this point in the history
  • Loading branch information
tmg0 committed Apr 22, 2024
1 parent c81cbaf commit b12b652
Show file tree
Hide file tree
Showing 17 changed files with 1,163 additions and 82 deletions.
8 changes: 0 additions & 8 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Transition props can be used in both `HeroProvider` and `Hero`.
The configuration defined in `HeroProvider` will be used as global default value, and you do not need to re-declare it on each `Hero` components.

```ts
type Transition = {
interface Transition {
delay: number
repeat: number
repeatDelay: number
Expand Down
4 changes: 4 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// eslint.config.js
import antfu from '@antfu/eslint-config'

export default antfu()
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "hero-motion",
"version": "0.2.0",
"description": "A shared layout animations for vue like framer motion.",
"author": "zekun.jin",
"license": "MIT",
"homepage": "https://github.com/tmg0/hero-motion#readme",
"repository": {
Expand All @@ -11,11 +12,17 @@
"bugs": {
"url": "https://github.com/tmg0/hero-motion/issues"
},
"keywords": [
"animation",
"vue",
"motion",
"vueuse"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.cjs",
Expand All @@ -29,19 +36,17 @@
"lint:fix": "eslint . --fix",
"test": "vitest"
},
"keywords": [
"animation",
"vue",
"motion",
"vueuse"
],
"author": "zekun.jin",
"peerDependencies": {
"@vueuse/core": ">=10.0.0",
"@vueuse/motion": ">=2.0.0",
"vue": ">=3.0.0"
},
"dependencies": {
"defu": "^6.1.4",
"lodash.omit": "^4.5.0"
},
"devDependencies": {
"@antfu/eslint-config": "^2.15.0",
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"@types/lodash.omit": "^4.5.9",
"@vue/tsconfig": "^0.5.0",
Expand All @@ -53,9 +58,5 @@
"unplugin-vue-jsx": "^0.3.0",
"vitest": "^1.0.0",
"vue": "^3.4.21"
},
"dependencies": {
"defu": "^6.1.4",
"lodash.omit": "^4.5.0"
}
}
4 changes: 2 additions & 2 deletions playground/vite/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@hero-motion/vite",
"private": true,
"version": "0.0.0",
"type": "module",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build",
Expand Down
4 changes: 2 additions & 2 deletions playground/vite/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
autoprefixer: {},
},
}
12 changes: 7 additions & 5 deletions playground/vite/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import Cursor from './components/Cursor.vue'
const activeKey = ref(5)
const isActive = i => i === activeKey.value
const mapRange = (from, to) => (value) => {
const [fromMin, fromMax] = from
const [toMin, toMax] = to
return (value - fromMin) * (toMax - toMin) / (fromMax - fromMin) + toMin
function mapRange(from, to) {
return (value) => {
const [fromMin, fromMax] = from
const [toMin, toMax] = to
return (value - fromMin) * (toMax - toMin) / (fromMax - fromMin) + toMin
}
}
const fontSizeRange = mapRange([1, 9], [12, 12 * 9])
Expand All @@ -23,7 +25,7 @@ const BG_COLORS = [
'#22c55e',
'#10b981',
'#14b8a6',
'#06b6d4'
'#06b6d4',
]
</script>

Expand Down
6 changes: 3 additions & 3 deletions playground/vite/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
export default {
content: [
'./index.html',
'./src/**/*.{vue,js,ts,jsx,tsx}'
'./src/**/*.{vue,js,ts,jsx,tsx}',
],
theme: {
extend: {}
extend: {},
},
plugins: []
plugins: [],
}
2 changes: 1 addition & 1 deletion playground/vite/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()]
plugins: [vue()],
})
Loading

0 comments on commit b12b652

Please sign in to comment.