forked from hackclub/sprig
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making the new game button always create a new game (hackclub#2310)
* making progress on fixing * game saves on login * removing debug stuff * removing more debug stuff * finished css-ing * improved redirect to editor from 'make game' button * Update Maze-escape.js * Update Maze-escape.js * Update memory_game.js * fixing error + adding comment
- Loading branch information
1 parent
3fa4952
commit 01736fe
Showing
8 changed files
with
1,303 additions
and
1,627 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
35 changes: 35 additions & 0 deletions
35
src/components/popups-etc/project-creation-not-logged-in.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,35 @@ | ||
import styles from "./project-name-creator.module.css"; | ||
import Button from "../design-system/button"; | ||
import LinkButton from '../design-system/link-button'; | ||
import { defaultExampleCode } from "../../lib/examples"; | ||
|
||
export default function ProjectNameCreatorNotLoggedIn() { | ||
|
||
return ( | ||
<div class={styles.container}> | ||
<div></div> | ||
<div class={styles.containerInner}> | ||
<div class={styles.inner}> | ||
<h1 class={styles.header}>Create Game</h1> | ||
<p>You already have a game stored, but it hasn't been saved to an account. You can either log in to save it and create a new game, or open your existing game.</p> | ||
<div class={styles.buttonContainer}> | ||
<Button type="submit" accent class={styles.done} onClick={()=>{ | ||
window.location.href= `/login?to=/~/new-game`; | ||
}}><span>Log In</span></Button> | ||
<Button type="submit" accent class={styles.done} onClick={()=>{ | ||
window.location.href= `/editor`; | ||
}}><span>Open Your Game</span></Button> | ||
</div> | ||
<div class={[styles.buttonContainer, styles.muted].join(' ')}> | ||
<LinkButton | ||
onClick={() => { | ||
localStorage.setItem("sprigMemory", defaultExampleCode); | ||
window.location.href= `/editor`; | ||
}} | ||
>or, delete your old game and start from scratch</LinkButton> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
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
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
Oops, something went wrong.