Create project grid items

This commit is contained in:
Tanner Collin 2018-07-28 08:04:29 -06:00
parent 1bc64552c0
commit 2ce4389ce7
9 changed files with 147 additions and 19 deletions

View File

@ -3,5 +3,8 @@
} }
body { body {
font-family: sans-serif; line-height: 1.6;
font-size: 1.125rem;
color: #333;
background-color: #F9F9F9;
} }

View File

@ -5,7 +5,7 @@
} }
.grid-item { .grid-item {
background: linear-gradient(135deg, #87e0fd 0%,#53cbf1 40%,#05abe0 100%); //background: linear-gradient(135deg, #87e0fd 0%,#53cbf1 40%,#05abe0 100%);
position: relative; position: relative;
float: left; float: left;
@ -23,6 +23,79 @@
padding: 1rem; padding: 1rem;
} }
.menu {
display: flex;
flex-flow: column;
}
.menu .logo {
width: 100%;
padding: 1rem 5rem 0;
}
.menu section {
display: flex;
min-height: 0;
}
.menu aside {
flex: 1;
align-self: center;
text-align: right;
}
.menu .mug {
height: 100%;
padding: 2rem;
}
.project {
display: flex;
flex-flow: column;
}
.project header {
font-size: 2.25rem;
line-height: 1.2;
}
.project section {
min-height: 0;
flex: 1;
display: flex;
}
.project footer {
display: flex;
justify-content: space-between;
margin: 0 1em;
font-size: 1rem;
font-family: monospace;
}
.project.bottom section {
flex-flow: column;
}
.project.left section p {
align-self: center;
}
.project.left section img {
height: 100%;
padding: 1rem;
}
.project.bottom section p {
margin-bottom: 1rem;
}
.project.bottom section img {
object-fit: contain;
min-height: 0;
padding: 1rem;
}
@media all and (max-width: 120rem) { @media all and (max-width: 120rem) {
.grid-item { .grid-item {
width: 25%; width: 25%;
@ -49,7 +122,7 @@
@media all and (max-width: 51rem) { @media all and (max-width: 51rem) {
.grid-container { .grid-container {
max-width: 34rem;; max-width: 34rem;
} }
.grid-item { .grid-item {
width: 100%; width: 100%;

View File

@ -4,29 +4,81 @@ import './Grid.css';
import logo from './logo.png'; import logo from './logo.png';
import GridItem from './GridItem'; import GridItem from './GridItem';
import tanner from './tanner.jpg';
import dress1 from './dress1.jpg';
import switch1 from './switch1.jpg';
import pump1 from './pump1.jpg';
import hand1 from './hand1.jpg';
//function importAll(r) {
// return r.keys().map(x => r(x));
//}
//const images = importAll(require.context('./images'));
class Grid extends React.Component { class Grid extends React.Component {
render() { render() {
return ( return (
<div className='grid-container'> <div className='grid-container'>
<GridItem> <GridItem type='menu'>
<img src={logo} className="Home-logo" alt="logo" /> <img src={logo} className='logo' alt='Tanner Collin logo' />
<p>Links</p> <section>
<p>Links</p> <aside>
<p>Links</p> <p>Home</p>
<p>Links</p> <p>Projects</p>
<p>Links</p> <p>Photograhy</p>
<p>Art</p>
<p>About</p>
<p>Contact</p>
</aside>
<img src={tanner} className='mug' alt='Picture of Tanner' />
</section>
<footer>More info or a .onion link.</footer>
</GridItem> </GridItem>
<GridItem> <GridItem type='project left'>
<h1>Project 1</h1> <header>LED Dress</header>
<section>
<p>A dress lit up with LEDs that act as twinkling stars. Seven act as The Big Dipper, and the rest twinkle randomly.</p>
<img src={dress1} alt='LED Dress thumbnail' />
</section>
<footer>
<p>Project (Hardware)</p>
<p>2018-10-11</p>
</footer>
</GridItem> </GridItem>
<GridItem> <GridItem type='project bottom'>
<h1>Project 2</h1> <header>Remote Control Lightswitch</header>
<section>
<img src={switch1} alt='Lightswitch thumbnail' />
<p>Custom circuit that lets me control a ceiling light over Wifi.</p>
</section>
<footer>
<p>Project (Hardware)</p>
<p>2018-10-11</p>
</footer>
</GridItem> </GridItem>
<GridItem> <GridItem type='project bottom'>
<h1>Project 3</h1> <header>Plant Waterer</header>
<section>
<img src={pump1} alt='Plant Waterer thumbnail' />
<p>Controller that waters my plant automatically every day.</p>
</section>
<footer>
<p>Project (Hardware)</p>
<p>2018-10-11</p>
</footer>
</GridItem> </GridItem>
<GridItem> <GridItem type='project left'>
<h1>Project 4</h1> <header>Hand of Ozymandias</header>
<section>
<p>Sculpture welded together out of scrap metal for practice.</p>
<img src={hand1} alt='Metal Hand thumbnail' />
</section>
<footer>
<p>Project (Hardware)</p>
<p>2018-10-11</p>
</footer>
</GridItem> </GridItem>
</div> </div>
); );

View File

@ -4,7 +4,7 @@ class GridItem extends React.Component {
render() { render() {
return ( return (
<div className='grid-item'> <div className='grid-item'>
<div className='grid-item-content'> <div className={'grid-item-content ' + this.props.type}>
{this.props.children} {this.props.children}
</div> </div>
</div> </div>

BIN
src/dress1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
src/hand1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
src/pump1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
src/switch1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 KiB

BIN
src/tanner.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB