-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
consistency responsive header update header remove chatgpt comments finish up header and fix up other components lint and delete basecard (will be merged in future pr) Add BaseCard and Header Base Card/text components and veiws make header/sidebar fixed, create documentationpage for quickstart/resources
- Loading branch information
1 parent
075ca13
commit e5dc253
Showing
16 changed files
with
1,134 additions
and
25 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
|
||
interface BaseCardProps { | ||
GameImage: string; | ||
GameName: string; | ||
GameDescr: string; | ||
GameYear: number; | ||
} | ||
|
||
const YearCard: React.FC<BaseCardProps> = ({ GameImage, GameName, GameDescr, GameYear }) => { | ||
const redirect = (): void => { | ||
console.log(GameYear.toString()); // Redirect to year page | ||
}; | ||
|
||
return ( | ||
<div className="max-w-sm rounded overflow-hidden shadow-md transition duration-300 ease-in-out transform hover:shadow-lg hover:cursor-pointer" onClick={redirect}> | ||
<div className="aspect-w-4 aspect-h-3"> | ||
<img className="object-cover" src={require(`../${GameImage}`)} alt={GameName} /> | ||
</div> | ||
<div className="px-6 py-4"> | ||
<div className="font-bold text-xl mb-2">{GameName}</div> | ||
<p className="text-gray-700 text-base">{GameDescr}</p> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default YearCard; |
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,48 @@ | ||
import React from "react"; | ||
import ReactMarkdown from "react-markdown"; | ||
import { Link } from "react-router-dom"; | ||
|
||
const isInternalLink = (to: string): boolean => { | ||
const url = new URL(to, window.location.origin); | ||
console.log(url, window.location.hostname); | ||
return url.hostname === window.location.hostname; | ||
}; | ||
|
||
interface DocumentationPageProps { | ||
text: string; | ||
} | ||
|
||
const DocumentationPage: React.FC<DocumentationPageProps> = ({ text }) => { | ||
return ( | ||
<div className="h-full w-full overflow-auto bg-white p-6"> | ||
<ReactMarkdown | ||
components={{ | ||
a: ({ href, ...props }) => { | ||
const target = href ?? ""; | ||
if (isInternalLink(target)) { | ||
return ( | ||
<Link | ||
className="text-cyan-600 hover:underline" | ||
to={target} | ||
{...props} | ||
/> | ||
); | ||
} else { | ||
return ( | ||
<a | ||
className="text-cyan-600 hover:underline" | ||
href={target} | ||
{...props} | ||
/> | ||
); | ||
} | ||
}, | ||
}} | ||
> | ||
{text} | ||
</ReactMarkdown> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DocumentationPage; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
|
||
export const BC23_QUICKSTART = | ||
`This is the Battlecode 2023 contest website, which will be your main hub for all Battlecode-related things for the duration of the contest. For a general overview of what Battlecode is, visit [our landing page](https://battlecode.org/). | ||
## Create an account and team | ||
To participate in Battlecode, you need an account and a team. Each team can consist of 1 to 4 people. | ||
[Create an account](/register) on this website, and then go to the [team section](/bc23/team) to either create or join a team. | ||
## Installation | ||
### Step 1: Install Java | ||
You'll need a Java Development Kit (JDK) version 8. Unfortunately, higher versions will not work. [Download it here](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html). You may need to create an Oracle account. | ||
- Alternatively, you can install a JDK yourself using your favorite package manager. Make sure it's an Oracle JDK — we don't support anything else — and is compatible with Java 8. | ||
If you're unsure how to install the JDK, you can find instructions for all operating systems [here](https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html) (pay attention to \`PATH\` and \`CLASSPATH\`). | ||
### Step 2: Download Battlecode | ||
Next, you should download the [Battlecode 2023 scaffold](https://github.com/battlecode/battlecode23-scaffold). To get up and running quickly, you can click "Clone or download" and then "Download ZIP," and move on to the next step. | ||
# Troubleshooting | ||
`; | ||
|
||
export const BC23_RESOURCES = | ||
`# Markdown syntax guide | ||
## Headers | ||
# This is a Heading h1 | ||
## This is a Heading h2 | ||
###### This is a Heading h6 | ||
## Emphasis | ||
*This text will be italic* | ||
_This will also be italic_ | ||
**This text will be bold** | ||
__This will also be bold__ | ||
_You **can** combine them_ | ||
## Lists | ||
### Unordered | ||
* Item 1 | ||
* Item 2 | ||
* Item 2a | ||
* Item 2b | ||
### Ordered | ||
1. Item 1 | ||
1. Item 2 | ||
1. Item 3 | ||
1. Item 3a | ||
1. Item 3b | ||
## Images | ||
![This is an alt text.](/image/sample.png "This is a sample image.") | ||
## Links | ||
You may be using [Markdown Live Preview](https://markdownlivepreview.com/). | ||
## Blockquotes | ||
> Markdown is a lightweight markup language with plain-text-formatting syntax, created in 2004 by John Gruber with Aaron Swartz. | ||
> | ||
>> Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor. | ||
## Tables | ||
| Left columns | Right columns | | ||
| ------------- |:-------------:| | ||
| left foo | right foo | | ||
| left bar | right bar | | ||
| left baz | right baz | | ||
## Blocks of code | ||
\`\`\` | ||
let message = 'Hello world'; | ||
alert(message); | ||
\`\`\` | ||
## Inline code | ||
This web site is using \`markedjs/marked\`. | ||
`; |
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 |
---|---|---|
@@ -1,4 +1,37 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Josefin+Sans:wght@100;300;400;500;700&display=swap'); | ||
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Josefin+Sans:wght@100;300;400;500;700&display=swap"); | ||
|
||
@layer base { | ||
h1 { | ||
@apply pb-4 text-2xl font-medium text-gray-900; | ||
} | ||
h2 { | ||
@apply pb-4 pt-6 text-2xl font-medium text-gray-900; | ||
} | ||
h3 { | ||
@apply pb-4 text-xl font-medium text-gray-900; | ||
} | ||
h4 { | ||
@apply pb-4 text-lg font-medium text-gray-700; | ||
} | ||
p { | ||
@apply pb-4 text-gray-900; | ||
} | ||
code { | ||
@apply rounded bg-gray-100 px-1 py-0.5 text-sm text-cyan-900; | ||
} | ||
pre code { | ||
@apply p-0; | ||
} | ||
pre { | ||
@apply bg-gray-100 px-4 py-3 rounded; | ||
} | ||
ul { | ||
@apply ml-6 list-outside list-disc pb-4; | ||
} | ||
ol { | ||
@apply ml-6 list-outside list-decimal pb-4; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import React from "react"; | ||
import DocumentationPage from "../components/DocumentationPage"; | ||
import { BC23_QUICKSTART } from "../content/bc23"; | ||
|
||
const QuickStart: React.FC = () => { | ||
return <p>quickstart page</p>; | ||
return <DocumentationPage text={BC23_QUICKSTART} />; | ||
}; | ||
|
||
export default QuickStart; | ||
// todo this file |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from "react"; | ||
import { BC23_RESOURCES } from "../content/bc23"; | ||
import DocumentationPage from "../components/DocumentationPage"; | ||
|
||
const Resources = (): JSX.Element => { | ||
return <DocumentationPage text={BC23_RESOURCES} />; | ||
}; | ||
|
||
export default Resources; |