-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
145 lines (139 loc) · 5.42 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
144
145
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en">
<head>
<title>Calculator</title>
<link rel="stylesheet" href="style.css" />
<link href="https://fonts.googleapis.com/css?family=Abril+Fatface|Open+Sans|Rubik+One" rel="stylesheet">
</head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
<body>
<menu>
<button class="holder" aria-label="How to" aria-expanded="false" aria-controls="howto" onclick="toggleSlide(this, 'howto')">
<svg role="button" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<!-- Gradient -->
<lineargradient id="gradient" x1="0%" y1="0%" x2="100%" y2="0">
<stop offset="0%" style="stop-color:#57e7eb;"/>
<stop offset="25%" style="stop-color:#D62229;"/>
<stop offset="50%" style="stop-color:#E97639;"/>
<stop offset="75%" style="stop-color:#1adb7f;"/>
<stop offset="100%" style="stop-color:#57e7eb;"/>
</lineargradient>
<!-- Pattern consisting of two seamless animations -->
<pattern id="pattern1" width="300%" height="100%" patternunits="userSpaceOnUse">
<rect id="first" x="0" y="0" width="150%" height="100%" fill="url(#gradient)">
<animate attributetype="XML"
attributename="x"
from="0" to="150%"
dur="7s"
repeatcount="indefinite"/>
</rect>
<rect id="two" x="-150%" y="0" width="150%" height="100%" fill="url(#gradient)">
<animate attributetype="XML"
attributename="x"
from="-150%" to="0"
dur="7s"
repeatcount="indefinite"/>
</rect>
</pattern>
</defs>
<text x="50%" y="40" fill="url(#pattern1)">HOWTO</text>
</svg>
</button>
<ul class="sliding hide" id="howto">
<li>
use keyboard or mouse for numbers and operators
</li>
<li>
specify the degree when calculating a root: <strong>8√3=2</strong>
</li>
<li>
absolute percentage when following a number: <strong>9%=0.09</strong>
</li>
<li>
relative percentage when following an expression: <strong>100+9%=109</strong>
</li>
<li>
follow number by multiplication sign and equate to calculate power:
<strong>2*=4</strong>
</li>
<li>
maximum capability of screen is 17 symbols
</li>
</ul>
<button class="holder" aria-label="keyboard shortcuts" aria-expanded="false" aria-controls="shortcuts" onclick="toggleSlide(this, 'shortcuts')">
<svg>
<text x="50%" y="40" fill="url(#pattern2)">SHORTCUTS</text>
<pattern id="pattern2" width="300%" height="100%" patternunits="userSpaceOnUse">
<use xlink:href="#first"/>
<use xlink:href="#two"/>
</pattern>
</svg>
</button>
<ul class="sliding hide" id="shortcuts">
<li>
<strong>A</strong> to clear all
</li>
<li>
<strong>BACKSPACE</strong> to clear last
</li>
<li>
<strong>N</strong> for nth root
</li>
<li>
<strong>*</strong> for multiplication
</li>
<li>
<strong>/</strong> for division
</li>
<li>
<strong>ENTER</strong> or <strong>=</strong> to see result
</li>
</ul>
<button class="holder" aria-label="Inspiration" aria-expanded="false" aria-controls="inspiration" onclick="toggleSlide(this, 'inspiration')">
<svg role="button">
<text x="50%" y="40" fill="url(#pattern3)">INSPIRATION</text>
<pattern id="pattern3" width="300%" height="100%" patternunits="userSpaceOnUse">
<use xlink:href="#first"/>
<use xlink:href="#two"/>
</pattern>
</svg>
</button>
<p class="sliding hide" id="inspiration">
inspired by OSX calculator design and
<a id="proto" aria-label="design by Fabian Frey" href="https://dribbble.com/shots/3031958-Day-004-Calculator">this prototype</a>
</p>
</menu>
<main id="calculator">
<div id="total">
<div id="display" role="main" aria-live="assertive">
<div id="screen"></div>
<div id="result"></div>
</div>
<button aria-label="backspace" class="key clears" id="clear"><</button>
</div>
<div id="keyboard">
<button aria-label="clear all" class="key clears" id="clearall">AC</button>
<button class="key operators" id="percent">%</button>
<button aria-label="nth root" class="key operators" id="nroot">√</button>
<button class="key operators">+</button>
<button class="key">7</button>
<button class="key">8</button>
<button class="key">9</button>
<button aria-label="minus" class="key operators">-</button>
<button class="key">4</button>
<button class="key">5</button>
<button class="key">6</button>
<button class="key operators">÷</button>
<button class="key">1</button>
<button class="key">2</button>
<button class="key">3</button>
<button class="key operators">×</button>
<button class="key">0</button>
<button aria-label="decimal point" class="key" id="decimal">.</button>
<button class="key operators" id="equals">=</button>
</div>
</main>
<script src="script.js"></script>
</body>
</html>