reorganization

This commit is contained in:
Adam Piontek 2022-09-14 07:17:24 -04:00
parent 1dd3a7d821
commit b0c1c4c648
65 changed files with 137 additions and 135 deletions

1
.prettierignore Normal file
View file

@ -0,0 +1 @@
dist

View file

@ -1,128 +0,0 @@
// backs & joker
import card1B from "./cards/1B.svg?raw";
import card2B from "./cards/2B.svg?raw";
import card1J from "./cards/1J.svg?raw";
// suit: clubs
import cardAC from "./cards/AC.svg?raw";
import card2C from "./cards/2C.svg?raw";
import card3C from "./cards/3C.svg?raw";
import card4C from "./cards/4C.svg?raw";
import card5C from "./cards/5C.svg?raw";
import card6C from "./cards/6C.svg?raw";
import card7C from "./cards/7C.svg?raw";
import card8C from "./cards/8C.svg?raw";
import card9C from "./cards/9C.svg?raw";
import cardTC from "./cards/TC.svg?raw";
import cardJC from "./cards/JC.svg?raw";
import cardQC from "./cards/QC.svg?raw";
import cardKC from "./cards/KC.svg?raw";
// suit: diamonds
import cardAD from "./cards/AD.svg?raw";
import card2D from "./cards/2D.svg?raw";
import card3D from "./cards/3D.svg?raw";
import card4D from "./cards/4D.svg?raw";
import card5D from "./cards/5D.svg?raw";
import card6D from "./cards/6D.svg?raw";
import card7D from "./cards/7D.svg?raw";
import card8D from "./cards/8D.svg?raw";
import card9D from "./cards/9D.svg?raw";
import cardTD from "./cards/TD.svg?raw";
import cardJD from "./cards/JD.svg?raw";
import cardQD from "./cards/QD.svg?raw";
import cardKD from "./cards/KD.svg?raw";
// suit: hearts
import cardAH from "./cards/AH.svg?raw";
import card2H from "./cards/2H.svg?raw";
import card3H from "./cards/3H.svg?raw";
import card4H from "./cards/4H.svg?raw";
import card5H from "./cards/5H.svg?raw";
import card6H from "./cards/6H.svg?raw";
import card7H from "./cards/7H.svg?raw";
import card8H from "./cards/8H.svg?raw";
import card9H from "./cards/9H.svg?raw";
import cardTH from "./cards/TH.svg?raw";
import cardJH from "./cards/JH.svg?raw";
import cardQH from "./cards/QH.svg?raw";
import cardKH from "./cards/KH.svg?raw";
// suit: spades
import cardAS from "./cards/AS.svg?raw";
import card2S from "./cards/2S.svg?raw";
import card3S from "./cards/3S.svg?raw";
import card4S from "./cards/4S.svg?raw";
import card5S from "./cards/5S.svg?raw";
import card6S from "./cards/6S.svg?raw";
import card7S from "./cards/7S.svg?raw";
import card8S from "./cards/8S.svg?raw";
import card9S from "./cards/9S.svg?raw";
import cardTS from "./cards/TS.svg?raw";
import cardJS from "./cards/JS.svg?raw";
import cardQS from "./cards/QS.svg?raw";
import cardKS from "./cards/KS.svg?raw";
let cardSvgs = {
"1B": card1B,
"2B": card2B,
"1J": card1J,
AC: cardAC,
"2C": card2C,
"3C": card3C,
"4C": card4C,
"5C": card5C,
"6C": card6C,
"7C": card7C,
"8C": card8C,
"9C": card9C,
TC: cardTC,
JC: cardJC,
QC: cardQC,
KC: cardKC,
AD: cardAD,
"2D": card2D,
"3D": card3D,
"4D": card4D,
"5D": card5D,
"6D": card6D,
"7D": card7D,
"8D": card8D,
"9D": card9D,
TD: cardTD,
JD: cardJD,
QD: cardQD,
KD: cardKD,
AH: cardAH,
"2H": card2H,
"3H": card3H,
"4H": card4H,
"5H": card5H,
"6H": card6H,
"7H": card7H,
"8H": card8H,
"9H": card9H,
TH: cardTH,
JH: cardJH,
QH: cardQH,
KH: cardKH,
AS: cardAS,
"2S": card2S,
"3S": card3S,
"4S": card4S,
"5S": card5S,
"6S": card6S,
"7S": card7S,
"8S": card8S,
"9S": card9S,
TS: cardTS,
JS: cardJS,
QS: cardQS,
KS: cardKS,
};
export default cardSvgs;

View file

@ -12,11 +12,11 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "NODE_ENV=production vite build && html-minifier --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --case-sensitive -o ./dist/index.html ./dist/index.html", "build": "rm -rf dist && NODE_ENV=production vite build && html-minifier --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --case-sensitive -o ./dist/index.html ./dist/index.html",
"preview": "vite preview", "preview": "vite preview",
"test": "mocha", "test": "mocha",
"lint": "eslint --ext .js,.html --ignore-path .gitignore --fix .", "lint": "eslint --ext .js,.html --ignore-path .gitignore --fix .",
"format": "prettier . --write" "format": "prettier . --write"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View file

Before

Width:  |  Height:  |  Size: 541 B

After

Width:  |  Height:  |  Size: 541 B

View file

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View file

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View file

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View file

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View file

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View file

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View file

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View file

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View file

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View file

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View file

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View file

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -294,6 +294,6 @@
</p> </p>
</footer> </footer>
<script type="module" src="/main.js"></script> <script type="module" src="./js/main.js"></script>
</body> </body>
</html> </html>

128
src/js/cardSvgs.js Normal file
View file

@ -0,0 +1,128 @@
// backs & joker
import card1B from "../cards/1B.svg?raw";
import card2B from "../cards/2B.svg?raw";
import card1J from "../cards/1J.svg?raw";
// suit: clubs
import cardAC from "../cards/AC.svg?raw";
import card2C from "../cards/2C.svg?raw";
import card3C from "../cards/3C.svg?raw";
import card4C from "../cards/4C.svg?raw";
import card5C from "../cards/5C.svg?raw";
import card6C from "../cards/6C.svg?raw";
import card7C from "../cards/7C.svg?raw";
import card8C from "../cards/8C.svg?raw";
import card9C from "../cards/9C.svg?raw";
import cardTC from "../cards/TC.svg?raw";
import cardJC from "../cards/JC.svg?raw";
import cardQC from "../cards/QC.svg?raw";
import cardKC from "../cards/KC.svg?raw";
// suit: diamonds
import cardAD from "../cards/AD.svg?raw";
import card2D from "../cards/2D.svg?raw";
import card3D from "../cards/3D.svg?raw";
import card4D from "../cards/4D.svg?raw";
import card5D from "../cards/5D.svg?raw";
import card6D from "../cards/6D.svg?raw";
import card7D from "../cards/7D.svg?raw";
import card8D from "../cards/8D.svg?raw";
import card9D from "../cards/9D.svg?raw";
import cardTD from "../cards/TD.svg?raw";
import cardJD from "../cards/JD.svg?raw";
import cardQD from "../cards/QD.svg?raw";
import cardKD from "../cards/KD.svg?raw";
// suit: hearts
import cardAH from "../cards/AH.svg?raw";
import card2H from "../cards/2H.svg?raw";
import card3H from "../cards/3H.svg?raw";
import card4H from "../cards/4H.svg?raw";
import card5H from "../cards/5H.svg?raw";
import card6H from "../cards/6H.svg?raw";
import card7H from "../cards/7H.svg?raw";
import card8H from "../cards/8H.svg?raw";
import card9H from "../cards/9H.svg?raw";
import cardTH from "../cards/TH.svg?raw";
import cardJH from "../cards/JH.svg?raw";
import cardQH from "../cards/QH.svg?raw";
import cardKH from "../cards/KH.svg?raw";
// suit: spades
import cardAS from "../cards/AS.svg?raw";
import card2S from "../cards/2S.svg?raw";
import card3S from "../cards/3S.svg?raw";
import card4S from "../cards/4S.svg?raw";
import card5S from "../cards/5S.svg?raw";
import card6S from "../cards/6S.svg?raw";
import card7S from "../cards/7S.svg?raw";
import card8S from "../cards/8S.svg?raw";
import card9S from "../cards/9S.svg?raw";
import cardTS from "../cards/TS.svg?raw";
import cardJS from "../cards/JS.svg?raw";
import cardQS from "../cards/QS.svg?raw";
import cardKS from "../cards/KS.svg?raw";
let cardSvgs = {
"1B": card1B,
"2B": card2B,
"1J": card1J,
AC: cardAC,
"2C": card2C,
"3C": card3C,
"4C": card4C,
"5C": card5C,
"6C": card6C,
"7C": card7C,
"8C": card8C,
"9C": card9C,
TC: cardTC,
JC: cardJC,
QC: cardQC,
KC: cardKC,
AD: cardAD,
"2D": card2D,
"3D": card3D,
"4D": card4D,
"5D": card5D,
"6D": card6D,
"7D": card7D,
"8D": card8D,
"9D": card9D,
TD: cardTD,
JD: cardJD,
QD: cardQD,
KD: cardKD,
AH: cardAH,
"2H": card2H,
"3H": card3H,
"4H": card4H,
"5H": card5H,
"6H": card6H,
"7H": card7H,
"8H": card8H,
"9H": card9H,
TH: cardTH,
JH: cardJH,
QH: cardQH,
KH: cardKH,
AS: cardAS,
"2S": card2S,
"3S": card3S,
"4S": card4S,
"5S": card5S,
"6S": card6S,
"7S": card7S,
"8S": card8S,
"9S": card9S,
TS: cardTS,
JS: cardJS,
QS: cardQS,
KS: cardKS,
};
export default cardSvgs;

View file

@ -1,4 +1,4 @@
import "./style.scss"; import "../scss/style.scss";
import Alpine from "alpinejs"; import Alpine from "alpinejs";
import cardSvgs from "./cardSvgs"; import cardSvgs from "./cardSvgs";
import SolverWorker from "./solverWorker?worker"; import SolverWorker from "./solverWorker?worker";

View file

@ -1,4 +1,4 @@
import { solve } from "./solver"; import { solve } from "../../solver";
const runSolve = async (game) => { const runSolve = async (game) => {
let result = await solve(game.slice(0, 28), game.slice(28, 52), self); let result = await solve(game.slice(0, 28), game.slice(28, 52), self);

View file

@ -1,6 +1,6 @@
@use "sass:math"; @use "sass:math";
@import "./node_modules/bootstrap/scss/bootstrap"; @import "../../node_modules/bootstrap/scss/bootstrap";
#gamePyramid { #gamePyramid {
display: grid; display: grid;

View file

@ -1,6 +1,7 @@
import { defineConfig } from "vite"; import { defineConfig } from "vite";
import path from 'path';
export default defineConfig({ export default defineConfig({
// ... root: path.resolve(__dirname, "src"),
base: "./", base: "./",
}); });