-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from JollyGrin/preview-cards/add-release-notes
Preview cards/add release notes
- Loading branch information
Showing
15 changed files
with
522 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
#### 12:57 | ||
- i updated the view so you can see full cards on grid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export const KeyboardKey = (props: { children: string }) => { | ||
return ( | ||
<span | ||
style={{ | ||
borderRadius: "0.25rem", | ||
background: "rgba(0,0,0,0.2)", | ||
padding: "2px 6px", | ||
fontFamily: "monospace", | ||
borderBottom: "solid 1px black", | ||
}} | ||
> | ||
{props.children} | ||
</span> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
src/components/molecules/ReleaseNotes/Notes/20241013.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
import { KeyboardKey } from "@/components/atoms/KeyboardKey"; | ||
import { CardAtlas } from "@/components/atoms/mock-cards/atlas"; | ||
import { CardImage } from "@/components/atoms/mock-cards/card"; | ||
import { LOCALSTORAGE_KEYS } from "@/components/organisms/GameBoard/constants"; | ||
import { AltGridDisplay } from "@/components/organisms/GameBoard/Grid/AltGridDisplay"; | ||
import { Button } from "@/components/ui/button"; | ||
import { useLocalStorage } from "@/utils/hooks"; | ||
import { mock_griditem_red } from "@/utils/mocks/mock_gamecards"; | ||
import { Box, Divider, Grid, HStack, VStack } from "styled-system/jsx"; | ||
|
||
export const Note20241013 = () => { | ||
const { key, ...options } = LOCALSTORAGE_KEYS.SETTINGS.DISPLAY.toggle; | ||
const [isDisplay, setIsDisplay] = useLocalStorage(key, false, options); | ||
|
||
return ( | ||
<> | ||
<Grid gridTemplateColumns="repeat(2, 1fr)"> | ||
<Box minW="300px"> | ||
<p style={{ fontSize: "1.5rem", opacity: 0.5, marginBottom: "1rem" }}> | ||
October 13, 2024 | ||
</p> | ||
<p style={{ fontWeight: 600 }}> | ||
View the grid with full card previews! | ||
</p> | ||
<VStack alignItems="start" fontSize="0.825rem" gap={2}> | ||
<p> | ||
Have a more realistic view of the table to match your expectations | ||
from playing Sorcery in real life. | ||
</p> | ||
<p> | ||
Cards always switch to minimized view when hovering or dragging an | ||
item, to allow you to position the ordering of cards. | ||
</p> | ||
|
||
<HStack> | ||
<p>Try it out! Click the button</p> | ||
|
||
<Button onClick={() => setIsDisplay(!isDisplay)}> | ||
{isDisplay ? "Show min card view" : "Show full card"} | ||
</Button> | ||
</HStack> | ||
|
||
<Divider /> | ||
|
||
<p style={{ fontWeight: 600, fontSize: "1rem", marginTop: "1rem" }}> | ||
Wish to change this setting in the future? | ||
</p> | ||
<p> | ||
While in game, press <KeyboardKey>?</KeyboardKey> to open up the | ||
commands menu. | ||
</p> | ||
<p style={{ opacity: 0.5 }}> | ||
Question mark is achieved on most keyboards by pressing | ||
simultaneously: <KeyboardKey>SHIFT</KeyboardKey>{" "} | ||
<KeyboardKey>/</KeyboardKey> | ||
</p> | ||
<p> | ||
From there you can find these settings in the menu item:{" "} | ||
<span style={{ fontWeight: 700 }}> | ||
Display full/minimized cards view | ||
</span> | ||
</p> | ||
</VStack> | ||
</Box> | ||
<Grid | ||
justifySelf="end" | ||
gridTemplateRows="repeat(2, 210px)" | ||
w="200px" | ||
minH="200px" | ||
> | ||
{isDisplay ? ( | ||
<> | ||
<AltGridDisplay | ||
cards={mock_griditem_red.map((card) => ({ | ||
...card, | ||
playerName: "bar", | ||
}))} | ||
myName="foo" | ||
/> | ||
<AltGridDisplay | ||
cards={mock_griditem_red.map((card) => ({ | ||
...card, | ||
playerName: "foo", | ||
}))} | ||
myName="foo" | ||
/> | ||
</> | ||
) : ( | ||
<> | ||
<VStack> | ||
{mock_griditem_red?.map((card, index) => { | ||
const CardType = card.type === "site" ? CardAtlas : CardImage; | ||
return ( | ||
<CardType | ||
key={card.img + index} | ||
img={card.img} | ||
isMine={false} | ||
/> | ||
); | ||
})} | ||
</VStack> | ||
<VStack> | ||
{mock_griditem_red?.map((card, index) => { | ||
const CardType = card.type === "site" ? CardAtlas : CardImage; | ||
return ( | ||
<CardType | ||
key={card.img + index} | ||
img={card.img} | ||
isMine={true} | ||
/> | ||
); | ||
})} | ||
</VStack> | ||
</> | ||
)} | ||
</Grid> | ||
</Grid> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { Box, Divider } from "styled-system/jsx"; | ||
import { Note20241013 } from "./Notes/20241013"; | ||
import { LOCALSTORAGE_KEYS } from "@/components/organisms/GameBoard/constants"; | ||
import { useLocalStorage } from "@/utils/hooks"; | ||
|
||
export const ReleaseNoteBody = () => { | ||
const { key, ...options } = | ||
LOCALSTORAGE_KEYS.DISCLAIMER.GAMEBOARD.lastSeenNote; | ||
const [, setLastSeenNote] = useLocalStorage(key, 0, options); | ||
|
||
function confirmRead() { | ||
const now = Date.now(); | ||
setLastSeenNote(now); | ||
} | ||
|
||
return ( | ||
<Box | ||
maxW="700px" | ||
w={{ base: "65vw", md: "80vw" }} | ||
maxH="600px" | ||
overflowY="auto" | ||
position="relative" | ||
> | ||
<Box | ||
position="absolute" | ||
right={0} | ||
bg="gray.300" | ||
padding="0.25rem 0.5rem" | ||
borderRadius="4px" | ||
cursor="pointer" | ||
transition="all 0.25s ease" | ||
_hover={{ | ||
bg: "gray.200", | ||
}} | ||
onClick={confirmRead} | ||
> | ||
X | ||
</Box> | ||
<p | ||
style={{ | ||
fontWeight: 700, | ||
fontSize: "2.5rem", | ||
}} | ||
> | ||
Release Notes | ||
</p> | ||
<p>(new updates!)</p> | ||
<Divider my="1rem" /> | ||
<Note20241013 /> | ||
</Box> | ||
); | ||
}; |
Oops, something went wrong.