-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
85 lines (68 loc) · 2.47 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// let width = screen.availWidth;
// console.log(width);
/*function click (){
document.getElementById("button").addEventListener("click", function() {
$("body").css("background-color", "black");
});
}*/
/*$(".nine").click(function() {
$(this).toggleClass("ninetrans");
});*/
let check = $("#toggle_button").is(':checked');
let button = $("#toggle_button");
let bodyclick = $("body");
function Delete() {
$(".nine").removeClass("ninetrans");
$(".bar1").removeClass("bar1trans");
$(".bar2").removeClass("bar2trans");
$(".bar3").removeClass("bar3trans");
}
button.click(function() {
$(".nine").addClass((this.checked) ? "ninetrans" : Delete());
$(".bar1").addClass((this.checked) ? "bar1trans" : Delete());
$(".bar2").addClass((this.checked) ? "bar2trans" : Delete());
$(".bar3").addClass((this.checked) ? "bar3trans" : Delete());
console.log("hello");
});
// let color_Button = $("#purpel");
// let beige_button = $("#beige");
// function color(){
// $(".paraServic").css("color","black");
// }
// color_Button.click(function(){
// $("h5").css("color", (this.click)? "#8b8fe6": color());
// $(".serIcon").css("color", (this.click)? "#8991ff": "#8991ff");
// $(".services").css("color", (this.click)? "#1c29d44a": "#1c29d44a");
// });
// beige_button.click(function(){
// $("h5").css("color", (this.click)? "black":"black");
// $(".serIcon").css("color", (this.click)? "#6cc9bf": "#6cc9bf");
// $(".services").css("color", (this.click)? "#F5EDDC": "#F5EDDC");
// });
// window.addEventListener("resize", function(){
// let width = $("body").css("width");
// width = (width.slice(0, (width.length-2)));
// console.log(width);
// });
$(function(){
$(document).scroll(function(){
if($(this).scrollTop() >= $('#content').offset().top - 50) {
$("#content").css("background","red");
} else {
$("#content").css("background","orange");
}
});
});
window.addEventListener("scroll", (event) => {
let scroll = this.scrollY;
// console.log(Math.trunc(scroll));
scroll = Math.trunc(scroll);
if (scroll > 1490) {
$(".portcol").css("animation","cardtrans 1s cubic-bezier(0, 0.37, 0.74, 0.76) 0.2s 1 normal forwards");
console.log("great");
}
});
// function transition() {
//
//
// }