Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tutorial #137

Merged
merged 62 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
0605abf
chore(contracts): update events
broody Sep 5, 2023
8336ec4
fix(web): invalid sig errors on tx
broody Sep 6, 2023
905bc26
chore(web): use hosted madara in prod
broody Sep 6, 2023
c8ade60
back in business!
broody Sep 6, 2023
2a1a993
update to latest dojo
broody Sep 7, 2023
a4be2d0
update read me
broody Sep 7, 2023
2a0d9c4
inline methods
broody Sep 7, 2023
fb6657c
feat(contracts): hustler actions and consequences
broody Sep 7, 2023
6855e14
rename to player_status
broody Sep 8, 2023
11dbe2c
more updates
broody Sep 8, 2023
90ec176
working game loop
broody Sep 9, 2023
45f3b68
refactor
broody Sep 9, 2023
486b818
added officer tree
broody Sep 11, 2023
75ff9f5
Merge branch 'main' into officer-tree
broody Sep 11, 2023
5957efb
Update landing (#131)
notV4l Sep 12, 2023
2b3e572
more updates
broody Sep 12, 2023
760d75c
Market pricing (#135)
notV4l Sep 13, 2023
c85826f
point prod env to hosted katana/torii
broody Sep 13, 2023
7cdbba3
temp fix travel
broody Sep 13, 2023
846255c
fix wording
broody Sep 13, 2023
7ed80af
Merge branch 'main' into officer-tree
broody Sep 13, 2023
fef3468
new consqeuence images
broody Sep 13, 2023
fa2d392
enable market price and update price range
broody Sep 13, 2023
fa1f5e7
sort by price
broody Sep 13, 2023
06dd579
fix travel risk
broody Sep 13, 2023
314b6f4
fix buttons cutoff on decision page
broody Sep 13, 2023
732d415
update trade page
broody Sep 14, 2023
ae95100
btn stay depressed on create
broody Sep 14, 2023
7770451
single column drugs on location page on mobile
broody Sep 14, 2023
2c87844
gray out btn if can't perform trade
broody Sep 14, 2023
ede8838
stack header on mobile
broody Sep 14, 2023
7ab1593
indicate actual price
broody Sep 14, 2023
90fb351
sort price low to high
broody Sep 14, 2023
1aa8403
fix gang/cop encounter bias
broody Sep 14, 2023
fb0132c
ui fixes
broody Sep 14, 2023
e5b98d7
fix mobile menu
broody Sep 14, 2023
b2d7a5d
fix buying when inventory full
broody Sep 14, 2023
2d8dd23
fix media player height and padding
broody Sep 14, 2023
926e753
toggle buy/sell on mobile
broody Sep 14, 2023
1d2f4a5
fix travel delay
broody Sep 14, 2023
5f0dbae
quantity selector fix
broody Sep 14, 2023
b36d84a
fix decision screen disappearing too fast
broody Sep 14, 2023
1ce02a9
header buttons float top on mobile
broody Sep 14, 2023
57da0e7
yellow when inventory > 0
broody Sep 14, 2023
24e4aaf
move days countdown around
broody Sep 14, 2023
a7c95e0
use button with clicky sounds
broody Sep 14, 2023
9e8fa08
fix map outline error
broody Sep 15, 2023
640b2b5
Merge branch 'main' into officer-tree
broody Sep 15, 2023
c1b8269
fix create burner button
notV4l Sep 15, 2023
b99a9a3
merge 117_pages_updates
notV4l Sep 15, 2023
8b3a76f
add tutorial
notV4l Sep 15, 2023
aa9c570
change hover sound to click
notV4l Sep 15, 2023
7d1a1f2
make toast dismissable
notV4l Sep 15, 2023
1252056
fix build issues
notV4l Sep 15, 2023
d131f22
zzz
notV4l Sep 15, 2023
25fe344
zzzzzz
notV4l Sep 15, 2023
fee34f9
adjustments
notV4l Sep 15, 2023
266724e
Merge branch 'main' into add_tutorial
notV4l Sep 15, 2023
b4c6a0e
update sounds & dots
notV4l Sep 16, 2023
f78d6c8
try waking up github
notV4l Sep 16, 2023
16ecf85
Merge branch 'main' into add_tutorial
notV4l Sep 16, 2023
92b37af
remove shitty anim & update home
notV4l Sep 18, 2023
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
1 change: 1 addition & 0 deletions scripts/default_auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pushd $(dirname "$0")/..

#export RPC_URL="http://localhost:5050";
export RPC_URL="https://api.cartridge.gg/x/rollyourown/katana";

export WORLD_ADDRESS="0x3c3dfeb374720dfd73554dc2b9e0583cb9668efb3055d07d1533afa5d219fd5";

# enable system -> component authorizations
Expand Down
3 changes: 2 additions & 1 deletion src/constants.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const SCALING_FACTOR: u128 = 10_000;
const TRAVEL_RISK: u8 = 30; // 30% chance of mugged
const RUN_CHANCE: u8 = 50; // 50% chance of successfully getting away

const BASE_PAYMENT: u128 = 500_0000; // base payment is $500

const BASE_PAYMENT: u128 = 400_0000; // base payment is $400

// starting stats
const STARTING_CASH: u128 = 4000_0000; // $4000
Expand Down
Binary file modified web/public/images/landing/step1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/landing/step2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/landing/step3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/landing/step4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/images/tutorial/tuto1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/images/tutorial/tuto2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/images/tutorial/tuto3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/images/tutorial/tuto4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/sounds/Gang.mp3
Binary file not shown.
Binary file added web/public/sounds/Police.mp3
Binary file not shown.
4 changes: 2 additions & 2 deletions web/src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { playSound, Sounds } from "@/hooks/sound";
// so we do it here on text...
const Button = ({
children,
hoverSound = Sounds.HoverClick,
clickSound = undefined,
hoverSound = undefined,
clickSound = Sounds.HoverClick,
...props
}: { children: ReactNode } & { hoverSound?: Sounds | undefined } & {
clickSound?: Sounds | undefined;
Expand Down
33 changes: 33 additions & 0 deletions web/src/components/Dot.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { StyleProps, Box } from "@chakra-ui/react";

const Dot = ({
active,
onClick,
...props
}: { active: boolean; onClick: () => void } & StyleProps) => (
<Box onClick={onClick} cursor={"pointer"} {...props}>
<svg
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
{active ? (
<Box
as="path"
d="M5.99667 2V2.99917H3.99833V3.99833H2.99917V5.99667H2V10.0033H2.99917V12.0017H3.99833V13.0008H5.99667V14H10.0033V13.0008H12.0017V12.0017H13.0008V10.0033H14V5.99667H13.0008V3.99833H12.0017V2.99917H10.0033V2H5.99667Z"
fill="neon.200"
/>
) : (
<Box
as="path"
d="M6.66445 4V4.66611H5.33222V5.33222H4.66611V6.66445H4V9.33555H4.66611V10.6678H5.33222V11.3339H6.66445V12H9.33555V11.3339H10.6678V10.6678H11.3339V9.33555H12V6.66445H11.3339V5.33222H10.6678V4.66611H9.33555V4H6.66445Z"
fill="neon.500"
/>
)}
</svg>
</Box>
);

export default Dot;
30 changes: 16 additions & 14 deletions web/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const Header = ({ back }: HeaderProps) => {
<HStack flex="1" justify="center">
<HStack
h={["80px", "40px"]}
w="full"
w="auto"
px="20px"
spacing={["10px", "30px"]}
bg="neon.700"
Expand Down Expand Up @@ -133,22 +133,24 @@ const Header = ({ back }: HeaderProps) => {
{!isMobile && (
<>
<MediaPlayer />
<Button
variant="pixelated"
isLoading={isBurnerDeploying}
onClick={() => {
if (!account) {
createBurner();
}
}}
>
{account
? formatAddress(account.address.toUpperCase())
: "Create Burner"}
</Button>
</>
)}

{(!isMobile || (!account && isMobile)) && (
<Button
variant="pixelated"
isLoading={isBurnerDeploying}
onClick={() => {
if (!account) {
createBurner();
}
}}
>
{account
? formatAddress(account.address.toUpperCase())
: "Create Burner"}
</Button>
)}
{isMobile && <MobileMenu />}
</HStack>
</HStack>
Expand Down
233 changes: 233 additions & 0 deletions web/src/components/HomeLeftPanel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
import {
Text,
VStack,
HStack,
Divider,
Card,
Heading,
Image,
Box,
Link as ChakraLink,
keyframes,
} from "@chakra-ui/react";
import Layout from "@/components/Layout";
import Button from "@/components/Button";
import { ScrollDown } from "@/components/icons/ScrollDown";
import { Cartridge } from "@/components/icons/branding/Cartridge";
import { Dojo } from "@/components/icons/branding/Dojo";

const floatAnim = keyframes`
0% {transform: translateY(0%);}
25% {transform: translateY(-6px);}
50% {transform: translateY(0%);}
70% {transform: translateY(8px);}
`;

const steps = [
{
step: 1,
title: "Buy Low",
desc: "A short description of this step, maybe one to two sentences. Here is one.",
},
{
step: 2,
title: "Sell High",
desc: "A short description of this step, maybe one to two sentences. Here is one.",
},
{
step: 3,
title: "???",
desc: "A short description of this step, maybe one to two sentences. Here is one.",
},
{
step: 4,
title: "Profit",
desc: "A short description of this step, maybe one to two sentences. Here is one.",
},
];

const HomeStep = ({
step,
}: {
step: { step: number; title: string; desc: string };
}) => {
return (
<>
<HStack
flexDirection={step.step % 2 == 1 ? "row" : "row-reverse"}
gap="20px"
>
<Image
src={`/images/landing/step${step.step}.png`}
alt={`step${step.step}`}
w="42%"
/>

<VStack w="58%" alignItems="flex-start" py="100px">
<HStack>
<Image
src={`/images/landing/step${step.step}-icon.png`}
alt={`step${step.step}`}
w="92px"
/>
<VStack alignItems="flex-start">
<Text
fontSize="11px"
fontFamily="broken-console"
backgroundColor="#174127"
padding="0.5rem 0.5rem 0.25rem"
>
Step {step.step}
</Text>
<Heading
fontFamily={"ppneuebit"}
fontSize="44px"
lineHeight={"1"}
>
{step.title}
</Heading>
</VStack>
</HStack>
{/* <Text p="10px">{step.desc}</Text> */}
</VStack>
</HStack>
</>
);
};

const onScrollDown = () => {
let steps = document.getElementById("steps");

setTimeout(() => {
steps &&
steps.scrollIntoView({
behavior: "smooth",
block: "start",
inline: "nearest",
});
}, 10);
};

const HomeLeftPanel = () => {
return (
<>
<VStack
my="auto"
flex={["auto", "1"]}
position="relative"
maxH={["80px", "800px"]}
overflow="hidden"
overflowY="auto"
sx={{
"::-webkit-scrollbar": {
display: "none",
},
"scrollbar-width": "none",
}}
>
<VStack zIndex="2">
<Text textStyle="subheading" fontSize="11px">
DOPE WARS
</Text>
<Heading fontSize={["40px", "48px"]} fontWeight="normal">
Roll your Own
</Heading>
</VStack>

<VStack position="relative" top="-160px" display={["none", "flex"]}>
<Image
src={"/images/landing/main.png"}
maxH="75vh"
display={["none", "block"]}
alt="context"
/>

<Box
id="steps"
style={{ marginTop: "30px" }}
position="relative"
onClick={() => onScrollDown()}
animation={`${floatAnim} infinite 3s linear`}
cursor={"pointer"}
>
<ScrollDown width="40px" height="40px" />
</Box>

<Box>
{steps.map((step) => {
return <HomeStep step={step} key={step.step} />;
})}
</Box>

<HStack py="100px">
<Card
display="flex"
flexDirection="row"
p="2"
alignItems="center"
variant="pixelated"
px="5"
>
<ChakraLink
href="https://cartridge.gg/"
target="_blank"
display="flex"
justifyContent="center"
alignItems="center"
textDecoration="none"
_hover={{
color: "cartridgeYellow",
}}
>
BUILT BY <Cartridge ml="2" />
</ChakraLink>

<Text px="2" fontSize="xl">
|
</Text>
<ChakraLink
href="https://dojoengine.org/"
target="_blank"
display="flex"
justifyContent="center"
alignItems="center"
textDecoration="none"
_hover={{
color: "dojoRed",
}}
>
BUILT WITH <Dojo ml="2" />
</ChakraLink>
</Card>
</HStack>
</VStack>
</VStack>

<HStack
w="calc((100% - 100px) / 2)"
h="200px"
position="absolute"
display={["none", "block"]}
top="0px"
marginTop="-80px"
zIndex={1}
background="linear-gradient(#172217, #172217, transparent)"
pointerEvents="none"
></HStack>

<HStack
w="calc((100% - 100px) / 2)"
h="200px"
position="absolute"
display={["none", "block"]}
bottom="0px"
marginBottom="-80px"
zIndex={1}
background="linear-gradient(transparent, #172217, #172217)"
pointerEvents="none"
></HStack>
</>
);
};

export default HomeLeftPanel;
7 changes: 4 additions & 3 deletions web/src/components/Toast.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { cardPixelatedStyle } from "@/theme/styles";
import { HStack, Link, Text } from "@chakra-ui/react";
import { ReactNode } from "react";
import { Alert, ExternalLink } from "./icons";
import { Alert, Close, ExternalLink } from "./icons";

export const Toast = ({
message,
Expand Down Expand Up @@ -32,11 +32,12 @@ export const Toast = ({
<Text>{message}</Text>
</>
</HStack>
{link && (
<Close onClick={onClose} cursor="pointer" />
{/* {link && (
<Link href={link} isExternal>
<ExternalLink />
</Link>
)}
)} */}
</HStack>
);
};
Loading