158 lines
4.7 KiB
HTML
158 lines
4.7 KiB
HTML
{{ define "main" }}
|
|
<h1>Game Compatibility List</h1>
|
|
<p>The Citra Emulator compatibility list contains all the games we tested, sorted by how well they work on the emulator.</p>
|
|
<table class="table table-striped table-bordered">
|
|
<tbody>
|
|
{{ range .Site.Data.compatibility }}
|
|
<tr>
|
|
<td style="width: 120px;"><div class="square-icon" style="background-color: {{ .color }}"></div> {{ .name }}</td>
|
|
<td class="row-compat-desc">{{ .description }}</td>
|
|
</tr>
|
|
{{ end }}
|
|
</tbody>
|
|
</table>
|
|
|
|
<div id="highchart-container" style="height: 100px; margin: 0 auto"></div>
|
|
|
|
<hr />
|
|
|
|
<div id="game-listing">
|
|
<div>
|
|
<form class="pull-right">
|
|
<div class="form-group">
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
<div class="input-group search-box">
|
|
<input type="text" class="form-control fuzzy-search" id="search-box" placeholder="Search...">
|
|
<span onclick="clearSearch()" class="clear-search input-group-addon">X</span>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<a href="https://services.citra-emu.org/game/" class="btn btn-default">Add a Game</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<ul class="pagination pull-left"></ul>
|
|
|
|
<table id="compatibility-list" class="table table-responsive">
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th class="sort" data-sort="title">Title</th>
|
|
<th class="sort" data-sort="type">Type</th>
|
|
<th class="sort" data-sort="compatibility">Compatibility</th>
|
|
<th class="sort" data-sort="date-tested">Date Tested</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="list">
|
|
{{ range .Data.Pages.GroupByParam "section_id" }}
|
|
|
|
{{ range .Pages }}
|
|
{{- $key := substr .Params.title 0 1 }}
|
|
{{- $rating := index .Site.Data.compatibility .Params.compatibility }}
|
|
{{- $type := index .Site.Data.gameTypes (.Params.game_type | default "3ds") }}
|
|
<tr data-key="{{ $key }}">
|
|
<td class="hidden listing-metadata">
|
|
{{ .Params.title }} {{ $type.name }} {{ $rating.name }} {{ dateFormat "January 2, 2006" .Params.testcase_date }}
|
|
</td>
|
|
<td class="col-md-1 icon">
|
|
<img src="/images/game/icons/{{ .File.BaseFileName }}.png" />
|
|
</td>
|
|
<td class="col-md-6 title">
|
|
<a href="{{ .Permalink }}">{{ .Params.title }}</a>
|
|
</td>
|
|
<td class="col-md-1 type">
|
|
<img src="/images/game/types/{{ $type.key }}.png" title="{{ $type.name }}" />
|
|
</td>
|
|
<td class="col-md-1 compatibility">
|
|
<div class="square-icon" style="background-color: {{ $rating.color }}"></div> {{ $rating.name }}
|
|
</td>
|
|
<td class="col-md-3 date-tested">
|
|
{{ dateFormat "January 2, 2006" .Params.testcase_date }}
|
|
</td>
|
|
</tr>
|
|
{{ end }}
|
|
{{ end }}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{{ end }}
|
|
|
|
{{ define "scripts" }}
|
|
<script src="/js/vendor/list.min.js"></script>
|
|
<script src="https://code.highcharts.com/highcharts.js"></script>
|
|
<script src="https://code.highcharts.com/modules/exporting.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
var options = {
|
|
valueNames: ['listing-metadata', 'icon', 'title', 'type', 'compatibility', 'date-tested'],
|
|
pagination: true,
|
|
indexAsync: true,
|
|
page: 50
|
|
};
|
|
|
|
var list = new List('game-listing', options);
|
|
|
|
list.sort("title", {order: "asc"});
|
|
|
|
$('#search-box').keyup(function() {
|
|
var searchString = $(this).val();
|
|
list.fuzzySearch(searchString, ['listing-metadata']);
|
|
});
|
|
|
|
list.on("updated", function(){
|
|
$("#compatibility-list tbody tr.key").removeClass("key");
|
|
if ($("#compatibility-list thead").find("th.asc[data-sort='title'], th.desc[data-sort='title']").length){
|
|
$("#compatibility-list tbody tr[data-key]").each(function(){
|
|
var key = $(this).attr("data-key")
|
|
if ($("tr[data-key='" + key + "']:first").is($(this))){
|
|
$(this).addClass("key");
|
|
}
|
|
})
|
|
}
|
|
})
|
|
|
|
function filterTable(_) {
|
|
var rating = this.name;
|
|
|
|
$("#search-box").val(rating);
|
|
list.search(rating, ['compatibility']);
|
|
}
|
|
|
|
function clearSearch() {
|
|
$("#search-box").val("");
|
|
list.fuzzySearch();
|
|
}
|
|
|
|
Highcharts.chart('highchart-container', {
|
|
chart: { type: 'bar' },
|
|
colors: [{{ range .Site.Data.compatibility }}"{{ .color }}", {{- end }}],
|
|
credits: { enabled: false },
|
|
exporting: { enabled: false },
|
|
title: { text: '' },
|
|
xAxis: { categories: [''] },
|
|
yAxis: { min: 0, max: {{ len .Data.Pages }}, title: { text: '' } },
|
|
legend: { enabled: false },
|
|
plotOptions: { series: {
|
|
stacking: 'normal',
|
|
cursor: 'pointer',
|
|
events: {
|
|
click: filterTable
|
|
}
|
|
} },
|
|
series: [
|
|
{{- $dataPages := .Data.Pages }}
|
|
{{- range .Site.Data.compatibility }}
|
|
{{- $dataPagesFiltered := where $dataPages ".Params.compatibility" .key }}
|
|
{ "name": "{{ .name }}", "data": [ {{ len $dataPagesFiltered }} ] },
|
|
{{- end }}
|
|
]
|
|
});
|
|
</script>
|
|
{{ end }}
|