@@ -4,7 +4,6 @@ $(document).ready(function(){
44// ----------------------------
55// character Movement
66// ----------------------------
7-
87function walk ( e ) {
98 /*Move right*/
109 let position = parseInt ( scene . style . backgroundPositionX ) ;
@@ -47,36 +46,42 @@ function walk(e){
4746// Portfolio Item 1 code
4847// -------------------------
4948
50- if ( position >= - 1200 && position <= - 760 ) {
51- $ ( '.portfolio-item1' ) . stop ( ) . animate ( { height : '0px' , width : '0px' , padding : '0px' } , 120 ) ;
52- } else if ( position <= - 1214 && position >= - 1400 ) {
53- $ ( '.portfolio-item1' ) . stop ( ) . animate ( { height : '500px' , width : '1200px' , padding : '15px' } , 220 ) ;
54- } else if ( position <= - 1650 && position >= - 1700 ) {
55- $ ( '.portfolio-item1' ) . stop ( ) . animate ( { height : '0px' , width : '0px' , padding : '0px' } , 120 ) ;
49+ if ( position >= - 1200 && position <= - 760 && PoIt1Ran === true ) {
50+ $ ( '.portfolio-item1' ) . stop ( ) . animate ( { height : '0px' , width : '0px' , padding : '0px' } , 220 ) ;
51+ PoIt1Ran = false ;
52+ } else if ( position <= - 1214 && position >= - 1400 && PoIt1Ran === false ) {
53+ $ ( '.portfolio-item1' ) . stop ( ) . animate ( { height : '500px' , width : '1200px' , padding : '15px' } , 420 ) ;
54+ PoIt1Ran = true ;
55+ } else if ( position <= - 1650 && position >= - 1700 && PoIt1Ran === true ) {
56+ $ ( '.portfolio-item1' ) . stop ( ) . animate ( { height : '0px' , width : '0px' , padding : '0px' } , 220 ) ;
57+ PoIt1Ran = false ;
5658}
5759
5860// -------------------------
5961// Portfolio Item 2 code
6062// -------------------------
6163
62- if ( position >= - 1990 && position <= - 1715 ) {
64+ if ( position >= - 1990 && position <= - 1715 && PoIt2Ran === true ) {
6365// $('.portfolio-item2').stop().slideUp(100);
6466 $ ( 'h2[data-info="vaardigheden"]' ) . stop ( ) . animate ( { top : '-300px' } , 160 ) ;
6567 $ ( 'img[data-info="css3"]' ) . stop ( ) . animate ( { top : '800px' } , 170 ) ;
6668 $ ( 'img[data-info="html5"]' ) . stop ( ) . animate ( { top : '800px' } , 170 ) ;
6769 $ ( 'img[data-info="js"]' ) . stop ( ) . animate ( { top : '800px' } , 170 ) ;
68- } else if ( position <= - 2000 && position >= - 2700 ) {
70+ PoIt2Ran = false ;
71+ } else if ( position <= - 2000 && position >= - 2700 && PoIt2Ran === false ) {
6972// $('.portfolio-item2').stop().slideDown(200);
7073 $ ( 'h2[data-info="vaardigheden"]' ) . stop ( ) . animate ( { top : '-50px' } , 170 ) ;
7174 $ ( 'img[data-info="css3"]' ) . stop ( ) . animate ( { top : '120px' } , 190 , 'swing' ) ;
7275 $ ( 'img[data-info="html5"]' ) . stop ( ) . animate ( { top : '120px' } , 190 , 'swing' ) ;
7376 $ ( 'img[data-info="js"]' ) . stop ( ) . animate ( { top : '120px' } , 190 , 'swing' ) ;
74- } else if ( position <= - 2900 && position >= - 3050 ) {
77+ PoIt2Ran = true
78+ } else if ( position <= - 2900 && position >= - 3050 && PoIt2Ran === true ) {
7579// $('.portfolio-item2').stop().slideUp(100);
7680 $ ( 'h2[data-info="vaardigheden"]' ) . stop ( ) . animate ( { top : '-300px' } , 160 ) ;
7781 $ ( 'img[data-info="css3"]' ) . stop ( ) . animate ( { top : '800px' } , 170 ) ;
7882 $ ( 'img[data-info="html5"]' ) . stop ( ) . animate ( { top : '800px' } , 170 ) ;
7983 $ ( 'img[data-info="js"]' ) . stop ( ) . animate ( { top : '800px' } , 170 ) ;
84+ PoIt2Ran = false ;
8085}
8186
8287// -------------------------
@@ -88,17 +93,34 @@ if(position >= -3490 && position <= - 3100) {
8893 $ ( 'p[data-info="css-hours"]' ) . stop ( ) . animate ( { opacity : '0' , 'font-size' : '10px' } , 200 ) ;
8994 $ ( 'p[data-info="js-hours"]' ) . stop ( ) . animate ( { opacity : '0' , 'font-size' : '10px' } , 200 ) ;
9095} else if ( position <= - 3500 && position >= - 4000 ) {
91- $ ( 'h2[data-info="timeSpent"]' ) . stop ( ) . animate ( { 'margin-top' : '170px' } , 420 ) ;
92- $ ( 'p[data-info="html-hours"]' ) . stop ( ) . animate ( { opacity : '1' , 'font-size' : '45px' } , 450 ) ;
93- $ ( 'p[data-info="css-hours"]' ) . stop ( ) . animate ( { opacity : '1' , 'font-size' : '45px' } , 450 ) ;
94- $ ( 'p[data-info="js-hours"]' ) . stop ( ) . animate ( { opacity : '1' , 'font-size' : '45px' } , 450 ) ;
96+ $ ( 'h2[data-info="timeSpent"]' ) . stop ( ) . animate ( { 'margin-top' : '170px' } , 380 ) ;
97+ $ ( 'p[data-info="html-hours"]' ) . stop ( ) . animate ( { opacity : '1' , 'font-size' : '45px' } , 290 ) ;
98+ $ ( 'p[data-info="css-hours"]' ) . stop ( ) . animate ( { opacity : '1' , 'font-size' : '45px' } , 290 ) ;
99+ $ ( 'p[data-info="js-hours"]' ) . stop ( ) . animate ( { opacity : '1' , 'font-size' : '45px' } , 290 ) ;
95100} else if ( position <= - 4200 && position >= - 4250 ) {
96101 $ ( 'h2[data-info="timeSpent"]' ) . stop ( ) . animate ( { 'margin-top' : '-800px' } , 160 ) ;
97102 $ ( 'p[data-info="html-hours"]' ) . stop ( ) . animate ( { opacity : '0' , 'font-size' : '10px' } , 200 ) ;
98103 $ ( 'p[data-info="css-hours"]' ) . stop ( ) . animate ( { opacity : '0' , 'font-size' : '10px' } , 200 ) ;
99104 $ ( 'p[data-info="js-hours"]' ) . stop ( ) . animate ( { opacity : '0' , 'font-size' : '10px' } , 200 ) ;
100105}
101106
107+ // -------------------------
108+ // Portfolio Item 4 code
109+ // -------------------------
110+ if ( position >= - 4490 && position <= - 4290 ) {
111+ $ ( 'img[data-info="es6-l"]' ) . stop ( ) . animate ( { bottom : '-300px' } , 200 ) ;
112+ $ ( 'img[data-info="jquary-l"]' ) . stop ( ) . animate ( { right : '1400px' } , 200 ) ;
113+ $ ( 'img[data-info="less-l"]' ) . stop ( ) . animate ( { left : '1400px' } , 200 ) ;
114+ } else if ( position <= - 4500 && position >= - 5000 ) {
115+ $ ( 'img[data-info="es6-l"]' ) . stop ( ) . animate ( { bottom : '80px' } , 450 ) ;
116+ $ ( 'img[data-info="jquary-l"]' ) . stop ( ) . animate ( { right : '50px' } , 450 ) ;
117+ $ ( 'img[data-info="less-l"]' ) . stop ( ) . animate ( { left : '50px' } , 450 ) ;
118+ } else if ( position <= - 5200 && position >= - 5250 ) {
119+ $ ( 'img[data-info="es6-l"]' ) . stop ( ) . animate ( { bottom : '-300px' } , 200 ) ;
120+ $ ( 'img[data-info="jquary-l"]' ) . stop ( ) . animate ( { right : '1400px' } , 200 ) ;
121+ $ ( 'img[data-info="less-l"]' ) . stop ( ) . animate ( { left : '1400px' } , 200 ) ;
122+ }
123+
102124// --------------------------
103125// Background Music
104126// --------------------------
0 commit comments