-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
201 lines (152 loc) · 4.31 KB
/
index.html
File metadata and controls
201 lines (152 loc) · 4.31 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Simple Cross-Multiplication Calculator</title>
<meta name="viewport" content="width=device-width">
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold' rel='stylesheet' type='text/css'>
<style type="text/css" media="screen">
body {
font-size: 62.5%;
background-color: #fafafa;
color: #777;
font-family: 'Droid Sans', arial, serif;
}
#container
{
max-width: 580px;
width: 100%;
margin: 10px auto;
}
h1 {
text-align: center;
margin: 30px;
font-size: 3.5em;
margin: 40px 0 0 0;
}
#intro {
text-align: center;
margin: 8px 0 30px 0;
font-size: 1.2em;
}
#old_dimensions {
float: left;
text-align: center;
}
#equals {
float: left;
width: 180px;
text-align: center;
font-size: 10.0em;
line-height: 120px;
}
#new_dimensions {
float: left;
text-align: center;
}
.dimensions {
width: 200px;
}
.dimensions input {
display: block;
margin: 0;
text-align: center;
height: 50px;
width: 100px;
color: #777;
font-size: 3.0em;
border-width: 0;
background-color: #fafafa;
}
::-webkit-input-placeholder {
text-align: center;
}
:-moz-placeholder {
text-align: center;
}
.dimensions input:focus {
background-color: #fff;
outline: none;
}
.dimensions .height
{
padding: 0 0 10px 0;
border-bottom: 3px solid #777;
}
.dimensions .width
{
padding: 10px 0 0 0;
}
#old_dimensions input {
margin: 0 0 0 auto;
}
#new_dimensions input {
margin: 0 auto 0 0;
}
@media (max-width: 600px) {
#container {
max-width: 400px;
}
#equals {
width: 100px;
}
.dimensions {
width: 140px;
}
}
</style>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function () {
var dimension = '';
jQuery('.dimensions input').change(function () {
CrossMultiply.dimensions[jQuery(this).attr('id')].val = jQuery(this).val();
CrossMultiply.recalculate();
if (CrossMultiply.dimensionCalculated !== false) {
jQuery('#' + CrossMultiply.dimensionCalculated).val(CrossMultiply.dimensions[CrossMultiply.dimensionCalculated].val).effect("highlight", {}, 1000);
jQuery('#equals').html(CrossMultiply.isRounded ? '≈' : '=');
};
});
jQuery('input').placeholder();
jQuery(window).on('load', function () {
jQuery('#a').focus();
});
});
</script>
</head>
<body>
<div id="container">
<h1>crossmultiply</h1>
<div id="intro">
enter three integers and leave one blank.
</div>
<form id="cross_multiplication" action="index.html" method="get" accept-charset="utf-8">
<div id="old_dimensions" class="dimensions">
<input type="text" name="a" value="" placeholder="a" id="a" class="height example" pattern="[0-9]*">
<input type="text" name="b" value="" placeholder="b" id="b" class="width example" pattern="[0-9]*">
</div>
<div id="equals">
=
</div>
<div id="new_dimensions" class="dimensions">
<input type="text" name="c" value="" placeholder="c" id="c" class="height example" pattern="[0-9]*">
<input type="text" name="d" value="" placeholder="d"id="d" class="width example" pattern="[0-9]*">
</div>
</form>
</div>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
<script src="jquery.placeholder.min.js" type="text/javascript" charset="utf-8"></script>
<script src="underscore-min.js" type="text/javascript" charset="utf-8"></script>
<script src="crossmultiply.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-6520337-5']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>