-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
139 lines (130 loc) · 4.51 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width initial-scale=1" />
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
/>
<link rel="stylesheet" href="assets/css/common.css" />
</head>
<body class="bg-light">
<div class="container">
<div class="text-center">
<h2>Fuel Bill Generator</h2>
<p class="lead">Let's Generate. Fill in Your Information</p>
</div>
<div class="row">
<div class="col-md-8 order-md-1">
<div class="panel panel-primary">
<div class="panel-heading">Select Your Template</div>
<div class="panel-body">
<label class="radio-inline"
><input
type="radio"
name="template"
value="0"
checked
/>Template 1</label
>
<label class="radio-inline"
><input type="radio" name="template" value="1" />Template
2</label
>
<label class="radio-inline"
><input type="radio" name="template" value="2" />Template
3</label
>
</div>
</div>
<div class="panel panel-primary" id="section-paper-texture">
<div class="panel-heading">Select Paper Texture</div>
<div class="panel-body"></div>
</div>
<div class="panel panel-primary" id="section-pump-logo">
<div class="panel-heading">Select Pump Logo</div>
<div class="panel-body"></div>
</div>
<div class="panel panel-primary" id="section-optional-fields">
<div class="panel-heading">Optinal Fields</div>
<div class="panel-body"></div>
</div>
<div class="panel panel-primary" id="section-data">
<div class="panel-heading">Enter Data</div>
<div class="panel-body">
<div class="row"></div>
</div>
</div>
<button type="button" class="btn btn-default" disabled>
Load Last Saved Data
</button>
<button type="button" class="btn btn-default" id="loadDefaultData">
Reset
</button>
<button type="button" class="btn btn-default" id="generate">
Preview
</button>
<button type="button" class="btn btn-default" disabled>
Download
</button>
</div>
<div class="col-md-4">
<input
type="range"
class="slider"
id="percentage-slider"
min="0"
max="100"
value="100"
/>
<span id="template-container"></span>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<script src="assets/js/common.js"></script>
<script src="templates/AbstractTemplate.js"></script>
<script src="templates/template-1/Template1.js"></script>
<script src="templates/template-2/Template2.js"></script>
<script src="templates/template-3/Template3.js"></script>
<script>
const templates = [
new Template1("template-container"),
new Template2("template-container"),
new Template3("template-container"),
];
var templateIndex;
var template;
$(document).ready(async function () {
await onInit();
$("#loadDefaultData").on("click", async function () {
await onTemplateSelected();
});
$("#generate").on("click", function () {
generate(template);
});
$("input[name=template]").change(async function () {
await onTemplateSelected();
});
$(document).on("click", "input[name=texture]", async function () {
generate(template);
});
$(document).on("click", "input[name=pumpLogo]", async function () {
generate(template);
});
$(document).on("click", ".optional-fields", async function () {
generate(template);
});
$(document).on("keyup", ".text-input", async function () {
generate(template);
});
});
async function onInit() {
await onTemplateSelected();
initZoomSlider();
}
</script>
</body>
</html>