Skip to content
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

added photo grids for album/photo galleries #3

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Grid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React, { Component } from 'react';
import Photo from './Photo.js';

class Grid extends Component {
render() {
const gridElements = this.props.urls.map((grid) =>
<Photo src={grid.url} name={grid.name} className="grid__photo"/>
);

return (
<div className={this.props.className}>{gridElements}</div>
);
}
}

export default Grid;
16 changes: 16 additions & 0 deletions src/Photo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React, { Component } from 'react';

class Photo extends Component {
render() {
return (
<div className={this.props.className}>
<img src={this.props.src}/>
<div className="label">
{this.props.name}
</div>
</div>
)
}
}

export default Photo;
Binary file added src/img/2011.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions src/pages/Album.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React, { Component } from 'react';
import Grid from '../Grid.js';
import '../styles/Album.css';

const items = [
{ name: '2017-2018', url: 'http://www.dogbreedslist.info/uploads/allimg/dog-pictures/Samoyed-2.jpg' },
{ name: '2016-2017', url: 'http://cdn.akc.org/Marketplace/Breeds/Pembroke_Welsh_Corgi_SERP.jpg' },
{ name: '2015-2016', url: 'https://i.ytimg.com/vi/wRx3Uvcktm8/maxresdefault.jpg' }
];

const items1 = [
{ name: '2014-2015', url: 'https://www.thelabradorsite.com/wp-content/uploads/2015/07/yellow-labrador-puppy-garden.jpg' },
{ name: '2013-2014', url: 'https://cdn.marketplace.akc.org/media/45488/1456977861_4573_8635.jpg' },
];

class Album extends Component {
render() {
return(
<div>
<div className="title">ALBUMS</div>
<Grid className="album__grid" urls={items} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you structure your Grid component so that it represents an entire grid, and not just a row?

<Grid className="album__grid" urls={items1} />
</div>
)
}
}

export default Album;
28 changes: 28 additions & 0 deletions src/pages/Events.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React, { Component } from 'react';
import Grid from '../Grid.js';
import '../styles/Events.css';

const items = [
{ name: 'First General Meeting', url: 'http://www.dogbreedslist.info/uploads/allimg/dog-pictures/Samoyed-2.jpg' },
{ name: 'Big C Hike + Pieology', url: 'http://cdn.akc.org/Marketplace/Breeds/Pembroke_Welsh_Corgi_SERP.jpg' },
{ name: '2nd General Meeting', url: 'https://i.ytimg.com/vi/wRx3Uvcktm8/maxresdefault.jpg' }
];

const items1 = [
{ name: 'Guide Dogs for the Blind', url: 'https://www.thelabradorsite.com/wp-content/uploads/2015/07/yellow-labrador-puppy-garden.jpg' },
{ name: 'Go Bears', url: 'https://cdn.marketplace.akc.org/media/45488/1456977861_4573_8635.jpg' },
];

class Events extends Component {
render() {
return(
<div>
<div className="title">2015-2016</div>
<Grid className="album__grid" urls={items} />
<Grid className="album__grid" urls={items1} />
</div>
)
}
}

export default Events;
29 changes: 29 additions & 0 deletions src/pages/Gallery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React, { Component } from 'react';
import Grid from '../Grid.js';
import '../styles/Gallery.css';

const items = [
{ url: 'http://www.dogbreedslist.info/uploads/allimg/dog-pictures/Samoyed-2.jpg' },
{ url: 'http://cdn.akc.org/Marketplace/Breeds/Pembroke_Welsh_Corgi_SERP.jpg' },
{ url: 'https://i.ytimg.com/vi/wRx3Uvcktm8/maxresdefault.jpg' }
];

const items1 = [
{ url: 'https://www.thelabradorsite.com/wp-content/uploads/2015/07/yellow-labrador-puppy-garden.jpg' },
{ url: 'https://cdn.marketplace.akc.org/media/45488/1456977861_4573_8635.jpg' },
{ url: 'https://cdn.marketplace.akc.org/media/45488/1456977861_4573_8635.jpg' }
];

class Gallery extends Component {
render() {
return(
<div>
<div className="title">PUMPKIN CARVING SOCIAL [FALL 2014]</div>
<Grid className="gallery__grid" urls={items} />
<Grid className="gallery__grid" urls={items1} />
</div>
)
}
}

export default Gallery;
33 changes: 33 additions & 0 deletions src/styles/css/album.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro");
* {
box-sizing: border-box; }

body {
margin: 0;
padding: 0; }

.album__grid {
margin: auto;
max-width: 1200px; }
.album__grid .grid__photo {
width: 33%;
height: 350px;
display: inline-block;
margin-bottom: 70px;
padding: 25px;
vertical-align: top; }
.album__grid .grid__photo img {
width: 100%;
height: 100%;
object-fit: cover; }
.album__grid .grid__photo img:hover {
opacity: 0.5;
transition: 0.5s;
cursor: pointer; }
.album__grid .grid__photo .label {
font-family: 'Source Sans Pro', sans-serif;
border-bottom: 2.5px solid #424242;
padding-top: 11px;
padding-bottom: 7px;
font-size: 20px;
color: #424242; }
33 changes: 33 additions & 0 deletions src/styles/css/events.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro");
* {
box-sizing: border-box; }

body {
margin: 0;
padding: 0; }

.album__grid {
margin: auto;
max-width: 1200px; }
.album__grid .grid__photo {
width: 33%;
height: 350px;
display: inline-block;
margin-bottom: 70px;
padding: 25px;
vertical-align: top; }
.album__grid .grid__photo img {
width: 100%;
height: 100%;
object-fit: cover; }
.album__grid .grid__photo img:hover {
opacity: 0.5;
transition: 0.5s;
cursor: pointer; }
.album__grid .grid__photo .label {
font-family: 'Source Sans Pro', sans-serif;
border-bottom: 2.5px solid #424242;
padding-top: 11px;
padding-bottom: 7px;
font-size: 20px;
color: #424242; }
33 changes: 33 additions & 0 deletions src/styles/css/gallery.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro");
* {
box-sizing: border-box; }

body {
margin: 0;
padding: 0; }

.title {
margin-top: 30px;
text-align: center;
font-family: 'Source Sans Pro', sans-serif;
font-size: 30px;
color: #424242; }

.gallery__grid {
margin: auto;
max-width: 1200px;
margin-top: 10px; }
.gallery__grid .grid__photo {
width: 33%;
height: 275px;
display: inline-block;
padding: 20px; }
.gallery__grid .grid__photo img {
width: 100%;
height: 100%;
object-fit: cover;
vertical-align: top; }
.gallery__grid .grid__photo img:hover {
opacity: 0.5;
transition: 0.5s;
cursor: pointer; }
45 changes: 45 additions & 0 deletions src/styles/scss/album.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro');

* {
box-sizing: border-box;
}

body {
margin: 0;
padding: 0;
}

.album__grid {
margin: auto;
max-width: 1200px;
.grid__photo {
width: 33%;
height: 350px;
display: inline-block;
margin-bottom: 70px;
padding: 25px;
vertical-align: top;
img {
width: 100%;
height: 100%;
object-fit: cover;
}

img:hover {
opacity: 0.5;
transition: 0.5s;
cursor: pointer;
}

.label {
font-family: 'Source Sans Pro', sans-serif;
// text-align: center;
border-bottom: 2.5px solid #424242;
padding-top: 11px;
padding-bottom: 7px;
font-size: 20px;
color: #424242;
}
}

}
45 changes: 45 additions & 0 deletions src/styles/scss/events.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro');

* {
box-sizing: border-box;
}

body {
margin: 0;
padding: 0;
}

.album__grid {
margin: auto;
max-width: 1200px;
.grid__photo {
width: 33%;
height: 350px;
display: inline-block;
margin-bottom: 70px;
padding: 25px;
vertical-align: top;
img {
width: 100%;
height: 100%;
object-fit: cover;
}

img:hover {
opacity: 0.5;
transition: 0.5s;
cursor: pointer;
}

.label {
font-family: 'Source Sans Pro', sans-serif;
// text-align: center;
border-bottom: 2.5px solid #424242;
padding-top: 11px;
padding-bottom: 7px;
font-size: 20px;
color: #424242;
}
}

}
44 changes: 44 additions & 0 deletions src/styles/scss/gallery.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro');

* {
box-sizing: border-box;
}

body {
margin: 0;
padding: 0;
}

.title {
margin-top: 30px;
text-align: center;
font-family: 'Source Sans Pro', sans-serif;
font-size: 30px;
color: #424242;
}

.gallery__grid {
margin: auto;
max-width: 1200px;
margin-top: 10px;
.grid__photo {
width: 33%;
height: 275px;
display: inline-block;
padding: 20px;
img {
width: 100%;
height: 100%;
object-fit: cover;
// margin-left: 15px;
// margin-right: 15px;
vertical-align: top;
}

img:hover {
opacity: 0.5;
transition: 0.5s;
cursor: pointer;
}
}
}
2 changes: 0 additions & 2 deletions src/styles/scss/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Then import those files here.
// This scss file will be compiled to index.css.
// index.css is imported in index.js and will apply styles to everything.

.App {
font-family: Helvetica;

}