-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathportscript.js
More file actions
125 lines (104 loc) · 3.8 KB
/
portscript.js
File metadata and controls
125 lines (104 loc) · 3.8 KB
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
if (window.matchMedia('screen and (max-device-width:400px)').matches) {
$("#firstbutton").click( function() {
let work = $("#work")[0];
$("#footer").toggleClass("visible");
work.scrollIntoView();
});
$("#majorbutton").click(function() {
$("#major,#about,#contact").removeClass("majheight");
$("#major").addClass("majheight");
});
$("#aboutbutton").click(function() {
$("#major,#about,#contact").removeClass("majheight");
$("#about").addClass("majheight");
});
$("#contactbutton").click(function() {
$("#major,#about,#contact").removeClass("majheight");
$("#contact").addClass("majheight");
});
} else {
window.onbeforeunload = function () {
window.scrollTo(0, 0);
}
document.getElementById("titlegroup").style.textShadow = '2px 2px 5px black';
function blurUp2() {
document.getElementById("epithet").style.textShadow = '2px 2px black';
}
function blurUp3() {
document.getElementById("firstbutton").style.opacity = '1';
}
document.getElementById("epithet").addEventListener("mouseover", () => {
blurUp2();
blurUp3();
});
//autoscroll on initial click
$("#firstbutton").click( function() {
let work = $("#work")[0];
$("#footer").toggleClass("visible");
work.scrollIntoView();
});
//deblur
$("#name, #firstbutton").hover(function() {
$("#name").css("textShadow", "2px 2px black")
})
//project width-controlling buttons
$("#gunninbutton").mouseover(function() {
$(".desc").removeClass("openwidth");
$("#gunnin").children("div").addClass("openwidth");
});
$("#hellobutton").mouseover(function() {
$(".desc").removeClass("openwidth");
$("#helloworld").children("div").addClass("openwidth");
});
$("#hackbutton").mouseover(function() {
$(".desc").removeClass("openwidth");
$("#cuhackit").children("div").addClass("openwidth");
});
//main site navigation buttons
$("#majorbutton").mouseover(function() {
$(".desc").removeClass("openwidth");
$("#major,#about,#contact").removeClass("majheight");
$("#major").addClass("majheight");
});
$("#aboutbutton").mouseover(function() {
$(".desc").removeClass("openwidth");
$("#major,#about,#contact").removeClass("majheight");
$("#about").addClass("majheight");
});
$("#contactbutton").mouseover(function() {
$(".desc").removeClass("openwidth");
$("#major,#about,#contact").removeClass("majheight");
$("#contact").addClass("majheight");
});
//site theme color changing buttons
$("#gunninbutton").hover( function() {
$("#work,#navigation,#upbutton").css("backgroundColor", "#a3a09f");
$(".navbutt").css("color", "#494241");
$(".social").css({"color": "white", "backgroundColor": "#f26735"});
});
$("#hellobutton").hover( function() {
$("#work,#navigation,#upbutton").css("backgroundColor", "#f7a73c");
$(".navbutt").css("color", "#ffe67b");
$(".social").css({"color": "#ea7657", "backgroundColor": "#8fe4ea"});
});
$("#hackbutton").hover( function() {
$("#work,#navigation,#upbutton").css("backgroundColor", "#50c6df");
$(".navbutt").css("color", "#2e3192");
$(".social").css({"color": "#fef8c0", "backgroundColor": "#f78d36"});
});
$("#navigation").mouseout( function() {
$("#work,#navigation,#upbutton").css("backgroundColor", "#f8c9dc");
$(".navbutt").css("color", "white");
$(".social").css({"color": "white", "backgroundColor": "hotpink"});
});
function shadowNone(x) {
if (x.matches) { // If media query matches
document.getElementById("titlegroup").style.textShadow = "none";
} else {
document.getElementById("titlegroup").style.textShadow = '2px 2px 5px black';
}
}
var x = window.matchMedia("(max-device-width: 480px)")
myFunction(x) // Call listener function at run time
x.addListener(shadowNone)
}