-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.dev.js
222 lines (193 loc) · 5.92 KB
/
app.dev.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
"use strict";
var sleep = function sleep(time) {
return new Promise(function (resolve) {
return setTimeout(resolve, time);
});
};
window.onload = function () {};
var cursor = document.querySelector("#cursor");
document.addEventListener("mousemove", function (e) {
cursor.style.top = "".concat(e.pageY - 10, "px");
cursor.style.left = "".concat(e.pageX - 10, "px");
});
document.addEventListener("click", function (e) {
cursor.style.animation = " click 0.7s ease 2 alternate";
setTimeout(function () {
cursor.style.animation = "";
}, 1400);
}); // gasp stuff
// gasp stuff
// gasp stuff
var riseLay = function riseLay(percentage) {
gsap.to("#middleSection>img", {
duration: 0.3,
ease: Power1.easeInOut,
clipPath: "circle(" + percentage + "%)"
});
};
if (document.querySelector("#topOfTPage")) {
document.addEventListener("scroll", function (e) {
var y = 100 - ((window.innerHeight - document.querySelector("#topOfTPage").getBoundingClientRect().top) / window.innerHeight - 1) * 400;
riseLay(y);
});
}
var type = function type() {
var typed, fav, i, j;
return regeneratorRuntime.async(function type$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
typed = document.querySelector("#typed");
if (!typed) {
_context.next = 24;
break;
}
fav = [" a web development", " a Machine Learning", " a computer science ", " a Data Science", "an AI"];
case 3:
if (!true) {
_context.next = 22;
break;
}
i = 0;
case 5:
if (!(i < fav.length)) {
_context.next = 20;
break;
}
j = 0;
case 7:
if (!(j < fav[i].length)) {
_context.next = 14;
break;
}
typed.append(fav[i].charAt(j));
_context.next = 11;
return regeneratorRuntime.awrap(sleep(100));
case 11:
j++;
_context.next = 7;
break;
case 14:
_context.next = 16;
return regeneratorRuntime.awrap(sleep(2000));
case 16:
typed.innerHTML = "";
case 17:
i++;
_context.next = 5;
break;
case 20:
_context.next = 3;
break;
case 22:
_context.next = 25;
break;
case 24:
return _context.abrupt("return", true);
case 25:
case "end":
return _context.stop();
}
}
});
};
type(); // if(document.querySelectorAll("#myProjects>article")){
// const lazyStuff = document.querySelectorAll("#myProjects>article");
// const observer = new IntersectionObserver((objects, observer)=>{
// objects.forEach(object =>{
// if(object.isIntersecting){
// object.target.classList.add("observed");
// let img;
// for (item in object.target.childNodes) {
// if(object.target.childNodes[item].nodeName != "#text"){
// console.log(object.target.childNodes[item].classList)
// if (object.target.childNodes[item].classList.contains("imgContainer")) {
// console.log("some")
// img = object.target.childNodes[item];
// console.log(img)
// for (item in img.childNodes){
// if(img.childNodes[item].tagName == "IMG"){
// img = img.childNodes[item]
// src = img.dataset.lazy;
// console.log(src);
// img.setAttribute("src", src);
// console.log(img);
// }
// }
// }
// // console.log(object.target.childNodes[item])
// }
// }
// observer.unobserve(object.target);
// }
// })
// });
try {
lazyStuff.forEach(function (object) {
console.log("inforeach");
observer.observe(object);
});
} catch (error) {
console.log(error);
} // BARBA things
// BARBA things
// BARBA things
barba.init({
// sync: true,
debug: true,
// sync:true,
transitions: [{
name: 'default-transition',
leave: function leave(data) {
var done;
return regeneratorRuntime.async(function leave$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
// gsap.from(data.current.container, {
// opacity: 0,
// duration:1,
// ease: Power1.easeOut
// });
done = this.async(); // type();
gsap.to("#tran li", {
duration: 0.5,
scaleY: 1,
transformOrigin: "bottom left",
stagger: 0.2
});
gsap.to("#tran li", {
duration: 0.5,
delay: 1,
scaleY: 0,
ease: Power2.easeOut,
transformOrigin: "bottom left",
stagger: 0.1
});
_context2.next = 5;
return regeneratorRuntime.awrap(sleep(1000));
case 5:
done();
case 6:
case "end":
return _context2.stop();
}
}
}, null, this);
},
enter: function enter(data) {
return regeneratorRuntime.async(function enter$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
case "end":
return _context3.stop();
}
}
});
},
after: function after(data) {
type();
}
}]
});