mirror of
https://github.com/medialab-prado/datamad2017.git
synced 2025-06-07 14:01:29 +02:00
Schedule page
This commit is contained in:
parent
e7d34d963f
commit
5c8e326daa
67 changed files with 1384 additions and 11890 deletions
8
js/jquery.sticky-kit.min.js
vendored
Normal file
8
js/jquery.sticky-kit.min.js
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
/*
|
||||
Sticky-kit v1.0.4 | WTFPL | Leaf Corcoran 2014 | http://leafo.net
|
||||
*/
|
||||
(function(){var b,m;b=this.jQuery;m=b(window);b.fn.stick_in_parent=function(e){var u,n,f,s,B,l,C;null==e&&(e={});s=e.sticky_class;u=e.inner_scrolling;f=e.parent;n=e.offset_top;null==n&&(n=0);null==f&&(f=void 0);null==u&&(u=!0);null==s&&(s="is_stuck");B=function(a,e,l,v,y,p,t){var q,z,k,w,c,d,A,x,g,h;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);d=a.parent();null!=f&&(d=d.closest(f));if(!d.length)throw"failed to find stick parent";q=k=!1;g=b("<div />");g.css("position",a.css("position"));A=function(){var c,
|
||||
b;c=parseInt(d.css("border-top-width"),10);b=parseInt(d.css("padding-top"),10);e=parseInt(d.css("padding-bottom"),10);l=d.offset().top+c+b;v=d.height();c=k?(k=!1,q=!1,a.insertAfter(g).css({position:"",top:"",width:"",bottom:""}),g.detach(),!0):void 0;y=a.offset().top-parseInt(a.css("margin-top"),10)-n;p=a.outerHeight(!0);t=a.css("float");g.css({width:a.outerWidth(!0),height:p,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":t});if(c)return h()};A();if(p!==v)return w=void 0,
|
||||
c=n,h=function(){var b,h,r,f;r=m.scrollTop();null!=w&&(h=r-w);w=r;k?(f=r+p+c>v+l,q&&!f&&(q=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom")),r<y&&(k=!1,c=n,"left"!==t&&"right"!==t||a.insertAfter(g),g.detach(),b={position:"",width:"",top:""},a.css(b).removeClass(s).trigger("sticky_kit:unstick")),u&&(b=m.height(),p>b&&!q&&(c-=h,c=Math.max(b-p,c),c=Math.min(n,c),k&&a.css({top:c+"px"})))):r>y&&(k=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+
|
||||
"px":a.width()+"px",a.css(b).addClass(s).after(g),"left"!==t&&"right"!==t||g.append(a),a.trigger("sticky_kit:stick"));if(k&&(null==f&&(f=r+p+c>v+l),!q&&f))return q=!0,"static"===d.css("position")&&d.css({position:"relative"}),a.css({position:"absolute",bottom:e,top:"auto"}).trigger("sticky_kit:bottom")},x=function(){A();return h()},z=function(){m.off("scroll",h);b(document.body).off("sticky_kit:recalc",x);a.off("sticky_kit:detach",z);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:""});
|
||||
d.position("position","");if(k)return a.insertAfter(g).removeClass(s),g.remove()},m.on("touchmove",h),m.on("scroll",h),m.on("resize",x),b(document.body).on("sticky_kit:recalc",x),a.on("sticky_kit:detach",z),setTimeout(h,0)}};l=0;for(C=this.length;l<C;l++)e=this[l],B(b(e));return this}}).call(this);
|
|
@ -20,14 +20,20 @@
|
|||
}, 1000);
|
||||
});
|
||||
|
||||
|
||||
$('.stream-header').each(function() {
|
||||
var scheduleFirstSlotText = $(this).closest('.schedule-table').find('.slot').first().data('slotDetail');
|
||||
$(this).find('.slot-detail').html(scheduleFirstSlotText);
|
||||
});
|
||||
|
||||
|
||||
if ($(window).width() > 1500) {
|
||||
$('.effect-wrapper').each(function() {
|
||||
$(this).addClass('col-lg-3');
|
||||
});
|
||||
$('.effect-wrapper').addClass('col-lg-3');
|
||||
}
|
||||
if ($(window).width() < 768) {
|
||||
$('.animated').removeClass('animated').removeClass('hiding');
|
||||
$('.stat span').removeClass('timer');
|
||||
$('.timeslot-label').addClass('stick-label');
|
||||
}
|
||||
if ($(window).height() < 512) {
|
||||
$('#bottom-navlinks').removeClass('bottom-navlinks').addClass('bottom-navlinks-small');
|
||||
|
@ -41,8 +47,8 @@
|
|||
var scroll = $(this).scrollTop();
|
||||
var header = $('#top-header');
|
||||
var logo = $('#logo-header .logo');
|
||||
var src = logo.attr('src');
|
||||
var buyButton = $('#right-nav-button');
|
||||
var topOffset = header.height() + $('.stream-header').height();
|
||||
|
||||
if (scroll >= 100) {
|
||||
header.addClass('after-scroll');
|
||||
|
@ -57,6 +63,15 @@
|
|||
} else {
|
||||
buyButton.addClass('right-nav-button-hidden');
|
||||
}
|
||||
|
||||
$('.slot').each(function() {
|
||||
var currentPosition = $(this).offset().top - scroll;
|
||||
var offsetActivator = topOffset + $(this).find('.slot-title').height();
|
||||
|
||||
if(currentPosition <= offsetActivator && currentPosition >= 0) {
|
||||
$('.stream-header.sticky').find('.slot-detail').html($(this).data('slotDetail'));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(function() {
|
||||
|
@ -221,8 +236,8 @@
|
|||
container.removeClass('st-menu-open');
|
||||
$('body').css('overflow', 'auto');
|
||||
}
|
||||
generateSameHeight()
|
||||
}
|
||||
generateSameHeight();
|
||||
}
|
||||
var bottomNavLinks = $('#bottom-navlinks');
|
||||
if ($(window).height() < 512) {
|
||||
bottomNavLinks.removeClass('bottom-navlinks').addClass('bottom-navlinks-small');
|
||||
|
@ -231,6 +246,9 @@
|
|||
}
|
||||
if ($(window).width() < 768) {
|
||||
$('.same-height').css('height', '100%');
|
||||
$('.timeslot-label').addClass('stick-label');
|
||||
} else {
|
||||
$('.timeslot-label').removeClass('stick-label');
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -279,7 +297,6 @@
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
//Google plus
|
||||
function initGooglePlus() {
|
||||
var po = document.createElement('script');
|
||||
|
|
2
js/scripts.min.js
vendored
2
js/scripts.min.js
vendored
File diff suppressed because one or more lines are too long
245
js/waves.js
Normal file
245
js/waves.js
Normal file
|
@ -0,0 +1,245 @@
|
|||
|
||||
/*!
|
||||
* Waves v0.5.0
|
||||
* https://publicis-indonesia.github.io/Waves
|
||||
*
|
||||
* Copyright 2014 Publicis Metro Indonesia, PT. and other contributors
|
||||
* Released under the BSD license
|
||||
* https://github.com/publicis-indonesia/Waves/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
;(function(window) {
|
||||
'use strict';
|
||||
|
||||
var Waves = Waves || {};
|
||||
var $$ = document.querySelectorAll.bind(document);
|
||||
|
||||
// Find exact position of element
|
||||
function position(obj) {
|
||||
|
||||
var left = 0;
|
||||
var top = 0;
|
||||
|
||||
if (obj.offsetParent) {
|
||||
do {
|
||||
left += obj.offsetLeft;
|
||||
top += obj.offsetTop;
|
||||
} while (obj === obj.offsetParent);
|
||||
}
|
||||
|
||||
return {
|
||||
top: top,
|
||||
left: left
|
||||
};
|
||||
}
|
||||
|
||||
function convertStyle(obj) {
|
||||
|
||||
var style = '';
|
||||
|
||||
for (var a in obj) {
|
||||
if (obj.hasOwnProperty(a)) {
|
||||
style += (a + ':' + obj[a] + ';');
|
||||
}
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
var Effect = {
|
||||
|
||||
// Effect delay
|
||||
duration: 5000,
|
||||
|
||||
show: function(e) {
|
||||
console.log("show");
|
||||
|
||||
var el = this;
|
||||
|
||||
// Create ripple
|
||||
var ripple = document.createElement('div');
|
||||
ripple.className = 'waves-ripple';
|
||||
el.appendChild(ripple);
|
||||
|
||||
// Get click coordinate and element witdh
|
||||
var pos = position(el);
|
||||
var relativeY = (e.pageY - pos.top) - 45;
|
||||
var relativeX = (e.pageX - pos.left) - 45;
|
||||
var scale = 'scale('+((el.clientWidth / 100) * 2.5)+')';
|
||||
|
||||
// Attach data to element
|
||||
ripple.setAttribute('data-hold', Date.now());
|
||||
ripple.setAttribute('data-scale', scale);
|
||||
ripple.setAttribute('data-x', relativeX);
|
||||
ripple.setAttribute('data-y', relativeY);
|
||||
|
||||
// Set ripple position
|
||||
var rippleStyle = {
|
||||
'top': relativeY+'px',
|
||||
'left': relativeX+'px'
|
||||
};
|
||||
|
||||
ripple.className = ripple.className + ' waves-notransition';
|
||||
ripple.setAttribute('style', convertStyle(rippleStyle));
|
||||
ripple.className = ripple.className.replace('waves-notransition', '');
|
||||
|
||||
// Scale the ripple
|
||||
rippleStyle['-webkit-transform'] = scale;
|
||||
rippleStyle['-moz-transform'] = scale;
|
||||
rippleStyle['-ms-transform'] = scale;
|
||||
rippleStyle['-o-transform'] = scale;
|
||||
rippleStyle.transform = scale;
|
||||
rippleStyle.opacity = '1';
|
||||
|
||||
rippleStyle['-webkit-transition-duration'] = Effect.duration + 'ms';
|
||||
rippleStyle['-moz-transition-duration'] = Effect.duration + 'ms';
|
||||
rippleStyle['-o-transition-duration'] = Effect.duration + 'ms';
|
||||
rippleStyle['transition-duration'] = Effect.duration + 'ms';
|
||||
|
||||
ripple.setAttribute('style', convertStyle(rippleStyle));
|
||||
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
|
||||
var el = this;
|
||||
|
||||
var width = el.clientWidth * 1.4;
|
||||
|
||||
// Get first ripple
|
||||
var ripple = null;
|
||||
|
||||
var childrenLength = el.children.length;
|
||||
|
||||
for (var a = 0; a < childrenLength; a++) {
|
||||
if (el.children[a].className.indexOf('waves-ripple') !== -1) {
|
||||
ripple = el.children[a];
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ripple) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var relativeX = ripple.getAttribute('data-x');
|
||||
var relativeY = ripple.getAttribute('data-y');
|
||||
var scale = ripple.getAttribute('data-scale');
|
||||
|
||||
// Get delay beetween mousedown and mouse leave
|
||||
var diff = Date.now() - Number(ripple.getAttribute('data-hold'));
|
||||
var delay = 500 - diff;
|
||||
|
||||
if (delay < 0) {
|
||||
delay = 0;
|
||||
}
|
||||
|
||||
// Fade out ripple after delay
|
||||
setTimeout(function() {
|
||||
|
||||
var style = {
|
||||
'top': relativeY+'px',
|
||||
'left': relativeX+'px',
|
||||
'opacity': '0',
|
||||
|
||||
// Duration
|
||||
'-webkit-transition-duration': Effect.duration + 'ms',
|
||||
'-moz-transition-duration': Effect.duration + 'ms',
|
||||
'-o-transition-duration': Effect.duration + 'ms',
|
||||
'transition-duration': Effect.duration + 'ms',
|
||||
'-webkit-transform': scale,
|
||||
'-moz-transform': scale,
|
||||
'-ms-transform': scale,
|
||||
'-o-transform': scale,
|
||||
'transform': scale,
|
||||
};
|
||||
|
||||
ripple.setAttribute('style', convertStyle(style));
|
||||
|
||||
setTimeout(function() {
|
||||
|
||||
try {
|
||||
el.removeChild(ripple);
|
||||
} catch(e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}, Effect.duration);
|
||||
|
||||
}, delay);
|
||||
|
||||
},
|
||||
|
||||
// Little hack to make <input> can perform waves effect
|
||||
wrapInput: function(elements) {
|
||||
|
||||
for (var a = 0; a < elements.length; a++) {
|
||||
|
||||
var el = elements[a];
|
||||
|
||||
if (el.tagName.toLowerCase() === 'input') {
|
||||
|
||||
var parent = el.parentNode;
|
||||
|
||||
// If input already have parent just pass through
|
||||
if (parent.tagName.toLowerCase() === 'i' && parent.className.indexOf('waves-effect') !== -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Put element class and style to the specified parent
|
||||
var wrapper = document.createElement('i');
|
||||
wrapper.className = el.className + ' waves-input-wrapper';
|
||||
|
||||
var elementStyle = el.getAttribute('style');
|
||||
var dimensionStyle = 'width:'+el.offsetWidth+'px;height:'+el.clientHeight+'px;';
|
||||
|
||||
if (!elementStyle) {
|
||||
elementStyle = '';
|
||||
}
|
||||
|
||||
wrapper.setAttribute('style', dimensionStyle+elementStyle);
|
||||
|
||||
el.className = 'waves-button-input';
|
||||
el.removeAttribute('style');
|
||||
|
||||
// Put element as child
|
||||
parent.replaceChild(wrapper, el);
|
||||
wrapper.appendChild(el);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Waves.displayEffect = function(options) {
|
||||
console.log("init");
|
||||
|
||||
options = options || {};
|
||||
|
||||
if ('duration' in options) {
|
||||
Effect.duration = options.duration;
|
||||
}
|
||||
|
||||
//Wrap input inside <i> tag
|
||||
Effect.wrapInput($$('.waves-effect'));
|
||||
|
||||
Array.prototype.forEach.call($$('.waves-effect'), function(i) {
|
||||
|
||||
if (window.Touch) {
|
||||
i.addEventListener('touchstart', Effect.show, false);
|
||||
i.addEventListener('touchend', Effect.hide, false);
|
||||
}
|
||||
|
||||
i.addEventListener('mousedown', Effect.show, false);
|
||||
i.addEventListener('mouseup', Effect.hide, false);
|
||||
i.addEventListener('mouseleave', Effect.hide, false);
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
window.Waves = Waves;
|
||||
|
||||
})(window);
|
7
js/waves.min.js
vendored
7
js/waves.min.js
vendored
|
@ -1,9 +1,10 @@
|
|||
/*!
|
||||
* Waves v0.1.0
|
||||
* https://publicis-indonesia.github.io/Waves/
|
||||
* Waves v0.5.1
|
||||
* https://publicis-indonesia.github.io/Waves
|
||||
*
|
||||
* Copyright 2014 Publicis Metro Indonesia, PT. and other contributors
|
||||
* Released under the BSD license
|
||||
* https://github.com/publicis-indonesia/Waves/blob/master/LICENSE
|
||||
*/
|
||||
;(function(b,c){var a={};a.rippleShow=function(j){var i=c(this);i.append('<div class="waves-ripple"></div>');var k=i.offset();var h=(j.pageX-k.left);var f=(j.pageY-k.top);var g=i.outerWidth();i.data("hold",Date.now());i.data("relativeX",h);i.data("relativeY",f);var d=i.find(".waves-ripple");d.addClass("waves-notransition").css({top:f,left:h});d.context.offsetHeight;d.removeClass("waves-notransition").css({"border-width":g,"margin-top":-g,"margin-left":-g,opacity:1})};a.rippleHide=function(){var f=c(this);var d=f.find(".waves-ripple");var g=Date.now()-f.data("hold");var e=500-g;if(e<0){e=0}setTimeout(function(){d.css({top:f.data("relativeY"),left:f.data("relativeX"),opacity:0});setTimeout(function(){d.remove()},300)},e)};c(document).on("ready",function(){c(this).on("mousedown",".waves-element",a.rippleShow).on("mouseup mouseleave",".waves-element",a.rippleHide)})})(window,jQuery);
|
||||
!function(a){"use strict";function b(a){return null!==a&&a===a.window}function c(a){return b(a)?a:9===a.nodeType&&a.defaultView}function d(a){var b,d,e={top:0,left:0},f=a&&a.ownerDocument;return b=f.documentElement,"undefined"!=typeof a.getBoundingClientRect&&(e=a.getBoundingClientRect()),d=c(f),{top:e.top+d.pageYOffset-b.clientTop,left:e.left+d.pageXOffset-b.clientLeft}}function e(a){var b="";for(var c in a)a.hasOwnProperty(c)&&(b+=c+":"+a[c]+";");return b}var f=f||{},g=document.querySelectorAll.bind(document),h={duration:500,show:function(a){var b=this,c=document.createElement("div");c.className="waves-ripple",b.appendChild(c);var f=d(b),g=a.pageY-f.top-45,i=a.pageX-f.left-45,j="scale("+b.clientWidth/100*2.5+")";c.setAttribute("data-hold",Date.now()),c.setAttribute("data-scale",j),c.setAttribute("data-x",i),c.setAttribute("data-y",g);var k={top:g+"px",left:i+"px"};c.className=c.className+" waves-notransition",c.setAttribute("style",e(k)),c.className=c.className.replace("waves-notransition",""),k["-webkit-transform"]=j,k["-moz-transform"]=j,k["-ms-transform"]=j,k["-o-transform"]=j,k.transform=j,k.opacity="1",k["-webkit-transition-duration"]=h.duration+"ms",k["-moz-transition-duration"]=h.duration+"ms",k["-o-transition-duration"]=h.duration+"ms",k["transition-duration"]=h.duration+"ms",c.setAttribute("style",e(k))},hide:function(){for(var a=this,b=(1.4*a.clientWidth,null),c=a.children.length,d=0;c>d;d++)-1===a.children[d].className.indexOf("waves-ripple")||(b=a.children[d]);if(!b)return!1;var f=b.getAttribute("data-x"),g=b.getAttribute("data-y"),i=b.getAttribute("data-scale"),j=Date.now()-Number(b.getAttribute("data-hold")),k=500-j;0>k&&(k=0),setTimeout(function(){var c={top:g+"px",left:f+"px",opacity:"0","-webkit-transition-duration":h.duration+"ms","-moz-transition-duration":h.duration+"ms","-o-transition-duration":h.duration+"ms","transition-duration":h.duration+"ms","-webkit-transform":i,"-moz-transform":i,"-ms-transform":i,"-o-transform":i,transform:i};b.setAttribute("style",e(c)),setTimeout(function(){try{a.removeChild(b)}catch(c){return!1}},h.duration)},k)},wrapInput:function(a){for(var b=0;b<a.length;b++){var c=a[b];if("input"===c.tagName.toLowerCase()){var d=c.parentNode;if("i"===d.tagName.toLowerCase()&&-1!==d.className.indexOf("waves-effect"))return!1;var e=document.createElement("i");e.className=c.className+" waves-input-wrapper";var f=c.getAttribute("style"),g="width:"+c.offsetWidth+"px;height:"+c.clientHeight+"px;";f||(f=""),e.setAttribute("style",g+f),c.className="waves-button-input",c.removeAttribute("style"),d.replaceChild(e,c),e.appendChild(c)}}}};f.displayEffect=function(b){b=b||{},"duration"in b&&(h.duration=b.duration),h.wrapInput(g(".waves-effect")),Array.prototype.forEach.call(g(".waves-effect"),function(b){a.Touch&&(b.addEventListener("touchstart",h.show,!1),b.addEventListener("touchend",h.hide,!1)),b.addEventListener("mousedown",h.show,!1),b.addEventListener("mouseup",h.hide,!1),b.addEventListener("mouseleave",h.hide,!1)})},a.Waves=f}(window);
|
||||
//# sourceMappingURL=waves.min.js.map
|
Loading…
Add table
Add a link
Reference in a new issue