-
Notifications
You must be signed in to change notification settings - Fork 0
/
cst-blog.html
128 lines (115 loc) · 5.3 KB
/
cst-blog.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>CST Dev Blog</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--===============================================================================================-->
<link rel="icon" type="image/png" href="images/icons/icon.png"/>
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<!--===============================================================================================-->
</head>
<body>
<div class="contact1">
<div class="container-contact1">
<div class="contact1-pic js-tilt" data-tilt>
<img src="images/img-01.png" alt="IMG">
</div>
<form method="GET" class="contact1-form validate-form">
<span class="contact1-form-title">
CST Blog
</span>
<div class="wrap-input1 validate-input" data-validate = "Name is required">
<input id = 'name' class="input1" type="text" name="name" placeholder="Name">
<span class="shadow-input1"></span>
</div>
<div class="wrap-input1 validate-input" data-validate = "Title is required">
<input id='title' class="input1" type="text" name="title" placeholder="Title">
<span class="shadow-input1"></span>
</div>
<div class="wrap-input1 validate-input">
<input id='preview' class="input1" type="text" name="preview" placeholder="Preview">
<span class="shadow-input1"></span>
</div>
<div class="wrap-input1 validate-input" data-validate = "Blog is required">
<textarea id='message' class="input1" name="message" placeholder="Blog Content"></textarea>
<span class="shadow-input1"></span>
</div>
<div class="container-contact1-form-btn">
<button type = 'button' onclick='postBlog()' class="contact1-form-btn">
<span>
Post
<i class="fa fa-long-arrow-right" aria-hidden="true"></i>
</span>
</button>
</div>
</form>
</div>
</div>
<script src="https://www.gstatic.com/firebasejs/5.5.0/firebase.js"></script>
<script src="js/firebaseInit.js"></script>
<!--===============================================================================================-->
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/bootstrap/js/popper.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/select2/select2.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/tilt/tilt.jquery.min.js"></script>
<script>
$('.js-tilt').tilt({
scale: 1.1
})
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-23581568-13"></script>
<script>
function postBlog(){
var name = document.getElementById('name').value;
var title = document.getElementById('title').value;
var preview = document.getElementById('preview').value;
var mess = document.getElementById('message').value;
if(name == '' || title == '' || preview == '' || mess == ''){
alert("Please Fill out the Required Forms!");
}else{
firebase.database().ref('CST/blogs/').push({
name: name,
title: title,
preview: preview,
message: mess,
date: Math.round(new Date().getTime()/1000.0)
}).then(function(){
alert('Successfully Posted!');
document.getElementById('message').value = '';
document.getElementById('preview').value = '';
document.getElementById('title').value = '';
document.getElementById('name').value = '';
}).catch(function(){
alert("We don't know what went wrong... Try again Later!");
});
}
}
</script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-23581568-13');
</script>
<!--===============================================================================================-->
<script src="js/main.js"></script>
</body>
</html>