This repository has been archived by the owner on Jul 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
pairwise-comparison.html
106 lines (98 loc) · 3.71 KB
/
pairwise-comparison.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Pairwise Comparison</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.8.0/css/bulma.min.css">
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.js"></script>
<script async defer src="https://buttons.github.io/buttons.js"></script>
</head>
<body>
<nav class="navbar is-light has-text-centered">
<div class="navbar-menu is-active">
<div class="navbar-start">
<a class="navbar-item" href="https://evgeniy-khist.github.io/">
evgeniy-khist.github.io
</a>
<a class="navbar-item" href="pairwise-comparison.html">
Pairwise Comparison
</a>
<a class="navbar-item" href="solution-comparison.html">
Solution Comparison
</a>
<a class="navbar-item" href="image-pairwise-comparison.html">
Image Pairwise Comparison
</a>
</div>
<div class="navbar-end">
<div class="navbar-item">
<a class="github-button" href="https://github.com/evgeniy-khist/pairwise-comparison" data-icon="octicon-star"
data-size="large" data-show-count="true"
aria-label="Star evgeniy-khist/pairwise-comparison on GitHub">Star</a>
</div>
<div class="navbar-item">
<a class="github-button" href="https://github.com/evgeniy-khist/pairwise-comparison/fork"
data-icon="octicon-repo-forked" data-size="large" data-show-count="true"
aria-label="Fork evgeniy-khist/pairwise-comparison on GitHub">Fork</a>
</div>
<div class="navbar-item">
<a class="github-button" href="https://github.com/evgeniy-khist" data-size="large" data-show-count="true"
aria-label="Follow @evgeniy-khist on GitHub">Follow @evgeniy-khist</a>
</div>
</div>
</div>
</nav>
<section id="app" class="section">
<div class="container">
<div class="columns">
<div class="column">
<div class="field has-addons">
<div class="control">
<input class="input" type="text" placeholder="New item" v-model="newItemValue" @keyup.enter="addItem">
</div>
<div class="control">
<a class="button is-primary" @click="addItem">Add</a>
</div>
</div>
<table class="table">
<thead>
<tr>
<th>Item</th>
<th>Score</th>
<th></th>
</tr>
</thead>
<tbody>
<tr v-for="item in sortedItems">
<th>{{ item.value }}</th>
<td>{{ item.score }}</td>
<td><span class="tag is-success" v-if="winners.includes(item)">Winner</span></td>
</tr>
</tbody>
</table>
</div>
<div class="column">
<p class="title is-3">Compare items</p>
<div class="field is-grouped is-grouped" v-for="pair in pairs">
<p class="control">
<a class="button" :class="{ 'is-primary': pair.isItem1Winner() }" :disabled="pair.voted"
@click="pair.voteForItem1()">
{{ pair.item1.value }}
</a>
</p>
<p class="control">
<a class="button" :class="{ 'is-primary': pair.isItem2Winner() }" :disabled="pair.voted"
@click="pair.voteForItem2()">
{{ pair.item2.value }}
</a>
</p>
</div>
</div>
</div>
</div>
</section>
<script src="pairwise-comparison.js"></script>
<script src="pairwise-comparison-vue.js"></script>
</body>
</html>