generated from codersforcauses/django-nextjs-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Issue 14 create first two sections of landing page #31
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
Merged
laurenpudz
merged 11 commits into
main
from
issue-14-Create_first_two_sections_of_landing_page
Jan 9, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
baa6e2b
Add first two sections of landing page
f277762
change details of first two components in on landing page
63f020f
finished first two sections of landing page
8c94fbc
accept example data
663a4f8
pull main branch into issue14 branch
26c1760
Fix the bug where updating the top image causes it to overlap the nav…
88f1b8f
fix problems after pull requests
bff4316
Merge branch 'main' into issue-14-Create_first_two_sections_of_landin…
laurenpudz e505859
move landing.tsx into index.tsx
ec51676
change HEX color format into HSL color format
41e97d5
change some custom HSL color
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can add the bomb decoration and sparkles in a later PR so don't worry about adding this for now :) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,26 @@ | ||
| import { useState } from "react"; | ||
|
|
||
| import { usePings } from "@/hooks/pings"; | ||
| import { cn } from "@/lib/utils"; | ||
|
|
||
| import { Button } from "../components/ui/button"; | ||
|
|
||
| export default function Home() { | ||
| const [clicked, setClicked] = useState(false); | ||
| const { data, isLoading } = usePings({ | ||
| enabled: clicked, | ||
| }); | ||
|
|
||
| return ( | ||
| <div className={cn("flex min-h-screen flex-col items-center gap-4 p-24")}> | ||
| <h1 className="font-jersey10 text-4xl text-primary">Test title</h1> | ||
| <h2 className="font-firaCode text-xl text-secondary">Test subtitle</h2> | ||
| <Button onClick={() => setClicked(true)}> | ||
| {isLoading ? "Loading" : "Ping"} | ||
| </Button> | ||
| <p> | ||
| Response from server: <span>{data as string}</span> | ||
| </p> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or 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,26 +1,189 @@ | ||
| import { useState } from "react"; | ||
|
|
||
| import { usePings } from "@/hooks/pings"; | ||
| import { cn } from "@/lib/utils"; | ||
| import Image from "next/image"; | ||
| import Link from "next/link"; | ||
|
|
||
| import { Button } from "../components/ui/button"; | ||
|
|
||
| export default function Home() { | ||
| const [clicked, setClicked] = useState(false); | ||
| const { data, isLoading } = usePings({ | ||
| enabled: clicked, | ||
| }); | ||
| export default function Landing() { | ||
| const btnList = [ | ||
| { name: "More about us", link: "/committee/about" }, | ||
| { name: "Join our Discord", link: "" }, | ||
| ]; | ||
|
|
||
| type cardImage = { | ||
| url: string; | ||
| width: number; | ||
| height: number; | ||
| alt: string; | ||
| }; | ||
|
|
||
| type cardType = { | ||
| id: number; | ||
| title: string; | ||
| description: string; | ||
| type: string; | ||
| image: cardImage | null; | ||
| row: number; | ||
| }; | ||
| const eventCards = [ | ||
| { | ||
| id: 1, | ||
| title: "Game Jams", | ||
| description: | ||
| "Compete with a team over a short time period to develop your own game! Each game jam has a different theme so be prepared to think creatively.", | ||
| type: "default", | ||
| image: { | ||
| url: "/trophy.png", | ||
| width: 200, | ||
| height: 200, | ||
| alt: "Trophy", | ||
| }, | ||
| row: 1, | ||
| }, | ||
| { | ||
| id: 2, | ||
| title: "Social Events", | ||
| description: | ||
| "Meet other folks interested in game dev, play games, and maybe even recruit members for your next game jam team :P", | ||
| type: "default", | ||
| image: null, | ||
| row: 1, | ||
| }, | ||
| { | ||
| id: 3, | ||
| title: "Other Event Type", | ||
| description: | ||
| "Some other event type that the club runs! I'm not sure what, but this section might look better with four boxes…", | ||
| type: "default", | ||
| image: null, | ||
| row: 2, | ||
| }, | ||
| { | ||
| id: 4, | ||
| title: "Workshops", | ||
| description: | ||
| "Learn core Game Development technologies, such as Godot, Unity and more. Most workshops are presented by committee members with the chance to produce your own small game.", | ||
| type: "special-border", | ||
| image: null, | ||
| row: 2, | ||
| }, | ||
| ]; | ||
|
|
||
| const logoImages = [ | ||
| { url: "/godot.png", alt: "Godot Logo", position: "start" }, | ||
| { url: "/unity-logo.png", alt: "Unity Logo", position: "end" }, | ||
| ]; | ||
|
|
||
| const row1Cards = eventCards.filter((card) => card.row === 1); | ||
| const row2Cards = eventCards.filter((card) => card.row === 2); | ||
|
|
||
| const renderCardHeader = (card: cardType) => { | ||
| if (card.type === "special-border") { | ||
| return ( | ||
| <div | ||
| style={{ | ||
| clipPath: | ||
| "polygon(0% 0%, 71% 0%, 78% 8px, 100% 8px, 100% calc(100% - 8px), 0% calc(100% - 8px))", | ||
| }} | ||
| className="relative bg-purple-400 p-[1px]" | ||
| > | ||
| <div | ||
| style={{ | ||
| clipPath: | ||
| "polygon(1px 1px, calc(71% - 1px) 1px, calc(78% - 1px) 8px, calc(100% - 1px) 8px, calc(100% - 1px) calc(100% - 8px - 1px), 1px calc(100% - 8px - 1px))", | ||
| }} | ||
| className="bg-dark_alt p-4 pt-3 font-jersey10 text-2xl font-semibold text-white" | ||
| > | ||
| {card.title} | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <div className="rounded-md border border-purple-400 bg-dark_alt px-4 py-2 font-jersey10 text-2xl font-semibold text-white"> | ||
| {card.title} | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| const renderCard = (card: cardType) => ( | ||
| <div key={card.id} className="flex flex-col"> | ||
| {renderCardHeader(card)} | ||
|
|
||
| <div className="mt-4 rounded-md border border-muted bg-landingCard1 p-4 text-gray-200"> | ||
| <div className="flex gap-2"> | ||
| <span>▶</span> | ||
| <p>{card.description}</p> | ||
| {card.image && ( | ||
| <Image | ||
| src={card.image.url} | ||
| width={card.image.width} | ||
| height={card.image.height} | ||
| alt={card.image.alt} | ||
| className="pl-[15px] pr-[30px]" | ||
| /> | ||
| )} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
|
|
||
| return ( | ||
| <div className={cn("flex min-h-screen flex-col items-center gap-4 p-24")}> | ||
| <h1 className="font-jersey10 text-4xl text-primary">Test title</h1> | ||
| <h2 className="font-firaCode text-xl text-secondary">Test subtitle</h2> | ||
| <Button onClick={() => setClicked(true)}> | ||
| {isLoading ? "Loading" : "Ping"} | ||
| </Button> | ||
| <p> | ||
| Response from server: <span>{data as string}</span> | ||
| </p> | ||
| <div> | ||
| <section className="flex w-full justify-center bg-[#182150] px-12 py-10"> | ||
| <div className="flex w-full max-w-[1440px] flex-col items-center justify-between gap-12 md:flex-row"> | ||
| <div className="flex max-w-lg flex-col gap-6 text-white"> | ||
| <h1 className="font-jersey10 text-4xl font-bold"> | ||
| Game Development UWA | ||
| </h1> | ||
| <p className="text-base leading-relaxed text-white/80"> | ||
| Little eye catching intro about what the club does here. Maybe | ||
| something about the purpose of the club, maybe something about the | ||
| type of events that the club runs. | ||
| </p> | ||
| <div className="mt-4 flex gap-4"> | ||
| {btnList.map((item, i) => ( | ||
| <Link href={item.link} key={i}> | ||
| <Button>{item.name} ></Button> | ||
| </Link> | ||
| ))} | ||
| </div> | ||
| </div> | ||
|
|
||
| <Image | ||
| src="/landing_placeholder.png" | ||
| width={600} | ||
| height={430} | ||
| alt="placeholder" | ||
laurenpudz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| className="rounded-md" | ||
| /> | ||
| </div> | ||
| </section> | ||
|
|
||
| <section className="bg-[#0d1025] py-16"> | ||
| <div className="container mx-auto px-6 lg:px-12"> | ||
| <div className="grid grid-cols-1 gap-10 md:grid-cols-2"> | ||
| {row1Cards.map(renderCard)} | ||
| </div> | ||
|
|
||
| <div className="mt-10 grid grid-cols-1 gap-10 md:grid-cols-[23fr_27fr_11fr]"> | ||
| {row2Cards.map(renderCard)} | ||
|
|
||
| <div className="flex flex-row items-center justify-center gap-4 md:hidden lg:flex lg:flex-col lg:items-start"> | ||
| {logoImages.map((logo, index) => ( | ||
| <Image | ||
| key={index} | ||
| src={logo.url} | ||
| width={135} | ||
| height={46} | ||
| alt={logo.alt} | ||
| className={`${index < logoImages.length - 1 ? "lg:mb-5" : ""} ${logo.position === "end" ? "lg:self-end" : ""}`} | ||
| /> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| </div> | ||
| ); | ||
| } | ||
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.