-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
92 lines (90 loc) · 4.61 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
<!DOCTYPE html>
<html lang="de" dir="ltr">
<!-- Flag emojis by Twemoji: https://twemoji.twitter.com/ -->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Medaillenspiegel</title>
</head>
<body>
<div class="background container-fluid">
<div class="row justify-content-center pb-3 pt-3">
<h1>Medaillenspiegel</h1>
</div>
<section class="app">
<section class="main justify-content-center entry-list mb-3" v-show="entries.length">
<transition-group tag="div" name="flip-list">
<div v-for="(entry, index) in entries"
class="row entry"
:key="entry.id"
:class="{ editing: entry == editedEntry }"
>
<div class="col rank">
<span class="h4">{{ index+1 }}.</span>
</div>
<div class="col-10 col-lg-3">
<label class="h4 view" @dblclick="editEntry(entry)">
<span class="h4 flag" v-bind:class="entry.class"></span>{{ entry.title }}
</label>
<input type="text"
class="form-control edit"
v-model="entry.title"
@keyup.enter="doneEdit(entry)"
@keyup.esc="cancelEdit(entry)"
/>
</div>
<div class="col-12 col-lg-4">
<div class="progress">
<div class="progress-bar bg-gold" role="progressbar" :style="{'width': `${calcProgressGold(entry.gold)}%`}"></div>
<div class="progress-bar bg-silver" role="progressbar" :style="{'width': `${calcProgressSilver(entry.silver)}%`}"></div>
<div class="progress-bar bg-bronze" role="progressbar" :style="{'width': `${calcProgressBronze(entry.bronze)}%`}"></div>
</div>
</div>
<div class="col-3 col-lg-1 text-right">
<label class="h4 view" @dblclick="editEntry(entry)">{{ entry.gold }}<span class="text-muted">×</span>🥇</label>
<input type="number" min="0" max="99" step="1"
class="form-control edit"
v-model="entry.gold"
@keyup.enter="doneEdit(entry)"
@keyup.esc="cancelEdit(entry)"
>
</div>
<div class="col-3 col-lg-1 text-right">
<label class="h4 view rounded-pill" @dblclick="editEntry(entry)">{{ entry.silver }}<span class="text-muted">×</span>🥈</label>
<input type="number" min="0" max="99" step="1"
class="form-control edit"
v-model="entry.silver"
@keyup.enter="doneEdit(entry)"
@keyup.esc="cancelEdit(entry)"
>
</div>
<div class="col-3 col-lg-1 text-right">
<label class="h4 view" @dblclick="editEntry(entry)">{{ entry.bronze }}<span class="text-muted">×</span>🥉</label>
<input type="number" min="0" max="99" step="1"
class="form-control edit"
v-model="entry.bronze"
@keyup.enter="doneEdit(entry)"
@keyup.esc="cancelEdit(entry)"
>
</div>
<div class="col-3 col-lg-1 view">
<button class="btn btn-outline-secondary" @click="editEntry(entry)">📝</button>
</div>
<div class="col-3 col-lg-1 btn-group edit">
<button class="btn btn-outline-success" @click="doneEdit(entry)">✔️</button><button class="btn btn-outline-warning" @click="cancelEdit(entry)">↩️</button>
</div>
</div>
</transition-group>
</section>
<footer class="row justify-content-lg-center footer">
<input class="form-control new-entry"
autofocus autocomplete="on"
placeholder="Gib ein neues Land ein und drücke [Enter]"
v-model="newEntry"
@keyup.enter="addEntry">
</footer>
</section>
</div>
<script src="./dist/bundle.js"></script>
</body>
</html>