-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 BUILD STUPID S#!T, GET STUPID PRIZES!
Co-authored-by: Samuel Fernandez <[email protected]> Co-authored-by: Rhys <[email protected]> Co-authored-by: BrightTheBackpack <[email protected]> Co-authored-by: Sam Poder <[email protected]>
- Loading branch information
1 parent
d59dd69
commit 4878594
Showing
59 changed files
with
1,498 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Box, Heading} from "theme-ui"; | ||
|
||
export default function IndexCard({ title, children, url}) { | ||
return ( | ||
<Box | ||
sx={{ | ||
p: 4, | ||
borderRadius: 4, | ||
boxShadow: '0 0 8px rgba(0, 0, 0, 0.125)', | ||
bg: 'white', | ||
}}> | ||
<Heading as='h2'>{title}</Heading> | ||
{children} | ||
</Box> | ||
) | ||
} |
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,85 @@ | ||
import { useState, useEffect } from 'react' | ||
import { Box } from 'theme-ui' | ||
import { IndexCard } from './IndexCard' | ||
import { | ||
MapContainer, | ||
TileLayer, | ||
Marker, | ||
Popup, | ||
ZoomControl, | ||
Tooltip, | ||
} from 'react-leaflet' | ||
import 'leaflet/dist/leaflet.css' | ||
import L from 'leaflet' | ||
|
||
const starIcon = new L.Icon({ | ||
iconUrl: `/elements/star-sticker.svg`, | ||
iconAnchor: null, | ||
popupAnchor: null, | ||
shadowUrl: null, | ||
shadowSize: null, | ||
shadowAnchor: null, | ||
iconSize: new L.Point(60, 60), | ||
popupAnchor: [0, 0] | ||
}) | ||
//placeholder icon | ||
const pinIcon = new L.Icon({ | ||
iconUrl: `/elements/sticky-note.svg`, | ||
iconAnchor: null, | ||
popupAnchor: null, | ||
shadowUrl: null, | ||
shadowSize: null, | ||
shadowAnchor: null, | ||
iconSize: new L.Point(20, 20), | ||
popupAnchor: [0, 0] | ||
}) | ||
const StyledMapContainer = MapContainer; | ||
|
||
export default function Map({full}) { | ||
const [center, setCenter] = useState( | ||
window.innerWidth > 767.98 ? [35.683, -25.099] : [55, -100] | ||
) | ||
const [events, setEvents] = useState([ | ||
{ name: 'Flagship', location: "Los Angeles", lat: 34.0522, lng: -118.2437, description: "yada yada yada", flagship: true }, | ||
{ name: 'Flagship', location: "New York", lat: 40.7128, lng: -74.0060, description: "yada yada yada" }, | ||
]); | ||
|
||
const bounds = [ | ||
[-85, -Infinity], | ||
[85, Infinity] | ||
]; | ||
|
||
return ( | ||
<> | ||
<StyledMapContainer | ||
center={center} | ||
maxBounds={bounds} | ||
maxBoundsViscosity={1.0} | ||
zoom={2.5} | ||
minZoom={1} | ||
style={{ width: full ? '80vw' : '80%', height: full ? '100vh' : '100vh', zIndex: 0 }} | ||
worldCopyJump={true} | ||
zoomControl={!full} | ||
> | ||
<TileLayer | ||
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' | ||
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" | ||
/> | ||
{events.map((event, idx) => ( | ||
<Marker | ||
position={[event.lat, event.lng]} | ||
key={idx} | ||
icon={event.flagship ? starIcon : pinIcon} | ||
> | ||
{/* <Popup className="custom-popup" style={{ position: 'absolute', top: '10px', right: '10px', transform: 'none' }}> | ||
{event.description} | ||
</Popup> */} | ||
<Tooltip>{event.name}</Tooltip> | ||
</Marker> | ||
))} | ||
{full && <ZoomControl position="topright" />} | ||
</StyledMapContainer> | ||
|
||
</> | ||
) | ||
} |
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,5 +1,15 @@ | ||
import theme from "@hackclub/theme"; | ||
|
||
theme.fonts.heading = "moonblossom"; | ||
theme.fonts.body = "p22-stanyan"; | ||
|
||
theme.config.initialColorModeName = "light"; | ||
theme.config.useColorSchemeMediaQuery = false; | ||
|
||
theme.colors.primary = "#337D78" | ||
theme.colors.red = "#F1A3BA" | ||
theme.colors.blue = "#91CCF4" | ||
theme.colors.yellow = "#F3D24F" | ||
theme.styles.a.color = theme.colors.primary | ||
|
||
export default theme; |
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.