diff --git a/assets/core.scss b/assets/core.scss
index 61d4df6..7f0571a 100644
--- a/assets/core.scss
+++ b/assets/core.scss
@@ -3,49 +3,67 @@
@tailwind utilities;
$motiva: (
- ("MotivaSansThin.ttf", "ttf", 100, normal),
- ("MotivaSansLight.woff.ttf", "woff", 300, normal),
- ("MotivaSansRegular.woff.ttf", "woff", 400, normal),
- ("MotivaSansMedium.woff.ttf", "woff", 500, normal),
- ("MotivaSansBold.woff.ttf", "woff", 600, normal),
- ("MotivaSansExtraBold.ttf", "woff", 700, normal),
- ("MotivaSansBlack.woff.ttf", "woff", 900, normal)
+ ("MotivaSansThin.ttf", "ttf", 100, normal),
+ ("MotivaSansLight.woff.ttf", "woff", 300, normal),
+ ("MotivaSansRegular.woff.ttf", "woff", 400, normal),
+ ("MotivaSansMedium.woff.ttf", "woff", 500, normal),
+ ("MotivaSansBold.woff.ttf", "woff", 600, normal),
+ ("MotivaSansExtraBold.ttf", "woff", 700, normal),
+ ("MotivaSansBlack.woff.ttf", "woff", 900, normal)
);
$helvetica: (
- ("Helvetica.woff", "woff", 400, normal),
- ("Helvetica-Oblique.woff", "woff", 400, italic),
- ("Helvetica-Bold.woff", "woff", 600, normal),
- ("Helvetica-BoldOblique.woff", "woff", 600, italic),
- ("helvetica-light-587ebe5a59211.woff2", "woff2", 300, normal)
+ ("Helvetica.woff", "woff", 400, normal),
+ ("Helvetica-Oblique.woff", "woff", 400, italic),
+ ("Helvetica-Bold.woff", "woff", 600, normal),
+ ("Helvetica-BoldOblique.woff", "woff", 600, italic),
+ ("helvetica-light-587ebe5a59211.woff2", "woff2", 300, normal)
);
@each $file, $format, $weight, $style in $motiva {
- @font-face {
- font-family: "Motiva Sans";
- src: url("/fonts/motiva/#{$file}") format($format);
- font-weight: $weight;
- font-style: $style;
- }
+ @font-face {
+ font-family: "Motiva Sans";
+ src: url("/fonts/motiva/#{$file}") format($format);
+ font-weight: $weight;
+ font-style: $style;
+ }
}
@each $file, $format, $weight, $style in $helvetica {
- @font-face {
- font-family: "Helvetica";
- src: url("/fonts/helvetica/#{$file}") format($format);
- font-weight: $weight;
- font-style: $style;
- }
+ @font-face {
+ font-family: "Helvetica";
+ src: url("/fonts/helvetica/#{$file}") format($format);
+ font-weight: $weight;
+ font-style: $style;
+ }
}
@font-face {
- font-family: "Inter";
- src: url("/fonts/inter/InterVariable.ttf");
- font-style: normal;
+ font-family: "Inter";
+ src: url("/fonts/inter/InterVariable.ttf");
+ font-style: normal;
}
@font-face {
- font-family: "Inter";
- src: url("/fonts/inter/InterVariable-Italic.ttf");
- font-style: italic;
-}
\ No newline at end of file
+ font-family: "Inter";
+ src: url("/fonts/inter/InterVariable-Italic.ttf");
+ font-style: italic;
+}
+
+.carousel__icon {
+ color: #f4f4f5;
+}
+.carousel__pagination-button::after {
+ background-color: #3f3f46;
+ border-radius: 999999px;
+}
+.carousel__pagination-button:hover::after {
+ background-color: #27272a;
+ border-radius: 999999px;
+}
+.carousel__pagination-button--active::after {
+ background-color: #a1a1aa;
+}
+.carousel__pagination-button--active:hover::after {
+ background-color: #d4d4d8;
+}
diff --git a/components/CarouselPagination.vue b/components/CarouselPagination.vue
new file mode 100644
index 0000000..9032195
--- /dev/null
+++ b/components/CarouselPagination.vue
@@ -0,0 +1,27 @@
+
+
+
+
+
+
diff --git a/nuxt.config.ts b/nuxt.config.ts
index 5f28cc7..72e0fb5 100644
--- a/nuxt.config.ts
+++ b/nuxt.config.ts
@@ -54,4 +54,4 @@ export default defineNuxtConfig({
},
},
},
-});
+});
\ No newline at end of file
diff --git a/package.json b/package.json
index 1ac0d8b..9ae7357 100644
--- a/package.json
+++ b/package.json
@@ -38,7 +38,6 @@
"devDependencies": {
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15",
- "@types/bcrypt": "^5.0.2",
"@types/bcryptjs": "^2.4.6",
"@types/markdown-it": "^14.1.2",
"@types/turndown": "^5.0.5",
diff --git a/pages/admin/auth/simple/index.vue b/pages/admin/auth/simple/index.vue
index 711da3b..b622835 100644
--- a/pages/admin/auth/simple/index.vue
+++ b/pages/admin/auth/simple/index.vue
@@ -43,14 +43,16 @@
>
-
-
-
+
+
{{ invitationUrls[invitationIdx] }}
-
-
+
+
+
-
{{ invitation.username ?? "No username enforced." }}
|
@@ -126,8 +128,8 @@
Invite user to Drop
+ >Invite user to Drop
+
Drop will generate a URL that you can send to the
@@ -203,8 +205,8 @@
as="span"
class="text-sm/6 font-medium text-zinc-100"
passive
- >Admin invitation
+ >Admin invitation
+
>>("/api/v1/admin/auth/invitation", {
- headers,
- })
+const { data } = await useFetch>>(
+ "/api/v1/admin/auth/invitation",
+ { headers }
);
+const invitations = ref(data.value ?? []);
const generateInvitationUrl = (id: string) =>
`${window.location.protocol}//${window.location.host}/register?id=${id}`;
diff --git a/pages/index.vue b/pages/index.vue
index 5eb8881..4388b2a 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -18,5 +18,5 @@ useHead({
});
const headers = useRequestHeaders(["cookie"]);
-const games = await $fetch("/api/v1/games/front", { headers });
+const games = await $fetch("/api/v1/store/recent", { headers });
diff --git a/pages/store/[id]/index.vue b/pages/store/[id]/index.vue
index 4b4ea4d..679f1fd 100644
--- a/pages/store/[id]/index.vue
+++ b/pages/store/[id]/index.vue
@@ -79,7 +79,7 @@
-
+
@@ -115,19 +115,6 @@
-
-
diff --git a/prisma/migrations/20241122215933_add_created_timestamps_for_games/migration.sql b/prisma/migrations/20241122215933_add_created_timestamps_for_games/migration.sql
new file mode 100644
index 0000000..b383c57
--- /dev/null
+++ b/prisma/migrations/20241122215933_add_created_timestamps_for_games/migration.sql
@@ -0,0 +1,5 @@
+-- AlterTable
+ALTER TABLE "Game" ADD COLUMN "created" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
+
+-- AlterTable
+ALTER TABLE "GameVersion" ADD COLUMN "created" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
diff --git a/prisma/schema/content.prisma b/prisma/schema/content.prisma
index 2ef7e40..d9307b0 100644
--- a/prisma/schema/content.prisma
+++ b/prisma/schema/content.prisma
@@ -1,6 +1,6 @@
enum MetadataSource {
- Custom
- GiantBomb
+ Custom
+ GiantBomb
}
model Game {
@@ -8,6 +8,7 @@ model Game {
metadataSource MetadataSource
metadataId String
+ created DateTime @default(now())
// Any field prefixed with m is filled in from metadata
// Acts as a cache so we can search and filter it
@@ -34,8 +35,10 @@ model Game {
// A particular set of files that relate to the version
model GameVersion {
gameId String
- game Game @relation(fields: [gameId], references: [id])
+ game Game @relation(fields: [gameId], references: [id])
versionName String // Sub directory for the game files
+
+ created DateTime @default(now())
platform Platform
launchCommand String // Command to run to start. Platform-specific. Windows games on Linux will wrap this command in Proton/Wine
diff --git a/server/api/v1/games/front.get.ts b/server/api/v1/store/recent.get.ts
similarity index 65%
rename from server/api/v1/games/front.get.ts
rename to server/api/v1/store/recent.get.ts
index 7bcbd93..16d3fac 100644
--- a/server/api/v1/games/front.get.ts
+++ b/server/api/v1/store/recent.get.ts
@@ -4,12 +4,13 @@ export default defineEventHandler(async (h3) => {
const userId = await h3.context.session.getUserId(h3);
if (!userId) throw createError({ statusCode: 403 });
- const rawGames = await prisma.game.findMany({
+ const games = await prisma.game.findMany({
select: {
id: true,
mName: true,
mShortDescription: true,
- mCoverId:true,
+ mCoverId: true,
+ mBannerId: true,
mDevelopers: {
select: {
id: true,
@@ -22,15 +23,12 @@ export default defineEventHandler(async (h3) => {
mName: true,
},
},
- versions: {
- select: {
- platform: true,
- },
- },
},
+ orderBy: {
+ created: "desc",
+ },
+ take: 8,
});
- const games = rawGames.map((e) => ({...e, platforms: e.versions.map((e) => e.platform).filter((e, _, r) => !r.includes(e))}))
-
return games;
});
diff --git a/server/api/v1/store/updated.get.ts b/server/api/v1/store/updated.get.ts
new file mode 100644
index 0000000..e235bbb
--- /dev/null
+++ b/server/api/v1/store/updated.get.ts
@@ -0,0 +1,20 @@
+import prisma from "~/server/internal/db/database";
+
+export default defineEventHandler(async (h3) => {
+ const userId = await h3.context.session.getUserId(h3);
+ if (!userId) throw createError({ statusCode: 403 });
+
+ const versions = await prisma.gameVersion.findMany({
+ select: {
+ game: true,
+ created: true,
+ platform: true,
+ },
+ orderBy: {
+ created: "desc",
+ },
+ take: 8,
+ });
+
+ return { versions };
+});
diff --git a/yarn.lock b/yarn.lock
index d34ccf1..f3c70a6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1382,13 +1382,6 @@
resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad"
integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==
-"@types/bcrypt@^5.0.2":
- version "5.0.2"
- resolved "https://registry.yarnpkg.com/@types/bcrypt/-/bcrypt-5.0.2.tgz#22fddc11945ea4fbc3655b3e8b8847cc9f811477"
- integrity sha512-6atioO8Y75fNcbmj0G7UjI9lXN2pQ/IGJ2FWT4a/btd0Lk9lQalHLKhkgKVZ3r+spnmWUKfbMi1GEe9wyHQfNQ==
- dependencies:
- "@types/node" "*"
-
"@types/bcryptjs@^2.4.6":
version "2.4.6"
resolved "https://registry.yarnpkg.com/@types/bcryptjs/-/bcryptjs-2.4.6.tgz#2b92e3c2121c66eba3901e64faf8bb922ec291fa"