-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
66 lines (52 loc) · 2.2 KB
/
index.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
$(document).ready(function(){
/*Refuse to support IE*/
var isIE = /(MSIE|Trident)/.test(window.navigator.userAgent);
if(isIE){
alert("Please update to a modern browser like Firefox, Chrome or Edge.");
}
else
{
/*init parallax.js*/
if(!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))) {
var parallaxInstance = new Parallax($("#scene").get(0));
}
/*calculate birthday*/
var now = new Date();
var then = new Date('1997-12-18T09:56:00');
var age = Math.floor((now-then)/1000/60/60/24/365);
$(".age")[0].innerHTML= `(${age})`;
/*deobfuscate mail*/
$(".obfuscated-mailto").attr("href", $(".obfuscated-mailto").attr("href").replace(",,,", "@").replace("---", "."))
$(".obfuscated-mail").html($(".obfuscated-mail").html().replace(",,,", "@").replace("---", "."));
/*greet detectives*/
var style = `background-color: #3e90d3;
color: white;
padding: 5px 10px 5px 5px;
border-radius: 10px;
font-size:1.5em;`;
console.log("%c Hey, how did you? 😨", style + `font-size: 2.5em`);
console.log("%c I'm hosting this website on github.io which means no fancy backend processing. If you must I suggest looking at the repo:", style);
console.log("%c https://github.com/hbnrmx/hbnr.mx",`font-size:1.5em;`);
console.log("%c Thanks!", style);
/**/
var card = $(".card");
$(".profile").hover(function(){
$(this).toggleClass("expanded")
});
$(".projects").click(function(){
card.addClass("wide");
card.removeClass("flipped");
document.title = "hbnr.mx | Projects";
});
$(".aboutme").click(function(){
card.addClass("wide");
card.removeClass("flipped");
document.title = "hbnr.mx | About Me";
});
$(".contactme").click(function(){
card.addClass("flipped");
card.removeClass("wide");
document.title = "hbnr.mx | Contact";
});
}
});