├── .gitignore
├── CHANGE_LOG.md
├── README.md
├── change_log_images
└── after-create-react-app-vscode-screenshot.png
├── package.json
├── public
├── favicon.ico
├── index.html
├── manifest.json
├── robots.txt
└── youtube-talk-image.jpeg
├── react-create-README.md
├── src
├── App.css
├── App.test.tsx
├── App.tsx
├── components
│ ├── ImageCanvas.tsx
│ ├── PasteMessage.tsx
│ └── UploadArea.tsx
├── index.css
├── index.tsx
├── logo.svg
├── react-app-env.d.ts
├── reportWebVitals.ts
├── setupTests.ts
└── utils
│ ├── file-handling-utils.ts
│ └── image-scaling-utils.ts
├── tsconfig.json
└── yarn.lock
/.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 | node_modules
25 |
--------------------------------------------------------------------------------
/CHANGE_LOG.md:
--------------------------------------------------------------------------------
1 | ## 1) Starting Up the Project
2 |
3 | In the MacOS finder I made a folder called ReactConf-Lyle.
4 |
5 | > When I ran react-create (next step) - I got an error about the name having upper case. So in finder I changed the name to react-conf-2021-lyle
6 |
7 | I then Dropped the folder onto [Visual Studio Code](https://code.visualstudio.com/download)
8 |
9 | In Visual Studio Code I used `Ctrl+~` to open the terminal drawer at the bottom and then ran these commands.
10 |
11 | I like to have my git repo started first off.
12 |
13 | ```bash
14 | git init
15 | ```
16 |
17 | Create a TypeScript React App
18 |
19 | ```bash
20 | npx create-react-app . --template typescript
21 | ```
22 |
23 | Learn more about [create-react-app](https://create-react-app.dev/).
24 |
25 | > While this was running Visual Studio Code brought up a message about how git was having trouble keeping up and suggested that we add `/node_modules` to the project's [.gitignore](.gitignore) file. - I just said yes to this dialog.
26 |
27 | I decided that documenting things would be good so I made this file, and moved the react-create generated README.md file to be `react-create-README.md` - and then made a README.md for this project.
28 |
29 | create-react-app has a great return message... I went ahead and made a folder for keeping screenshots and [here is an image of what I got back](./change_log_images/after-create-react-app-vscode-screenshot.png)
30 |
31 | I then made the first commit by running these two commands:
32 |
33 | ```
34 | git add .
35 | git commit -m "Initial Commit with React Create"
36 | ```
37 |
38 | ## 2) Add a File Drop Area
39 |
40 | - Made an UploadArea component, and a utility for said.
41 | - Pulled the react logo
42 | - put some styling in the main css file - not happy with this - clean it up later?
43 |
44 | ## 3) Add the Canvas
45 |
46 | - Create an ImageCanvas Component that renders the image
47 | - Provide a toggle for Cover and Fit of the image
48 |
49 | ## 4) Start the On Paste handling
50 |
51 | - Create a PasteMessage Component
52 | - Add an event listener for `onpaste`
53 | - Add a "button" for using `navigator.clipboard`
54 | - Ensure we always use HTTPS
55 | - Small main page layout cleanup
56 |
57 | ## 5) Add Links
58 |
59 | - In the talk I mention a bunch of things - it seems like having these things all in one place would be useful.
60 | - Add React Conf and logo to the app
61 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # React Conf 2021 Talk
2 |
3 | ## UI Tools for Artists
4 |
5 | This repo was created to share source code for my (Lyle) December 8th 2021 React Conf lighting talk.
6 |
7 | Here is the video of my talk:
8 | [](https://www.youtube.com/watch?v=b3l4WxipFsE&list=PLNG_1j3cPCaZZ7etkzWA7JfdmKWT0pMsa&t=1s)
9 |
10 | Here are some of the things I referred to in the talk:
11 |
12 | - My Netflix Culture Podcast [WeAreNetflix](https://jobs.netflix.com/podcast)
13 | - The wonderful Minion based [Animation Pipeline interactive site](https://www.illuminationMacGuff.com/pipeline) by Illumination MacGuff
14 | - Netflix Shows:
15 | - - [Over the Moon](https://www.netflix.com/title/80214236) - AWN's [article on OTM](https://www.awn.com/animationworld/glen-keanes-over-moon-artfully-illustrates-healing-grief-through-play) by Victoria Davis
16 | - - [Klaus](https://www.netflix.com/title/80183187) - IAMAG's article [The Art of Klaus](https://www.iamag.co/the-art-of-klaus-40-concept-art-collection/)
17 | - The [Hawkins: Diving into the Reasoning Behind our Design System](https://netflixtechblog.com/hawkins-diving-into-the-reasoning-behind-our-design-system-964a7357547) blog post by [Joshua Godi](https://www.linkedin.com/in/jgodi/)
18 | - The Art Director of SPA Studios [Szymon Biernacki](https://www.artstation.com/biernac) - the Snow Covered [The Post Office](https://www.artstation.com/artwork/PegLZ)
19 |
20 | The [photos I used](https://photos.app.goo.gl/ZpD3N3tThVL7ocodA) to show off different workshops and art studios were taken by me, of either my workshop, and workshops/studios I have visited, mostly while enjoying the [Santa Cruz Open Studios Art Tour](https://santacruzopenstudios.com/) which happens every year in October.
21 |
22 | I also found, but did not use, this amazing short film [Isolation](https://www.youtube.com/watch?v=v7_foJZk9zA) which shows a lot of different art studios.
23 |
24 | ## Running this Repo
25 |
26 | Download the source, open a terminal to the source folder and ...
27 |
28 | ```
29 | yarn install
30 | yarn start
31 | ```
32 |
33 | ## How I got Here
34 |
35 | With an attempt to document the full creation of this project I am documenting each step. You can see those steps in the [CHANGE_LOG](CHANGE_LOG.md) (and in the commit messages)
36 |
--------------------------------------------------------------------------------
/change_log_images/after-create-react-app-vscode-screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lyle/react-conf-2021/54869b4192f4a008faccc85db23ef3f234fc91fc/change_log_images/after-create-react-app-vscode-screenshot.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-conf-2021-lyle",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.11.4",
7 | "@testing-library/react": "^11.1.0",
8 | "@testing-library/user-event": "^12.1.10",
9 | "@types/jest": "^26.0.15",
10 | "@types/node": "^12.0.0",
11 | "@types/react": "^17.0.0",
12 | "@types/react-dom": "^17.0.0",
13 | "react": "^17.0.2",
14 | "react-dom": "^17.0.2",
15 | "react-scripts": "4.0.3",
16 | "typescript": "^4.1.2",
17 | "web-vitals": "^1.0.1"
18 | },
19 | "scripts": {
20 | "start": "HTTPS=true react-scripts start",
21 | "build": "react-scripts build",
22 | "test": "react-scripts test",
23 | "eject": "react-scripts eject"
24 | },
25 | "eslintConfig": {
26 | "extends": [
27 | "react-app",
28 | "react-app/jest"
29 | ]
30 | },
31 | "browserslist": {
32 | "production": [
33 | ">0.2%",
34 | "not dead",
35 | "not op_mini all"
36 | ],
37 | "development": [
38 | "last 1 chrome version",
39 | "last 1 firefox version",
40 | "last 1 safari version"
41 | ]
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lyle/react-conf-2021/54869b4192f4a008faccc85db23ef3f234fc91fc/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
27 | React App
28 |
29 |
30 |
31 |
32 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React Conf 2021",
3 | "name": "Artists Flexibility",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/public/youtube-talk-image.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lyle/react-conf-2021/54869b4192f4a008faccc85db23ef3f234fc91fc/public/youtube-talk-image.jpeg
--------------------------------------------------------------------------------
/react-create-README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4 |
5 | ## Available Scripts
6 |
7 | In the project directory, you can run:
8 |
9 | ### `yarn start`
10 |
11 | Runs the app in the development mode.\
12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13 |
14 | The page will reload if you make edits.\
15 | You will also see any lint errors in the console.
16 |
17 | ### `yarn test`
18 |
19 | Launches the test runner in the interactive watch mode.\
20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21 |
22 | ### `yarn build`
23 |
24 | Builds the app for production to the `build` folder.\
25 | It correctly bundles React in production mode and optimizes the build for the best performance.
26 |
27 | The build is minified and the filenames include the hashes.\
28 | Your app is ready to be deployed!
29 |
30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31 |
32 | ### `yarn eject`
33 |
34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35 |
36 | 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.
37 |
38 | 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.
39 |
40 | 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.
41 |
42 | ## Learn More
43 |
44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45 |
46 | To learn React, check out the [React documentation](https://reactjs.org/).
47 |
--------------------------------------------------------------------------------
/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | .App-header {
11 | background-color: #282c34;
12 | min-height: 100vh;
13 | display: flex;
14 | flex-direction: column;
15 | align-items: center;
16 | justify-content: center;
17 | font-size: calc(10px + 2vmin);
18 | color: white;
19 | }
20 |
21 | .App-link {
22 | color: #61dafb;
23 | }
24 | .App-logo {
25 | height: 2em;
26 | }
27 |
--------------------------------------------------------------------------------
/src/App.test.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render, screen } from '@testing-library/react';
3 | import App from './App';
4 |
5 | test('renders learn react link', () => {
6 | render();
7 | const linkElement = screen.getByText(/learn react/i);
8 | expect(linkElement).toBeInTheDocument();
9 | });
10 |
--------------------------------------------------------------------------------
/src/App.tsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import "./App.css";
3 | import { ImageCanvas } from "./components/ImageCanvas";
4 | import { PasteMessage } from "./components/PasteMessage";
5 | import { UploadArea } from "./components/UploadArea";
6 | import { ScaleType } from "./utils/image-scaling-utils";
7 | import logo from "./logo.svg";
8 | const WIDTH = 600;
9 | const HEIGHT = 400;
10 | function App() {
11 | const [image, setImage] = useState();
12 | const [scaleType, setScaleType] = useState(ScaleType.COVER);
13 |
14 | return (
15 |