Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

[Front | FlexScreen] Banner | GalleryCard | Product #99

Merged
merged 5 commits into from
Jan 29, 2024
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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"@azure/msal-browser": "^3.7.1",
"@azure/msal-common": "^14.6.1",
"@azure/msal-react": "^2.0.10",
"@fluentui/react-components": "^9.46.0",
"@fluentui/react-components": "^9.46.2",
"@fluentui/react-hooks": "^8.6.36",
"@fluentui/react-icons": "^2.0.225",
"@fluentui/react-icons": "^2.0.226",
"@griffel/react": "^1.5.20",
"@lexical/clipboard": "0.10.0",
"@lexical/code": "0.10.0",
Expand All @@ -38,7 +38,7 @@
"@lexical/utils": "0.10.0",
"@microsoft/signalr": "^8.0.0",
"@microsoft/signalr-protocol-msgpack": "^8.0.0",
"ahooks": "^3.7.8",
"ahooks": "^3.7.9",
"dayjs": "^1.11.10",
"dexie": "^3.2.4",
"dexie-react-hooks": "^1.1.7",
Expand Down
402 changes: 194 additions & 208 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

Binary file added public/banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 14 additions & 5 deletions src/Pages/Gallery/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ColFlex, Cover, Flex } from "~/Helpers/Styles";
/**
* @author Aloento
* @since 1.3.5
* @version 0.1.0
* @version 0.2.0
*/
const useStyles = makeStyles({
main: {
Expand All @@ -16,6 +16,7 @@ const useStyles = makeStyles({
...Cover,
aspectRatio: "42/9",
width: "100%",
minHeight: "320px",
...shorthands.borderRadius(tokens.borderRadiusXLarge),
},
mask: {
Expand All @@ -32,17 +33,25 @@ const useStyles = makeStyles({
position: "absolute",
top: 0,
...shorthands.padding(tokens.spacingHorizontalXXXL),
height: "-webkit-fill-available",
},
space: {
flexBasis: "50%",
flexShrink: 0
flexShrink: 0,
"@media screen and (max-width: 1024px)": {
flexBasis: 0,
}
},
txt: {
...ColFlex,
rowGap: tokens.spacingVerticalXL,
justifyContent: "space-around"
},
white: {
color: "white !important"
color: "white !important",
"@media screen and (max-width: 600px)": {
fontSize: tokens.fontSizeBase300,
lineHeight: tokens.lineHeightBase300,
}
}
});

Expand Down Expand Up @@ -98,7 +107,7 @@ export function Banner() {
</LargeTitle>
</div>

<Text size={500} className={style.white}>
<Text size={500} truncate className={style.white}>
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled it to make a type specimen book.
Expand Down
10 changes: 3 additions & 7 deletions src/Pages/Gallery/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ import { Hub } from "~/ShopNet";
/**
* @author Aloento
* @since 0.1.0
* @version 0.1.0
* @version 0.2.0
*/
const useStyles = makeStyles({
card: {
flexBasis: "23%",
flexGrow: 0,
},
img: {
aspectRatio: "1",
...Cover,
Expand All @@ -28,7 +24,7 @@ const log = new Logger("Gallery", "Category", "Card");
/**
* @author Aloento
* @since 0.5.0
* @version 0.1.5
* @version 0.1.6
*/
export function GalleryCard({ Id }: { Id: number }) {
const style = useStyles();
Expand All @@ -37,7 +33,7 @@ export function GalleryCard({ Id }: { Id: number }) {
});

return (
<Card className={style.card}>
<Card>
<CardPreview>
<GuidImage className={style.img} Guid={data?.Cover} Log={log} />
</CardPreview>
Expand Down
27 changes: 15 additions & 12 deletions src/Pages/Gallery/Category.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { SkeletonItem, Title3, makeStyles, tokens } from "@fluentui/react-components";
import { useRequest } from "ahooks";
import { random } from "lodash-es";
import { Logger } from "~/Helpers/Logger";
import { Flex } from "~/Helpers/Styles";
import { Hub } from "~/ShopNet";
Expand All @@ -9,18 +8,22 @@ import { GalleryCard } from "./Card";
/**
* @author Aloento
* @since 0.1.0
* @version 0.1.0
* @version 0.2.0
*/
const useStyles = makeStyles({
card: {
flexBasis: "23%",
flexGrow: 0,
flexBasis: "20%",
flexGrow: 1,
flexShrink: 0,
maxWidth: "25%",
minWidth: `${375 / 2}px`,
boxSizing: "border-box",
paddingRight: tokens.spacingHorizontalL,
paddingLeft: tokens.spacingHorizontalL,
},
cate: {
...Flex,
flexWrap: "wrap",
justifyContent: "space-evenly",
columnGap: tokens.spacingVerticalL,
rowGap: tokens.spacingVerticalXL
}
});
Expand All @@ -30,7 +33,7 @@ const log = new Logger("Gallery", "Category");
/**
* @author Aloento
* @since 0.5.0
* @version 0.1.4
* @version 0.1.5
*/
export function GalleryCategory({ Category }: { Category: string }) {
const style = useStyles();
Expand All @@ -45,11 +48,11 @@ export function GalleryCategory({ Category }: { Category: string }) {
{
loading
? <SkeletonItem size={128} />
: data![0].map((x, i) => <GalleryCard key={i} Id={x} />)
.concat(
Array(data![1]).fill(null)
.map((_, i) => <div key={i + random(10, 100)} className={style.card} />)
)
: data!.map((x, i) => (
<div className={style.card}>
<GalleryCard key={i} Id={x} />
</div>
))
}
</div>
</>
Expand Down
41 changes: 22 additions & 19 deletions src/Pages/Product/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ import { ProductRadioList } from "./RadioList";
/**
* @author Aloento
* @since 0.1.0
* @version 0.1.0
* @version 0.2.0
*/
const useStyles = makeStyles({
main: ColFlex,
info: {
...Flex,
columnGap: tokens.spacingHorizontalXXXL
columnGap: tokens.spacingHorizontalXXXL,
"@media screen and (max-width: 600px)": {
flexWrap: "wrap",
}
},
detail: {
...BaseCard,
Expand All @@ -38,6 +40,9 @@ const useStyles = makeStyles({
flexBasis: "50%",
flexShrink: 0,
rowGap: tokens.spacingVerticalXL,
"@media screen and (max-width: 600px)": {
flexBasis: "100%",
}
},
fore: {
color: tokens.colorBrandForeground1
Expand All @@ -59,7 +64,7 @@ const log = new Logger("Product");
/**
* @author Aloento
* @since 0.1.0
* @version 0.3.0
* @version 0.3.1
*/
function Product() {
const style = useStyles();
Expand All @@ -82,27 +87,25 @@ function Product() {
<title>{data?.Name || ""} - {Dic.Name}</title>
</Helmet>

<div className={style.main}>
<div className={style.info}>
<ProductCarousel Id={id} />
<div className={style.info}>
<ProductCarousel Id={id} />

<div className={style.lex}>
<div className={style.detail}>
<LargeTitle className={style.fore}>
{data?.Name || "Loading..."}
</LargeTitle>
<div className={style.lex}>
<div className={style.detail}>
<LargeTitle className={style.fore}>
{data?.Name || "Loading..."}
</LargeTitle>

<Divider />
<Divider />

<ProductRadioList ProdId={id} />
<ProductRadioList ProdId={id} />

<Divider />
<Divider />

<ProductQuantity Id={id} />
</div>

<ProductLexicalRender ProdId={id} />
<ProductQuantity Id={id} />
</div>

<ProductLexicalRender ProdId={id} />
</div>
</div>
</RadioGroupContext>
Expand Down
2 changes: 1 addition & 1 deletion src/Pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { NotFound } from "./404";
const useStyles = makeStyles({
body: {
...ColFlex,
minWidth: "1024px",
minWidth: "375px",
position: "absolute",
marginTop: `${NavH}px`,
width: "100%",
Expand Down
10 changes: 3 additions & 7 deletions src/ShopNet/Gallery/Get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ export abstract class GalleryGet extends ShopNet {
/**
* @author Aloento
* @since 0.5.0
* @version 0.2.1
* @version 0.2.2
*/
public static async Products(category: string): Promise<[number[], number]> {
public static async Products(category: string): Promise<number[]> {
const nums = await this.GetTimeCache<number[]>(category, "GalleryGetProducts", (x) => x.add(1, "m"), category);

return [
nums,
4 - (nums.length % 4)
];
return nums;
}
}
Loading