-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
204 lines (121 loc) · 4.18 KB
/
index.html
File metadata and controls
204 lines (121 loc) · 4.18 KB
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE HTML>
<html>
<head>
<title>Mutabel Data</title>
<meta charset="UTF-8">
</head>
<!--
NOTE:
==============================================================================================================
Because of simplicity & demonstration purposes, the "style" attribute is used within html tags.
Nevertheless it is recommended to use CSS for styling.
"margin: auto" sets the "div" tag to center. This would also work in "body" tag but then there would be
no default margin for top.
"div" tag doesn`t react to "text-align:center" which is found in "body" tag, but other tags do.
Some "div" tags have "position:absolute" to adjust them into desired position.
This works because of "position:relative" which is found in the parent tag "section".
The "height" and "width" attributes of the "div" tag defines the area which attribute "onclick" should react
"id" of a "div" which contains a state has to be identical with state key
when filling state objects in "mutable.js".
Some tag attributes are put into new lines, to keep them more visible.
==============================================================================================================
-->
<body style="text-align:center; margin-left: auto; margin-right:auto;">
<h2>Door State Diagram</h2>
<!--STATES & TRANSITIONS-->
<section style="position:relative;
width:300px;
height:250px;
left:calc(50% - 150px);">
<!--1. ROW-->
<div class="states"
id="OPENED"
style=" height:50px;
width:100px;
margin: auto;">
<img src="images/states/stOpened.png">
</div>
<!--2. ROW-->
<div onclick="changeColor('CLOSING', 'CLOSE','OPENED', 'OPENING_FIN', '#FF8C00', false);"
style=" height:50px;
width:150px;
float:left">
<img src="images/transitions/trClose.png">
</div>
<div onclick="changeColor('OPENED', 'OPENING_FIN','OPENING', 'OPEN', '#FF8C00', false);"
style=" height:50px;
width:150px;
float:left">
<img src="images/transitions/trOpeningFIN.png">
</div>
<!--3. ROW-->
<div class="states"
id="CLOSING"
style=" height:50px;
width:100px;
float:left;">
<img src="images/states/stClosing.png">
</div>
<div onclick="changeColor('OPENING', 'OPEN','CLOSING', 'CLOSE', '#FF8C00', false);"
style=" height:25px;
width:100px;
float:left;">
<img src="images/transitions/trOpenSEC.png">
</div>
<div class="states"
id="OPENING"
style=" height:50px;
width:100px;
float:left;">
<img src="images/states/stOpening.png">
</div>
<div onclick="changeColor('CLOSING', 'CLOSE','OPENING', 'OPEN', '#FF8C00', false);"
style=" height:25px;
width:100px;
position: absolute;
left: 33.4%;
top: 50%;">
<img src="images/transitions/trCloseSEC.png">
</div>
<!--4. ROW-->
<div onclick="changeColor('CLOSED', 'CLOSING_FIN','CLOSING', 'CLOSE', '#FF8C00', false);"
style=" height:50px;
width:150px;
float:left">
<img src="images/transitions/trClosingFIN.png">
</div>
<div onclick="changeColor('OPENING', 'OPEN','CLOSED', 'CLOSING_FIN', '#FF8C00', false);"
style=" height:50px;
width:150px;
float:left">
<img src="images/transitions/trOpen.png">
</div>
<!--5. ROW-->
<div class="states"
id="CLOSED"
style=" height:50px;
width:100px;
position: absolute;
left: 33.4%;
top: 80%;">
<img src="images/states/stClosed.png">
</div>
</section>
<section style="margin-top:25px;">
<h3>Interface</h3>
<p>Transition Name: <span id="interface">XXX</span></p>
</section>
<br>
<hr width="45%;">
<section>
<br>
<br>
For more explanation please visit -
<a href="https://github.com/Incrementis/Javascript-mutable-data-and-prototypes-/wiki">
Mutable data and prototypes Wiki</a>
</section>
</body>
<footer>
<script language="javascript" type="text/javascript" src="mutable.js"></script>
</footer>
</html>