-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
77 lines (76 loc) · 2.45 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sum It</title>
<link rel="stylesheet" href="assets/style.css?v3" />
<link
href="//fonts.googleapis.com/css2?family=Noto+Sans&display=swap"
rel="stylesheet"
/>
<style>
.loader{
position: absolute;
top:0px;
left:0px;
width:100vw;
height: 100vh;
z-index: 1000;
display: grid;
justify-items: center;
align-content: center;
background-color: #fff;
}
</style>
</head>
<body>
<section id="loader" class='loader' >loading . . . </section>
<section class="content">
<div id="app">
<div class="form">
<label v-show="sum">Total = {{sum}}</label>
<input
type="text"
v-model="item"
v-on:keyup.enter="addItem"
v-on:keydown.delete="undoAddition"
ref="n"
/><br />
<input type="checkbox" v-model="del" />
<span>Activate Backspace/Delete Key to Undo additions</span>
</div>
<div>
<ul class="items">
<li v-for="(item,index) in items">
<div class="left">{{item}}</div>
<div class="right">
<button @click="removeItem(index)">Delete</button>
</div>
</li>
<!-- <li class="seperator"></li> -->
<li class="total" v-show="sum">
<div class="left">Total</div>
<div class="right">{{sum}}</div>
</li>
</ul>
</div>
<div class="info">
<p>
* Type a number and hit <kbd>Enter</kbd> to add it<br />
* Type a math expression like 16 * 4 or 56 / 7 and hit
<kbd>Enter</kbd> to add the result<br />
* Hit <kbd>Delete</kbd> / <kbd>Backspace</kbd> key to undo the
addition<br />
* Click on <kbd class="light">Delete</kbd> button to remove any
specific item<br />
* Check source code and send issues/sugegstions -
<a href="https://github.com/hasinhayder/vue-calc" target="_blank">Sum It</a><br />
</p>
</div>
</div>
</section>
<script src="//unpkg.com/vue@next"></script>
<script src="assets/main.js?v4"></script>
</body>
</html>