-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
124 lines (124 loc) · 5.85 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Form Builder & Validation</title>
<link rel="stylesheet" href="./dist/css/vender/normalize.css" />
<link rel="stylesheet" href="./dist/css/vender/vue-select.css" />
<link rel="stylesheet" href="./dist/css/main.css" />
<script defer src="./assets/js/vendor/vue@2.6.11.js"></script>
<script defer src="./assets/js/vendor/httpVueLoader.js"></script>
<script defer src="./assets/js/vendor/Sortable.min.js"></script>
<script defer src="./assets/js/vendor/vuedraggable.umd.min.js"></script>
<script defer src="./assets/js/vendor/vue-select.js"></script>
<script defer src="./assets/js/vendor/fuse.js"></script>
<script defer src="./assets/js/vendor/popper.min.js"></script>
<script defer src="https://zhongyoulu.github.io/commonUtil/assets/js/commonUtil.js"></script>
<script defer src="./assets/js/_formUtil.js"></script>
<script defer src="./assets/js/main.js"></script>
<style>
.ghost {
opacity: 0.5;
}
</style>
</head>
<body>
<div id="app">
<div id="setting">
<div class="control-bar">
<button @click="addToHistory">
<svg focusable="false" viewbox="0 0 24 24">
<path
d="M17 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V7l-4-4m2 16H5V5h11.17L19 7.83V19m-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3s3-1.34 3-3s-1.34-3-3-3M6 6h9v4H6V6z"
fill="currentColor"
></path>
</svg>
</button>
<button @click="restorePrev" :disabled="history.length == 0 || historyIdx == 0">
<svg focusable="false" viewBox="0 0 24 24">
<path
d="M13.26 3C8.17 2.86 4 6.95 4 12H2.21c-.45 0-.67.54-.35.85l2.79 2.8c.2.2.51.2.71 0l2.79-2.8a.5.5 0 0 0-.36-.85H6c0-3.9 3.18-7.05 7.1-7c3.72.05 6.85 3.18 6.9 6.9c.05 3.91-3.1 7.1-7 7.1c-1.61 0-3.1-.55-4.28-1.48a.994.994 0 0 0-1.32.08c-.42.42-.39 1.13.08 1.49A8.858 8.858 0 0 0 13 21c5.05 0 9.14-4.17 9-9.26c-.13-4.69-4.05-8.61-8.74-8.74zm-.51 5c-.41 0-.75.34-.75.75v3.68c0 .35.19.68.49.86l3.12 1.85c.36.21.82.09 1.03-.26c.21-.36.09-.82-.26-1.03l-2.88-1.71v-3.4c0-.4-.34-.74-.75-.74z"
fill="currentColor"
></path>
</svg>
</button>
<button @click="restoreNext" :disabled="history.length == 0 || historyIdx == history.length-1">
<svg focusable="false" viewBox="0 0 24 24">
<path
d="M11 8.75v3.68c0 .35.19.68.49.86l3.12 1.85c.36.21.82.09 1.03-.26c.21-.36.1-.82-.26-1.03l-2.87-1.71v-3.4c-.01-.4-.35-.74-.76-.74s-.75.34-.75.75zm10 .75V4.21c0-.45-.54-.67-.85-.35l-1.78 1.78a9.01 9.01 0 0 0-7.21-2.6c-4.19.38-7.64 3.75-8.1 7.94a9 9 0 0 0 17.87 2.14c.07-.6-.4-1.12-1-1.12c-.5 0-.92.37-.98.86c-.43 3.49-3.44 6.19-7.05 6.14c-3.71-.05-6.84-3.18-6.9-6.9C4.94 8.2 8.11 5 12 5c1.93 0 3.68.79 4.95 2.05l-2.09 2.09c-.32.32-.1.86.35.86h5.29c.28 0 .5-.22.5-.5z"
fill="currentColor"
></path>
</svg>
</button>
<span>{{history[historyIdx]?.created}}</span>
<div>(localStorage 紀錄最後五筆手動存檔)</div>
</div>
<draggable v-model="formJSON.columns" animation="300" ghostClass="ghost" handle=".card__drag">
<transition-group type="transition">
<column-form
v-for="(column, idx) in formJSON.columns"
:column="column"
:columns="columns"
:idx="idx"
:key="column.id"
@delete="handleDelete"
@save="addToHistory"
></column-form>
</transition-group>
</draggable>
<button class="btn btn--add" @click="handleAdd">✚</button>
</div>
<div id="result">
<form-builder :json="formJSON"></form-builder>
</div>
</div>
<a href="https://github.com/ZhongYouLu/FormBuilder" class="github-corner" aria-label="View source on GitHub"
><svg
width="80"
height="80"
viewBox="0 0 250 250"
style="fill: #151513; color: #fff; position: absolute; top: 0; border: 0; right: 0"
aria-hidden="true"
>
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
fill="currentColor"
style="transform-origin: 130px 106px"
class="octo-arm"
></path>
<path
d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
fill="currentColor"
class="octo-body"
></path></svg></a
><style>
.github-corner:hover .octo-arm {
animation: octocat-wave 560ms ease-in-out;
}
@keyframes octocat-wave {
0%,
100% {
transform: rotate(0);
}
20%,
60% {
transform: rotate(-25deg);
}
40%,
80% {
transform: rotate(10deg);
}
}
@media (max-width: 500px) {
.github-corner:hover .octo-arm {
animation: none;
}
.github-corner .octo-arm {
animation: octocat-wave 560ms ease-in-out;
}
}
</style>
</body>
</html>