-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwishform.html
89 lines (87 loc) · 4.17 KB
/
wishform.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1">
<script src="Garlic.js-1.4.2/garlic.js"></script>
<script src="node_modules/jquery/src/jquery.js"></script>
<script src="https://code.jquery.com/jquery.min.js"></script>
<script src="./HeightMax.js"></script>
<link rel="stylesheet" href="./reset.css">
<link rel="stylesheet" type="text/css" href="./header.css" />
<link rel="stylesheet" type="text/css" href="./wishform.css" />
<title>harugassyuku</title>
<script>
(function(d) {
var config = {kitId: 'txx2rmk',scriptTimeout: 3000,async: true},
h=d.documentElement,t=setTimeout(function(){
h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){
a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)})(document);
</script>
</head>
<body>
<header>
<div class="HeaderInner">
<h1 class="HeaderTitle HeaderTitle">
<a href="./index.html">
<img src="logo.png" alt="春合宿のロゴです" class="OurName">
</a>
</h1>
<button class="HeaderHamburger Hamburger" id="JsHamburger">
<span></span>
<span></span>
<span></span>
</button>
</div>
<nav class="HeaderNav Nav" id="JsNav">
<ul class="NavMenuUl">
<li class="NavMenuLi"><a class="NavText" href="./index.html"><ruby>ホーム<rt></rt></ruby></a></li>
<li class="NavMenuLi"><a class="NavText" href="./wishlist.html"><ruby>企画詳細<rt>きかくしょうさい</rt></ruby></a></li>
<li class="NavMenuLi"><a class="NavText" href="./forkids.html"><ruby>小学生<rt>しょうがくせい</rt>の方へ</ruby></a></li>
<li class="NavMenuLi"><a class="NavText" href="./forparent.html"><ruby>保護者<rt>ほごしゃ</rt>の方へ</ruby></a></li>
<li class="NavMenuLi"><a class="NavText" href="./forstudent.html"><ruby>学生<rt>がくせい</rt></ruby>の方へ</a></li>
<li class="NavMenuLi"><a class="NavText" href="https://forms.gle/QrNshyGzHCidRzX6A" target="_blank" rel="noopener noreferrer"><ruby>お問い合わせ<rt>おといあわせ</rt></ruby></a></li>
</ul>
</nav>
</header>
<main>
<div class="MainImg">
<form name="WishForm" id="WishForm">
<label for="WishName" class="WishTitle">タイトル</label>
<input id="WishName" class="WishName" type="text" name="WishName" placeholder="したいことを書いてね">
<label for="OutLine" class="WishDetail">詳細</label>
<textarea id="OutLine" class="OutLine" name="OutLine" rows="6" placeholder="したいことの詳細を書いてね"></textarea>
<button type="submit" id="SubmitButton" class="SubmitButton btn btn-border">送信</button>
</form>
</div>
</main>
<script type="module">
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.4.0/firebase-app.js";
import { getDatabase, ref, child, push, update } from "https://www.gstatic.com/firebasejs/10.4.0/firebase-database.js";
const firebaseConfig = {
databaseURL:"https://harugassyukuhp-8c700-default-rtdb.asia-southeast1.firebasedatabase.app/"
};
const app = initializeApp(firebaseConfig);
const database = getDatabase(app);
const Submit=document.getElementById("SubmitButton");
if(Submit){
Submit.addEventListener('click', (e) =>{
e.preventDefault();
console.log("1");
const WishName=WishForm.WishName.value;
const WishDetail=WishForm.OutLine.value;
if(WishName){
document.getElementById("WishForm").reset();
console.log("2");
const db = getDatabase();
push(ref(db, 'numbers/'), {
title: WishName,
detail:WishDetail,
});
}
},false);
}
</script>
<script type="text/javascript" src="./Hamburger.js"></script>
</body>
</html>