Replace test site with skeleton of real site

This commit is contained in:
Thomas Busby
2018-06-19 20:28:18 +02:00
parent d0a98c54b3
commit 3a915fe040
71 changed files with 1922 additions and 152 deletions

41
static/js/projects.js Normal file
View File

@@ -0,0 +1,41 @@
(function($){
$(document).ready(function(){
$(document).on('click','.tag-filter',function(){
var $this = $(this);
$('span.tag-filter').removeClass("active");
$this.addClass("active");
$('.tag-group').children().each(function(){
if( $(this).data('tag') == $this.data('tag')){
$(this).addClass("active");
}
});
if( $(this).hasClass('all'))
$('.project-item').showAll();
else
$('.project-item').filterTags( $(this).data('tag') );
});
});
$.fn.extend({
filterTags: function(tagName) {
this.removeClass('not-show');
return this.each(function() {
var itemTagArray = JSON.parse( $(this).attr('data-tags') );
if($.inArray(tagName, itemTagArray) === -1){
$(this).addClass('not-show');
}
});
},
showAll: function(){
return this.each(function() {
if($(this).hasClass('not-show')){
$(this).removeClass('not-show');
}
});
}
});
})(jQuery)