WIP: Todo List
|
@ -62,6 +62,12 @@
|
||||||
image="/images/calculator.png"
|
image="/images/calculator.png"
|
||||||
label="Calculator"
|
label="Calculator"
|
||||||
href="/calculator" />
|
href="/calculator" />
|
||||||
|
<SidebarItem
|
||||||
|
on:clicked={close}
|
||||||
|
active={segment === 'todo'}
|
||||||
|
image="/images/settings.png"
|
||||||
|
label="Todo List"
|
||||||
|
href="/todo" />
|
||||||
<SidebarItem
|
<SidebarItem
|
||||||
on:clicked={close}
|
on:clicked={close}
|
||||||
active={segment === 'settings'}
|
active={segment === 'settings'}
|
||||||
|
|
|
@ -352,4 +352,10 @@ export const itemList = {
|
||||||
cecilia: { id: 'cecilia', name: 'Cecilia' },
|
cecilia: { id: 'cecilia', name: 'Cecilia' },
|
||||||
jueyun_chili: { id: 'jueyun_chili', name: 'Jueyun Chili' },
|
jueyun_chili: { id: 'jueyun_chili', name: 'Jueyun Chili' },
|
||||||
silk_flower: { id: 'silk_flower', name: 'Silk Flower' },
|
silk_flower: { id: 'silk_flower', name: 'Silk Flower' },
|
||||||
|
mystic_enhancement_ore: { id: 'mystic_enhancement_ore', name: 'Mystic Enhancement Ore' },
|
||||||
|
fine_enhancement_ore: { id: 'fine_enhancement_ore', name: 'Fine Enhancement Ore' },
|
||||||
|
enhancement_ore: { id: 'enhancement_ore', name: 'Enhancement Ore' },
|
||||||
|
any_weapon_1: { id: 'any_weapon_1', name: '1 Star Weapon' },
|
||||||
|
any_weapon_2: { id: 'any_weapon_2', name: '2 Star Weapon' },
|
||||||
|
any_weapon_3: { id: 'any_weapon_3', name: '3 Star Weapon' },
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { fade } from 'svelte/transition';
|
import { fade } from 'svelte/transition';
|
||||||
import { mdiStar, mdiClose, mdiInformationOutline } from '@mdi/js';
|
import { mdiStar, mdiClose, mdiInformationOutline, mdiCheckCircleOutline } from '@mdi/js';
|
||||||
|
|
||||||
import Select from '../../components/Select.svelte';
|
import Select from '../../components/Select.svelte';
|
||||||
import Input from '../../components/Input.svelte';
|
import Input from '../../components/Input.svelte';
|
||||||
|
@ -12,6 +12,7 @@
|
||||||
import Icon from '../../components/Icon.svelte';
|
import Icon from '../../components/Icon.svelte';
|
||||||
|
|
||||||
import { weaponExp } from '../../data/weaponExp';
|
import { weaponExp } from '../../data/weaponExp';
|
||||||
|
import { addTodo } from '../../stores/todo';
|
||||||
|
|
||||||
let weaponsRarity = [
|
let weaponsRarity = [
|
||||||
{ label: '3 Star', value: 3 },
|
{ label: '3 Star', value: 3 },
|
||||||
|
@ -23,17 +24,55 @@
|
||||||
{
|
{
|
||||||
selected: true,
|
selected: true,
|
||||||
disabled: true,
|
disabled: true,
|
||||||
image: '/images/crystal_3.png',
|
id: 'mystic_enhancement_ore',
|
||||||
|
image: '/images/items/mystic_enhancement_ore.png',
|
||||||
label: 'Mystic Enhancement Ore',
|
label: 'Mystic Enhancement Ore',
|
||||||
value: '10000',
|
value: '10000',
|
||||||
},
|
},
|
||||||
{ selected: true, disabled: false, image: '/images/crystal_2.png', label: 'Fine Enhancement Ore', value: '2000' },
|
{
|
||||||
{ selected: true, disabled: false, image: '/images/crystal_1.png', label: 'Enhancement Ore', value: '400' },
|
selected: true,
|
||||||
{ selected: true, disabled: false, image: '/images/weapons/sword.png', label: '1 Star Weapon', value: '600' },
|
disabled: false,
|
||||||
{ selected: true, disabled: false, image: '/images/weapons/sword.png', label: '2 Star Weapon', value: '1200' },
|
id: 'fine_enhancement_ore',
|
||||||
{ selected: true, disabled: false, image: '/images/weapons/sword.png', label: '3 Star Weapon', value: '1800' },
|
image: '/images/items/fine_enhancement_ore.png',
|
||||||
|
label: 'Fine Enhancement Ore',
|
||||||
|
value: '2000',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selected: true,
|
||||||
|
disabled: false,
|
||||||
|
id: 'enhancement_ore',
|
||||||
|
image: '/images/items/enhancement_ore.png',
|
||||||
|
label: 'Enhancement Ore',
|
||||||
|
value: '400',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selected: true,
|
||||||
|
disabled: false,
|
||||||
|
id: 'any_weapon_1',
|
||||||
|
image: '/images/weapons/sword.png',
|
||||||
|
label: '1 Star Weapon',
|
||||||
|
value: '600',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selected: true,
|
||||||
|
disabled: false,
|
||||||
|
id: 'any_weapon_2',
|
||||||
|
image: '/images/weapons/sword.png',
|
||||||
|
label: '2 Star Weapon',
|
||||||
|
value: '1200',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selected: true,
|
||||||
|
disabled: false,
|
||||||
|
id: 'any_weapon_3',
|
||||||
|
image: '/images/weapons/sword.png',
|
||||||
|
label: '3 Star Weapon',
|
||||||
|
value: '1800',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
let addedToTodo = false;
|
||||||
|
|
||||||
let withAscension = true;
|
let withAscension = true;
|
||||||
|
|
||||||
let rarity = null;
|
let rarity = null;
|
||||||
|
@ -248,6 +287,40 @@
|
||||||
|
|
||||||
changed = false;
|
changed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function addToTodo() {
|
||||||
|
const levelRes = usedResource.reduce((prev, item, i) => {
|
||||||
|
if (currentMax.usage[i] > 0) {
|
||||||
|
prev[item.id] = currentMax.usage[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return prev;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
const ascensionRes = Object.keys(ascensionResouce).reduce((prev, item) => {
|
||||||
|
if (ascensionResouce[item].amount > 0) {
|
||||||
|
prev[item] = ascensionResouce[item].amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
return prev;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
addTodo({
|
||||||
|
type: 'weapon',
|
||||||
|
weapon: selectedWeapon,
|
||||||
|
level: { from: currentLevel, to: intendedLevel },
|
||||||
|
resources: {
|
||||||
|
mora: moraNeeded,
|
||||||
|
...levelRes,
|
||||||
|
...ascensionRes,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
addedToTodo = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
addedToTodo = false;
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="bg-item rounded-xl p-4">
|
<div class="bg-item rounded-xl p-4">
|
||||||
|
@ -400,6 +473,14 @@
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
</table>
|
</table>
|
||||||
|
<Button className="mt-2 w-full" on:click={addToTodo}>
|
||||||
|
{#if addedToTodo}
|
||||||
|
<span class="text-green-400" in:fade={{ duration: 100 }}>
|
||||||
|
<Icon path={mdiCheckCircleOutline} size={0.8} />
|
||||||
|
Added to Todo List
|
||||||
|
</span>
|
||||||
|
{:else}<span in:fade={{ duration: 100 }}>Add to Todo List </span>{/if}
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
6
src/routes/todo.svelte
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<svelte:head>
|
||||||
|
<title>Todo List - Paimon.moe</title>
|
||||||
|
</svelte:head>
|
||||||
|
<div class="lg:ml-64 pt-20 px-8 lg:pt-8">
|
||||||
|
<h1 class="font-display font-black text-5xl text-white">Todo List</h1>
|
||||||
|
</div>
|
10
src/stores/todo.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import { writable } from 'svelte/store';
|
||||||
|
|
||||||
|
export const todos = writable([]);
|
||||||
|
|
||||||
|
export function addTodo(data) {
|
||||||
|
todos.update((value) => {
|
||||||
|
console.log([...value, data]);
|
||||||
|
return [...value, data];
|
||||||
|
});
|
||||||
|
}
|
BIN
static/images/items/any_weapon_1.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
static/images/items/any_weapon_2.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
static/images/items/any_weapon_3.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |