diff --git a/app/features/user-page/routes/u.$identifier.vods.tsx b/app/features/user-page/routes/u.$identifier.vods.tsx index f7f8cf6f6..3e07467bb 100644 --- a/app/features/user-page/routes/u.$identifier.vods.tsx +++ b/app/features/user-page/routes/u.$identifier.vods.tsx @@ -1,15 +1,13 @@ import { useLoaderData, useMatches } from "@remix-run/react"; import { AddNewButton } from "~/components/AddNewButton"; import { VodListing } from "~/features/vods/components/VodListing"; +import styles from "~/features/vods/routes/vods.module.css"; import invariant from "~/utils/invariant"; import type { SendouRouteHandle } from "~/utils/remix.server"; import { newVodPage } from "~/utils/urls"; - import { loader } from "../loaders/u.$identifier.vods.server"; export { loader }; -import "~/features/vods/vods.css"; - export const handle: SendouRouteHandle = { i18n: ["vods"], }; @@ -24,7 +22,7 @@ export default function UserVodsPage() {
-
+
{data.vods.map((vod) => ( ))} diff --git a/app/features/vods/components/VodListing.module.css b/app/features/vods/components/VodListing.module.css new file mode 100644 index 000000000..dd0a37394 --- /dev/null +++ b/app/features/vods/components/VodListing.module.css @@ -0,0 +1,34 @@ +.listing { + max-width: 355px; +} + +.thumbnail { + aspect-ratio: 16 / 9; + width: 100%; + height: 100%; + object-fit: cover; + min-width: 355px; +} + +.info { + display: flex; + justify-content: space-between; + align-items: center; +} + +.castText { + font-size: var(--fonts-sm); + font-weight: var(--semi-bold); + color: var(--text-lighter); +} + +.weaponsNotShown { + background-color: var(--bg-lighter); + border-radius: 100%; + display: grid; + place-items: center; + font-weight: var(--semi-bold); + width: 38px; + height: 38px; + font-size: var(--fonts-sm); +} diff --git a/app/features/vods/components/VodListing.tsx b/app/features/vods/components/VodListing.tsx index 560351e8d..e704b4463 100644 --- a/app/features/vods/components/VodListing.tsx +++ b/app/features/vods/components/VodListing.tsx @@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next"; import { WeaponImage } from "~/components/Image"; import { vodVideoPage } from "~/utils/urls"; import type { ListVod } from "../vods-types"; +import styles from "./VodListing.module.css"; import { PovUser } from "./VodPov"; export function VodListing({ @@ -15,20 +16,18 @@ export function VodListing({ const { t } = useTranslation(["vods"]); return ( -
+

{vod.title}

-
+
{vod.type === "CAST" || !showUser ? ( -
- {t(`vods:type.${vod.type}`)} -
+
{t(`vods:type.${vod.type}`)}
) : ( )} @@ -58,9 +57,7 @@ function WeaponsPeek({ weapons }: { weapons: ListVod["weapons"] }) { /> ))} {amountOfWeaponsNotShown > 0 ? ( -
- +{amountOfWeaponsNotShown} -
+
+{amountOfWeaponsNotShown}
) : null}
); diff --git a/app/features/vods/routes/vods.$id.module.css b/app/features/vods/routes/vods.$id.module.css new file mode 100644 index 000000000..ec04770d1 --- /dev/null +++ b/app/features/vods/routes/vods.$id.module.css @@ -0,0 +1,46 @@ +.matches { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); + flex-wrap: wrap; + column-gap: var(--s-4); + row-gap: var(--s-8); + justify-content: space-between; + margin-block-start: var(--s-2); + place-items: center; +} + +.match { + position: relative; + display: flex; + align-items: center; + text-align: center; + flex-direction: column; + font-size: var(--fonts-xs); + line-height: 1.3; + font-weight: var(--semi-bold); + flex-grow: 1; + width: max-content; + gap: var(--s-1); +} + +.matchWeapon { + position: absolute; + top: -15px; + left: -20px; +} + +.matchWeapons { + display: grid; + grid-template-columns: repeat(2, 1fr); + margin-block-end: var(--s-2); +} + +.matchMode { + position: absolute; + top: -15px; + right: -15px; +} + +.matchMode.cast { + right: -8px; +} diff --git a/app/features/vods/routes/vods.$id.tsx b/app/features/vods/routes/vods.$id.tsx index fc99572a6..c64082c97 100644 --- a/app/features/vods/routes/vods.$id.tsx +++ b/app/features/vods/routes/vods.$id.tsx @@ -31,10 +31,9 @@ import { PovUser } from "../components/VodPov"; import { loader } from "../loaders/vods.$id.server"; import type { Vod } from "../vods-types"; import { canEditVideo, secondsToHoursMinutesSecondString } from "../vods-utils"; +import styles from "./vods.$id.module.css"; export { loader, action }; -import "../vods.css"; - export const handle: SendouRouteHandle = { breadcrumb: ({ match }) => { const data = match.data as SerializeFrom | undefined; @@ -143,7 +142,7 @@ export default function VodPage() { ) : null}
-
+
{data.vod.matches.map((match) => ( +
) : null} {t(`game-misc:MODE_LONG_${match.mode}`)} {weapons ? (
-
+
{weapons.slice(0, 4).map((weapon, i) => { return ( -
+
{weapons.slice(4).map((weapon, i) => { const adjustedI = i + 4; return ( diff --git a/app/features/vods/routes/vods.module.css b/app/features/vods/routes/vods.module.css new file mode 100644 index 000000000..297e24158 --- /dev/null +++ b/app/features/vods/routes/vods.module.css @@ -0,0 +1,10 @@ +.listingList { + display: flex; + flex-wrap: wrap; + gap: var(--s-6); + justify-content: center; +} + +.typeSelect { + width: 220px; +} diff --git a/app/features/vods/routes/vods.tsx b/app/features/vods/routes/vods.tsx index 3f27195e9..04eeea3f4 100644 --- a/app/features/vods/routes/vods.tsx +++ b/app/features/vods/routes/vods.tsx @@ -15,10 +15,9 @@ import { navIconUrl, newVodPage, VODS_PAGE } from "~/utils/urls"; import { VodListing } from "../components/VodListing"; import { loader } from "../loaders/vods.server"; import { VODS_PAGE_BATCH_SIZE, videoMatchTypes } from "../vods-constants"; +import styles from "./vods.module.css"; export { loader }; -import "../vods.css"; - export const handle: SendouRouteHandle = { i18n: ["vods"], breadcrumb: () => ({ @@ -58,7 +57,7 @@ export default function VodsSearchPage() {
{data.vods.length > 0 ? ( <> -
+
{data.vods.map((vod) => ( ))} @@ -156,7 +155,7 @@ function Filters({