Skip to content

Commit

Permalink
feat: add avatar initial transition
Browse files Browse the repository at this point in the history
  • Loading branch information
CaliCastle committed May 5, 2023
1 parent 7372a0a commit 28c5693
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const config = {
parserOptions: {
project: path.join(__dirname, 'tsconfig.json'),
},
plugins: ['@typescript-eslint', 'simple-import-sort', 'unused-imports'],
plugins: ['turbo', '@typescript-eslint', 'simple-import-sort', 'unused-imports'],
extends: ['next/core-web-vitals', 'plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/consistent-type-imports': [
Expand Down
24 changes: 20 additions & 4 deletions components/layouts/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,19 @@ export function Header() {
'var(--header-position)' as React.CSSProperties['position'],
}}
>
<div
<motion.div
className="top-[var(--avatar-top,theme(spacing.3))] w-full select-none"
style={{
position:
'var(--header-inner-position)' as React.CSSProperties['position'],
}}
initial={{ opacity: 0, y: 15 }}
animate={{ opacity: 1, y: 0 }}
transition={{
type: 'spring',
damping: 30,
stiffness: 200,
}}
>
<motion.div
className="relative inline-flex"
Expand Down Expand Up @@ -194,7 +201,7 @@ export function Header() {
/>
</motion.div>
</motion.div>
</div>
</motion.div>
</Container>
</>
)}
Expand All @@ -215,7 +222,16 @@ export function Header() {
}}
>
<div className="relative flex gap-4">
<div className="flex flex-1">
<motion.div
className="flex flex-1"
initial={{ opacity: 0, y: 15 }}
animate={{ opacity: 1, y: 0 }}
transition={{
type: 'spring',
damping: 30,
stiffness: 200,
}}
>
<AnimatePresence>
{!isHomePage && (
<motion.div
Expand All @@ -229,7 +245,7 @@ export function Header() {
</motion.div>
)}
</AnimatePresence>
</div>
</motion.div>
<div className="flex flex-1 justify-end md:justify-center">
<NavigationBar.Mobile className="pointer-events-auto md:hidden" />
<NavigationBar.Desktop className="pointer-events-auto hidden md:block" />
Expand Down
4 changes: 0 additions & 4 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import { get } from '@vercel/edge-config'

/** @type {import('next').NextConfig} */
const nextConfig = {
// experimental: {
// serverActions: true,
// },

images: {
domains: ['cdn.sanity.io'],
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"autoprefixer": "^10.4.14",
"eslint": "^8.39.0",
"eslint-config-next": "^13.4.0",
"eslint-config-turbo": "^1.9.3",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
Expand Down
20 changes: 20 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 28c5693

Please sign in to comment.