From 68b3dd7c3879b85209ba6621363764b87a619d25 Mon Sep 17 00:00:00 2001 From: midblep Date: Tue, 24 May 2022 23:35:59 +0200 Subject: [PATCH] fix bugs and add the rest --- src/lib/calculator/Calculator.svelte | 53 ++++--- src/lib/en-lang.json | 224 +++++++++++++++++++++++++++ 2 files changed, 252 insertions(+), 25 deletions(-) diff --git a/src/lib/calculator/Calculator.svelte b/src/lib/calculator/Calculator.svelte index 60edd09..22eb808 100644 --- a/src/lib/calculator/Calculator.svelte +++ b/src/lib/calculator/Calculator.svelte @@ -42,6 +42,7 @@ console.log(value.example); }); } catch(msg) { + commissions = []; error = "The selected preset link failed to load. It may be from an old version of the commission picker. It has been replaced with the default preset below." } } @@ -56,10 +57,10 @@ let lastAnswer = commission.answers[commission.answers.length - 1]; let example = ""; commission.example = ""; - let type = types.filter(value => { + let typeFound = types.filter(value => { return value['name'] == commission.type; }); - type = type[0]; + let type = typeFound[0]; let count = 0; commission.questions.forEach(value => { @@ -215,35 +216,37 @@ {#each [...commissions].reverse() as commission}
-
-
-

{commission.name}

${commission.price}

- - - -
- -
{update_example(commission)}}> -
- - +
+
+
+

{commission.name}

${commission.price}

+ + +
- {#each commission.questions as question, key} + {update_example(commission)}}>
- - {update_commission_type(commission)}}> + {#each types as question} + {/each}
- {/each} - + + {#each commission.questions as question, key} +
+ + +
+ {/each} + +
diff --git a/src/lib/en-lang.json b/src/lib/en-lang.json index 5c150b4..9a4c5e7 100644 --- a/src/lib/en-lang.json +++ b/src/lib/en-lang.json @@ -152,6 +152,230 @@ ] } ] + }, + { + "name": "Halfbody", + "examples_from": "Detail level", + "examples": [ + { + "name": "basic", + "url": "/commissions/halfbodybasic.jpg" + }, + { + "name": "sketchy", + "url": "/commissions/halfbodysketchy.jpg" + }, + { + "name": "ultralineart", + "url": "/commissions/halfbodyultralineart.jpg" + }, + { + "name": "basiclineless", + "url": "/commissions/halfbodybasiclineless.jpg" + } + ], + "questions": [ + { + "name": "Detail level", + "options": [ + { + "name": "Sketchy", + "example": "sketchy", + "price": 18 + }, + { + "name": "Basic", + "example": "basic", + "price": 23 + }, + { + "name": "Basic Lineless", + "price": 23 + }, + { + "name": "Cell Shaded", + "price": 28 + }, + { + "name": "Ultra Lineart", + "example": "ultralineart", + "price": 40 + } + ] + }, + { + "name": "Fur", + "options": [ + { + "name": "1-3 fur colors", + "example": "3fur", + "price": 0 + }, + { + "name": "4-5 fur colors", + "example": "4fur", + "price": 10 + }, + { + "name": "6+ fur colors", + "example": "4fur", + "price": 15 + } + ] + } + ] + }, + { + "name": "Fullbody", + "examples_from": "Detail level", + "examples": [ + { + "name": "basic", + "url": "/commissions/fullbodybasic.jpg" + }, + { + "name": "ultralineart", + "url": "/commissions/fullbodyultralineart.jpg" + }, + { + "name": "basiclineless", + "url": "/commissions/fullbodybasiclineless.jpg" + } + ], + "questions": [ + { + "name": "Detail level", + "options": [ + { + "name": "Sketchy", + "price": 23 + }, + { + "name": "Basic", + "example": "basic", + "price": 28 + }, + { + "name": "Basic Lineless", + "example": "basiclineless", + "price": 28 + }, + { + "name": "Cell Shaded", + "price": 33 + }, + { + "name": "Ultra Lineart", + "example": "ultralineart", + "price": 45 + } + ] + }, + { + "name": "Fur", + "options": [ + { + "name": "1-3 fur colors", + "example": "3fur", + "price": 0 + }, + { + "name": "4-5 fur colors", + "example": "4fur", + "price": 15 + }, + { + "name": "6+ fur colors", + "example": "4fur", + "price": 20 + } + ] + } + ] + }, + { + "name": "Reference sheet", + "examples_from": "Views", + "examples": [ + { + "name": "2views", + "url": "/commissions/refsheet2.jpg" + }, + { + "name": "3views", + "url": "/commissions/refsheet1.jpg" + } + ], + "questions": [ + { + "name": "Views", + "options": [ + { + "name": "Front + Back", + "example": "2views", + "price": 40 + }, + { + "name": "Front + Side + Back", + "example": "3views", + "price": 50 + } + ] + }, + { + "name": "Fur", + "options": [ + { + "name": "1-3 fur colors", + "example": "3fur", + "price": 0 + }, + { + "name": "4-5 fur colors", + "example": "4fur", + "price": 20 + }, + { + "name": "6+ fur colors", + "example": "4fur", + "price": 25 + } + ] + }, + { + "name": "Additions", + "options": [ + { + "name": "Custom Design", + "price": 20 + }, + { + "name": "Extra Headshot", + "price": 15 + }, + { + "name": "Paws", + "price": 10 + }, + { + "name": "Maw", + "price": 5 + }, + { + "name": "Standalone outfit", + "price": 10 + }, + { + "name": "Full alt. version", + "price": 20 + }, + { + "name": "Chibi alt. version", + "price": 10 + } + ] + } + ] } ] },