Skip to content

Commit

Permalink
random work
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnuttandrew committed Dec 4, 2023
0 parents commit c6f6e4e
Show file tree
Hide file tree
Showing 28 changed files with 5,989 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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?
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["svelte.svelte-vscode"]
}
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Svelte + TS + Vite

This template should help get you started developing with Svelte and TypeScript in Vite.

## Recommended IDE Setup

[VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode).

## Need an official Svelte framework?

Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also powered by Vite. Deploy anywhere with its serverless-first approach and adapt to various platforms, with out of the box support for TypeScript, SCSS, and Less, and easily-added support for mdsvex, GraphQL, PostCSS, Tailwind CSS, and more.

## Technical considerations

**Why use this over SvelteKit?**

- It brings its own routing solution which might not be preferable for some users.
- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.

This template contains as little as possible to get started with Vite + TypeScript + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.

Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate.

**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?**

Setting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding `svelte` and `vite/client` type information.

**Why include `.vscode/extensions.json`?**

Other templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to install the recommended extension upon opening the project.

**Why enable `allowJs` in the TS template?**

While `allowJs: false` would indeed prevent the use of `.js` files in the project, it does not prevent the use of JavaScript syntax in `.svelte` files. In addition, it would force `checkJs: false`, bringing the worst of both worlds: not being able to guarantee the entire codebase is TypeScript, and also having worse typechecking for the existing JavaScript. In addition, there are valid use cases in which a mixed codebase may be relevant.

**Why is HMR not preserving my local component state?**

HMR state preservation comes with a number of gotchas! It has been disabled by default in both `svelte-hmr` and `@sveltejs/vite-plugin-svelte` due to its often surprising behavior. You can read the details [here](https://github.com/rixo/svelte-hmr#svelte-hmr).

If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR.

```ts
// store.ts
// An extremely simple external store
import { writable } from 'svelte/store'
export default writable(0)
```
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Svelte + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
35 changes: 35 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "color-pal-builder",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@tsconfig/svelte": "^5.0.2",
"@types/chroma-js": "^2.4.3",
"@types/d3": "^7.4.3",
"autoprefixer": "^10.4.16",
"postcss": "^8.4.32",
"svelte": "^4.2.3",
"svelte-check": "^3.6.0",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vega-typings": "^1.0.1",
"vite": "^5.0.0"
},
"dependencies": {
"chroma-js": "^2.4.2",
"d3-dsv": "^3.0.1",
"d3-scale": "^4.0.2",
"tailwindcss": "^3.3.5",
"vega": "^5.26.1",
"vega-embed": "^6.23.0",
"vega-lite": "^5.16.3"
}
}
7 changes: 7 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import tailwind from "tailwindcss";
import tailwindConfig from "./tailwind.config.js";
import autoprefixer from "autoprefixer";

export default {
plugins: [tailwind(tailwindConfig), autoprefixer],
};
Binary file added public/circle-grad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions public/outfit-colors.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name Category Soft Cool fill1 fill2 fill3
enjoyable casual 1.372964899 2.47249863 #F68B41 #F6ED83 #3FB876
bright casual 1.038386856 2.656801366 #F4B260 #FAF7F4 #F25846
casual casual 0.7037963654 2.181292322 #F15845 #F7F4F1 #0351A1
colorful casual 0.2884490914 2.299138593 #F7E869 #F69345 #E84F82
chic chic 0.1369180981 -1.244630434 #D8DACD #86AD94 #566C5D
noble and elegant chic -0.2182972367 -0.9965678627 #A0A096 #D3D3D3 #95AFC7
stylish chic -0.5735125716 -0.8556815786 #294C9A #A0A579 #D8DCCE
traditional classic -1.596041822 0.7707846692 #B7854C #38241A #6C8455
elaborate classic -1.965446851 0.5932917317 #443513 #9A9157 #182D48
heavy and deep classic -2.438486433 0.4205169288 #332D1B #B2723B #182222
neat clear 2.629878018 -2.322768478 #D7E9CF #F9F9F6 #DDEFEF
clean clear 1.994339059 -2.399245267 #98D0DB #F9F9F7 #B6C9DB
refreshing clear 1.372267862 -2.322768478 #ABD59B #FAF9F6 #5696AB
youthful cool casual 1.010206622 -1.510140406 #F5ED85 #9FD19E #5797B1
agile cool casual 0.3997635051 -2.312029346 #20A56D #F6F7F5 #00B2B4
speed cool casual 0.03770226537 -2.097099127 #FCDB60 #F9F8F4 #0056AA
quiet and sophisticated dandy -1.04377645 -0.3797234052 #908747 #1B2114 #ACB3A8
dapper dandy -1.608837441 -0.7228022094 #5B6B52 #A4A582 #103434
dignified dandy -2.222628827 -1.103398406 #1B2117 #7F867B #192E1A
lively dynamic -0.4614886731 2.656801366 #F18439 #0655A2 #F25A47
bold dynamic -1.127620115 2.73321318 #F8D75A #F15144 #030200
active dynamic -1.542967389 2.30738795 #020101 #F05346 #0B52A3
wild dynamic -1.992930047 1.768118227 #F05747 #332920 #B0A23D
delicate elegant 1.400448096 -0.6493485685 #F1E3D7 #E6D1CC #9DAFC6
emotional elegant 1.081914364 0.1256018889 #EBD8C3 #CFBFD0 #A6A296
graceful elegant 0.6507219318 0.5974237888 #9E9C96 #DDA8A9 #D3D3D6
fashionable elegant 0.5844909136 -0.5534679766 #CCCDC4 #E8D7D0 #A1B1A2
calm elegant 0.3441125218 0.2218914703 #EED9C5 #C09E80 #CCCCC7
alluring gorgeous -0.4058252427 1.305932454 #E3A7A9 #C5605C #212A7A
extravagant gorgeous -0.7461165049 1.808312181 #D15E41 #E2C14D #2D2773
mellow gorgeous -0.8581404033 0.7666568284 #264D18 #E75A50 #2E4795
luxorious gorgeous -1.196079164 1.590629085 #522830 #05020D #E6C555
sharp modern -0.9324495892 -2.286001602 #050503 #F6F5F3 #1EA66A
rational modern -1.273773961 -2.081802083 #8B988D #F9F9F5 #10383E
masculine modern -1.664500871 -1.924218915 #BDCBD6 #3B7988 #05040A
metallic modern -2.250809061 -2.285103512 #050403 #91A89D #132715
intimate natural 1.995037341 0.7235147784 #ECBB7F #F8F3C5 #F5F2BB
tranquil natural 1.941962908 -0.4311000548 #F2E4B7 #F6F0D5 #C6DEB3
plain natural 1.938676873 -1.244630434 #F9F7CF #D9DFA3 #CFD0C8
wholesome natural 1.625628579 0.1705063878 #F6EED5 #CDD97E #B7AD89
fresh natural 1.572554145 -1.484445756 #E6EA99 #B1D899 #E6EED9
mild natural 1.038386856 1.025095923 #F3E7D5 #E2A887 #B7A285
modest elegant -0.2314413742 0.2052746975 #8C8541 #AF9877 #CBC6BE
sweet pretty 2.451716455 1.56436944 #F8CB94 #FDF9F5 #F3BFA8
pretty pretty 2.001756286 2.232682042 #FEED72 #F8F4D2 #EB717B
childlike pretty 1.678703012 1.693413164 #F48C72 #F5F2CD #ADD5A1
soft romantic 2.736026886 0.2218914703 #F2E8D7 #F7F6F3 #F3F4C6
dreamy romantic 2.599108788 -0.8828393136 #F1E7D5 #FAF9F6 #E4E7EB
charming romantic 2.367872791 -0.01380444407 #F4E8DD #ECCBC7 #DEECEC
Loading

0 comments on commit c6f6e4e

Please sign in to comment.