This commit is contained in:
@@ -10,29 +10,39 @@
|
||||
<body>
|
||||
<h1>Warframe Market Gaps</h1>
|
||||
|
||||
<label for="minDifference">Filter by difference</label>
|
||||
<input type="range" min="1" max="60" value="1" id="minDifference">
|
||||
<span id="filterValue">1</span>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Parts price</th>
|
||||
<th>Set price</th>
|
||||
<th>Difference</th>
|
||||
</tr>
|
||||
{{#each items}}
|
||||
<tr>
|
||||
<td class="name">
|
||||
<a href="{{this.link}}" target="_blank">
|
||||
{{this.name}}
|
||||
</a>
|
||||
</td>
|
||||
<td>{{this.parts}}</td>
|
||||
<td>{{this.set}}</td>
|
||||
<td>{{this.difference}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Parts price</th>
|
||||
<th>Set price</th>
|
||||
<th>Difference</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="items">
|
||||
{{#each items}}
|
||||
<tr data-difference="{{this.difference}}">
|
||||
<td class="name">
|
||||
<a href="{{this.link}}" target="_blank">
|
||||
{{this.name}}
|
||||
</a>
|
||||
</td>
|
||||
<td>{{this.parts}}</td>
|
||||
<td>{{this.set}}</td>
|
||||
<td>{{this.difference}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="timestamp">
|
||||
Generated at {{timestamp}}
|
||||
</div>
|
||||
|
||||
<script src="index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
14
public/index.js
Normal file
14
public/index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const slider = document.getElementById('minDifference')
|
||||
|
||||
slider.addEventListener('input', function (event) {
|
||||
const table = document.getElementById('items')
|
||||
Array.from(table.children).forEach(row => {
|
||||
if (row.dataset.difference < Number(event.target.value)) {
|
||||
row.style.display = 'none'
|
||||
} else {
|
||||
row.style.display = 'table-row'
|
||||
}
|
||||
})
|
||||
|
||||
document.getElementById('filterValue').innerText = event.target.value
|
||||
})
|
||||
@@ -16,10 +16,6 @@ tr {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
tr:nth-child(even) {
|
||||
background: rgb(240, 242, 243);
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 2px 16px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user