/
index.html
133 lines (124 loc) · 4.3 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=1024, maximum-scale=1.0" />
<meta name="og:type" content="website" />
<meta name="twitter:card" content="photo" />
<link rel="stylesheet" type="text/css" href="css/homepage-desktop.css" />
<link rel="stylesheet" type="text/css" href="css/styleguide.css" />
<link rel="stylesheet" type="text/css" href="css/globals.css" />
<title>GL.</title>
</head>
<body style="margin: 0; background: #2f303a">
<input type="hidden" id="anPageName" name="page" value="homepage-desktop" />
<div class="container-center-horizontal">
<div class="homepage-desktop screen">
<img class="pic-xRzIwx" src="img/pic@1x.png" />
<div class="view_-portfolio-button-xRzIwx animate-enter8">
<a href="about-page-desktop.html">
<div class="portfolio-button-HZ4QFS smart-layers-pointers border-5px-west-side"></div
></a>
<div class="view-my-portfolio-HZ4QFS montserrat-medium-outer-space-36px">View my Portfolio</div>
</div>
<img class="hello-im-geoffrey-lazer-xRzIwx animate-enter9" src="img/hello--i-m-geoffrey-lazer-@2x.svg" />
<div class="game-developer-x-tech-enthusiast-xRzIwx montserrat-normal-white-24px animate-enter10">
Game Developer x Tech Enthusiast
</div>
</div>
</div>
<script>
function ShowOnScroll() {
this.toShow = [];
this.nextEventY = undefined;
}
ShowOnScroll.prototype.show = function (e) {
e.style.display = "";
};
ShowOnScroll.prototype.hide = function (e) {
e.style.display = "none";
};
ShowOnScroll.prototype.getTop = function (e) {
if (e.Top != undefined && e.Top != 0) {
return e.Top;
}
var top = 0;
var iter = e;
do {
top += iter.offsetTop || 0;
iter = iter.offsetParent;
} while (iter);
e.Top = top;
return top;
};
ShowOnScroll.prototype.onScroll = function () {
var screenBottom = window.pageYOffset + window.innerHeight;
if (this.nextEventY == undefined || this.nextEventY > screenBottom) {
return;
}
this.nextEventY = undefined;
for (var i = 0; i < this.toShow.length; i++) {
var e = this.toShow[i];
var top = this.getTop(e);
if (top < screenBottom) {
this.show(e);
this.toShow.shift();
i--;
} else {
this.nextEventY = top;
break;
}
}
};
ShowOnScroll.prototype.resetScrolling = function () {
// Clear state
var screenBottom = window.pageYOffset + window.innerHeight;
for (var i = 0; i < this.toShow.length; i++) {
var e = this.toShow[i];
this.show(e);
}
this.toShow = [];
this.nextEventY == undefined;
// Collect items
var itemsToShowOnScroll = Array.prototype.slice.call(document.getElementsByTagName("*"));
itemsToShowOnScroll = itemsToShowOnScroll.filter(function (e) {
return e.getAttribute("show-on-scroll") != undefined;
});
var getTop = this.getTop;
itemsToShowOnScroll.sort(function (a, b) {
return getTop(a) - getTop(b);
});
for (var i = 0; i < itemsToShowOnScroll.length; i++) {
var e = itemsToShowOnScroll[i];
var top = this.getTop(e);
if (top < screenBottom) {
continue;
}
this.toShow.push(e);
this.hide(e);
this.nextEventY = this.nextEventY != undefined ? this.nextEventY : top;
}
};
ShowOnScroll.prototype.handleEvent = function (e) {
switch (e.type) {
case "scroll":
this.onScroll();
break;
case "resize":
this.resetScrolling();
break;
}
};
ShowOnScroll.prototype.init = function () {
this.resetScrolling();
window.addEventListener("scroll", this);
window.addEventListener("resize", this);
};
// After anima-src
setTimeout(function () {
var instShowOnScroll = new ShowOnScroll();
instShowOnScroll.init();
}, 250);
</script>
</body>
</html>