├── .env
├── .gitignore
├── .prettierrc
├── README.md
├── README.md.bootstrap
├── package-lock.json
├── package.json
├── public
├── favicon.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
├── opengraph.png
├── repo-header.png
└── robots.txt
├── src
├── App.js
├── App.test.js
├── components
│ ├── atmos
│ │ ├── button
│ │ │ └── index.jsx
│ │ ├── icon
│ │ │ └── index.jsx
│ │ ├── slider
│ │ │ └── index.jsx
│ │ ├── toggle
│ │ │ └── index.jsx
│ │ ├── toolbar
│ │ │ └── toolbar.jsx
│ │ └── uploader
│ │ │ └── index.jsx
│ ├── controller
│ │ └── index.jsx
│ ├── layout
│ │ └── layout.jsx
│ ├── preview
│ │ └── index.jsx
│ ├── settings
│ │ ├── background.jsx
│ │ ├── header.jsx
│ │ ├── index.jsx
│ │ ├── options.jsx
│ │ └── templates.jsx
│ ├── shot
│ │ ├── index.jsx
│ │ └── templates
│ │ │ ├── constants.js
│ │ │ ├── expanded.jsx
│ │ │ ├── index.jsx
│ │ │ └── standard.jsx
│ └── swatcher
│ │ └── index.jsx
├── constants.js
├── images
│ └── brand.svg
├── index.js
├── serviceWorker.js
├── setupTests.js
├── store
│ └── index.js
├── tailwind
│ ├── generated.css
│ └── index.css
└── theme
│ └── index.js
└── tailwind.config.js
/.env:
--------------------------------------------------------------------------------
1 | REACT_APP_WEBSITE_NAME=Shooot
2 | REACT_APP_WEBSITE_DESCRIPTION=${npm_package_description}
3 | REACT_APP_WEBSITE_VERSION=${npm_package_version}
4 | REACT_APP_WEBSITE_REPOSITORY=https://github.com/bourhaouta/shooot
5 | REACT_APP_WEBSITE_URL=${npm_package_homepage}
6 | REACT_APP_OWNER_USERNAME=${npm_package_author_name}
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
25 | # Local Netlify folder
26 | .netlify
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "endOfLine": "lf",
3 | "semi": false,
4 | "singleQuote": true,
5 | "jsxSingleQuote": true,
6 | "tabWidth": 2,
7 | "trailingComma": "all"
8 | }
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://shooot.bourhaouta.com/)
2 |
3 | [](https://app.netlify.com/sites/shooot/deploys)
4 |
5 | ## SHOOOT
6 |
7 | Create amazing screenshots for you dribbble _shots_: [shooot.bourhaouta.com](https://shooot.bourhaouta.com/)
8 |
9 | (This project was bootstrapped with CRA. You can find the [bootstrapped readme here](./README.md.bootstrap).)
10 |
--------------------------------------------------------------------------------
/README.md.bootstrap:
--------------------------------------------------------------------------------
1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2 |
3 | ## Available Scripts
4 |
5 | In the project directory, you can run:
6 |
7 | ### `yarn start`
8 |
9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11 |
12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console.
14 |
15 | ### `yarn test`
16 |
17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19 |
20 | ### `yarn build`
21 |
22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance.
24 |
25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed!
27 |
28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29 |
30 | ### `yarn eject`
31 |
32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33 |
34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35 |
36 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37 |
38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39 |
40 | ## Learn More
41 |
42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43 |
44 | To learn React, check out the [React documentation](https://reactjs.org/).
45 |
46 | ### Code Splitting
47 |
48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49 |
50 | ### Analyzing the Bundle Size
51 |
52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53 |
54 | ### Making a Progressive Web App
55 |
56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57 |
58 | ### Advanced Configuration
59 |
60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61 |
62 | ### Deployment
63 |
64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65 |
66 | ### `yarn build` fails to minify
67 |
68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
69 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "shooot",
3 | "description": "Free Dribbble shots generator",
4 | "version": "0.2.0",
5 | "author": {
6 | "name": "bourhaouta",
7 | "email": "bourhaouta@gmail.com",
8 | "url": "https://bourhaouta.com"
9 | },
10 | "homepage": "https://shooot.bourhaouta.com",
11 | "repository": "https://github.com/bourhaouta/shooot",
12 | "dependencies": {
13 | "@testing-library/jest-dom": "^4.2.4",
14 | "@testing-library/react": "^9.3.2",
15 | "@testing-library/user-event": "^7.1.2",
16 | "classnames": "^2.2.6",
17 | "dom-to-image": "^2.6.0",
18 | "dom-to-image-more": "^2.8.0",
19 | "file-saver": "^2.0.2",
20 | "minireset.css": "0.0.6",
21 | "node-vibrant": "^3.1.5",
22 | "react": "^16.12.0",
23 | "react-dom": "^16.12.0",
24 | "react-ga": "^2.7.0",
25 | "react-scripts": "^3.4.0",
26 | "tailwindcss": "^1.4.6"
27 | },
28 | "scripts": {
29 | "start": "npm run tailwind:css && react-scripts start",
30 | "build": "npm run tailwind:purge && react-scripts build",
31 | "test": "react-scripts test",
32 | "eject": "react-scripts eject",
33 | "tailwind:css": "tailwind build src/tailwind/index.css -o src/tailwind/generated.css",
34 | "tailwind:purge": "NODE_ENV=production npm run tailwind:css"
35 | },
36 | "eslintConfig": {
37 | "extends": "react-app"
38 | },
39 | "browserslist": {
40 | "production": [
41 | ">0.2%",
42 | "not dead",
43 | "not op_mini all"
44 | ],
45 | "development": [
46 | "last 1 chrome version",
47 | "last 1 firefox version",
48 | "last 1 safari version"
49 | ]
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bourhaouta/shooot/f4f8422e0489dfce0367994edc7b54f34e04a726/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
13 |
14 |
23 | %REACT_APP_WEBSITE_NAME% - %REACT_APP_WEBSITE_DESCRIPTION%
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bourhaouta/shooot/f4f8422e0489dfce0367994edc7b54f34e04a726/public/logo192.png
--------------------------------------------------------------------------------
/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bourhaouta/shooot/f4f8422e0489dfce0367994edc7b54f34e04a726/public/logo512.png
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "Shooot",
3 | "name": "Dribbble shot generator",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/public/opengraph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bourhaouta/shooot/f4f8422e0489dfce0367994edc7b54f34e04a726/public/opengraph.png
--------------------------------------------------------------------------------
/public/repo-header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bourhaouta/shooot/f4f8422e0489dfce0367994edc7b54f34e04a726/public/repo-header.png
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | import domtoimage from 'dom-to-image-more'
2 | import { saveAs } from 'file-saver'
3 | import * as Vibrant from 'node-vibrant'
4 | import React, { useContext, useEffect } from 'react'
5 | import ReactGA from 'react-ga'
6 | import Layout from './components/layout/layout'
7 | import Preview from './components/preview'
8 | import Settings from './components/settings'
9 | import { SettingsContext } from './store'
10 |
11 | ReactGA.initialize('UA-114909372-3')
12 | ReactGA.pageview(window.location.pathname + window.location.search)
13 |
14 | const App = () => {
15 | const handleVibrantChange = ({ target }) => setVibrant(target.value)
16 |
17 | const { file, setVibrant, setPalette } = useContext(SettingsContext)
18 |
19 | useEffect(() => {
20 | file &&
21 | Vibrant.from(file)
22 | .getPalette()
23 | .then((palette) => {
24 | setVibrant(palette.Vibrant.hex)
25 | setPalette(Object.values(palette))
26 | })
27 | }, [file, setPalette, setVibrant])
28 |
29 | const handleSave = () => {
30 | ReactGA.event({
31 | category: 'User',
32 | action: 'Created a Shot',
33 | })
34 |
35 | const el = document.getElementById('frame')
36 | const scale = 2
37 | const output = 'download.png'
38 |
39 | domtoimage
40 | .toBlob(el, {
41 | height: el.offsetHeight * scale,
42 | style: {
43 | transform: `scale(${scale}) translate(${
44 | el.offsetWidth / 2 / scale
45 | }px, ${el.offsetHeight / 2 / scale}px)`,
46 | },
47 | width: el.offsetWidth * scale,
48 | })
49 | .then((blob) => saveAs(blob, output))
50 | .catch((error) => console.error('Oops, something went wrong!', error))
51 | }
52 |
53 | return (
54 |
55 |
56 |
57 |
58 | )
59 | }
60 |
61 | export default App
62 |
--------------------------------------------------------------------------------
/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { render } from '@testing-library/react'
3 | import App from './App'
4 |
5 | test('renders learn react link', () => {
6 | const { getByText } = render()
7 | const linkElement = getByText(/learn react/i)
8 | expect(linkElement).toBeInTheDocument()
9 | })
10 |
--------------------------------------------------------------------------------
/src/components/atmos/button/index.jsx:
--------------------------------------------------------------------------------
1 | import cx from 'classnames'
2 | import React from 'react'
3 | import Icon from '../icon'
4 |
5 | export const Button = ({
6 | type = 'button',
7 | children,
8 | disabled,
9 | icon,
10 | onClick,
11 | }) => (
12 |
25 | )
26 |
27 | export default Button
28 |
--------------------------------------------------------------------------------
/src/components/atmos/icon/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const Icon = ({ name, size = 16 }) => {
4 | const path = () => {
5 | switch (name) {
6 | case 'download':
7 | return 'M3 19h18v2H3v-2zm10-5.828L19.071 7.1l1.414 1.414L12 17 3.515 8.515 4.929 7.1 11 13.17V2h2v11.172z'
8 |
9 | case 'back':
10 | return 'M7.828 11H20v2H7.828l5.364 5.364-1.414 1.414L4 12l7.778-7.778 1.414 1.414z'
11 |
12 | case 'settings':
13 | return 'M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2h4.17zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2h10.17zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4h4.17zM9 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm6 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-6 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2z'
14 |
15 | case 'image':
16 | return 'M4.828 21l-.02.02-.021-.02H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H4.828zM20 15V5H4v14L14 9l6 6zm0 2.828l-6-6L6.828 19H20v-1.172zM8 11a2 2 0 1 1 0-4 2 2 0 0 1 0 4z'
17 |
18 | case 'layout':
19 | return 'M20 3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h16zm-9 10H5v6h6v-6zm2 6h6V5h-6v14zM11 5H5v6h6V5z'
20 |
21 | case 'toggle':
22 | return 'M8 7a5 5 0 1 0 0 10h8a5 5 0 0 0 0-10H8zm0-2h8a7 7 0 0 1 0 14H8A7 7 0 0 1 8 5zm0 10a3 3 0 1 1 0-6 3 3 0 0 1 0 6z'
23 |
24 | case 'brush':
25 | return 'M15.456 9.678l-.142-.142a5.475 5.475 0 0 0-2.39-1.349c-2.907-.778-5.699.869-6.492 3.83-.043.16-.066.34-.104.791-.154 1.87-.594 3.265-1.8 4.68 2.26.888 4.938 1.514 6.974 1.514a5.505 5.505 0 0 0 5.31-4.078 5.497 5.497 0 0 0-1.356-5.246zM13.29 6.216l4.939-3.841a1 1 0 0 1 1.32.082l2.995 2.994a1 1 0 0 1 .082 1.321l-3.84 4.938a7.505 7.505 0 0 1-7.283 9.292C8 21.002 3.5 19.5 1 18c3.98-3 3.047-4.81 3.5-6.5 1.058-3.95 4.842-6.257 8.789-5.284zm3.413 1.879c.065.063.13.128.193.194l1.135 1.134 2.475-3.182-1.746-1.746-3.182 2.475 1.125 1.125z'
26 |
27 | case 'github':
28 | return 'M12 2C6.475 2 2 6.475 2 12a9.994 9.994 0 0 0 6.838 9.488c.5.087.687-.213.687-.476 0-.237-.013-1.024-.013-1.862-2.512.463-3.162-.612-3.362-1.175-.113-.288-.6-1.175-1.025-1.413-.35-.187-.85-.65-.013-.662.788-.013 1.35.725 1.538 1.025.9 1.512 2.338 1.087 2.912.825.088-.65.35-1.087.638-1.337-2.225-.25-4.55-1.113-4.55-4.938 0-1.088.387-1.987 1.025-2.688-.1-.25-.45-1.275.1-2.65 0 0 .837-.262 2.75 1.026a9.28 9.28 0 0 1 2.5-.338c.85 0 1.7.112 2.5.337 1.912-1.3 2.75-1.024 2.75-1.024.55 1.375.2 2.4.1 2.65.637.7 1.025 1.587 1.025 2.687 0 3.838-2.337 4.688-4.562 4.938.362.312.675.912.675 1.85 0 1.337-.013 2.412-.013 2.75 0 .262.188.574.688.474A10.016 10.016 0 0 0 22 12c0-5.525-4.475-10-10-10z'
29 |
30 | case 'eyedrop':
31 | return 'M13.96 6.504l2.829-2.828a1 1 0 0 1 1.414 0l2.121 2.121a1 1 0 0 1 0 1.414l-2.828 2.829 1.767 1.768-1.414 1.414-7.07-7.071 1.413-1.414 1.768 1.767zM10.778 8.98l4.243 4.243L7.243 21H3v-4.243l7.778-7.778z'
32 |
33 | case 'spacing':
34 | return 'M4 9v4h16V9h2v5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V9h2z'
35 |
36 | case 'radius':
37 | return 'M5 8a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm14 0a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 14a3 3 0 1 1 0-6 3 3 0 0 1 0 6zM5 22a3 3 0 1 1 0-6 3 3 0 0 1 0 6zM9 4h6v2H9V4zm0 14h6v2H9v-2zM4 9h2v6H4V9zm14 0h2v6h-2V9z'
38 |
39 | case 'delete':
40 | return 'M7 4V2h10v2h5v2h-2v15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6H2V4h5zM6 6v14h12V6H6zm3 3h2v8H9V9zm4 0h2v8h-2V9z'
41 |
42 | default:
43 | return ''
44 | }
45 | }
46 |
47 | return (
48 |
56 | )
57 | }
58 |
59 | export default Icon
60 |
--------------------------------------------------------------------------------
/src/components/atmos/slider/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const Slider = ({ min, onChange, value }) => (
4 |
11 | )
12 |
13 | export default Slider
14 |
--------------------------------------------------------------------------------
/src/components/atmos/toggle/index.jsx:
--------------------------------------------------------------------------------
1 | import cx from 'classnames'
2 | import React from 'react'
3 |
4 | const Toggle = ({ id, checked, label, onChange }) => (
5 |
6 |
23 |
24 |
32 |
33 | )
34 |
35 | export default Toggle
36 |
--------------------------------------------------------------------------------
/src/components/atmos/toolbar/toolbar.jsx:
--------------------------------------------------------------------------------
1 | import cx from 'classnames'
2 | import React from 'react'
3 |
4 | const colors = ['bg-red-500', 'bg-orange-500', 'bg-green-500']
5 |
6 | const Toolbar = ({ children, hasToolbar }) => {
7 | return hasToolbar ? (
8 |
9 |
10 | {colors.map((color) => (
11 |
12 | ))}
13 |
14 |
{children}
15 |
16 | ) : (
17 | children
18 | )
19 | }
20 |
21 | export default Toolbar
22 |
--------------------------------------------------------------------------------
/src/components/atmos/uploader/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { useContext } from 'react'
2 | import { SettingsContext } from '../../../store'
3 |
4 | const Uploader = ({ id }) => {
5 | const { setFile } = useContext(SettingsContext)
6 |
7 | return (
8 |
9 |
15 |
16 |
23 |
24 | )
25 | }
26 |
27 | export default Uploader
28 |
--------------------------------------------------------------------------------
/src/components/controller/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Icon from '../atmos/icon'
3 |
4 | const Controller = ({ label, icon, children }) => {
5 | return (
6 |
7 | {label && (
8 |
9 | {icon && }
10 | {label}
11 |
12 |
13 | )}
14 |
15 |
{children}
16 |
17 | )
18 | }
19 |
20 | export default Controller
21 |
--------------------------------------------------------------------------------
/src/components/layout/layout.jsx:
--------------------------------------------------------------------------------
1 | import React, { useContext } from 'react'
2 | import { SettingsContext } from '../../store'
3 | import '../../tailwind/generated.css'
4 | import Icon from '../atmos/icon'
5 |
6 | const Layout = ({ children }) => {
7 | const { setSettingsVisibility } = useContext(SettingsContext)
8 |
9 | return (
10 |
11 |
setSettingsVisibility(true)}
13 | className='fixed top-0 left-0 z-10 p-1 m-3 bg-white border border-gray-300 rounded shadow sm:hidden'
14 | >
15 |
16 |
17 |
18 | {children}
19 |
20 | )
21 | }
22 |
23 | export default Layout
24 |
--------------------------------------------------------------------------------
/src/components/preview/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { useContext, useState } from 'react'
2 | import { SettingsContext } from '../../store'
3 | import Slider from '../atmos/slider'
4 | import Shot from '../shot'
5 |
6 | const Preview = () => {
7 | const [scale, setScale] = useState(45)
8 |
9 | const { file, vibrant } = useContext(SettingsContext)
10 |
11 | const shotProps = { className: 'absolute', file, vibrant, scale }
12 |
13 | return (
14 |
15 |
16 |
17 |
18 | setScale(value)}
21 | value={scale}
22 | />
23 |
24 |
25 | )
26 | }
27 |
28 | export default Preview
29 |
--------------------------------------------------------------------------------
/src/components/settings/background.jsx:
--------------------------------------------------------------------------------
1 | import React, { useContext } from 'react'
2 | import { SettingsContext } from '../../store'
3 | import Toggle from '../atmos/toggle'
4 | import Controller from '../controller'
5 | import Swatcher from '../swatcher'
6 |
7 | const Background = () => {
8 | const { isBlended, isBlurred, setIsBlended, setIsBlurred } = useContext(
9 | SettingsContext,
10 | )
11 |
12 | return (
13 |
14 |
15 |
16 |
17 |
18 |
19 | {
23 | setIsBlurred(!isBlurred)
24 | isBlended && setIsBlended(false)
25 | }}
26 | checked={isBlurred}
27 | />
28 |
29 | {
33 | setIsBlended(!isBlended)
34 | !isBlended && setIsBlurred(true)
35 | }}
36 | checked={isBlended}
37 | />
38 |
39 |
40 | )
41 | }
42 |
43 | export default Background
44 |
--------------------------------------------------------------------------------
/src/components/settings/header.jsx:
--------------------------------------------------------------------------------
1 | import React, { useContext } from 'react'
2 | import { SettingsContext } from '../../store'
3 | import Icon from '../atmos/icon'
4 |
5 | const Header = () => {
6 | const { setSettingsVisibility } = useContext(SettingsContext)
7 |
8 | return (
9 |
37 | )
38 | }
39 | export default Header
40 |
--------------------------------------------------------------------------------
/src/components/settings/index.jsx:
--------------------------------------------------------------------------------
1 | import cx from 'classnames'
2 | import React, { useContext } from 'react'
3 | import { SettingsContext } from '../../store'
4 | import Button from '../atmos/button'
5 | import Uploader from '../atmos/uploader'
6 | import Controller from '../controller'
7 | import Background from './background'
8 | import Header from './header'
9 | import Options from './options'
10 | import Templates from './templates'
11 |
12 | const Settings = ({ onSave }) => {
13 | const { file, settingsVisibility } = useContext(SettingsContext)
14 |
15 | return (
16 |
42 | )
43 | }
44 |
45 | export default Settings
46 |
--------------------------------------------------------------------------------
/src/components/settings/options.jsx:
--------------------------------------------------------------------------------
1 | import React, { useContext } from 'react'
2 | import { SettingsContext } from '../../store'
3 | import Controller from '../controller'
4 |
5 | const Settings = () => {
6 | const {
7 | setSpacing,
8 | setAllSpacing,
9 | spacing,
10 | setRadius,
11 | setAllRadius,
12 | radius,
13 | } = useContext(SettingsContext)
14 |
15 | const spacingController = [
16 | {
17 | side: 'top',
18 | position: 'col-start-2 row-start-1',
19 | },
20 | {
21 | side: 'right',
22 | position: 'col-start-3 row-start-2',
23 | },
24 | {
25 | side: 'bottom',
26 | position: 'col-start-2 row-start-3',
27 | },
28 | {
29 | side: 'left',
30 | position: 'col-start-1 row-start-2',
31 | },
32 | ]
33 |
34 | const radiusController = [
35 | {
36 | side: 'top-left',
37 | position: 'col-start-1 row-start-1',
38 | },
39 | {
40 | side: 'top-right',
41 | position: 'col-start-3 row-start-1',
42 | },
43 | {
44 | side: 'bottom-right',
45 | position: 'col-start-3 row-start-3',
46 | },
47 | {
48 | side: 'bottom-left',
49 | position: 'col-start-1 row-start-3',
50 | },
51 | ]
52 |
53 | const controllers = [
54 | {
55 | label: 'Spacing',
56 | icon: 'spacing',
57 | getter: spacing,
58 | allGetter: spacing,
59 | setter: setSpacing,
60 | allSetter: setAllSpacing,
61 | controller: spacingController,
62 | },
63 | {
64 | label: 'Radius',
65 | icon: 'radius',
66 | getter: radius,
67 | setter: setRadius,
68 | allSetter: setAllRadius,
69 | controller: radiusController,
70 | },
71 | ]
72 |
73 | return (
74 |
75 | {controllers.map(
76 | ({ label, icon, controller, getter, setter, allSetter }) => (
77 |
78 |
79 |
80 |
81 | allSetter(value)}
86 | placeholder='All'
87 | value={getter[0]}
88 | />
89 |
90 | {controller.map(({ side, position }) => (
91 |
92 |
97 | setter({ ...getter, [side]: value })
98 | }
99 | value={getter[side]}
100 | />
101 |
102 | ))}
103 |
104 |
105 | ),
106 | )}
107 |
108 | )
109 | }
110 |
111 | export default Settings
112 |
--------------------------------------------------------------------------------
/src/components/settings/templates.jsx:
--------------------------------------------------------------------------------
1 | import cx from 'classnames'
2 | import React, { useContext } from 'react'
3 | import { SettingsContext } from '../../store'
4 | import Toggle from '../atmos/toggle'
5 | import Controller from '../controller'
6 | import Template from '../shot/templates'
7 | import TEMPLATES from '../shot/templates/constants'
8 |
9 | const Templates = () => {
10 | const { template, setTemplate, setHasToolbar, hasToolbar } = useContext(
11 | SettingsContext,
12 | )
13 |
14 | return (
15 |
16 |
17 |
setHasToolbar(!hasToolbar)}
21 | checked={hasToolbar}
22 | />
23 |
24 |
25 | {TEMPLATES.map((name) => (
26 | - setTemplate(name)}>
27 |
35 |
36 |
37 | {name}
38 |
39 | ))}
40 |
41 |
42 |
43 | )
44 | }
45 |
46 | export default Templates
47 |
--------------------------------------------------------------------------------
/src/components/shot/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { useContext } from 'react'
2 | import { SettingsContext } from '../../store'
3 | import Template from './templates'
4 |
5 | const Shot = ({ scale }) => {
6 | const {
7 | file,
8 | hasToolbar,
9 | isBlended,
10 | isBlurred,
11 | radius,
12 | spacing,
13 | template,
14 | vibrant,
15 | } = useContext(SettingsContext)
16 |
17 | const templateProps = {
18 | width: '1600px',
19 | file,
20 | hasToolbar,
21 | isBlended,
22 | isBlurred,
23 | name: template,
24 | radius,
25 | scale,
26 | spacing,
27 | vibrant,
28 | }
29 |
30 | return
31 | }
32 |
33 | export default Shot
34 |
--------------------------------------------------------------------------------
/src/components/shot/templates/constants.js:
--------------------------------------------------------------------------------
1 | export const STANDARD = 'standard'
2 | export const EXPANDED = 'expanded'
3 |
4 | export default [STANDARD, EXPANDED]
5 |
--------------------------------------------------------------------------------
/src/components/shot/templates/expanded.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Toolbar from '../../atmos/toolbar/toolbar'
3 |
4 | const Expanded = ({ file, hasToolbar, radius, spacing }) => (
5 |
6 |
22 |
23 |
32 |
33 | )
34 |
35 | Expanded.defaultProps = {
36 | file: '',
37 | hasToolbar: false,
38 | radius: 2,
39 | spacing: 20,
40 | }
41 |
42 | export default Expanded
43 |
--------------------------------------------------------------------------------
/src/components/shot/templates/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import * as TEMPLATES from './constants'
3 | import Expanded from './expanded'
4 | import Standard from './standard'
5 |
6 | const getSelectedTemplate = (name) => {
7 | switch (name) {
8 | case TEMPLATES.STANDARD:
9 | return Standard
10 |
11 | case TEMPLATES.EXPANDED:
12 | return Expanded
13 |
14 | default:
15 | return Standard
16 | }
17 | }
18 |
19 | const getScale = (scale) => `scale(${scale / 100})`
20 |
21 | const Template = ({
22 | id,
23 | file,
24 | isBlurred,
25 | isBlended,
26 | hasToolbar,
27 | name,
28 | radius,
29 | scale,
30 | spacing,
31 | style,
32 | vibrant,
33 | width,
34 | }) => {
35 | const SelectedTemplate = getSelectedTemplate(name)
36 |
37 | const getSpacing = (s, unit) =>
38 | `${s['top'] + unit} ${s['right'] + unit} ${s['bottom'] + unit} ${
39 | s['left'] + unit
40 | }`
41 |
42 | const getRadius = (r, unit) =>
43 | `${r['top-left'] + unit} ${r['top-right'] + unit} ${
44 | r['bottom-right'] + unit
45 | } ${r['bottom-left'] + unit}`
46 |
47 | const selectedTemplateProps = {
48 | file,
49 | hasToolbar,
50 | radius: getRadius(radius, 'px'),
51 | spacing: getSpacing(spacing, '%'),
52 | }
53 |
54 | return (
55 |
59 |
67 | {isBlurred && (
68 |
77 | )}
78 |
79 |
80 |
81 |
82 | )
83 | }
84 |
85 | Template.defaultProps = {
86 | radius: {
87 | 'top-left': 10,
88 | 'top-right': 10,
89 | 'bottom-right': 10,
90 | 'bottom-left': 10,
91 | },
92 | spacing: {
93 | top: 15,
94 | right: 15,
95 | bottom: 15,
96 | left: 15,
97 | },
98 | width: '100%',
99 | scale: 100,
100 | }
101 |
102 | export default Template
103 |
--------------------------------------------------------------------------------
/src/components/shot/templates/standard.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Toolbar from '../../atmos/toolbar/toolbar'
3 |
4 | const Standard = ({ file, hasToolbar, radius, spacing }) => (
5 |
21 | )
22 |
23 | Standard.defaultProps = {
24 | file: '',
25 | hasToolbar: false,
26 | radius: 2,
27 | spacing: 20,
28 | }
29 |
30 | export default Standard
31 |
--------------------------------------------------------------------------------
/src/components/swatcher/index.jsx:
--------------------------------------------------------------------------------
1 | import cx from 'classnames'
2 | import React, { useContext } from 'react'
3 | import { SettingsContext } from '../../store'
4 | import Icon from '../atmos/icon'
5 |
6 | const Swatcher = () => {
7 | const { vibrant, setVibrant, palette } = useContext(SettingsContext)
8 | const setVibrantValue = (e) => setVibrant(e.target.value)
9 |
10 | return (
11 |
12 |
27 |
28 |
setVibrantValue(e)}
32 | value={vibrant}
33 | />
34 |
35 |
36 |
Colors:
37 |
38 | {palette.map(({ hex }) => (
39 | - setVibrant(hex)}
47 | />
48 | ))}
49 |
50 |
51 |
52 | )
53 | }
54 |
55 | export default Swatcher
56 |
--------------------------------------------------------------------------------
/src/constants.js:
--------------------------------------------------------------------------------
1 | export const size = [
2 | [400, 300],
3 | [800, 600],
4 | [1600, 1200],
5 | ]
6 |
--------------------------------------------------------------------------------
/src/images/brand.svg:
--------------------------------------------------------------------------------
1 |
16 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom'
3 | import App from './App'
4 | import * as serviceWorker from './serviceWorker'
5 | import SettingsProvider from './store'
6 |
7 | ReactDOM.render(
8 |
9 |
10 | ,
11 | document.getElementById('root'),
12 | )
13 |
14 | // If you want your app to work offline and load faster, you can change
15 | // unregister() to register() below. Note this comes with some pitfalls.
16 | // Learn more about service workers: https://bit.ly/CRA-PWA
17 | serviceWorker.unregister()
18 |
--------------------------------------------------------------------------------
/src/serviceWorker.js:
--------------------------------------------------------------------------------
1 | // This optional code is used to register a service worker.
2 | // register() is not called by default.
3 |
4 | // This lets the app load faster on subsequent visits in production, and gives
5 | // it offline capabilities. However, it also means that developers (and users)
6 | // will only see deployed updates on subsequent visits to a page, after all the
7 | // existing tabs open on the page have been closed, since previously cached
8 | // resources are updated in the background.
9 |
10 | // To learn more about the benefits of this model and instructions on how to
11 | // opt-in, read https://bit.ly/CRA-PWA
12 |
13 | const isLocalhost = Boolean(
14 | window.location.hostname === 'localhost' ||
15 | // [::1] is the IPv6 localhost address.
16 | window.location.hostname === '[::1]' ||
17 | // 127.0.0.0/8 are considered localhost for IPv4.
18 | window.location.hostname.match(
19 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/,
20 | ),
21 | )
22 |
23 | export function register(config) {
24 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
25 | // The URL constructor is available in all browsers that support SW.
26 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href)
27 | if (publicUrl.origin !== window.location.origin) {
28 | // Our service worker won't work if PUBLIC_URL is on a different origin
29 | // from what our page is served on. This might happen if a CDN is used to
30 | // serve assets; see https://github.com/facebook/create-react-app/issues/2374
31 | return
32 | }
33 |
34 | window.addEventListener('load', () => {
35 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`
36 |
37 | if (isLocalhost) {
38 | // This is running on localhost. Let's check if a service worker still exists or not.
39 | checkValidServiceWorker(swUrl, config)
40 |
41 | // Add some additional logging to localhost, pointing developers to the
42 | // service worker/PWA documentation.
43 | navigator.serviceWorker.ready.then(() => {
44 | console.log(
45 | 'This web app is being served cache-first by a service ' +
46 | 'worker. To learn more, visit https://bit.ly/CRA-PWA',
47 | )
48 | })
49 | } else {
50 | // Is not localhost. Just register service worker
51 | registerValidSW(swUrl, config)
52 | }
53 | })
54 | }
55 | }
56 |
57 | function registerValidSW(swUrl, config) {
58 | navigator.serviceWorker
59 | .register(swUrl)
60 | .then(registration => {
61 | registration.onupdatefound = () => {
62 | const installingWorker = registration.installing
63 | if (installingWorker == null) {
64 | return
65 | }
66 | installingWorker.onstatechange = () => {
67 | if (installingWorker.state === 'installed') {
68 | if (navigator.serviceWorker.controller) {
69 | // At this point, the updated precached content has been fetched,
70 | // but the previous service worker will still serve the older
71 | // content until all client tabs are closed.
72 | console.log(
73 | 'New content is available and will be used when all ' +
74 | 'tabs for this page are closed. See https://bit.ly/CRA-PWA.',
75 | )
76 |
77 | // Execute callback
78 | if (config && config.onUpdate) {
79 | config.onUpdate(registration)
80 | }
81 | } else {
82 | // At this point, everything has been precached.
83 | // It's the perfect time to display a
84 | // "Content is cached for offline use." message.
85 | console.log('Content is cached for offline use.')
86 |
87 | // Execute callback
88 | if (config && config.onSuccess) {
89 | config.onSuccess(registration)
90 | }
91 | }
92 | }
93 | }
94 | }
95 | })
96 | .catch(error => {
97 | console.error('Error during service worker registration:', error)
98 | })
99 | }
100 |
101 | function checkValidServiceWorker(swUrl, config) {
102 | // Check if the service worker can be found. If it can't reload the page.
103 | fetch(swUrl, {
104 | headers: { 'Service-Worker': 'script' },
105 | })
106 | .then(response => {
107 | // Ensure service worker exists, and that we really are getting a JS file.
108 | const contentType = response.headers.get('content-type')
109 | if (
110 | response.status === 404 ||
111 | (contentType != null && contentType.indexOf('javascript') === -1)
112 | ) {
113 | // No service worker found. Probably a different app. Reload the page.
114 | navigator.serviceWorker.ready.then(registration => {
115 | registration.unregister().then(() => {
116 | window.location.reload()
117 | })
118 | })
119 | } else {
120 | // Service worker found. Proceed as normal.
121 | registerValidSW(swUrl, config)
122 | }
123 | })
124 | .catch(() => {
125 | console.log(
126 | 'No internet connection found. App is running in offline mode.',
127 | )
128 | })
129 | }
130 |
131 | export function unregister() {
132 | if ('serviceWorker' in navigator) {
133 | navigator.serviceWorker.ready.then(registration => {
134 | registration.unregister()
135 | })
136 | }
137 | }
138 |
--------------------------------------------------------------------------------
/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom/extend-expect'
6 |
--------------------------------------------------------------------------------
/src/store/index.js:
--------------------------------------------------------------------------------
1 | import React, { createContext, useState } from 'react'
2 | import * as TEMPLATES from '../components/shot/templates/constants'
3 |
4 | export const SettingsContext = createContext(null)
5 |
6 | export default ({ children }) => {
7 | const [template, setTemplate] = useState(TEMPLATES.STANDARD)
8 | const [file, setFile] = useState(null)
9 | const [vibrant, setVibrant] = useState('#e2e8f0')
10 | const [palette, setPalette] = useState([{ hex: vibrant }])
11 |
12 | const [spacing, setSpacing] = useState({
13 | top: 10,
14 | right: 10,
15 | bottom: 10,
16 | left: 10,
17 | })
18 | const setAllSpacing = (value) =>
19 | setSpacing({
20 | top: value,
21 | right: value,
22 | bottom: value,
23 | left: value,
24 | })
25 |
26 | const [radius, setRadius] = useState({
27 | 'top-left': 10,
28 | 'top-right': 10,
29 | 'bottom-right': 10,
30 | 'bottom-left': 10,
31 | })
32 |
33 | const setAllRadius = (value) =>
34 | setRadius({
35 | 'top-left': value,
36 | 'top-right': value,
37 | 'bottom-right': value,
38 | 'bottom-left': value,
39 | })
40 |
41 | const [hasToolbar, setHasToolbar] = useState(true)
42 | const [isBlurred, setIsBlurred] = useState(false)
43 | const [settingsVisibility, setSettingsVisibility] = useState(false)
44 | const [isBlended, setIsBlended] = useState(false)
45 |
46 | const settings = {
47 | settingsVisibility,
48 | setSettingsVisibility,
49 |
50 | template,
51 | setTemplate,
52 |
53 | file,
54 | setFile: (e) => setFile(URL.createObjectURL(e.target.files[0])),
55 |
56 | spacing,
57 | setSpacing,
58 | setAllSpacing,
59 |
60 | vibrant,
61 | setVibrant,
62 |
63 | palette,
64 | setPalette,
65 |
66 | radius,
67 | setRadius,
68 | setAllRadius,
69 |
70 | isBlurred,
71 | setIsBlurred,
72 |
73 | isBlended,
74 | setIsBlended,
75 |
76 | hasToolbar,
77 | setHasToolbar,
78 | }
79 |
80 | return (
81 |
82 | {children}
83 |
84 | )
85 | }
86 |
--------------------------------------------------------------------------------
/src/tailwind/index.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
--------------------------------------------------------------------------------
/src/theme/index.js:
--------------------------------------------------------------------------------
1 | export const colors = {
2 | transparent: 'transparent',
3 |
4 | black: '#000000',
5 | white: '#ffffff',
6 |
7 | primary: {
8 | 100: '#fbdbe7',
9 | 200: '#f7b7d0',
10 | 300: '#f294b8',
11 | 400: '#ee70a1',
12 | 500: '#ea4c89',
13 | 600: '#de1a66',
14 | 700: '#a6144c',
15 | 800: '#6f0d33',
16 | 900: '#370719',
17 | },
18 |
19 | gray: {
20 | 100: '#f7fafc',
21 | 200: '#edf2f7',
22 | 300: '#e2e8f0',
23 | 400: '#cbd5e0',
24 | 500: '#a0aec0',
25 | 600: '#718096',
26 | 700: '#4a5568',
27 | 800: '#2d3748',
28 | 900: '#1a202c',
29 | },
30 | }
31 |
32 | export const spacing = {
33 | px: '1px',
34 | 0: '0',
35 | 1: '1px',
36 | 2: '2px',
37 | 3: '3px',
38 | 4: '4px',
39 | 5: '5px',
40 | 6: '6px',
41 | 8: '8px',
42 | 10: '10px',
43 | 12: '12px',
44 | 14: '14px',
45 | 16: '16px',
46 | 20: '20px',
47 | 24: '24px',
48 | 32: '32px',
49 | 40: '40px',
50 | 48: '48px',
51 | 56: '56px',
52 | 64: '64px',
53 | }
54 |
55 | export const radius = {
56 | none: '0',
57 | sm: spacing[6],
58 | default: spacing[6],
59 | md: spacing[6],
60 | full: '9999px',
61 | }
62 |
63 | export const fontSize = {
64 | xs: '0.75rem',
65 | sm: '0.875rem',
66 | base: spacing[14],
67 | lg: '1.125rem',
68 | xl: '1.25rem',
69 | }
70 |
--------------------------------------------------------------------------------
/tailwind.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | purge: ['./src/**/*.html', './src/**/*.vue', './src/**/*.jsx'],
3 | target: 'relaxed',
4 | prefix: '',
5 | important: false,
6 | separator: ':',
7 | theme: {
8 | screens: {
9 | sm: '640px',
10 | md: '768px',
11 | lg: '1024px',
12 | xl: '1280px',
13 | },
14 | colors: {
15 | transparent: 'transparent',
16 | current: 'currentColor',
17 |
18 | black: '#000',
19 | white: '#fff',
20 |
21 | primary: {
22 | 100: '#f8dbdd',
23 | 200: '#f1b8ba',
24 | 300: '#e99498',
25 | 400: '#e27175',
26 | 500: '#db4d53',
27 | 600: '#af3e42',
28 | 700: '#832e32',
29 | 800: '#581f21',
30 | 900: '#2c0f11',
31 | },
32 | secondary: {
33 | 100: '#cddadd',
34 | 200: '#9bb4ba',
35 | 300: '#6a8f98',
36 | 400: '#386975',
37 | 500: '#064453',
38 | 600: '#053642',
39 | 700: '#042932',
40 | 800: '#021b21',
41 | 900: '#010e11',
42 | },
43 |
44 | gray: {
45 | 100: '#f7fafc',
46 | 200: '#edf2f7',
47 | 300: '#e2e8f0',
48 | 400: '#cbd5e0',
49 | 500: '#a0aec0',
50 | 600: '#718096',
51 | 700: '#4a5568',
52 | 800: '#2d3748',
53 | 900: '#1a202c',
54 | },
55 | red: {
56 | 100: '#fff5f5',
57 | 200: '#fed7d7',
58 | 300: '#feb2b2',
59 | 400: '#fc8181',
60 | 500: '#f56565',
61 | 600: '#e53e3e',
62 | 700: '#c53030',
63 | 800: '#9b2c2c',
64 | 900: '#742a2a',
65 | },
66 | orange: {
67 | 100: '#fffaf0',
68 | 200: '#feebc8',
69 | 300: '#fbd38d',
70 | 400: '#f6ad55',
71 | 500: '#ed8936',
72 | 600: '#dd6b20',
73 | 700: '#c05621',
74 | 800: '#9c4221',
75 | 900: '#7b341e',
76 | },
77 | yellow: {
78 | 100: '#fffff0',
79 | 200: '#fefcbf',
80 | 300: '#faf089',
81 | 400: '#f6e05e',
82 | 500: '#ecc94b',
83 | 600: '#d69e2e',
84 | 700: '#b7791f',
85 | 800: '#975a16',
86 | 900: '#744210',
87 | },
88 | green: {
89 | 100: '#f0fff4',
90 | 200: '#c6f6d5',
91 | 300: '#9ae6b4',
92 | 400: '#68d391',
93 | 500: '#48bb78',
94 | 600: '#38a169',
95 | 700: '#2f855a',
96 | 800: '#276749',
97 | 900: '#22543d',
98 | },
99 | teal: {
100 | 100: '#e6fffa',
101 | 200: '#b2f5ea',
102 | 300: '#81e6d9',
103 | 400: '#4fd1c5',
104 | 500: '#38b2ac',
105 | 600: '#319795',
106 | 700: '#2c7a7b',
107 | 800: '#285e61',
108 | 900: '#234e52',
109 | },
110 | blue: {
111 | 100: '#ebf8ff',
112 | 200: '#bee3f8',
113 | 300: '#90cdf4',
114 | 400: '#63b3ed',
115 | 500: '#4299e1',
116 | 600: '#3182ce',
117 | 700: '#2b6cb0',
118 | 800: '#2c5282',
119 | 900: '#2a4365',
120 | },
121 | indigo: {
122 | 100: '#ebf4ff',
123 | 200: '#c3dafe',
124 | 300: '#a3bffa',
125 | 400: '#7f9cf5',
126 | 500: '#667eea',
127 | 600: '#5a67d8',
128 | 700: '#4c51bf',
129 | 800: '#434190',
130 | 900: '#3c366b',
131 | },
132 | purple: {
133 | 100: '#faf5ff',
134 | 200: '#e9d8fd',
135 | 300: '#d6bcfa',
136 | 400: '#b794f4',
137 | 500: '#9f7aea',
138 | 600: '#805ad5',
139 | 700: '#6b46c1',
140 | 800: '#553c9a',
141 | 900: '#44337a',
142 | },
143 | pink: {
144 | 100: '#fff5f7',
145 | 200: '#fed7e2',
146 | 300: '#fbb6ce',
147 | 400: '#f687b3',
148 | 500: '#ed64a6',
149 | 600: '#d53f8c',
150 | 700: '#b83280',
151 | 800: '#97266d',
152 | 900: '#702459',
153 | },
154 | },
155 | spacing: {
156 | px: '1px',
157 | '0': '0',
158 | '1': '0.25rem',
159 | '2': '0.5rem',
160 | '3': '0.75rem',
161 | '4': '1rem',
162 | '5': '1.25rem',
163 | '6': '1.5rem',
164 | '8': '2rem',
165 | '10': '2.5rem',
166 | '12': '3rem',
167 | '16': '4rem',
168 | '20': '5rem',
169 | '24': '6rem',
170 | '32': '8rem',
171 | '40': '10rem',
172 | '48': '12rem',
173 | '56': '14rem',
174 | '64': '16rem',
175 | },
176 | backgroundColor: (theme) => theme('colors'),
177 | backgroundOpacity: (theme) => theme('opacity'),
178 | backgroundPosition: {
179 | bottom: 'bottom',
180 | center: 'center',
181 | left: 'left',
182 | 'left-bottom': 'left bottom',
183 | 'left-top': 'left top',
184 | right: 'right',
185 | 'right-bottom': 'right bottom',
186 | 'right-top': 'right top',
187 | top: 'top',
188 | },
189 | backgroundSize: {
190 | auto: 'auto',
191 | cover: 'cover',
192 | contain: 'contain',
193 | full: '100% auto',
194 | },
195 | borderColor: (theme) => ({
196 | ...theme('colors'),
197 | default: theme('colors.gray.300', 'currentColor'),
198 | }),
199 | borderOpacity: (theme) => theme('opacity'),
200 | borderRadius: {
201 | none: '0',
202 | sm: '0.125rem',
203 | default: '0.25rem',
204 | md: '0.375rem',
205 | lg: '0.5rem',
206 | full: '9999px',
207 | },
208 | borderWidth: {
209 | default: '1px',
210 | '0': '0',
211 | '2': '2px',
212 | '4': '4px',
213 | '8': '8px',
214 | },
215 | boxShadow: {
216 | xs: '0 0 0 1px rgba(0, 0, 0, 0.05)',
217 | sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
218 | default:
219 | '0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)',
220 | md:
221 | '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
222 | lg:
223 | '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
224 | xl:
225 | '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)',
226 | '2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)',
227 | inner: 'inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)',
228 | outline: '0 0 0 3px rgba(66, 153, 225, 0.5)',
229 | none: 'none',
230 | },
231 | container: {},
232 | cursor: {
233 | auto: 'auto',
234 | default: 'default',
235 | pointer: 'pointer',
236 | wait: 'wait',
237 | text: 'text',
238 | move: 'move',
239 | 'not-allowed': 'not-allowed',
240 | },
241 | divideColor: (theme) => theme('borderColor'),
242 | divideOpacity: (theme) => theme('borderOpacity'),
243 | divideWidth: (theme) => theme('borderWidth'),
244 | fill: {
245 | current: 'currentColor',
246 | },
247 | flex: {
248 | '1': '1 1 0%',
249 | auto: '1 1 auto',
250 | initial: '0 1 auto',
251 | none: 'none',
252 | },
253 | flexGrow: {
254 | '0': '0',
255 | default: '1',
256 | },
257 | flexShrink: {
258 | '0': '0',
259 | default: '1',
260 | },
261 | fontFamily: {
262 | sans: [
263 | 'system-ui',
264 | '-apple-system',
265 | 'BlinkMacSystemFont',
266 | '"Segoe UI"',
267 | 'Roboto',
268 | '"Helvetica Neue"',
269 | 'Arial',
270 | '"Noto Sans"',
271 | 'sans-serif',
272 | '"Apple Color Emoji"',
273 | '"Segoe UI Emoji"',
274 | '"Segoe UI Symbol"',
275 | '"Noto Color Emoji"',
276 | ],
277 | serif: ['Georgia', 'Cambria', '"Times New Roman"', 'Times', 'serif'],
278 | mono: [
279 | 'Menlo',
280 | 'Monaco',
281 | 'Consolas',
282 | '"Liberation Mono"',
283 | '"Courier New"',
284 | 'monospace',
285 | ],
286 | },
287 | fontSize: {
288 | xs: '0.75rem',
289 | sm: '0.875rem',
290 | base: '1rem',
291 | lg: '1.125rem',
292 | xl: '1.25rem',
293 | '2xl': '1.5rem',
294 | '3xl': '1.875rem',
295 | '4xl': '2.25rem',
296 | '5xl': '3rem',
297 | '6xl': '4rem',
298 | },
299 | fontWeight: {
300 | hairline: '100',
301 | thin: '200',
302 | light: '300',
303 | normal: '400',
304 | medium: '500',
305 | semibold: '600',
306 | bold: '700',
307 | extrabold: '800',
308 | black: '900',
309 | },
310 | height: (theme) => ({
311 | auto: 'auto',
312 | ...theme('spacing'),
313 | full: '100%',
314 | screen: '100vh',
315 | }),
316 | inset: {
317 | '0': '0',
318 | auto: 'auto',
319 | },
320 | letterSpacing: {
321 | tighter: '-0.05em',
322 | tight: '-0.025em',
323 | normal: '0',
324 | wide: '0.025em',
325 | wider: '0.05em',
326 | widest: '0.1em',
327 | },
328 | lineHeight: {
329 | none: '1',
330 | tight: '1.25',
331 | snug: '1.375',
332 | normal: '1.5',
333 | relaxed: '1.625',
334 | loose: '2',
335 | '3': '.75rem',
336 | '4': '1rem',
337 | '5': '1.25rem',
338 | '6': '1.5rem',
339 | '7': '1.75rem',
340 | '8': '2rem',
341 | '9': '2.25rem',
342 | '10': '2.5rem',
343 | },
344 | listStyleType: {
345 | none: 'none',
346 | disc: 'disc',
347 | decimal: 'decimal',
348 | },
349 | margin: (theme, { negative }) => ({
350 | auto: 'auto',
351 | ...theme('spacing'),
352 | ...negative(theme('spacing')),
353 | }),
354 | maxHeight: {
355 | full: '100%',
356 | screen: '100vh',
357 | },
358 | maxWidth: (theme, { breakpoints }) => ({
359 | none: 'none',
360 | xs: '20rem',
361 | sm: '24rem',
362 | md: '28rem',
363 | lg: '32rem',
364 | xl: '36rem',
365 | '2xl': '42rem',
366 | '3xl': '48rem',
367 | '4xl': '56rem',
368 | '5xl': '64rem',
369 | '6xl': '72rem',
370 | full: '100%',
371 | ...breakpoints(theme('screens')),
372 | }),
373 | minHeight: {
374 | '0': '0',
375 | full: '100%',
376 | screen: '100vh',
377 | },
378 | minWidth: {
379 | '0': '0',
380 | full: '100%',
381 | },
382 | objectPosition: {
383 | bottom: 'bottom',
384 | center: 'center',
385 | left: 'left',
386 | 'left-bottom': 'left bottom',
387 | 'left-top': 'left top',
388 | right: 'right',
389 | 'right-bottom': 'right bottom',
390 | 'right-top': 'right top',
391 | top: 'top',
392 | },
393 | opacity: {
394 | '0': '0',
395 | '25': '0.25',
396 | '50': '0.5',
397 | '75': '0.75',
398 | '100': '1',
399 | },
400 | order: {
401 | first: '-9999',
402 | last: '9999',
403 | none: '0',
404 | '1': '1',
405 | '2': '2',
406 | '3': '3',
407 | '4': '4',
408 | '5': '5',
409 | '6': '6',
410 | '7': '7',
411 | '8': '8',
412 | '9': '9',
413 | '10': '10',
414 | '11': '11',
415 | '12': '12',
416 | },
417 | padding: (theme) => theme('spacing'),
418 | placeholderColor: (theme) => theme('colors'),
419 | placeholderOpacity: (theme) => theme('opacity'),
420 | space: (theme, { negative }) => ({
421 | ...theme('spacing'),
422 | ...negative(theme('spacing')),
423 | }),
424 | stroke: {
425 | current: 'currentColor',
426 | },
427 | strokeWidth: {
428 | '0': '0',
429 | '1': '1',
430 | '2': '2',
431 | },
432 | textColor: (theme) => theme('colors'),
433 | textOpacity: (theme) => theme('opacity'),
434 | width: (theme) => ({
435 | auto: 'auto',
436 | ...theme('spacing'),
437 | '1/2': '50%',
438 | '1/3': '33.333333%',
439 | '2/3': '66.666667%',
440 | '1/4': '25%',
441 | '2/4': '50%',
442 | '3/4': '75%',
443 | '1/5': '20%',
444 | '2/5': '40%',
445 | '3/5': '60%',
446 | '4/5': '80%',
447 | '1/6': '16.666667%',
448 | '2/6': '33.333333%',
449 | '3/6': '50%',
450 | '4/6': '66.666667%',
451 | '5/6': '83.333333%',
452 | '1/12': '8.333333%',
453 | '2/12': '16.666667%',
454 | '3/12': '25%',
455 | '4/12': '33.333333%',
456 | '5/12': '41.666667%',
457 | '6/12': '50%',
458 | '7/12': '58.333333%',
459 | '8/12': '66.666667%',
460 | '9/12': '75%',
461 | '10/12': '83.333333%',
462 | '11/12': '91.666667%',
463 | full: '100%',
464 | screen: '100vw',
465 | }),
466 | zIndex: {
467 | auto: 'auto',
468 | '0': '0',
469 | '10': '10',
470 | '20': '20',
471 | '30': '30',
472 | '40': '40',
473 | '50': '50',
474 | },
475 | gap: (theme) => theme('spacing'),
476 | gridTemplateColumns: {
477 | none: 'none',
478 | app: '330px minmax(0, 1fr)',
479 | '1': 'repeat(1, minmax(0, 1fr))',
480 | '2': 'repeat(2, minmax(0, 1fr))',
481 | '3': 'repeat(3, minmax(0, 1fr))',
482 | '4': 'repeat(4, minmax(0, 1fr))',
483 | '5': 'repeat(5, minmax(0, 1fr))',
484 | '6': 'repeat(6, minmax(0, 1fr))',
485 | '7': 'repeat(7, minmax(0, 1fr))',
486 | '8': 'repeat(8, minmax(0, 1fr))',
487 | '9': 'repeat(9, minmax(0, 1fr))',
488 | '10': 'repeat(10, minmax(0, 1fr))',
489 | '11': 'repeat(11, minmax(0, 1fr))',
490 | '12': 'repeat(12, minmax(0, 1fr))',
491 | },
492 | gridColumn: {
493 | auto: 'auto',
494 | 'span-1': 'span 1 / span 1',
495 | 'span-2': 'span 2 / span 2',
496 | 'span-3': 'span 3 / span 3',
497 | 'span-4': 'span 4 / span 4',
498 | 'span-5': 'span 5 / span 5',
499 | 'span-6': 'span 6 / span 6',
500 | 'span-7': 'span 7 / span 7',
501 | 'span-8': 'span 8 / span 8',
502 | 'span-9': 'span 9 / span 9',
503 | 'span-10': 'span 10 / span 10',
504 | 'span-11': 'span 11 / span 11',
505 | 'span-12': 'span 12 / span 12',
506 | },
507 | gridColumnStart: {
508 | auto: 'auto',
509 | '1': '1',
510 | '2': '2',
511 | '3': '3',
512 | '4': '4',
513 | '5': '5',
514 | '6': '6',
515 | '7': '7',
516 | '8': '8',
517 | '9': '9',
518 | '10': '10',
519 | '11': '11',
520 | '12': '12',
521 | '13': '13',
522 | },
523 | gridColumnEnd: {
524 | auto: 'auto',
525 | '1': '1',
526 | '2': '2',
527 | '3': '3',
528 | '4': '4',
529 | '5': '5',
530 | '6': '6',
531 | '7': '7',
532 | '8': '8',
533 | '9': '9',
534 | '10': '10',
535 | '11': '11',
536 | '12': '12',
537 | '13': '13',
538 | },
539 | gridTemplateRows: {
540 | none: 'none',
541 | '1': 'repeat(1, minmax(0, 1fr))',
542 | '2': 'repeat(2, minmax(0, 1fr))',
543 | '3': 'repeat(3, minmax(0, 1fr))',
544 | '4': 'repeat(4, minmax(0, 1fr))',
545 | '5': 'repeat(5, minmax(0, 1fr))',
546 | '6': 'repeat(6, minmax(0, 1fr))',
547 | },
548 | gridRow: {
549 | auto: 'auto',
550 | 'span-1': 'span 1 / span 1',
551 | 'span-2': 'span 2 / span 2',
552 | 'span-3': 'span 3 / span 3',
553 | 'span-4': 'span 4 / span 4',
554 | 'span-5': 'span 5 / span 5',
555 | 'span-6': 'span 6 / span 6',
556 | },
557 | gridRowStart: {
558 | auto: 'auto',
559 | '1': '1',
560 | '2': '2',
561 | '3': '3',
562 | '4': '4',
563 | '5': '5',
564 | '6': '6',
565 | '7': '7',
566 | },
567 | gridRowEnd: {
568 | auto: 'auto',
569 | '1': '1',
570 | '2': '2',
571 | '3': '3',
572 | '4': '4',
573 | '5': '5',
574 | '6': '6',
575 | '7': '7',
576 | },
577 | transformOrigin: {
578 | center: 'center',
579 | top: 'top',
580 | 'top-right': 'top right',
581 | right: 'right',
582 | 'bottom-right': 'bottom right',
583 | bottom: 'bottom',
584 | 'bottom-left': 'bottom left',
585 | left: 'left',
586 | 'top-left': 'top left',
587 | },
588 | scale: {
589 | '0': '0',
590 | '50': '.5',
591 | '75': '.75',
592 | '90': '.9',
593 | '95': '.95',
594 | '100': '1',
595 | '105': '1.05',
596 | '110': '1.1',
597 | '125': '1.25',
598 | '150': '1.5',
599 | },
600 | rotate: {
601 | '-180': '-180deg',
602 | '-90': '-90deg',
603 | '-45': '-45deg',
604 | '0': '0',
605 | '45': '45deg',
606 | '90': '90deg',
607 | '180': '180deg',
608 | },
609 | translate: (theme, { negative }) => ({
610 | ...theme('spacing'),
611 | ...negative(theme('spacing')),
612 | '-full': '-100%',
613 | '-1/2': '-50%',
614 | '1/2': '50%',
615 | full: '100%',
616 | }),
617 | skew: {
618 | '-12': '-12deg',
619 | '-6': '-6deg',
620 | '-3': '-3deg',
621 | '0': '0',
622 | '3': '3deg',
623 | '6': '6deg',
624 | '12': '12deg',
625 | },
626 | transitionProperty: {
627 | none: 'none',
628 | all: 'all',
629 | default:
630 | 'background-color, border-color, color, fill, stroke, opacity, box-shadow, transform',
631 | colors: 'background-color, border-color, color, fill, stroke',
632 | opacity: 'opacity',
633 | shadow: 'box-shadow',
634 | transform: 'transform',
635 | },
636 | transitionTimingFunction: {
637 | linear: 'linear',
638 | in: 'cubic-bezier(0.4, 0, 1, 1)',
639 | out: 'cubic-bezier(0, 0, 0.2, 1)',
640 | 'in-out': 'cubic-bezier(0.4, 0, 0.2, 1)',
641 | },
642 | transitionDuration: {
643 | '75': '75ms',
644 | '100': '100ms',
645 | '150': '150ms',
646 | '200': '200ms',
647 | '300': '300ms',
648 | '500': '500ms',
649 | '700': '700ms',
650 | '1000': '1000ms',
651 | },
652 | transitionDelay: {
653 | '75': '75ms',
654 | '100': '100ms',
655 | '150': '150ms',
656 | '200': '200ms',
657 | '300': '300ms',
658 | '500': '500ms',
659 | '700': '700ms',
660 | '1000': '1000ms',
661 | },
662 | },
663 | variants: {
664 | accessibility: ['responsive', 'focus'],
665 | alignContent: ['responsive'],
666 | alignItems: ['responsive'],
667 | alignSelf: ['responsive'],
668 | appearance: ['responsive'],
669 | backgroundAttachment: ['responsive'],
670 | backgroundColor: ['responsive', 'hover', 'focus'],
671 | backgroundOpacity: ['responsive', 'hover', 'focus'],
672 | backgroundPosition: ['responsive'],
673 | backgroundRepeat: ['responsive'],
674 | backgroundSize: ['responsive'],
675 | borderCollapse: ['responsive'],
676 | borderColor: ['responsive', 'hover', 'focus'],
677 | borderOpacity: ['responsive', 'hover', 'focus'],
678 | borderRadius: ['responsive'],
679 | borderStyle: ['responsive'],
680 | borderWidth: ['responsive'],
681 | boxShadow: ['responsive', 'hover', 'focus'],
682 | boxSizing: ['responsive'],
683 | cursor: ['responsive'],
684 | display: ['responsive'],
685 | divideColor: ['responsive'],
686 | divideOpacity: ['responsive'],
687 | divideWidth: ['responsive'],
688 | fill: ['responsive'],
689 | flex: ['responsive'],
690 | flexDirection: ['responsive'],
691 | flexGrow: ['responsive'],
692 | flexShrink: ['responsive'],
693 | flexWrap: ['responsive'],
694 | float: ['responsive'],
695 | clear: ['responsive'],
696 | fontFamily: ['responsive'],
697 | fontSize: ['responsive'],
698 | fontSmoothing: ['responsive'],
699 | fontStyle: ['responsive'],
700 | fontWeight: ['responsive', 'hover', 'focus'],
701 | height: ['responsive'],
702 | inset: ['responsive'],
703 | justifyContent: ['responsive'],
704 | letterSpacing: ['responsive'],
705 | lineHeight: ['responsive'],
706 | listStylePosition: ['responsive'],
707 | listStyleType: ['responsive'],
708 | margin: ['responsive'],
709 | maxHeight: ['responsive'],
710 | maxWidth: ['responsive'],
711 | minHeight: ['responsive'],
712 | minWidth: ['responsive'],
713 | objectFit: ['responsive'],
714 | objectPosition: ['responsive'],
715 | opacity: ['responsive', 'hover', 'focus'],
716 | order: ['responsive'],
717 | outline: ['responsive', 'focus'],
718 | overflow: ['responsive'],
719 | padding: ['responsive'],
720 | placeholderColor: ['responsive', 'focus'],
721 | placeholderOpacity: ['responsive', 'focus'],
722 | pointerEvents: ['responsive'],
723 | position: ['responsive'],
724 | resize: ['responsive'],
725 | space: ['responsive'],
726 | stroke: ['responsive'],
727 | strokeWidth: ['responsive'],
728 | tableLayout: ['responsive'],
729 | textAlign: ['responsive'],
730 | textColor: ['responsive', 'hover', 'focus'],
731 | textOpacity: ['responsive', 'hover', 'focus'],
732 | textDecoration: ['responsive', 'hover', 'focus'],
733 | textTransform: ['responsive'],
734 | userSelect: ['responsive'],
735 | verticalAlign: ['responsive'],
736 | visibility: ['responsive'],
737 | whitespace: ['responsive'],
738 | width: ['responsive'],
739 | wordBreak: ['responsive'],
740 | zIndex: ['responsive'],
741 | gap: ['responsive'],
742 | gridAutoFlow: ['responsive'],
743 | gridTemplateColumns: ['responsive'],
744 | gridColumn: ['responsive'],
745 | gridColumnStart: ['responsive'],
746 | gridColumnEnd: ['responsive'],
747 | gridTemplateRows: ['responsive'],
748 | gridRow: ['responsive'],
749 | gridRowStart: ['responsive'],
750 | gridRowEnd: ['responsive'],
751 | transform: ['responsive'],
752 | transformOrigin: ['responsive'],
753 | scale: ['responsive', 'hover', 'focus'],
754 | rotate: ['responsive', 'hover', 'focus'],
755 | translate: ['responsive', 'hover', 'focus'],
756 | skew: ['responsive', 'hover', 'focus'],
757 | transitionProperty: ['responsive'],
758 | transitionTimingFunction: ['responsive'],
759 | transitionDuration: ['responsive'],
760 | transitionDelay: ['responsive'],
761 | },
762 | corePlugins: {},
763 | plugins: [
764 | ({ addComponents, theme }) => {
765 | addComponents({
766 | '.slider': {
767 | '@apply w-full h-2 rounded-full appearance-none bg-primary-200': {},
768 | maxWidth: '200px',
769 |
770 | '&::-webkit-slider-thumb': {
771 | '@apply w-4 h-4 rounded-full appearance-none cursor-pointer bg-primary-500 shadow': {},
772 | },
773 | },
774 | })
775 | },
776 | ],
777 | }
778 |
--------------------------------------------------------------------------------