This website is a part of our final year project at ENSAD. We decide to share the source code, and documentate it.
- Projects organization by country
- Projects are draggable in the country containment
- Projects are filtrables with checkbox filters
- JQuery
- jquery.cookie.js -> https://github.com/carhartl/jquery-cookie
- firstImpression.js -> https://github.com/robflaherty/firstImpression.js/tree/master
- Typeface : Old Standard TT -> http://www.fontsquirrel.com/fonts/Old-Standard-TT
var div = document.createElement('div');
div.className = "france-wrapper";
$('.projets').append(div);
$('.france').each(function() {
$(div).append($(this));
});
$(".france-wrapper").append('<p class="pays">France</p>');
$(".france-wrapper li").each(
function(intIndex) {
var l = Math.floor(Math.random() * $(".france-wrapper").width());
var t = Math.floor(Math.random() * $(".france-wrapper").height());
$(this).css("left", l);
$(this).css("top", t);
});
var a = 3;
$(".france-wrapper li").draggable({
containment: ".france-wrapper",
start: function(event, ui) { $(this).css("z-index", a++); }
});
if ( firstImpression() ) {
$('.intro-text').css('display','block');
}
else {
$('.intro-text').css('display','none');
}
});
$('div.tags').delegate('input[type=checkbox]', 'change', function()
{
var $lis = $('.projets > div > li'),
$checked = $('input:checked');
if ($checked.length) {
var selector = $checked.map(function(){
return '.' + $(this).attr('rel');
}).get().join('');
$lis.hide().filter(selector).show();
}
else {
$lis.show();
}
});