@ -1,24 +1,47 @@
import "./ProjectGrid.scss" ;
import "./ProjectGrid.scss" ;
import Masonry from "masonry-layout" ;
import Masonry from "masonry-layout" ;
import { useEffect } from "react" ;
type GridElementImageProps = {
image_url : string ;
image_alt : string ;
title : string ;
text : string ;
} ;
type GridElementProps = {
type GridElementProps = {
image_url : string ;
image_url : string ;
image_alt : string ;
image_alt : string ;
title : string ;
text : string ;
text : string ;
} ;
} ;
const OneByOneGridElement = ( {
const OneWide = ( { title , text } : GridElementProps ) = > {
return (
< div className = { "OneByOne GridElement" } >
< div className = { "title" } >
< h2 > { title } < / h2 >
< / div >
< div className = { "description" } >
< p > { text } < / p >
< / div >
< / div >
) ;
} ;
const OneWidePic = ( {
image_url ,
image_url ,
image_alt ,
image_alt ,
title ,
text ,
text ,
} : GridElementProps ) = > {
} : GridElement Image Props) = > {
return (
return (
< div className = { "OneByOneGridElement" } >
< div className = { "OneByOne GridElement"} >
< div className = { "image" } >
< div className = { "image" } >
< img src = { image_url } alt = { image_alt } / >
< img src = { image_url } alt = { image_alt } / >
< / div >
< / div >
< div className = { "description" } >
< div className = { "description" } >
< h2 > { title } < / h2 >
< p > { text } < / p >
< p > { text } < / p >
< / div >
< / div >
< / div >
< / div >
@ -28,14 +51,17 @@ const OneByOneGridElement = ({
const FourByOneGridElement = ( {
const FourByOneGridElement = ( {
image_url ,
image_url ,
image_alt ,
image_alt ,
title ,
text ,
text ,
} : GridElement Props) = > {
} : GridElement Image Props) = > {
return (
return (
< div className = { "FourByOne GridElement"} >
< div className = { "FourByOne GridElement"} >
< div className = { "image" } >
< div className = { "image" } >
< img src = { image_url } alt = { image_alt } / >
< img src = { image_url } alt = { image_alt } / >
< / div >
< / div >
< div className = { "description" } >
< div className = { "description" } >
< h2 > { title } < / h2 >
< p > { text } < / p >
< p > { text } < / p >
< / div >
< / div >
< / div >
< / div >
@ -43,34 +69,50 @@ const FourByOneGridElement = ({
} ;
} ;
export const ProjectGrid = ( ) = > {
export const ProjectGrid = ( ) = > {
useEffect ( ( ) = > {
var elem = document . querySelector ( "#project-grid" ) ;
// @ts-ignore
var msnry = new Masonry ( elem , {
itemSelector : ".GridElement" ,
gutter : 5 ,
columnWidth : ".GridSizer" ,
percentPosition : true ,
} ) ;
} ) ;
return (
return (
< div id = { "project-grid-parent" } >
< div id = { "project-grid" } >
< div id = { "project-grid" } >
< OneByOneGridElement
< div className = { "GridSizer" } / >
< OneWidePic
image_url = { "http://jakecover.me/images/codedaysd.png" }
image_url = { "http://jakecover.me/images/codedaysd.png" }
image_alt = { "CodeDay San Diego Logo" }
image_alt = { "CodeDay San Diego Logo" }
title = { "CodeDay" }
text = {
text = {
"CodeDay, an event by SRND, is a beginner-friendly 24 hour event for students that challenges\n attendees to create a game or an app."
"CodeDay, an event by SRND, is a beginner-friendly 24 hour event for students that challenges\n attendees to create a game or an app."
}
}
/ >
/ >
< OneByOneGridElement
< OneWidePic
image_url = { "http://jakecover.me/images/codedaysd.png" }
image_url = { "http://jakecover.me/images/codedaysd.png" }
image_alt = { "CodeDay San Diego Logo" }
image_alt = { "CodeDay San Diego Logo" }
title = { "CodeDay" }
text = {
text = {
"CodeDay, an event by SRND, is a beginner-friendly 24 hour event for students that challenges\n attendees to create a game or an app."
"CodeDay, an event by SRND, is a beginner-friendly 24 hour event for students that challenges\n attendees to create a game or an app."
}
}
/ >
/ >
< OneByOneGridElement
< OneWidePic
image_url = { "http://jakecover.me/images/codedaysd.png" }
image_url = { "http://jakecover.me/images/codedaysd.png" }
image_alt = { "CodeDay San Diego Logo" }
image_alt = { "CodeDay San Diego Logo" }
title = { "CodeDay" }
text = {
text = {
"CodeDay, an event by SRND, is a beginner-friendly 24 hour event for students that challenges\n attendees to create a game or an app."
"CodeDay, an event by SRND, is a beginner-friendly 24 hour event for students that challenges\n attendees to create a game or an app."
}
}
/ >
/ >
< OneByOneGridElement
< OneWidePic
image_url = { "http://jakecover.me/images/codedaysd.png" }
image_url = { "http://jakecover.me/images/codedaysd.png" }
image_alt = { "CodeDay San Diego Logo" }
image_alt = { "CodeDay San Diego Logo" }
title = { "CodeDay" }
text = {
text = {
"CodeDay, an event by SRND, is a beginner-friendly 24 hour event for students that challenges\n attendees to create a game or an app."
"CodeDay, an event by SRND, is a beginner-friendly 24 hour event for students that challenges\n attendees to create a game or an app."
}
}
@ -78,10 +120,53 @@ export const ProjectGrid = () => {
< FourByOneGridElement
< FourByOneGridElement
image_url = { "http://jakecover.me/images/foresightsports.png" }
image_url = { "http://jakecover.me/images/foresightsports.png" }
image_alt = { "Foresight Sports Logo" }
image_alt = { "Foresight Sports Logo" }
title = { "Foresight Sports" }
text = {
text = {
"Foresight Sports creates advanced augmented reality sports experiences. I created multiple games using Unity that took data from their launch monitor technology and translated it into a seamless experience."
"Foresight Sports creates advanced augmented reality sports experiences. I created multiple games using Unity that took data from their launch monitor technology and translated it into a seamless experience."
}
}
/ >
/ >
< OneWidePic
image_url = { "http://jakecover.me/images/codedaysd.png" }
image_alt = { "CodeDay San Diego Logo" }
title = { "CodeDay" }
text = {
"CodeDay, an event by SRND, is a beginner-friendly 24 hour event for students that challenges\n attendees to create a game or an app."
}
/ >
< OneWidePic
image_url = { "http://jakecover.me/images/codedaysd.png" }
image_alt = { "CodeDay San Diego Logo" }
title = { "CodeDay" }
text = {
"CodeDay, an event by SRND, is a beginner-friendly 24 hour event for students that challenges\n attendees to create a game or an app."
}
/ >
< OneWidePic
image_url = { "http://jakecover.me/images/codedaysd.png" }
image_alt = { "CodeDay San Diego Logo" }
title = { "CodeDay" }
text = {
"CodeDay, an event by SRND, is a beginner-friendly 24 hour event for students that challenges\n attendees to create a game or an app."
}
/ >
< OneWidePic
image_url = { "http://jakecover.me/images/codedaysd.png" }
image_alt = { "CodeDay San Diego Logo" }
title = { "CodeDay" }
text = {
"CodeDay, an event by SRND, is a beginner-friendly 24 hour event for students that challenges\n attendees to create a game or an app."
}
/ >
< OneWidePic
image_url = { "http://jakecover.me/images/codedaysd.png" }
image_alt = { "CodeDay San Diego Logo" }
title = { "CodeDay" }
text = {
"CodeDay, an event by SRND, is a beginner-friendly 24 hour event for students that challenges\n attendees to create a game or an app."
}
/ >
< / div >
< / div >
< / div >
) ;
) ;
} ;
} ;