2018-04-26 04:55:34 +02:00
|
|
|
{{ define "header" }}
|
|
|
|
<div class="container">
|
2022-10-20 01:19:21 +02:00
|
|
|
<div class="section pb-xs">
|
|
|
|
<h1 class="title">Game Compatibility List</h1>
|
|
|
|
<p class="content">
|
2022-10-25 10:30:42 +02:00
|
|
|
The compatibility list contains all the games that have been tested, sorted by how well they work on the emulator.
|
2022-10-20 01:19:21 +02:00
|
|
|
</p>
|
|
|
|
<table class="table is-fullwidth">
|
|
|
|
<tbody>
|
|
|
|
{{ range .Site.Data.compatibility }}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<div class="is-square" style="background-color: {{ .color }}"></div>
|
|
|
|
{{ .name }}
|
|
|
|
</td>
|
|
|
|
<td>{{ .description }}</td>
|
|
|
|
</tr>
|
|
|
|
{{ end }}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2022-10-25 13:24:27 +02:00
|
|
|
<canvas id="chartjs-container" style="width:100%;height:130px"></canvas>
|
2022-10-20 01:19:21 +02:00
|
|
|
</div>
|
2018-04-26 04:55:34 +02:00
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "main" }}
|
2022-10-20 01:19:21 +02:00
|
|
|
<div id="game-listing">
|
2022-10-25 10:30:42 +02:00
|
|
|
<div class="pagination-search-container">
|
|
|
|
<div class="pagination-container">
|
2022-10-20 01:19:21 +02:00
|
|
|
<ul class="pagination paginationTop is-pulled-left"></ul>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<form>
|
|
|
|
<div class="form-group">
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td>
|
2022-10-25 10:30:42 +02:00
|
|
|
<div class="input-group search-box search-container">
|
2022-10-20 01:19:21 +02:00
|
|
|
<input type="text" class="search input is-rounded" id="search-box" placeholder="Search...">
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section pt-xs">
|
|
|
|
<table id="compatibility-list" class="table table-responsive is-fullwidth">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th></th>
|
|
|
|
<th class="sort" data-sort="title">Game Title</th>
|
|
|
|
<th class="sort" data-sort="compatibility">Compatibility</th>
|
|
|
|
<th class="sort" data-sort="date-tested">Date Tested</th>
|
2018-04-26 04:55:34 +02:00
|
|
|
</tr>
|
2022-10-20 01:19:21 +02:00
|
|
|
</thead>
|
|
|
|
<tbody class="list is-size-6">
|
2018-10-17 02:33:45 +02:00
|
|
|
{{ range .Pages }}
|
|
|
|
{{ $rating := index .Site.Data.compatibility .Params.compatibility }}
|
|
|
|
<tr data-key="{{ .Params.section_id }}">
|
2022-10-20 01:19:21 +02:00
|
|
|
<td class="hidden listing-metadata">
|
|
|
|
<span hidden>{{ .Params.title }} {{ $rating.name }}</span>
|
|
|
|
</td>
|
2022-10-25 13:24:27 +02:00
|
|
|
<td class="game-title" data-title="{{ .Params.title }}">
|
2022-10-20 01:19:21 +02:00
|
|
|
<a href="{{ .Permalink }}">{{ .Params.title }}</a>
|
|
|
|
</td>
|
2022-10-25 13:24:27 +02:00
|
|
|
<td class="compatibility" data-compatibility="{{ $rating.key }}">
|
2022-10-20 01:19:21 +02:00
|
|
|
<div class="is-square" style="background-color: {{ $rating.color }}"></div>
|
|
|
|
<span>{{ $rating.name }}</span>
|
|
|
|
</td>
|
2022-10-25 13:24:27 +02:00
|
|
|
<td class="date-tested" data-timestamp="{{ .Params.testcase_date }}">
|
2022-10-30 13:55:00 +01:00
|
|
|
<span>{{ if .Params.testcase_date }}{{ dateFormat "January 2, 2006" .Params.testcase_date }}{{ end }}</span>
|
2022-10-20 01:19:21 +02:00
|
|
|
</td>
|
2018-10-17 02:33:45 +02:00
|
|
|
</tr>
|
|
|
|
{{ end }}
|
2022-10-20 01:19:21 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<ul class="pagination paginationBottom is-pulled-left"></ul>
|
|
|
|
</div>
|
2018-04-26 04:55:34 +02:00
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "scripts" }}
|
2022-10-30 13:55:00 +01:00
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"
|
2022-10-20 01:19:21 +02:00
|
|
|
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
|
2022-10-30 13:55:00 +01:00
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js"
|
|
|
|
integrity="sha256-NEVvGNMGqFvs6adGLZjm5sLgcuX9rGTg1wlGtA1f7M8=" crossorigin="anonymous"></script>
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js"
|
|
|
|
integrity="sha256-+8RZJua0aEWg+QVVKg4LEzEEm/8RFez5Tb4JBNiV5xA=" crossorigin="anonymous"></script>
|
2022-10-20 01:16:05 +02:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
|
|
|
function getLastSorted(list){
|
|
|
|
var currentSorted = $(list.listContainer).find(".asc, .desc").attr("data-sort");
|
2022-10-30 13:55:00 +01:00
|
|
|
if (!currentSorted)
|
2022-10-20 01:16:05 +02:00
|
|
|
list.lastSorted = currentSorted;
|
|
|
|
return list.lastSorted;
|
|
|
|
}
|
|
|
|
|
2022-10-25 13:24:27 +02:00
|
|
|
function filterTable(index, name) {
|
|
|
|
$("#search-box").val(name);
|
2022-10-20 01:16:05 +02:00
|
|
|
list.search(index, ['compatibility']);
|
|
|
|
}
|
|
|
|
|
|
|
|
function clearSearch() {
|
|
|
|
$("#search-box").val("");
|
|
|
|
list.search();
|
|
|
|
}
|
|
|
|
|
|
|
|
var options = {
|
|
|
|
valueNames: [
|
|
|
|
'listing-metadata',
|
2022-10-25 13:24:27 +02:00
|
|
|
{ name: 'game-title', attr: 'data-title' },
|
2022-10-20 01:16:05 +02:00
|
|
|
{ name: 'compatibility', attr: 'data-compatibility' },
|
|
|
|
{ name: 'date-tested', attr: 'data-timestamp' }
|
|
|
|
],
|
|
|
|
searchColumns: [ 'listing-metadata' ],
|
|
|
|
pagination: [
|
|
|
|
{ paginationClass: "paginationTop" },
|
|
|
|
{ paginationClass: "paginationBottom" }
|
|
|
|
],
|
|
|
|
indexAsync: true,
|
|
|
|
page: 30
|
|
|
|
};
|
|
|
|
|
|
|
|
var list = new List('game-listing', options);
|
|
|
|
|
|
|
|
list.sort("title", {order: "asc"});
|
|
|
|
|
|
|
|
list.on("updated", function(list){
|
|
|
|
var $list = $(list.list);
|
|
|
|
var $items = $list.children();
|
|
|
|
$items.removeClass("key");
|
2022-10-30 13:55:00 +01:00
|
|
|
if ('title' === getLastSorted(list)){
|
2022-10-20 01:16:05 +02:00
|
|
|
$items.each(function(){
|
|
|
|
var key = $(this).attr("data-key")
|
|
|
|
if (
|
|
|
|
$list
|
|
|
|
.children("[data-key='" + key + "']")
|
|
|
|
.first()
|
|
|
|
.is( $(this) )
|
|
|
|
){
|
|
|
|
$(this).addClass("key");
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#game-listing .clear-search').click(clearSearch);
|
2022-10-25 13:24:27 +02:00
|
|
|
|
2022-10-30 13:55:00 +01:00
|
|
|
var dataset = [
|
2022-10-25 13:24:27 +02:00
|
|
|
{{- $dataPages := .Data.Pages }}
|
|
|
|
{{- range .Site.Data.compatibility }}
|
|
|
|
{{- $dataPagesFiltered := where $dataPages ".Params.compatibility" .key }}
|
|
|
|
{ axis: "y", "label": "{{ .name }}", "data": [ {{ len $dataPagesFiltered }} ], backgroundColor: "{{ .color }}" },
|
|
|
|
{{- end }}
|
|
|
|
].reverse()
|
|
|
|
|
|
|
|
|
|
|
|
var chart = new Chart("chartjs-container", {
|
|
|
|
type: 'bar',
|
|
|
|
data: {
|
|
|
|
labels: [""],
|
|
|
|
datasets: dataset
|
|
|
|
},
|
|
|
|
options: {
|
|
|
|
plugins: {
|
|
|
|
legend: {
|
|
|
|
display: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
responsive: true,
|
|
|
|
scales: {
|
|
|
|
x: { stacked: true },
|
|
|
|
y: { stacked: true },
|
|
|
|
},
|
|
|
|
indexAxis: 'y',
|
|
|
|
onClick: (e) => {
|
2022-10-30 13:55:00 +01:00
|
|
|
var points = chart.getElementsAtEventForMode(e, 'nearest', {
|
2022-10-25 13:24:27 +02:00
|
|
|
intersect: true
|
|
|
|
}, true);
|
|
|
|
|
|
|
|
if(points.length) {
|
|
|
|
// The index of compatibility ratings is reversed
|
|
|
|
filterTable(dataset.length - points[0].datasetIndex - 1, dataset[points[0].datasetIndex].label);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2022-10-20 01:16:05 +02:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2018-10-17 02:33:45 +02:00
|
|
|
{{ end }}
|