fix bugs and add the rest

main^2
Midnight 3 years ago
parent 7e18aa3003
commit 68b3dd7c38

@ -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}
<section class="flex gap-5">
<div class="w-3/5 bg-slate-800 rounded-lg shadow-lg p-5 flex flex-col gap-5">
<div class="flex justify-between">
<h3 class="text-xl font-bold flex gap-5">{commission.name}<p class="bg-green-500 py-1 text-sm px-5 rounded-lg">${commission.price}</p></h3>
<span>
<Button on:click={() => {remove(commission.name)}}>🗑️</Button>
</span>
</div>
<form class="flex flex-col gap-10" on:change={() => {update_example(commission)}}>
<div class="flex flex-col gap-1">
<label for={commission.type}>Type of commission</label>
<select class="bg-slate-600 p-2 rounded-lg" bind:value={commission.type} on:change={() => {update_commission_type(commission)}}>
{#each types as question}
<option value={question.name}>{question.name}</option>
{/each}
</select>
<div class="w-3/5">
<div class="bg-slate-800 rounded-lg shadow-lg p-5 flex flex-col gap-5">
<div class="flex justify-between">
<h3 class="text-xl font-bold flex gap-5">{commission.name}<p class="bg-green-500 py-1 text-sm px-5 rounded-lg">${commission.price}</p></h3>
<span>
<Button on:click={() => {remove(commission.name)}}>🗑️</Button>
</span>
</div>
{#each commission.questions as question, key}
<form class="flex flex-col gap-10" on:change={() => {update_example(commission)}}>
<div class="flex flex-col gap-1">
<label for={commission.answers[key]['option']}>{question.name}</label>
<select class="bg-slate-600 p-2 rounded-lg" bind:value={commission.answers[key]['option']} on:change={() => {update_price(commission)}}>
{#each question.options as option}
<option value={option.name}>{option.name} | ${option.price}</option>
<label for={commission.type}>Type of commission</label>
<select class="bg-slate-600 p-2 rounded-lg" bind:value={commission.type} on:change={() => {update_commission_type(commission)}}>
{#each types as question}
<option value={question.name}>{question.name}</option>
{/each}
</select>
</div>
{/each}
</form>
{#each commission.questions as question, key}
<div class="flex flex-col gap-1">
<label for={commission.answers[key]['option']}>{question.name}</label>
<select class="bg-slate-600 p-2 rounded-lg" bind:value={commission.answers[key]['option']} on:change={() => {update_price(commission)}}>
{#each question.options as option}
<option value={option.name}>{option.name} | ${option.price}</option>
{/each}
</select>
</div>
{/each}
</form>
</div>
</div>
<div class="w-2/5">

@ -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
}
]
}
]
}
]
},

Loading…
Cancel
Save