Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ body:
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of the bug.
validations:
required: true

- type: textarea
attributes:
label: Expected behavior
description: Describe what should have happened when you encountered the bug.
description: A clear and concise description of the bug. Describe what should have happened when you encountered the bug.
validations:
required: true

Expand Down
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/new_feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ body:
attributes:
label: Rationale
description: Why should this be added?
validations:
required: true
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,30 @@ jobs:
!.github/workflows/ci.yml
**.md

# typecheck:
# needs: files
# timeout-minutes: 10
# runs-on: ubuntu-latest
# name: Typecheck

# steps:
# - name: Checkout
# uses: actions/checkout@v4

# - name: Set Node.js version to 22
# uses: actions/setup-node@v4
# with:
# node-version: 22

# - name: Install dependencies
# run: npm install

# - name: Build
# run: npm run build

# - name: Typecheck
# run: npm run typecheck

lint:
needs: files
timeout-minutes: 10
Expand Down
6 changes: 2 additions & 4 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,15 @@ onMounted(() => {
document.body.style.display = "block";

const isTemporaryUser = (!localStorage.getItem("uid") || !localStorage.getItem("token")) && Object.keys(route.query).length !== 0;
console.log(`isTemp: ${!isTemporaryUser}`);
userStore.init(!isTemporaryUser);

if (!isTemporaryUser) return;
const stop = watch(
() => route.query,
(queries) => {
async (queries) => {
if (Object.keys(queries).length !== 0) return;
console.log(`queries: ${Object.keys(queries).length !== 0}`);
stop();
void userStore.getUser(true);
await userStore.getUser(true);
}
);
});
Expand Down
10 changes: 9 additions & 1 deletion components/Blueprints/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
class="peer fo-input grow border-neutral-300 bg-white text-left text-black opacity-0 hover:border-neutral-400 focus:opacity-100 dark:border-neutral-700 dark:hover:border-neutral-600"
placeholder="Tech Points"
@blur="updateTp"
@keypress="handleEnter"
/>
<div class="pointer-events-none absolute left-0 top-0 flex h-full w-full items-center justify-center overflow-hidden peer-focus:invisible">
<p class="w-full px-3 text-left text-black">
Expand Down Expand Up @@ -200,7 +201,14 @@ const isGolden = computed(() => props.ship.techPoints >= ("modules" in props.shi

function updateTp() {
if (!tpInput.value) return;
techPoints.value = Number(tpInput.value.value);
techPoints.value = Number(tpInput.value.value.replace(".", ""));
}

function handleEnter(event: KeyboardEvent) {
if (event.key !== "Enter") return;

tpInput.value?.blur();
updateTp();
}

function unlock() {
Expand Down
67 changes: 63 additions & 4 deletions components/Blueprints/Category.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,55 @@
<template>
<div v-if="data && displayedData && displayedData.filter((ship) => ship.type === shipType).length > 0" class="flex w-full flex-col items-center justify-center">
<h2 class="mt-4 text-2xl font-bold transition duration-500">{{ shipType }}s</h2>
<Teleport to="body">
<Transition name="menu">
<div v-if="showTPModal" class="fixed left-0 top-0 z-20 flex h-dvh w-dvw items-center justify-center bg-black/50" @click="showTPModal = false">
<div id="menu" class="flex flex-col items-center justify-center gap-6 rounded-xl bg-body px-20 py-7" @click.stop>
<h2 class="text-xl font-medium">
How many unassigned <span class="text-2xl font-bold">{{ shipType }}</span> Tech Points do you have?
</h2>
<div class="fo-input-group max-w-sm">
<label class="fo-input-group-text" :for="'unassignedTechPoints' + shipType">TP</label>
<div class="relative grow">
<input
:id="'unassignedTechPoints' + shipType"
v-model.number="unassignedTp"
type="number"
class="peer fo-input grow border-neutral-300 bg-white text-left text-black hover:border-neutral-400 dark:border-neutral-700 dark:hover:border-neutral-600"
placeholder="Tech Points"
/>
</div>
</div>
<button
class="du-btn flex h-9 min-h-9 items-center justify-center gap-2 rounded-full border-green-300 bg-green-100 py-2 transition duration-500 hover:scale-105 hover:border-green-400 hover:bg-green-200 dark:border-green-500 dark:bg-green-800 dark:text-white dark:hover:bg-green-700"
type="button"
@click="showTPModal = false"
>
Done
</button>
</div>
</div>
</Transition>
</Teleport>

<div class="mt-4 flex items-center justify-center gap-1">
<h3 class="text-2xl font-bold transition duration-500">{{ shipType }}s</h3>
<ClientOnly>
<button class="du-tooltip z-[1] translate-y-0.5" :data-tip="`${unassignedTp?.toLocaleString()} unassigned ${shipType} Tech Points`" type="button" @click="showTPModal = true">
<img class="size-7 transition duration-500 dark:invert" src="/ui/plusCircle.svg" :alt="`Declare unassigned ${shipType} Tech Points`" />
</button>
</ClientOnly>
</div>
<p class="transition duration-500">{{ data.filter((ship) => ship.type === shipType && ship.unlocked).length }}/{{ data.filter((ship) => ship.type === shipType).length }} unlocked</p>
<ClientOnly>
<p class="mb-4 transition duration-500">
{{ getTotalTP(displayedData.filter((ship) => ship.type === shipType)).toLocaleString() }}
{{ (getTotalTP(displayedData.filter((ship) => ship.type === shipType)) + (unassignedTp ?? 0)).toLocaleString() }}
total Tech Points
</p>
</ClientOnly>
<div class="flex flex-wrap items-stretch justify-center gap-3">
<LazyBlueprintsCard
v-for="ship in displayedData.filter((ship) => ship.type === shipType)"
:key="ship.name + ship.variant"
:key="ship.id"
:ship="ship"
:mirror="ship.mirrorTechPoints"
:layout="currentLayout"
Expand Down Expand Up @@ -41,6 +79,9 @@ const emit = defineEmits<{ modules: [BlueprintSuperCapitalShip] }>();

const userStore = useUserStore();

const unassignedTp = defineModel<number>();
const showTPModal = ref(false);

function handleTp(targetShip: BlueprintAllShip, tp: number) {
if (!props.data) return;
userStore.hasUnsavedChanges = true;
Expand Down Expand Up @@ -81,4 +122,22 @@ function getTotalTP(ships: BlueprintAllShip[]) {
}
</script>

<style scoped></style>
<style scoped>
.menu-enter-active,
.menu-leave-active {
transition: all 0.5s ease-in-out;

#menu {
transition: all 0.35s ease-in-out;
}
}

.menu-enter-from,
.menu-leave-to {
opacity: 0;

#menu {
transform: scale(0);
}
}
</style>
4 changes: 3 additions & 1 deletion components/Blueprints/Toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const props = defineProps<{
data: BlueprintAllShip[] | undefined;
isOwner: boolean | undefined;
accountIndex: number;
unassignedTp: number[];
}>();

const emit = defineEmits<{
Expand Down Expand Up @@ -194,7 +195,8 @@ async function saveBlueprints() {
accessToken: userStore.user.accessToken,
blueprints: props.data,
accountIndex: props.accountIndex,
accountName: getObjectKey(userStore.user.blueprints[props.accountIndex]) ?? "Unnamed"
accountName: getObjectKey(userStore.user.blueprints[props.accountIndex]) ?? "Unnamed",
unassignedTp: props.unassignedTp
}
});

Expand Down
Loading
Loading