Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
b193224
Initial commit
Mar 24, 2024
e7b72b1
Add 'Inter' font family
Mar 24, 2024
ded090a
Install prettier-plugin-tailwindcss
Mar 25, 2024
b79c301
Remove default README.md, replace it with placeholder.
Mar 25, 2024
5042cc8
Move fontFamily.sans to theme.extend
Mar 25, 2024
e8b3fd1
First version of scrollable animations plugin
Mar 25, 2024
f44bad9
Add page bg gradient, base layout with responsivity, base bg color
Mar 25, 2024
1ab6984
First pieces of content and few basic components: title, link, paragraph
Mar 25, 2024
9483f4a
Move content to separate components, add Code component
Mar 25, 2024
b4b7523
Add 'Figma' part, empty for now
Mar 25, 2024
9fd60a0
Add various parts of the page
Mar 25, 2024
ee61170
Tune link animations, add nicer code source link
Mar 25, 2024
8d8d51b
Various components
Mar 26, 2024
6e0c4a6
Tune header, add more header components, add anchors to titles, new a…
Mar 26, 2024
bdc69e4
Header gradient experiments, add various elements, animations
Mar 26, 2024
a9ffb07
Add animation-range (start, end) utilities
Mar 26, 2024
5346382
Tune animations, hide arrow up on < sm
Mar 26, 2024
363744d
Update page title, fix build, add robots.txt
Mar 26, 2024
3901ada
Fix dark mode detection, tune top menu translateY
Mar 26, 2024
221bc6d
Rename Title to Heading.tsx, tune spacing, colors
Mar 26, 2024
24b3e68
Tune Heading.tsx to render <h*>... components, tune dark mode colors
Mar 27, 2024
b820b3d
Add supports-animations and -no-animations rules to config, fallback …
Mar 27, 2024
3e3e6d7
Rename easing curves, tune heading weights and sizes
Mar 27, 2024
2f7ad06
Rename Figma to OpenSource.tsx, remove 'up' arrow from menu
Mar 27, 2024
7f8b51f
Add draft of the code part, tune Code and CodeBlock styling, rename T…
Mar 27, 2024
0b635da
Refactor utilities in plugin
Mar 28, 2024
ef44f30
Update code examples, move them to separate file
Mar 28, 2024
f5407ef
Update dark mode switch, add dark class directly to <body>
Mar 28, 2024
1e5a37b
Fix various issues; tune code examples, some responsivity
Mar 28, 2024
b0e18fe
Move the plugin to separate folder, add README (WIP) and Demo (WIP); …
Mar 29, 2024
12edd59
Update code highlight, use prismjs with custom styling
Mar 29, 2024
714b743
Update code highlight styling, tune demo
Mar 29, 2024
e668744
Tune demo on mobile, correct code example
Mar 29, 2024
26fa981
Update plugin README
Mar 29, 2024
fb1e757
Tune demo
Mar 29, 2024
4599a8e
Add 'not supported' message to the demo, @supports rules
Mar 29, 2024
17b7c0c
Reorganize content: make new Demo section, move Open source into 'Me'
Mar 29, 2024
6792be4
Move the plugin to separate repository
Mar 29, 2024
694b42f
Update typo in the plugin name, update to 0.0.7
Mar 29, 2024
81ca4e4
Update to plugin 0.0.9
Mar 29, 2024
0dd7dc9
Fix dark mode switch, rename components, move the state to the compon…
Mar 30, 2024
8365922
Move plugin demo, code examples to src/components
Mar 30, 2024
753389f
Replace dark mode switch animation with framer-motion
Mar 30, 2024
0ec7b3e
Fix link styling
Mar 30, 2024
113b108
Update links to code examples, remove plugin import from config
Mar 30, 2024
0078653
Update link to the repo, add link to the plugin
Mar 30, 2024
63e12cd
Update README
Mar 30, 2024
241a07f
Update scroll-driven anim plugin to 0.1.0
Mar 30, 2024
2de94c0
Redirect all traffic to https
Mar 30, 2024
ab29627
Header segment relative
Mar 30, 2024
7d4e84f
Add photo, tune texts, spacing
Mar 31, 2024
71a3d61
Update content: no photo, longer title, Intro section
Apr 2, 2024
3a90d36
Update header, add AP 'logo', bike anim
Apr 2, 2024
3f5c116
Remove icon and anim from the 'logo'
Apr 2, 2024
4fb9783
Fix range code demo + link
Apr 2, 2024
a1dce22
Add github link, tune hover colors
Apr 2, 2024
530bb65
Tune header, change dark/light anim
Apr 2, 2024
f16c59a
Fix texts
Apr 2, 2024
4a86a02
Finalize things
Apr 2, 2024
0d31ac1
Minor fixes: update content for mobile, fix missing header item on mo…
Apr 3, 2024
40a9a23
Add router, create pages with plugin, usage + demos
Apr 3, 2024
f8cc51b
Update demos, remove prettier imports plugin
Apr 3, 2024
376191b
Update .htaccess
Apr 3, 2024
75a51f4
Tune demo, nav item on mobile
Apr 3, 2024
587835b
Fix dom error, add ScrollRestoration
Apr 3, 2024
8a6523c
Rename view components
Apr 3, 2024
5423d87
Remove unused component
Apr 3, 2024
cae3a77
Add usage: animation-timeline
Apr 3, 2024
69a4f20
Tune docu in progress message
Apr 3, 2024
052a660
Make page wider, add documentation
Apr 3, 2024
1d1bd0a
Add more demos, more examples
Apr 3, 2024
9036e63
Tune demos, move demos on top
Apr 3, 2024
4d17557
Update .htaccess
Apr 3, 2024
25f8a93
Fix spacing
Apr 3, 2024
aca0e0b
Fix errors in demos, tuning
Apr 3, 2024
c960f0a
Tune the main title.
Apr 3, 2024
ba8f0bc
Fix errors in the demo descriptions
Apr 3, 2024
00ee6c9
Tune demos, still some errors and typos
Apr 3, 2024
407f024
Tune demo trigger line
Apr 3, 2024
5117e9f
Update Chrome version in the alert to 116
Apr 6, 2024
70a724c
Remove robots.txt
Apr 6, 2024
1ca2c8b
Add demo links to titles
Apr 7, 2024
a8d66b6
Update demo links, add color to active menu item
Apr 7, 2024
213ac83
Remove .htaccess - no longer needed on Vercel
Apr 7, 2024
670431a
Update UsageTable header
Apr 7, 2024
eabd736
Merge pull request #1 from adamplesnik/feature-update-documentation
adamplesnik Apr 7, 2024
8bb8a0a
Add remaining utilities to docu tables
Apr 8, 2024
8b578d0
Add links to docu in heading, tune demo links
Apr 8, 2024
694f349
Rename Usage* to Docs*
Apr 8, 2024
44dc097
Add footer
Apr 8, 2024
1a135b2
Merge pull request #3 from adamplesnik/feature/update-documentation
adamplesnik Apr 8, 2024
11e5b31
Add Vercel analytics
Apr 8, 2024
fdb0983
Merge pull request #4 from adamplesnik/feature/vercel-analytics
adamplesnik Apr 8, 2024
9a194f7
Add htaccess
Apr 8, 2024
0da57f5
Add vercel.json
Apr 8, 2024
57972d7
Tune spacing, colors
Apr 8, 2024
754f189
Rename nav to docs, disable routes on 'main', update vercel.json
Apr 9, 2024
4e72d92
Add routes back
Apr 9, 2024
5143819
Document new range utilities
Apr 10, 2024
fb85e0b
Fix typo in usage
Apr 10, 2024
ac7695b
Update code link line number
Apr 10, 2024
0f57a79
Update docs table
Apr 10, 2024
7d80e21
Update documentation: add new demos, tune spacing, colors
Apr 10, 2024
5ecbb93
Fix errors
Apr 10, 2024
4ef5244
Fix colors, update texts
Apr 10, 2024
68530bd
Fix error
Apr 10, 2024
dca916a
Fix various issues, tune spacing
Apr 10, 2024
a129102
Tune text colors
Apr 10, 2024
3eff8a9
Tune spacing, colors in Nav
Apr 11, 2024
555d673
Update docu to use no-animations:, change code,
Apr 11, 2024
97873c8
Fix errors
Apr 11, 2024
dbe8285
Update docs, demos
Apr 11, 2024
4dc4988
Remove dots from class names, tune things
Apr 11, 2024
6123be5
Fix typo in demo
Apr 11, 2024
a61abb9
Update demo wrapper, add action button
Apr 11, 2024
b201515
Add intro to the docs
Apr 12, 2024
ffc9391
Tune the demo
Apr 12, 2024
9c57b0a
Remove Tailwind job application info from the title
Apr 16, 2024
c0f852f
Update README.md
adamplesnik Apr 16, 2024
81893c2
Update readme, package.json name
Apr 16, 2024
658c00e
Move all to docs/
Apr 16, 2024
b671fcc
Merge remote-tracking branch 'docs/prepare-merge-to-docs' into featur…
Apr 16, 2024
319ae46
Update package.json
Apr 16, 2024
e1ef4a6
Remove docs/README
Apr 16, 2024
5c1c63b
Remove 'me' from nav, delete .htaccess
Apr 16, 2024
33428d8
Update docs
Apr 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
26 changes: 26 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

package-lock.json
12 changes: 12 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en" class="scroll-smooth bg-zinc-50 text-zinc-700 dark:bg-zinc-900 dark:text-zinc-400">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tailwind Labs Job Application, Adam Plesník</title>
</head>
<body>
<div id="root" class=""></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
51 changes: 51 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "tailwindcss-scroll-driven-animations-docu",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"prettier": {
"printWidth": 100,
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"plugins": [
"prettier-plugin-tailwindcss"
]
},
"dependencies": {
"@vercel/analytics": "^1.2.2",
"framer-motion": "^11.0.24",
"lucide-react": "^0.363.0",
"prismjs": "^1.29.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.3"
},
"devDependencies": {
"@adam.plesnik/tailwindcss-scroll-driven-animations": "^0.2.5",
"@types/node": "^20.11.30",
"@types/prismjs": "^1.26.3",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"postcss": "^8.4.38",
"postcss-import": "^16.1.0",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.12",
"tailwindcss": "^3.4.1",
"typescript": "^5.2.2",
"vite": "^5.2.0"
}
}
7 changes: 7 additions & 0 deletions docs/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
plugins: {
'postcss-import': {},
tailwindcss: {},
autoprefixer: {},
},
}
57 changes: 57 additions & 0 deletions docs/src/components/ActionButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { LucideIcon } from 'lucide-react'
import { MouseEvent, MouseEventHandler, useState } from 'react'

const ActionButton = ({
clickAction,
Icon,
IconOnClick = undefined,
tooltip = '',
}: ReplayButtonProps) => {
const [clicked, setClicked] = useState(false)
function handleClick(e: MouseEvent) {
clickAction(e)
setClicked(true)
setTimeout(() => setClicked(false), 2000)
}
return (
<div
onClick={(e) => {
handleClick(e)
}}
title={tooltip}
className="group cursor-pointer p-1"
>
<div
className={
'ease-custom relative flex size-6 items-center justify-center rounded-full bg-gradient-to-tr from-slate-400 to-indigo-500 text-zinc-100 opacity-80 ' +
'overflow-hidden transition-[transform,opacity] duration-300 group-hover:scale-125 group-hover:opacity-100 ' +
(clicked ? 'scale-125' : 'group-hover:scale-125')
}
>
<Icon
className={
'ease-custom absolute size-3 transition-[opacity,transform] duration-500 group-hover:rotate-180 ' +
(clicked ? 'translate-y-24 rotate-180 delay-300' : 'translate-y-0 delay-75')
}
/>
{IconOnClick && (
<IconOnClick
className={
'ease-custom size-3 transition-[opacity,transform] duration-[1s] ' +
(clicked ? 'translate-y-0' : '-translate-y-24')
}
/>
)}
</div>
</div>
)
}

export interface ReplayButtonProps {
clickAction: MouseEventHandler
Icon: LucideIcon
IconOnClick?: LucideIcon | undefined
tooltip: string
}

export default ActionButton
17 changes: 17 additions & 0 deletions docs/src/components/Code.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { PropsWithChildren } from 'react'

const Code = ({ children }: PropsWithChildren<InlineCodeProps>) => (
<code
className={
'whitespace-nowrap bg-fuchsia-200/40 p-1 px-1 py-0.5 font-mono text-sm text-zinc-900 dark:bg-indigo-200/20 dark:text-zinc-300'
}
>
{children}
</code>
)

export interface InlineCodeProps {
children: PropsWithChildren
}

export default Code
52 changes: 52 additions & 0 deletions docs/src/components/CodeBlock.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { LucideIcon } from 'lucide-react'
import Prism from 'prismjs'
import { PropsWithChildren, useEffect } from 'react'
import Link from './Link.tsx'

const CodeBlock = ({
children,
Icon = undefined,
language = 'javascript',
linkHref = '',
linkText = '',
}: PropsWithChildren<CodeProps>) => {
useEffect(() => {
Prism.highlightAll()
}, [])

return (
<div
className={
'mb-4 rounded-lg border border-zinc-300 bg-zinc-100 text-zinc-900 dark:border-zinc-700 dark:bg-slate-800 dark:text-zinc-300'
}
>
<code
className={`language-${language} block overflow-y-auto whitespace-pre rounded-lg bg-transparent p-4 text-sm dark:text-zinc-300`}
>
{children}
</code>
{linkHref && (
<div
className={
'flex items-center gap-1 border-t border-t-zinc-300 bg-zinc-200/10 px-4 py-2 text-xs dark:border-t-slate-700 dark:bg-zinc-800/10 '
}
>
{Icon && <Icon size={14} strokeWidth={2} />}
<Link href={linkHref} target={'_blank'} borderWidth={'narrow'}>
{linkText ? linkText : linkHref}
</Link>
</div>
)}
</div>
)
}

export interface CodeProps {
children: PropsWithChildren
Icon?: LucideIcon | undefined
language?: 'javascript' | 'css' | 'html'
linkHref?: string | undefined
linkText?: string | undefined
}

export default CodeBlock
40 changes: 40 additions & 0 deletions docs/src/components/DarkModeSwitch.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { motion } from 'framer-motion'
import { Moon, Sun } from 'lucide-react'
import { MouseEventHandler, useState } from 'react'

const DarkModeSwitch = () => {
const systemDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
const storageModeDark = localStorage.getItem('mode') === 'dark'
const [darkMode, setDarkMode] = useState(storageModeDark || systemDarkMode ? true : false)
const classList = document.documentElement.classList
darkMode ? classList.add('dark') : classList.remove('dark')

const switchMode = () => {
localStorage.setItem('mode', darkMode ? 'light' : 'dark')
setDarkMode(!darkMode)
}

return (
<div
className="flex size-8 cursor-pointer flex-col overflow-hidden rounded-full transition-colors hover:bg-white/40 dark:hover:bg-slate-500/60"
onClick={switchMode}
>
<motion.div
initial={{ y: !darkMode ? 0 : '-2rem' }}
animate={{ y: !darkMode ? 0 : '-2rem' }}
transition={{ ease: [0.65, 0.05, 0.17, 0.99], duration: 0.5, delay: 0.2 }}
className="group flex flex-col"
>
<Sun className="size-8 p-1 transition-transform duration-700 ease-line group-hover:rotate-[22deg]" />
<Moon className="size-8 p-1 transition-transform duration-700 ease-line group-hover:-rotate-[22deg]" />
</motion.div>
</div>
)
}

export interface ModeSwitchProps {
mode: string
onClick: MouseEventHandler
}

export default DarkModeSwitch
34 changes: 34 additions & 0 deletions docs/src/components/DemoAnimationExampleRow.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { addWithSpace } from '../utils/addWithSpace'
import Code from './Code'

const DemoAnimationExampleRow = ({ animations, timeline }: DemoAnimationExampleRowProps) => {
const animationClasses = animations.split(' ')
return (
<div className="flex items-center gap-2 sm:flex-col sm:items-start">
<div className="w-36 flex-shrink-0">
{animationClasses.map((animation) => (
<Code key={animation}>{animation}</Code>
))}
</div>
<div className="relative w-full flex-1 rounded-full bg-slate-300/40 text-sm sm:flex-none dark:bg-slate-300/20">
<span className="absolute left-1 font-mono text-xs opacity-50">0%</span>
<span className="absolute left-1/2 top-1.5 size-1 -translate-x-1/2 rotate-90 rounded-full bg-current font-mono text-xs opacity-30 sm:opacity-50"></span>
<span className="absolute right-1 font-mono text-xs opacity-50">100%</span>
<div
className={
'h-4 w-0 animate-scale-to-right rounded-full bg-sky-500/70 dark:bg-fuchsia-500/60' +
addWithSpace(animations) +
addWithSpace(timeline)
}
></div>
</div>
</div>
)
}

export interface DemoAnimationExampleRowProps {
animations: string
timeline: string
}

export default DemoAnimationExampleRow
32 changes: 32 additions & 0 deletions docs/src/components/HeaderNavAnchor.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { PropsWithChildren } from 'react'
import { NavLink } from 'react-router-dom'

const HeaderNavAnchor = ({
children,
to: href,
className = '',
external = false,
}: PropsWithChildren<HeaderNavAnchorProps>) => {
return (
<NavLink
to={href}
className={({ isActive }) =>
'flex items-center justify-center rounded-full px-2 text-sm font-medium transition-colors duration-200 md:min-w-12 ' +
'hover:bg-fuchsia-400/40 dark:hover:bg-slate-500/60 ' +
(isActive ? 'bg-fuchsia-400/30 dark:bg-slate-500/50 ' : '') +
(className != '' ? ` ${className}` : '')
}
target={external ? '_blank' : ''}
>
{children}
</NavLink>
)
}

export interface HeaderNavAnchorProps {
children: PropsWithChildren
to: string
className?: string | undefined
external?: boolean
}
export default HeaderNavAnchor
Loading