Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
FernandoDoming committed Nov 28, 2016
2 parents 64d61b5 + 86f079c commit 99e8d56
Show file tree
Hide file tree
Showing 5 changed files with 204 additions and 59 deletions.
50 changes: 29 additions & 21 deletions _config.yml
Expand Up @@ -178,27 +178,35 @@ technologies:
icon: 'techs/r2.png'

gallery:
- name: Lorem ipsum
thumb: https://images.unsplash.com/photo-1471070855862-324d571a1857?dpr=1&auto=format&fit=crop&w=800&h=600&q=80&cs=tinysrgb&crop=
src: https://images.unsplash.com/photo-1471070855862-324d571a1857?dpr=1&auto=format&fit=crop&w=1600&h=1200&q=80&cs=tinysrgb&crop=
description: "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste amet eum eligendi
ut officiis totam rem cum ducimus quam quisquam ipsum adipisci quaerat fugiat odio,
doloremque tempora, reprehenderit accusantium quas."
- name: Lorem ipsum
thumb: https://images.unsplash.com/photo-1452127308952-47a699216fc5?dpr=1&auto=format&fit=crop&w=400&h=400&q=80&cs=tinysrgb&crop=
src: https://images.unsplash.com/photo-1452127308952-47a699216fc5?dpr=1&auto=format&fit=crop&w=1200&h=1200&q=80&cs=tinysrgb&crop=
- name: Lorem ipsum
thumb: https://images.unsplash.com/photo-1467642511314-5699547ddf30?dpr=1&auto=format&fit=crop&w=400&h=600&q=80&cs=tinysrgb&crop=
src: https://images.unsplash.com/photo-1467642511314-5699547ddf30?dpr=1&auto=format&fit=crop&w=800&h=1200&q=80&cs=tinysrgb&crop=
- name: Lorem ipsum
thumb: https://images.unsplash.com/photo-1414433473172-dc6afb63e4ba?dpr=1&auto=format&fit=crop&w=300&h=200&q=80&cs=tinysrgb&crop=
src: https://images.unsplash.com/photo-1414433473172-dc6afb63e4ba?dpr=1&auto=format&fit=crop&w=1200&h=800&q=80&cs=tinysrgb&crop=
- name: Lorem ipsum
thumb: https://images.unsplash.com/photo-1476231682828-37e571bc172f?dpr=1&auto=format&fit=crop&w=450&h=620&q=80&cs=tinysrgb&crop=
src: https://images.unsplash.com/photo-1476231682828-37e571bc172f?dpr=1&auto=format&fit=crop&w=900&h=1240&q=80&cs=tinysrgb&crop=
- name: Lorem ipsum
thumb: https://images.unsplash.com/photo-1468224970805-92d72c619545?dpr=1&auto=format&fit=crop&w=580&h=400&q=80&cs=tinysrgb&crop=
src: https://images.unsplash.com/photo-1468224970805-92d72c619545?dpr=1&auto=format&fit=crop&w=1160&h=800&q=80&cs=tinysrgb&crop=
- category: 'Projects'
images:
- name: 'Yucca'
src: 'https://images.unsplash.com/photo-1476365518243-f738bf58443d?dpr=2&auto=format&fit=crop&w=500&h=800&q=80&cs=tinysrgb&crop='
description: 'Yucca is an awesome open-source jekyll theme.'
link: 'https://github.com/FernandoDoming/yucca'
- category: 'Photography'
images:
- name: Lorem ipsum
thumb: https://images.unsplash.com/photo-1471070855862-324d571a1857?dpr=1&auto=format&fit=crop&w=800&h=600&q=80&cs=tinysrgb&crop=
src: https://images.unsplash.com/photo-1471070855862-324d571a1857?dpr=1&auto=format&fit=crop&w=1600&h=1200&q=80&cs=tinysrgb&crop=
description: "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste amet eum eligendi
ut officiis totam rem cum ducimus quam quisquam ipsum adipisci quaerat fugiat odio,
doloremque tempora, reprehenderit accusantium quas."
- name: Lorem ipsum
thumb: https://images.unsplash.com/photo-1452127308952-47a699216fc5?dpr=1&auto=format&fit=crop&w=400&h=400&q=80&cs=tinysrgb&crop=
src: https://images.unsplash.com/photo-1452127308952-47a699216fc5?dpr=1&auto=format&fit=crop&w=1200&h=1200&q=80&cs=tinysrgb&crop=
- name: Lorem ipsum
thumb: https://images.unsplash.com/photo-1467642511314-5699547ddf30?dpr=1&auto=format&fit=crop&w=400&h=600&q=80&cs=tinysrgb&crop=
src: https://images.unsplash.com/photo-1467642511314-5699547ddf30?dpr=1&auto=format&fit=crop&w=800&h=1200&q=80&cs=tinysrgb&crop=
- name: Lorem ipsum
thumb: https://images.unsplash.com/photo-1414433473172-dc6afb63e4ba?dpr=1&auto=format&fit=crop&w=300&h=200&q=80&cs=tinysrgb&crop=
src: https://images.unsplash.com/photo-1414433473172-dc6afb63e4ba?dpr=1&auto=format&fit=crop&w=1200&h=800&q=80&cs=tinysrgb&crop=
- name: Lorem ipsum
thumb: https://images.unsplash.com/photo-1476231682828-37e571bc172f?dpr=1&auto=format&fit=crop&w=450&h=620&q=80&cs=tinysrgb&crop=
src: https://images.unsplash.com/photo-1476231682828-37e571bc172f?dpr=1&auto=format&fit=crop&w=900&h=1240&q=80&cs=tinysrgb&crop=
- name: Lorem ipsum
thumb: https://images.unsplash.com/photo-1468224970805-92d72c619545?dpr=1&auto=format&fit=crop&w=580&h=400&q=80&cs=tinysrgb&crop=
src: https://images.unsplash.com/photo-1468224970805-92d72c619545?dpr=1&auto=format&fit=crop&w=1160&h=800&q=80&cs=tinysrgb&crop=

certifications:
- name: 'My certification 1'
Expand Down
48 changes: 17 additions & 31 deletions _includes/gallery.html
@@ -1,40 +1,26 @@
<div id="gallery" class="section">
<h3>Gallery</h3>
<div class="gallery">
<div class="row">
{% for img in site.gallery %}
<figure class="">
<span class="close">&#10799;</span>
<span class="img-wrapper">
<img src="{{ img.thumb }}" srcset="{{ img.src }} 500w" alt="{{ img.name }}">
</span>
<div class="info">
<div class="wrapper">
<div class="title">{{ img.name }}</div>
<div class="description">
{{ img.description }}
</div>
</div>
</div>
</figure>
<ul class="categories">
<li class="active">All</li>
{% for item in site.gallery %}
<li>{{ item.category }}</li>
{% endfor %}
</div>
</ul>
{% for item in site.gallery %}
<div id="{{ item.category }}" class="category-container">
<h4 class="category">{{ item.category }}</h4>
<hr>
<div class="row">
{% for img in item.images %}
{% include image.html img=img %}
{% endfor %}
</div> <!-- /.row -->
</div> <!-- /.category-container -->
{% endfor %}
</div>
</div>

<script>
$container = $('.gallery .row');
$container.imagesLoaded(function () {
$container.masonry({
itemSelector: 'figure'
});
});

$container.find('figure').on('click', function () {
$(this).addClass('open');
});

$(document).on('click', 'figure.open .close', function () {
$(this).parent('figure.open').removeClass('open');
});
{% include gallery.js %}
</script>
31 changes: 31 additions & 0 deletions _includes/gallery.js
@@ -0,0 +1,31 @@
var $container = $('.gallery .row');
$container.imagesLoaded(function () {
$container.masonry({
itemSelector: 'figure'
});
});

$container.find('figure').on('click', function () {
$(this).addClass('open');
});

$(document).on('click', 'figure.open .close', function () {
$(this).parent('figure.open').removeClass('open');
});

var $categories = $('.gallery ul.categories');
$categories.find('li').click(function () {
$categories.find('li.active').removeClass('active');
$(this).addClass('active');
filterCategory( $(this).text() );
});

function filterCategory(category) {
var $gallery = $('.gallery');

$gallery.find('.category-container').removeClass('hide');
if (category != 'All') {
$gallery.find('.category-container:not(#' + category + ')')
.addClass('hide');
}
}
27 changes: 27 additions & 0 deletions _includes/image.html
@@ -0,0 +1,27 @@
<figure>
<span class="close">&#10799;</span>
<span class="img-wrapper">
<img src="{% if img.thumb %}
{{ img.thumb }}
{% else %}
{{ img.src }}
{% endif%}"
srcset="{{ img.src }} 500w" alt="{{ img.name }}">
</span>
<div class="info">
<div class="wrapper">
<div style="width: 100%;">
<div class="title">{{ img.name }}</div>
<hr>
</div>
<div class="description">
{{ img.description }}
</div>
{% if img.link %}
<div>
<a class="more-info" href="{{ img.link }}" target="_blank">Learn more</a>
</div>
{% endif %}
</div> <!-- /.wrapper -->
</div> <!-- /.info -->
</figure>
107 changes: 100 additions & 7 deletions _scss/gallery.scss
@@ -1,12 +1,56 @@
.gallery {

ul.categories {
width: 100%;
display: block;
list-style: none;
font-family: 'Scope One';
text-align: center;

li {
display: inline;
padding: 5px 10px;
border-radius: 2px;
cursor: pointer;
transition: color 300ms, background-color 300ms;

&:hover {
color: $accent;
}

&.active {
color: $accent;
background-color: $muted;
}
}
}

.category-container:not(:first-child) {
margin-top: 25px;
}

.category {
font-family: 'Scope One';
font-weight: 500;
font-size: 22px;
text-align: center;
padding: 10px;
color: #989898;
margin: 0;

& + hr {
margin: 0 45% 30px 45%;
}
}

figure {
margin: 3px;
width: calc(50% - 10px);
display: inline-block;
position: relative;
cursor: zoom-in;

@media (max-width: $break-phone) {
@media (max-width: $break-phone-portrait) {
width: 100%;
}

Expand All @@ -32,6 +76,11 @@
display: inline-flex;
align-items: center;

@media (max-width: $break-phone-portrait) {
width: 100%;
height: 70%;
}

img {
max-width: 100%;
max-height: 100%;
Expand All @@ -55,6 +104,16 @@
background-color: #333;
color: lighten($muted, 30%);

@media (max-width: $break-phone-portrait) {
display: block;
width: 100%;
padding: 10px;
}

hr {
border-top-color: lighten($muted, 30%);
}

.wrapper {
display: inline-block;
height: auto;
Expand All @@ -67,6 +126,10 @@
.description {
display: block;
}

a.more-info {
display: inline-block;
}
}
}

Expand All @@ -75,8 +138,8 @@
position: absolute;
top: 0;
right: 0;
font-size: 34px;
padding: 15px 20px;
font-size: 40px;
padding: 0 20px;
color: white;
font-weight: 100;
font-family: 'Roboto';
Expand All @@ -88,6 +151,7 @@
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
align-items: center;
padding: 0 40px;
}
Expand Down Expand Up @@ -115,18 +179,47 @@
text-transform: uppercase;
}

hr {
margin: 20px 35%;
border-top: 2px solid darken($muted, 60%);

@media (max-width: $break-phone-portrait) {
margin: 10px 45%;
}
}

.description {
display: none;
text-align: justify;
margin-top: 20px;
text-align: right;
margin: 20px 0;
font-family: 'Playfair Display';
font-style: italic;
font-style: normal;
font-size: 15px;

@media (max-width: $break-phone-portrait) {
margin: 0;
}
}

a.more-info {
margin-top: 10px;
display: none;
font-family: 'Roboto';
font-weight: 700;
border: 2px solid lighten($accent, 10%);
color: lighten($accent, 10%);
padding: 10px 15px;
text-decoration: none;
transition: background-color 300ms;

&:hover {
background-color: rgba(lighten($accent, 20%), .15);
}
}
}

&:hover .info {
opacity: 1;
}
}
}
}

0 comments on commit 99e8d56

Please sign in to comment.