เลือกภาพตามชื่อ
SignInFigure
One of the isometric figures, chosen by name, drawn with WebGL in a canvas that fills its container. The figure can be turned a little by dragging, and its marked parts respond to a press. It is decorative, so it is hidden from screen readers. Give it a container with a size. In the sign-in brand panel, as a slide's art, its background matches the panel's gradient; anywhere else it paints that gradient over its own box.
ใช้เมื่อเลือกภาพจากข้อมูล เช่น รายการข้อความบนหน้าเข้าสู่ระบบที่แต่ละข้อความระบุชื่อภาพ connected คือ ConnectedFigure approval คือ ApprovalFigure audit คือ AuditFigure และ assistant คือ AssistantFigure ถ้ารู้ภาพที่ต้องการอยู่แล้ว ใช้คอมโพเนนต์ของภาพนั้นตรง ๆ
import { SignInFigure } from "@bsru/ui/src/signin-figures";ตัวอย่าง
เลือกตามชื่อ
figure เลือกภาพ เปลี่ยนค่าแล้วภาพใหม่จะเริ่มจากท่าเปิดตัว
<div className="h-96">
<SignInFigure figure="audit" />
</div>| Prop | ค่าในตัวอย่างนี้ | ชนิดข้อมูล | คำอธิบาย |
|---|---|---|---|
| figure* จำเป็น | "audit" | SignInFigureKind ค่าที่ใช้ได้: "connected""approval""audit""assistant" | Which figure to show. Changing it starts the new figure from its entrance. |
props ทั้งหมด
ตัวอย่างด้านบนใช้ props เพียงบางตัว ตารางนี้แสดงทุกตัวที่คอมโพเนนต์รับ พร้อมค่าเริ่มต้นและค่าที่ใช้ได้
| ชื่อ | ชนิดข้อมูล | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|
| figure* จำเป็น | SignInFigureKind ค่าที่ใช้ได้: "connected""approval""audit""assistant" | — | Which figure to show. Changing it starts the new figure from its entrance. |
| interval | number | 4 | Seconds between comets, for the figures that send them: connected and assistant. |
| app | AppTheme ค่าที่ใช้ได้: "web""console" | — | Whose colours: web's or console's, drawn from that app's primary colour. Leave it out to follow AppThemeProvider, or web. |
ชนิดข้อมูล
SignInFigureKind
Which sign-in figure to show: `connected` for budget, supplies and staff in one place, `approval` for approving from a phone, `audit` for every change on record, and `assistant` for AI connected to the ERP through MCP.
type SignInFigureKind = "connected" | "approval" | "audit" | "assistant";AppTheme
Which app's colours to use. web is the staff and student app: dark green as the base, purple second. console is the administration console: dark purple as the base, green second. Status colours, such as approved and success, stay green in both.
type AppTheme = "web" | "console";ข้อควรปฏิบัติ
- ภาพสามมิติไอโซเมตริกวาดด้วย three.js ในแคนวาส WebGL นำเข้าจาก @bsru/ui/src/signin-figures ไม่ใช่จาก @bsru/ui แอปที่ไม่ใช้ภาพเหล่านี้จึงไม่ต้องโหลด three.js แอปที่ใช้ต้องติดตั้งแพ็กเกจที่ package.json ของไลบรารีระบุไว้สำหรับภาพเหล่านี้
- รูปแบบ: ทรงตันเป็นเฉดเข้มของสีหลักของแอป อ่านจากโทเคนของหน้า (web เป็นเขียว console เป็นม่วง) ด้านบนสว่างกว่า ด้านข้างเข้มกว่า เส้นขอบเรียบทุกชิ้น ฐานทุกชิ้นมีความหนา ไฟเป็นสีเหลือง ฟ้า และชมพูหลายเฉด ขัดเงาและเรืองแสง
- ภาพเป็นของตกแต่ง ซ่อนจากโปรแกรมอ่านหน้าจอ ภาพเคลื่อนไหวเองเฉพาะเมื่อผู้ใช้ไม่ได้ขอลดการเคลื่อนไหว
- ภาพใช้ GPU ใส่หน้าละภาพเดียว และแสดงเฉพาะจอกว้าง บนหน้าเข้าสู่ระบบ ใส่เป็น art ของแต่ละข้อความใน SignInLayout
ซอร์สโค้ด: ui/src/signin-figures/index.tsx