2017-06-03 22:00:44 +00:00
|
|
|
{{ define "main" }}
|
2017-06-03 23:19:19 +00:00
|
|
|
<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>
|
2017-06-04 18:06:33 +00:00
|
|
|
<table class="table table-striped table-bordered">
|
2017-06-03 23:19:19 +00:00
|
|
|
<tbody>
|
2017-06-11 12:38:58 +00:00
|
|
|
{{ range .Site.Data.compatibility }}
|
2017-06-04 18:12:44 +00:00
|
|
|
<tr>
|
2017-06-11 12:38:58 +00:00
|
|
|
<td style="width: 120px;"><div class="square-icon" style="background-color: {{ .color }}"></div> {{ .name }}</td>
|
|
|
|
<td class="row-compat-desc">{{ .description }}</td>
|
|
|
|
</tr>
|
|
|
|
{{ end }}
|
2017-06-03 23:19:19 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2017-06-04 17:57:52 +00:00
|
|
|
|
2017-06-05 21:34:27 +00:00
|
|
|
<div id="highchart-container" style="height: 100px; margin: 0 auto"></div>
|
|
|
|
|
2017-06-11 12:38:58 +00:00
|
|
|
<hr />
|
|
|
|
|
|
|
|
<div id="game-sections">
|
|
|
|
<div class="btn-group" role="group">
|
|
|
|
<a class="btn btn-secondary" href="##">#</a>
|
|
|
|
{{ range (seq 'a' 'z') }}
|
|
|
|
<a class="btn btn-secondary" href="#{{ printf "%c" . }}">{{ printf "%c" . }}</a>
|
2017-06-06 00:46:21 +00:00
|
|
|
{{ end }}
|
2017-06-11 12:38:58 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-06-28 00:14:39 +00:00
|
|
|
<table id="compatibility-list" class="table table-responsive">
|
2017-06-11 12:38:58 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th></th>
|
|
|
|
<th>Title</th>
|
2017-06-16 00:09:46 +00:00
|
|
|
<th>Type</th>
|
2017-06-11 12:38:58 +00:00
|
|
|
<th>Compatibility</th>
|
|
|
|
<th>Date Tested</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{ range .Data.Pages.GroupByParam "section_id" }}
|
|
|
|
<tr>
|
|
|
|
<td id="game-section-header">
|
|
|
|
<h3 id="{{ .Key }}">{{ .Key }}</h3>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
{{ range .Pages }}
|
|
|
|
{{- $rating := index .Site.Data.compatibility .Params.compatibility }}
|
2017-06-16 00:09:46 +00:00
|
|
|
{{- $type := index .Site.Data.gameTypes (.Params.game_type | default "3ds") }}
|
2017-06-28 00:14:39 +00:00
|
|
|
<tr data-compatibility="{{ $rating.name }}">
|
2017-06-16 00:09:46 +00:00
|
|
|
<td class="col-md-1"><img src="{{ .Site.BaseURL }}images/game/icons/{{ .File.BaseFileName }}.png" /></td>
|
|
|
|
<td class="col-md-6"><a href="{{ .Permalink }}">{{ .Params.title }}</a></td>
|
|
|
|
<td class="col-md-1"><img src="{{ .Site.BaseURL }}images/game/types/{{ $type.key }}.png" title="{{ $type.name }}" /></td>
|
|
|
|
<td class="col-md-1"><div class="square-icon" style="background-color: {{ $rating.color }}"></div> {{ $rating.name }}</td>
|
|
|
|
<td class="col-md-3">{{ dateFormat "January 2, 2006" .Params.testcase_date }}</td>
|
|
|
|
</tr>
|
2017-06-11 12:38:58 +00:00
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2017-06-03 22:00:44 +00:00
|
|
|
{{ end }}
|
2017-06-05 21:34:27 +00:00
|
|
|
|
|
|
|
{{ define "scripts" }}
|
|
|
|
<script src="https://code.highcharts.com/highcharts.js"></script>
|
|
|
|
<script src="https://code.highcharts.com/modules/exporting.js"></script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2017-06-28 00:14:39 +00:00
|
|
|
function filterTable(e){
|
|
|
|
var rating = this.name;
|
|
|
|
|
|
|
|
//If clicked on a new color, hides all other colors
|
|
|
|
if (rating != window.lastClicked){
|
|
|
|
clearFilter();
|
|
|
|
window.lastClicked = rating;
|
|
|
|
var chart = $("#highchart-container").highcharts()
|
|
|
|
window.clearButton = chart.renderer.button('Clear Filter', null, null, function(){ clearFilter() }, {
|
|
|
|
zIndex: 20
|
|
|
|
}).attr({
|
|
|
|
align: 'right',
|
|
|
|
title: 'Clear compatibility filter'
|
|
|
|
}).add().align({
|
|
|
|
align: 'right',
|
|
|
|
x: -16,
|
|
|
|
y: 18
|
|
|
|
}, false, null);
|
|
|
|
|
|
|
|
$("#compatibility-list tbody tr[data-compatibility][data-compatibility!=\"" + rating + "\"]").css('display', 'none');
|
|
|
|
|
|
|
|
//Checks if section headers are empty and hides them if they are
|
|
|
|
$("#compatibility-list tbody tr:not([data-compatibility])").each(function(){
|
|
|
|
var elements = $(this).nextUntil("#compatibility-list tbody tr:not([data-compatibility])").filter(function(){
|
|
|
|
return $(this).css('display') != 'none';
|
|
|
|
});
|
|
|
|
var containsVisible = !!elements.length;
|
|
|
|
if (!containsVisible)
|
|
|
|
$(this).css('display', 'none');
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
clearFilter();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function clearFilter(){
|
|
|
|
$("#compatibility-list tbody tr").css('display', '');
|
|
|
|
if (window.clearButton){
|
|
|
|
window.clearButton.destroy();
|
|
|
|
window.clearButton = undefined;
|
|
|
|
window.lastClicked = undefined;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-05 21:34:27 +00:00
|
|
|
Highcharts.chart('highchart-container', {
|
|
|
|
chart: { type: 'bar' },
|
|
|
|
colors: [{{ range .Site.Data.compatibility }}"{{ .color }}", {{- end }}],
|
|
|
|
credits: { enabled: false },
|
|
|
|
exporting: { enabled: false },
|
|
|
|
title: { text: '' },
|
|
|
|
xAxis: { categories: [''] },
|
2017-06-06 20:11:29 +00:00
|
|
|
yAxis: { min: 0, max: {{ len .Data.Pages }}, title: { text: '' } },
|
2017-06-05 21:34:27 +00:00
|
|
|
legend: { enabled: false },
|
2017-06-28 00:14:39 +00:00
|
|
|
plotOptions: { series: {
|
|
|
|
stacking: 'normal',
|
|
|
|
cursor: 'pointer',
|
|
|
|
events: {
|
|
|
|
click: filterTable
|
|
|
|
}
|
|
|
|
} },
|
2017-06-05 21:34:27 +00:00
|
|
|
series: [
|
2017-06-06 20:11:29 +00:00
|
|
|
{{- $dataPages := .Data.Pages }}
|
|
|
|
{{- range .Site.Data.compatibility }}
|
|
|
|
{{- $dataPagesFiltered := where $dataPages ".Params.compatibility" .key }}
|
|
|
|
{ "name": "{{ .name }}", "data": [ {{ len $dataPagesFiltered }} ] },
|
|
|
|
{{- end }}
|
2017-06-05 21:34:27 +00:00
|
|
|
]
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{{ end }}
|