$(window).ready(function(){ var w = 1146 var h = 763 var ratio = w / h var pictoFilet = [ { id: "confluence", picto: [ { id: "partager", left: -17, bottom: 190, filet: 1, filetHeight: 379, start: .4 }, { id: "coconstruire", left: 238, bottom: 447, filet: 2, filetHeight: 55, start: .2 }, { id: "preserver", left: 525, bottom: 206, filet: 3, filetHeight: 326, start: .5 }, { id: "proposer", left: 743, bottom: 384, filet: 4, filetHeight: 76, start: 1 }, { id: "dialoguer", left: 977, bottom: 159, filet: 5, filetHeight: 336, start: .7 } ] }, { id: "pont", picto: [ { id: "coconstruire", left: 50, bottom: 500, filet: 1, filetHeight: 63, start: 1 }, { id: "echanger", left: 290, bottom: 480, filet: 2, filetHeight: 57, start: .2 }, { id: "dialoguer", left: 539, bottom: 350, filet: 3, filetHeight: 116, start: .5 }, { id: "partager", left: 869, bottom: 262, filet: 4, filetHeight: 276, start: .4 } // { // id : "proposer", // left : 951, // bottom : 295, // filet : 5, // start :.7 // }, ] }, { id: "fleuve", picto: [ { id: "preserver", left: 12, bottom: 322, filet: 1, filetHeight: 244, start: .4 }, { id: "echanger", left: 181, bottom: 240, filet: 3, filetHeight: 85, start: .5 }, { id: "informer", left: 484, bottom: 144, filet: 2, filetHeight: 394, start: 1 }, { id: "coconstruire", left: 742, bottom: 348, filet: 4, filetHeight: 34, start: .2 }, { id: "sengager", left: 878, bottom: 211, filet: 5, filetHeight: 289, start: .7 } ] }, { id: "passerelle", picto: [ { id: "informer", left: 75, bottom: 20, filet: 1, filetHeight : 555, start: .4 }, { id: "concerter", left: 340, bottom: 569, filet: 2, filetHeight : 51, start: .2 }, { id: "defendre", left: 695, bottom: 299, filet: 3, filetHeight : 271, start: .5 }, { id: "sengager", left: 917, bottom: 405, filet: 4, filetHeight : 212, start: 1 } ] }, { id: "fourviere", picto: [ { id: "sengager", left: 0, bottom: 224, filet: 1, filetHeight : 391, start: .4 }, { id: "partager", left: 279, bottom: 429, filet: 2, filetHeight : 149, start: .2 }, { id: "preserver", left: 540, bottom: 167, filet: 3, filetHeight : 334, start: .5 }, { id: "defendre", left: 825, bottom: 381, filet: 4, filetHeight : 85, start: 1 }, { id: "echanger", left: 960, bottom: 174, filet: 5, filetHeight : 361, start: .7 } ] } ]; // resize() window.pictoFilet = pictoFilet var tmdessin = new TimelineMax(); tmdessin.add(TweenMax.from($('#dessin-main'),.2,{opacity:0}),.5) tmdessin.add(TweenMax.from($('#dessin-main'),1,{left:-100}),.5) tmdessin.add(TweenMax.from($('#dessin-main'),1,{y:'+=10'/*,ease : RoughEase.ease.config({ template: Power0.easeNone, strength: 8, points: 10, taper: "none", randomize: true, clamp: false})*/}),.5) function dessinTw(){ var width = $('#home-carousel').height() / 100 * 251.6382 $('#dessin-dessin-container').css( { opacity : 1 } ) TweenMax.fromTo($('#home-carousel #dessin-dessin-container'),1.7,{width:0},{width:width}) } tmdessin.add(dessinTw,.5) tmdessin.add(TweenMax.staggerFrom(["#dessin-text-1","#dessin-text-2","#dessin-text-3"],.5,{ease:Back.easeOut.config(1.7),top:"+=150",opacity:0},.1),"-=.7") tmdessin.pause() var animations = [ tmdessin ] window.animations = animations; var $carousel = $('#home-carousel') var $parent = $carousel.parent() $carousel.remove(); console.log($carousel.parent()) for(var i in pictoFilet){ var o = pictoFilet[i] var $item = $('
') $item.addClass('item') .attr('id', o.id) // .css('backgroundImage','url("/img/'+ o.id+'.jpg")') $item_inner = $('') $item_inner.addClass('item-inner') $item_inner.append('') $item.append($item_inner) var $container = $('') $container.addClass('filet-picto-container') // timeline var tm = new TimelineMax() for(var j in o.picto){ var p = o.picto[j] var $picto = $('') $picto.addClass('filet-picto') .css({ left : String((p.left * 100) / w) + "%", bottom : String((p.bottom * 100) / h) + "%", }) var html = '