-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend.html
More file actions
162 lines (137 loc) · 4.6 KB
/
send.html
File metadata and controls
162 lines (137 loc) · 4.6 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Rj Private Messager</title>
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css"
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2"
crossorigin="anonymous">
<script src="https://www.gstatic.com/firebasejs/3.7.4/firebase.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<h1 style="margin-top: 15px; margin-bottom: 15px;text-align: center;color: rgb(0, 212, 106);">
Rj Private Messanger
</h1>
<form class="container" id="contactForm">
<div class="card">
<div class="card-body">
<div class="form-group">
<label class="title" for="exampleFormControlInput1">
Who Are You?
</label>
<input type="text" class="inputsstyle form-control" placeholder="enter your name" id="nameField">
</div>
<div class="form-group">
<label class="title" for="exampleFormControlInput1">
What is Your Message
</label>
<input type="text" class="inputsstyle form-control" placeholder="write your message..." id="ageField">
</div>
</div>
<button onclick="writeData()" style="width: 100%;" class="bttn-dark bzbz btn btn--primary" type="submit">Send</button>
</div>
</form>
</body>
<style>
@import 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:700';
body{
text-align: center;
background-color: black;
}
.inputsstyle{
border-color: rgb(0, 212, 106);
font-size: 40px;
height: 100px;
width: 100%;
border-radius: 10px;
outline: none;
background-color: black;
color: rgb(0, 212, 106);
}
.card {
background-color: black;
}
.title {
color: white;
}
.bzbz {
background: black;
}
.bttn-dark {
font-size: 18px;
letter-spacing: 2px;
text-transform: uppercase;
display: inline-block;
color: white;
text-align: center;
width: 270px;
font-weight: bold;
padding: 14px 0px;
border: 3px solid rgb(0, 212, 106);
border-radius: 2px;
position: relative;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.1);
z-index: 2;
}
.bttn-dark:before {
-webkit-transition: 0.5s all ease;
transition: 0.5s all ease;
position: absolute;
top: 0;
left: 50%;
right: 50%;
color: black;
bottom: 0;
opacity: 0;
content: "";
background-color: rgb(0, 212, 106);
z-index: -1;
}
.bttn-dark:hover:before {
-webkit-transition: 0.5s all ease;
transition: 0.5s all ease;
left: 0;
right: 0;
opacity: 1;
}
.bttn-dark:focus:before {
-webkit-transition: 0.5s all ease;
transition: 0.5s all ease;
left: 0;
right: 0;
opacity: 1;
}
</style>
<script>
let firebaseConfig = {
apiKey: "AIzaSyAKWd8Uc7JyyXkL6ZdOUjeY3mux0Ga94qc",
authDomain: "rj-data-center.firebaseapp.com",
databaseURL: "https://rj-data-center-default-rtdb.firebaseio.com",
projectId: "rj-data-center",
storageBucket: "rj-data-center.appspot.com",
messagingSenderId: "418814155597",
appId: "1:418814155597:web:d156b8d44499bcaca1b504"
};
firebase.initializeApp(firebaseConfig);
function writeData() {
firebase.database().ref("User").set({
name: document.getElementById("nameField").value,
age: document.getElementById("ageField").value
});
alert("your message have been send successfully");
}
function getData() {
firebase.database().ref('/').once('value', function(snapshot) {
snapshot.forEach(function(childSnapshot)
{
var childKey = childSnapshot.key;
var childData = childSnapshot.val();
document.getElementById("data").innerHTML = childData['name'] + "," + childData['age'];
})
})
}
getData();
</script>
</html>