forked from cyberbuddy-io/forms.cyberbuddy.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
120 lines (111 loc) · 3.4 KB
/
main.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
var database = firebase.database();
const date = new Date();
function start() {
var ele = document.querySelectorAll("input");
ele.forEach((e) => {
e.disabled = true;
e.placeholder = "This form is closed.";
});
}
function send_message() {
var name = document.getElementById("name").value;
var number = document.getElementById("number").value;
var message = document.getElementById("message").value;
var email = document.getElementById("email").value;
var yes = document.getElementById("yes");
var no = document.getElementById("no");
var maybe = document.getElementById("maybe");
var html = document.getElementById("html");
var js = document.getElementById("js");
var python = document.getElementById("python");
var cpp = document.getElementById("cpp");
var java = document.getElementById("java");
var db = firebase.database();
if (yes.checked == true) {
db.ref(name + number).push({work : yes.id})
}
else if (no.checked == true) {
db.ref(name + number).push({work : no.id})
}
else {
db.ref(name + number).push({work : maybe.id})
}
if (html.checked == true) {
db.ref(name + number).push({language : html.id})
}
if (js.checked == true) {
db.ref(name + number).push({language : js.id})
}
if (python.checked == true) {
db.ref(name + number).push({language : python.id})
}
if (cpp.checked == true) {
db.ref(name + number).push({language : cpp.id})
}
if (java.checked == true) {
db.ref(name + number).push({language : java.id})
}
db.ref(name + number + date).push({
username: name,
number: number,
message: message,
email : email
})
.then(
(onResolved) => {
window.alert("Your response has been sent. We'll contact you soon on your Email ID. You can contact us on [email protected]")
}
);
}
function white_bg() {
document.getElementById("test").classList = null;
var divs = document.querySelectorAll('#div-test');
divs.forEach((e) => {
e.classList = null;
});
document.getElementById("input-test").classList = null;
}
function green_bg() {
white_bg();
document.getElementById("test").classList.add("green-bg");
var divs = document.querySelectorAll('#div-test');
divs.forEach((e) => {
e.classList.add("green-bg-div");
});
document.getElementById("input-test").classList.add("green-bg-input");
}
function dark_bg() {
white_bg();
document.getElementById("test").classList.add("dark-bg");
var divs = document.querySelectorAll('#div-test');
divs.forEach((e) => {
e.classList.add("dark-bg-div");
});
document.getElementById("input-test").classList.add("dark-bg-input");
}
function peach_bg() {
white_bg();
document.getElementById("test").classList.add("peach-bg");
var divs = document.querySelectorAll('#div-test');
divs.forEach((e) => {
e.classList.add("peach-bg-div");
});
document.getElementById("input-test").classList.add("peach-bg-input");
}
function purple_bg() {
white_bg();
document.getElementById("test").classList.add("purple-bg");
var divs = document.querySelectorAll('#div-test');
divs.forEach((e) => {
e.classList.add("purple-bg-div");
});
document.getElementById("input-test").classList.add("purple-bg-input");
}
$( "aside img" ).click(function() {
//alert($( this ).css( "transform" ));
if ( $( this ).css( "transform" ) == 'none' ){
$(this).css("transform","rotate(180deg)");
} else {
$(this).css("transform","" );
}
});