-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
143 lines (126 loc) · 3.38 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<title>Survey builder</title>
<link rel='stylesheet' href='dist/demo.css'>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css" />
<style>
.github-fork-ribbon:before {
background-color: rgb(124, 189, 180);
}
body {
margin: 40px 0;
padding: 20px 10px;
}
p.intro {
padding: 10px 10px 50px 20px;
}
#survey-builder {
position: relative;
padding-right: 30%;
}
#survey-builder .debug {
position: absolute;
right: 10px;
top: 50px;
height: 80%;
width: 25%;
padding-right: initial;
overflow-y: auto;
font-size: 14px;
}
@media (max-width: 1200px) {
#survey-builder {
padding-right: initial;
}
#survey-builder .debug {
position: initial;
}
}
footer {
margin: 50px -10px 0 -10px;
padding-left: 20px;
border-top: 1px solid #999;
padding-top: 20px;
color: #aaa;
text-align: center;
}
footer a {
margin-left: 50px;
}
</style>
</head>
<body>
<a class="github-fork-ribbon" href="https://github.com/lotas/survey-builder/" data-ribbon="Fork me on GitHub"
title="Fork me on GitHub">Fork me on GitHub</a>
<p class="intro">
Simple survey builder to create dynamic forms.
</p>
<div id="survey-builder"></div>
<div id="svelte-app"></div>
<footer>
© 2021
<a href="https://github.com/lotas/survey-builder/">github.com/lotas/survey-builder</a>
</footer>
<script>
// SurveyBuilderInit({
// target: document.getElementById('survey-builder'),
// props: {
// haveTitle: false,
// customInputNames: true,
// showExportButton: false,
// debug: true,
// snapshot: {
// title: 'Sample survey',
// questions: [
// {
// id: 'q-1',
// title: 'User name',
// name: 'userName',
// type: 'input',
// required: true,
// },
// {
// id: 'q-2',
// title: 'User rating',
// name: 'userRating',
// type: 'rating',
// required: true,
// options: 5,
// },
// {
// id: 'q-3',
// title: 'Account type',
// name: 'accountType',
// type: 'single',
// required: true,
// answers: [
// {
// id: 'a-1',
// title: 'Private account',
// type: 'text',
// },
// {
// id: 'a-2',
// title: 'Business account',
// type: 'text',
// },
// ],
// },
// ],
// },
// onExport: (data) => {
// console.log('Congrats: export', data)
// },
// onChange: (data) => {
// console.log('Model changed', data)
// },
// }
// })
</script>
<script src='dist/demo.js'></script>
</body>
</html>