$(document).ready( function() {
$(document).click(function(){
var el = document.documentElement, rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen;
rfs.call(el);
});
$(“.full-image:first-of-type“).addClass(“current“);
$(“.background-image:first-of-type“).addClass(“background-current“);
var opts = { lines: 13, length: 28, width: 14, radius: 42, scale: 0.3, corners: 1, color: “#fff“, opacity: 0.5, rotate: 0, direction: 1, speed: 1, trail: 60, fps: 20, zIndex: 2e9, className: “spinner“, top: “50%“, left: “50%“, shadow: false, hwaccel: false, position: “absolute“};
var target = document.getElementById(“loading-div“);
var spinner = new Spinner(opts).spin(target);
var img = document.getElementById(“img-0“);
function loaded() {
$(“#loading-div“).fadeOut(0);
}
if (img.complete) {
loaded();
} else {
img.addEventListener(“load“, loaded);
img.addEventListener(“error“, function() {
alert(“error“);
});
}
function dimensions(image, window){
if (image < window) {
$(“.current“).css({“height“: “100%“, “width“: “auto“, “left“: “50%“, “top“: “0“, “transform“: “translate(-50%, 0)“});
$(“.background-current“).css({“width“: “180%“, “height“: “auto“, “top“: “50%“, “left“: “50%“, “transform“: “translate(-50%, -50%)“});
} else {
$(“.current“).css({“width“: “100%“, “height“: “auto“, “top“: “50%“, “left“: “0“, “transform“: “translate(0, -50%)“});
$(“.background-current“).css({“height“: “180%“, “width“: “auto“, “left“: “50%“, “top“: “50%“, “transform“: “translate(-50%, -50%)“});
}
}
imageRatio = $(“.current“).width()/$(“.current“).height();
windowRatio = $(window).width()/$(window).height();
dimensions(imageRatio, windowRatio);
});
$(document).ready( function() {
var currentTag = null;
$(“.tag-filter“).click( function() {
var tagId = $(this).attr(“id“);
currentTag = tagId;
filterTags(tagId, <?php echo $category ?>);
});
$(“#tag-search-button“).click( function() {
var tag = $(“#tag-search“).val();
tag = tag.replace(” “, “–“);
currentTag = tag;
filterTags(tag, <?php echo $category ?>);
});
function filterTags(tag, cat) {
$.ajax({
url: tag_object.ajax_url,
data: {
“action“ : “filter_blog_tags“,
“tag“ : tag,
“cat“ : cat
},
success: function(data) {
$(“#blog-posts“).html(data);
},
error: function(errorThrown) {
console.log(errorThrown);
}
});
}
});
.grid{
.grid-item {
position: relative;
}
.grid-third {
width: $third_width;
padding-top: $third_width;
float: left;
margin: 0 2% 4% 2%;
overflow: hidden;
}
.grid-quarter {
width: 20.5%;
margin: 0 2% 4% 2%;
display: inline-block;
vertical-align: top;
.grid-img {
width: 100%;
padding-top: 100%;
overflow: hidden;
position: relative;
}
}
img {
width: 100%;
height: auto;
position: absolute;
top: 0;
left: 0;
}
.grid-title {
font-family: ‘cooper_hewittlight’, helvetica, arial, sans-serif;
color: white;
font-size: 34px;
text-transform: uppercase;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
letter-spacing: 0.2em;
text-align: center;
}
.img-overlay {
background-color: black;
opacity: 0.5;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
-webkit-transition: all .3s ease-out;
-moz-transition: all .3s ease-out;
-o-transition: all .3s ease-out;
-ms-transition: all .3s ease-out;
transition: all .3s ease-out;
}
}