Skip to content

Commit 855cb09

Browse files
committed
Added 4e item and performace improvement
- Added the 4e animation - Fixed laggy glitchy animation - improved performace by a lot
1 parent 5cd0361 commit 855cb09

File tree

6 files changed

+93
-16
lines changed

6 files changed

+93
-16
lines changed

css/style.css

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ p{
2222
font-family: 'Press Start 2P', cursive;
2323
}
2424

25+
h2{
26+
font-family: 'Bungee Shade', cursive;
27+
font-size: 42px;
28+
color: #e2cb1e;
29+
text-align: center;
30+
}
31+
2532
.guide{
2633
display: block;
2734
width: 1400px;
@@ -253,4 +260,41 @@ p{
253260
color: #e2cb1e;
254261
text-align: center;
255262
margin-top: -800px;
256-
}
263+
}
264+
265+
.portfolio-item4{
266+
height: 700px;
267+
width: 1400px;
268+
position: absolute;
269+
top: 0px;
270+
left: 0px;
271+
}
272+
273+
[data-info="frameworksAndLanguages"]{
274+
display: flex;
275+
flex-direction: row;
276+
align-items: center;
277+
justify-content: space-around;
278+
position: absolute;
279+
width: 1400px;
280+
height: 300px;
281+
bottom: 100px;
282+
}
283+
284+
[data-info="es6-l"]{
285+
position: absolute;
286+
bottom: -300px;
287+
right: 630px;
288+
}
289+
290+
[data-info="less-l"]{
291+
position: absolute;
292+
left: 1400px;
293+
bottom: 90px;
294+
}
295+
296+
[data-info="jquary-l"]{
297+
position: absolute;
298+
bottom: 90px;
299+
right: 1400px;
300+
}

index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<meta name="description" content="Jquery Animation">
99
<link rel="stylesheet" href="css/style.css" type="text/css">
1010
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
11+
<script src="//cdnjs.cloudflare.com/ajax/libs/velocity/1.4.0/velocity.min.js"></script>
1112
<link href="https://fonts.googleapis.com/css?family=Caveat:400,700%7CMarck+Script%7CPress+Start+2P" rel="stylesheet">
1213
<link href="https://fonts.googleapis.com/css?family=Bungee+Shade" rel="stylesheet">
1314
</head>
@@ -70,7 +71,12 @@ <h2 data-info="timeSpent">Tijd per week buiten school:</h2>
7071
</div>
7172
</div>
7273
<div class="portfolio-item4">
73-
74+
<h2 data-info="watImLearning">Wat ik nu aan het leren ben:</h2>
75+
<div data-info="frameworksAndLanguages">
76+
<img data-info="less-l" src="links/attributes/less.png" alt="less" height="120">
77+
<img data-info="es6-l" src="links/attributes/es6.png" alt="es6" height="140">
78+
<img data-info="jquary-l" src="links/attributes/jquary.png" alt="jquary" height="120">
79+
</div>
7480
</div>
7581
<div class="portfolio-item5">
7682

@@ -93,6 +99,11 @@ <h2 data-info="timeSpent">Tijd per week buiten school:</h2>
9399
var i = 10;
94100
var backgroundForward = 0;
95101
var backgroundBackward = 0;
102+
let PoIt1Ran = false;
103+
let PoIt2Ran = false;
104+
let PoIt3Ran = false;
105+
let PoIt4Ran = false;
106+
let PoIt5Ran = false;
96107
</script>
97108
<script src="js/scrips.js"></script>
98109
</body>

js/scrips.js

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ $(document).ready(function(){
44
// ----------------------------
55
// character Movement
66
// ----------------------------
7-
87
function 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
// --------------------------

links/attributes/es6.png

20.4 KB
Loading

links/attributes/jquary.png

33.2 KB
Loading

links/attributes/less.png

304 KB
Loading

0 commit comments

Comments
 (0)