xemu-website/templates/template_index.html

722 lines
22 KiB
HTML
Raw Permalink Normal View History

2022-06-08 07:54:42 +00:00
{% set title_status_colors = {'Unknown' : '#2A2A2A', 'Broken' : '#D7263D', 'Intro' : '#F86624', 'Starts' : '#FF9800', 'Playable' : '#42991b', 'Perfect' : '#1b8799'} %}
2020-04-05 02:26:14 +00:00
2020-04-03 11:58:48 +00:00
{% extends "template_base.html" %}
2020-04-05 02:26:14 +00:00
{% block append_head %}
2020-04-03 11:58:48 +00:00
<style type="text/css">
/* Account for the fixed header (which otherwise would occlude anchor targets) */
/* Via https://stackoverflow.com/a/28824157 */
:target::before {
content: "";
display: block;
2023-01-19 09:16:43 +00:00
height: 5rem; /* fixed header height*/
margin: -5rem 0 0; /* negative fixed header height */
2020-04-03 11:58:48 +00:00
}
2020-04-05 02:26:14 +00:00
2024-06-14 06:44:27 +00:00
#xbox-scene {
position: relative;
padding-bottom: 100%;
border: none;
}
#xbox-scene canvas {
position: absolute;
max-width: 100%;
height: auto;
}
2021-06-15 04:56:36 +00:00
#logo-canvas {
2021-06-15 04:56:36 +00:00
display: block;
visibility: hidden;
width: 256px;
height: 256px;
margin-left: -38px;
margin-bottom: -177px;
margin-top: -80px;
padding: 0;
border: none;
}
#bg-scene {
height: 100%;
width: 100%;
position: absolute;
left: 0;
top: 0;
}
.jumbotron {
position: relative;
2024-06-14 08:06:09 +00:00
display:flex;
flex-direction:column;
}
.disclaimer-container {
align-self: bottom;
z-index: 10;
}
.disclaimer {
color: #bbb;
background-color: rgba(0.2,0.2,0.2,0.6);
padding: 0.5em;
font-size: 0.9em;
}
.project-info {
margin: auto;
}
@media only screen and (min-width: 768px)
{
.navbar-transparent
{
2022-06-28 22:18:15 +00:00
background: transparent !important;
transition: background-color 200ms linear;
}
}
2023-01-17 23:04:34 +00:00
2023-01-19 09:16:43 +00:00
.button-icon {
display: inline-block;
margin-right: 0.75em;
2023-01-17 23:04:34 +00:00
}
2023-01-18 06:43:59 +00:00
.screenshot-window {
box-shadow: 0px 5px 25px rgba(0, 0, 0, 0.6);
border-radius: 10px;
max-width: 642px;
2023-01-19 09:16:43 +00:00
margin: 2em auto;
2023-01-18 06:43:59 +00:00
}
.screenshot-titlebar {
width: 100%;
2023-01-19 09:16:43 +00:00
display: block;
2023-01-18 06:43:59 +00:00
}
#screenshot-carousel {
border: 1px rgba(0, 0, 0, 0.6) solid;
border-top: 0;
width: 100%;
}
2023-01-19 09:16:43 +00:00
.feature-card {
min-height: 100%;
padding: 1rem 1rem 1rem 4.5rem;
}
.feature-card p {
margin: 0;
}
.feature-icon {
width: 4.5rem;
margin: 0 0 0 -4.5rem;
text-align: center;
color: #888;
}
{% for key in title_status_colors %}
.text-color-{{ key }} {
color: {{ title_status_colors[key] }};
}
.fill-color-{{ key }} {
background-color: {{ title_status_colors[key] }};
color: #fff;
font-weight: bold;
}
{% endfor %}
.title-card a {
color: #fff;
font-weight: bolder;
text-decoration: none;
}
.title-card-container {
width: 10rem;
background-color: #373737;
border-radius: 0.25rem;
overflow: hidden;
}
.title-card-image-container {
background-image: url('cover_front_default.png');
background-size: cover;
width: 100%;
height: 14.18rem;
}
.title-card-image-container img {
height: 100%;
width: 100%;
}
/* https://www.gungorbudak.com/blog/2018/12/12/bootstrap-4-search-box-with-search-icon/ */
.has-search .form-control {
padding-left: 2.375rem;
}
.has-search .form-control-feedback {
position: absolute;
z-index: 2;
display: block;
width: 2.375rem;
height: 2.375rem;
line-height: 2.375rem;
text-align: center;
pointer-events: none;
color: #aaa;
}
2020-04-03 11:58:48 +00:00
</style>
{% endblock %}
{% block jumbotron %}
<div class="jumbotron d-flex align-items-center min-vh-100">
<div id="bg-scene"></div>
2024-06-14 08:06:09 +00:00
<div class="container project-info py-5">
2020-04-03 11:58:48 +00:00
<div class="row mt-5">
<div class="col-md-6 mt-4 pb-5 pb-md-0 text-center">
2024-06-14 06:44:27 +00:00
<div id="xbox-scene"></div>
2020-04-03 11:58:48 +00:00
</div>
2024-06-14 06:44:27 +00:00
<div class="col-md-6 my-auto">
2023-01-18 06:43:59 +00:00
<h1 class="display-3">
<canvas id="logo-canvas" class="gl-logo"></canvas>
<img id="logo-fallback" alt="xemu logo" src="/logo-green-jumbotron.svg" style="height: 1.03em;">
</h1>
<h4 class="card-subtitle mb-2">Original Xbox Emulator</h4>
2023-01-19 09:16:43 +00:00
<p class="lead">
2023-01-18 06:43:59 +00:00
A free and open-source application that emulates the original Microsoft
Xbox game console, enabling people to play their original Xbox games on
Windows, macOS, and Linux systems.
</p>
2023-01-19 09:26:30 +00:00
<div class="d-flex flex-wrap m" style="grid-gap: 1em;">
2023-01-19 09:16:43 +00:00
<div>
<a class="btn btn-green btn-lg" role="button" id="download-gen" href="/docs/download">
<i class="fa fa-laptop button-icon" aria-hidden="true"></i>View Download Options
</a>
<a class="btn btn-green btn-lg" role="button" id="download-win" style="display: none" href="https://github.com/xemu-project/xemu/releases/latest/download/xemu-win-release.zip">
<i class="fab fa-windows button-icon" aria-hidden="true"></i>Download for Windows
</a>
<a class="btn btn-green btn-lg" role="button" id="download-mac" style="display: none" href="https://github.com/xemu-project/xemu/releases/latest/download/xemu-macos-universal-release.zip">
<i class="fab fa-apple button-icon" aria-hidden="true"></i>Download for macOS
</a>
<a class="btn btn-green btn-lg" role="button" id="download-linux" style="display: none" href="/docs/download/#download-for-linux">
<i class="fab fa-linux button-icon" aria-hidden="true"></i>Download for Linux
</a>
</div>
<div class="text-nowrap">
Version {{xemu_build_version}} ({{xemu_build_date.strftime('%b %-d, %Y')}})
<br />
<a href="/docs/download" id="download-options" style="display: none">Alternative download options</a>
2021-06-09 23:02:07 +00:00
</div>
2024-06-14 08:06:09 +00:00
2021-06-09 23:02:07 +00:00
</div>
2024-06-14 08:06:09 +00:00
2021-06-09 23:02:07 +00:00
</div>
2020-04-03 11:58:48 +00:00
</div>
</div>
2024-06-14 08:06:09 +00:00
<div class="disclaimer-container">
<div class="container text-center mx-auto disclaimer">
<b>Disclaimer:</b> This project is an independent open source emulation effort and is not endorsed by, directly affiliated with, maintained, authorized, or sponsored by Microsoft Corporation. All product and company names are the registered trademarks of their original owners. The use of any trade name or trademark is for identification and reference purposes only and does not imply any association with the trademark holder of their product brand.
</div>
</div>
2020-04-03 11:58:48 +00:00
</div>
{% endblock %}
{% block content %}
2023-01-19 09:16:43 +00:00
<div class="body-alt-section">
<div class="container">
<div class="screenshot-window">
<img src="linux_title_bar_dark_2x.png" class="screenshot-titlebar" />
<div id="screenshot-carousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
2024-09-02 22:07:32 +00:00
{% for i in range(7) %}
2023-01-19 09:16:43 +00:00
<div class="carousel-item {% if i<1 %}active{% endif %}">
2023-01-19 09:46:54 +00:00
<img src="/screenshots/{{ i }}.jpg" class="img-fluid lazy" />
2023-01-19 09:16:43 +00:00
</div>
{% endfor %}
</div>
<a class="carousel-control-prev" href="#screenshot-carousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#screenshot-carousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
2023-01-17 23:04:34 +00:00
</div>
</div>
</div>
2023-01-18 06:43:59 +00:00
</div>
2023-01-19 09:16:43 +00:00
<div class="container">
<div class="row">
<div class="col-md-6 p-1">
<div class="feature-card">
<h4><i class="fab fa-github feature-icon"></i>Open Source</h4>
<p>The source code for xemu is available on <a href="https://github.com/xemu-project/xemu">GitHub</a>. You are invited to help improve the project! Learn more <a href="/docs/dev/">here</a>.</p>
</div>
2023-01-18 17:03:28 +00:00
</div>
2023-01-19 09:16:43 +00:00
<div class="col-md-6 p-1">
<div class="feature-card">
<h4><i class="fas fa-users feature-icon"></i>Cross Platform</h4>
<p>xemu runs natively on Windows, macOS, and Linux platforms. Binaries are available for all platforms, or you can build from source if desired. Learn more <a href="/docs/download/">here</a>.</p>
</div>
2023-01-18 17:03:28 +00:00
</div>
2023-01-19 09:16:43 +00:00
<div class="col-md-6 p-1">
<div class="feature-card">
<h4><i class="fas fa-microchip feature-icon"></i>Low Level Emulation</h4>
<p>xemu emulates the hardware of the original Xbox, providing superior compatibility with kernels, titles, and homebrew applications.</p>
</div>
</div>
2023-01-19 09:16:43 +00:00
<div class="col-md-6 p-1">
<div class="feature-card">
<h4><i class="fas fa-gamepad feature-icon"></i>Controller Support</h4>
<p>Built on <a href="https://www.libsdl.org/">SDL2</a>, xemu supports virtually all controllers. Connect up to 4 controllers at any time, just like a real Xbox. Learn more <a href="/docs/input/">here</a>.</p>
</div>
2023-01-18 17:03:28 +00:00
</div>
2023-01-19 09:16:43 +00:00
<div class="col-md-6 p-1">
<div class="feature-card">
<h4><i class="fas fa-history feature-icon"></i>Snapshots (Save States)</h4>
<p>No need to wait for game checkpoints. xemu supports saving the current machine state and loading it back up at any time. Learn more <a href="/docs/snapshots/">here</a>.</p>
</div>
2023-01-18 17:03:28 +00:00
</div>
2023-01-19 09:16:43 +00:00
<div class="col-md-6 p-1">
<div class="feature-card">
<h4><i class="fas fa-expand-alt feature-icon"></i>Render Scaling</h4>
<p>Breathe new life into your original Xbox games by easily increasing the resolution that games render at, on the fly. Scale up from 480p to 1080p at the click of a button.</p>
</div>
2023-01-18 17:58:48 +00:00
</div>
2023-01-19 09:16:43 +00:00
<div class="col-md-6 p-1">
<div class="feature-card">
<h4><i class="fas fa-people-arrows feature-icon"></i>Networking</h4>
<p>Connect to other instances of xemu and real Xboxes, locally or over the Internet. Supports tunneling services and Xbox Live recreation projects. Learn more <a href="/docs/networking/">here</a>.</p>
</div>
2023-01-18 17:03:28 +00:00
</div>
2023-01-19 09:16:43 +00:00
<div class="col-md-6 p-1">
<div class="feature-card">
<h4><i class="fab fa-discord feature-icon"></i>Community</h4>
<p>xemu has a thriving online community of original Xbox fans. Set up multiplayer matches, get help running xemu, and more by joining our community on <a href="https://discord.gg/ayyjsuM">Discord</a>!</p>
</div>
2023-01-18 17:20:18 +00:00
</div>
</div>
2023-01-18 17:03:28 +00:00
</div>
2023-01-19 09:16:43 +00:00
<div class="body-alt-section">
<div class="container">
<h2 id="compatibility" class="mb-4 text-center">Compatibility</h2>
<div class="col-lg-10 mx-auto mt-2">
<p>
<b>Note:</b> Title compatibility status is provided by volunteer reporters in the community, as the reporter experienced the title in the current version of xemu on their computer at time of reporting. As the project evolves, reports may need to be updated. You are invited to help improve the project by submitting an updated compatibility report. Join the Discord server to learn how to contribute!
</p>
<div id="title_stats" style="height: 120px"></div>
<div class="form-group has-search">
<span class="fa fa-search form-control-feedback"></span>
<input class="form-control" type="text" placeholder="Search" id="filter">
</div>
<div class="row" id="results">
{% for title in titles %}
<div class="col px-1 mb-4 title-card" data-title-name="{{ title.title_name }}" data-title-status="{{ title.status }}">
<a href="{{ title.title_url }}">
<div class="mx-auto title-card-container">
<div class="title-card-image-container">
{% if not title.have_cover %}
<div class="card-body text-center">{{ title.title_name }}</div>
{% else %}
<img data-src="{{ title.cover_thumbnail_url }}" class="img-fluid lazy" title="{{ title.title_name }}">
{% endif %}
</div>
<div class="fill-color-{{ title.status }} card-body text-center py-1 my-0">
<small><strong>{{ title.status }}</strong></small>
</div>
2020-04-03 11:58:48 +00:00
</div>
2023-01-19 09:16:43 +00:00
</a>
</div>
{% endfor %}
</div>
2020-04-03 11:58:48 +00:00
</div>
</div>
2023-01-19 09:16:43 +00:00
</div>
2020-04-03 11:58:48 +00:00
{% endblock %}
2020-04-05 02:26:14 +00:00
{% block append_foot %}
2022-06-20 23:59:26 +00:00
<script type="text/javascript">
// Show platform-specific download button
var platform = undefined;
if (navigator.userAgent.indexOf("Win") != -1) platform = "win";
2022-06-21 09:38:40 +00:00
else if (navigator.userAgent.indexOf("Mac") != -1) {
if (navigator.userAgent.indexOf("iPhone") == -1) {
platform = "mac";
}
}
2022-06-20 23:59:26 +00:00
else if (navigator.userAgent.indexOf("Linux") != -1) platform = "linux";
if (platform != undefined) {
$('#download-gen').hide();
$('#download-' + platform).show();
$('#download-options').show();
}
</script>
2024-06-14 06:44:27 +00:00
<script type="importmap">
{
"imports": {
"three": "./three/three.module.js",
"three/addons/": "./three/"
}
}
</script>
2024-06-14 20:12:41 +00:00
<script type="text/javascript" src="gl_logo.js"></script>
2024-06-14 06:44:27 +00:00
<script type="module">
import * as THREE from 'three';
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
import { ArcballControls } from 'three/addons/controls/ArcballControls.js';
const gltf_loader = new GLTFLoader();
const draco_loader = new DRACOLoader();
draco_loader.setDecoderPath( 'three/loaders/' );
draco_loader.setDecoderConfig( { type: 'js' } );
gltf_loader.setDRACOLoader( draco_loader );
var canvas = document.querySelector('#bg-scene');
var scene = new THREE.Scene();
2022-06-23 07:08:40 +00:00
var camera = new THREE.PerspectiveCamera( 74.5, canvas.offsetWidth/canvas.offsetHeight, 0.1, 1000 );
scene.fog = new THREE.Fog('black', 0.2, 2.45);
scene.background = new THREE.Color('black');
2024-06-14 06:44:27 +00:00
var renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize( canvas.offsetWidth, canvas.offsetHeight );
renderer.setPixelRatio( window.devicePixelRatio );
canvas.appendChild( renderer.domElement );
const texture = new THREE.TextureLoader().load("mesh_pattern.svg");
2024-06-14 06:44:27 +00:00
texture.colorSpace = THREE.SRGBColorSpace;
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 50, -25 );
const geometry = new THREE.SphereGeometry( 1, 50, 25 );
var material = new THREE.MeshBasicMaterial( { map: texture, side: THREE.BackSide } );
var sphere = new THREE.Mesh( geometry, material );
scene.add( sphere );
2024-06-14 06:44:27 +00:00
2022-06-23 07:08:40 +00:00
camera.position.z = 0.65;
camera.position.x = 0.12;
var clock = new THREE.Clock();
2024-06-14 20:12:41 +00:00
var sphere_render = function () {
2022-06-23 07:08:40 +00:00
var t = clock.getElapsedTime();
2024-06-14 06:44:27 +00:00
var s = Math.sin(t * Math.PI / 50);
sphere.rotation.y = (Math.PI/10) * s;
renderer.render(scene, camera);
};
window.addEventListener('resize', function(){
camera.aspect = canvas.offsetWidth/canvas.offsetHeight;
camera.updateProjectionMatrix();
renderer.setSize(canvas.offsetWidth, canvas.offsetHeight);
}, false);
2024-06-14 06:44:27 +00:00
var xbox_canvas = document.querySelector('#xbox-scene');
var xbox_scene = new THREE.Scene();
// xbox_scene.background = new THREE.Color('black');
var xbox_camera = new THREE.PerspectiveCamera( 42.5, xbox_canvas.offsetWidth/xbox_canvas.offsetHeight, 0.1, 1000 );
var xbox_renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
xbox_renderer.setSize( xbox_canvas.offsetWidth, xbox_canvas.offsetHeight );
xbox_renderer.setPixelRatio( window.devicePixelRatio );
xbox_canvas.appendChild( xbox_renderer.domElement );
var xbox = null;
var xbox_scale = 1;
var xbox_sphere_radius = 0.23 * xbox_scale;
var xbox_base_color = new THREE.Color(0xA0B020);
var xbox_bright_color = new THREE.Color(0xD4E830);
var xbox_material = new THREE.MeshStandardMaterial( {
color: xbox_base_color,
transparent: true,
opacity: 0.25,
depthTest: false,
roughness: 0,
});
gltf_loader.load('xbox.glb', function ( gltf ) {
xbox = gltf.scene;
xbox.renderOrder = 10;
xbox.scale.set(xbox_scale, xbox_scale, xbox_scale);
xbox.position.set(0,0.05,0);
xbox.rotation.x = 0.14 * Math.PI;
xbox.rotation.z = -0.02 * Math.PI;
var order = 0;
xbox.traverse((o) => {
if (o.isMesh) {
o.material = xbox_material;
o.renderOrder = order;
order += 1;
}
});
xbox_scene.add(xbox);
});
const xbox_orb_geometry = new THREE.SphereGeometry( xbox_sphere_radius, 50, 25 );
var xbox_orb_material = new THREE.ShaderMaterial( {
// https://jsfiddle.net/8n36c47p/4/
vertexShader: `
varying vec3 vPositionW;
varying vec3 vNormalW;
void main() {
vPositionW = vec3( vec4( position, 1.0 ) * modelMatrix);
vNormalW = normalize( vec3( vec4( normal, 0.0 ) * modelMatrix ) );
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,
fragmentShader: `
varying vec3 vPositionW;
varying vec3 vNormalW;
void main() {
vec3 color = vec3(0.5, 1.0, 0.3);
vec3 base = vec3(0.1, 0.6, 0.05);
vec3 viewDirectionW = normalize(cameraPosition - vPositionW);
float f = clamp(pow(1.0 - dot(viewDirectionW, vNormalW), 1.3), 0.0, 1.);
gl_FragColor = vec4(mix(base, color, f), f * 0.5);
}`,
transparent: true,
});
var xbox_orb = new THREE.Mesh( xbox_orb_geometry, xbox_orb_material );
xbox_orb.renderOrder = 0;
xbox_scene.add( xbox_orb );
var light_color = new THREE.Color(1,1,1);
const ambient_light = new THREE.AmbientLight(light_color, 2);
xbox_scene.add(ambient_light);
var point_light = new THREE.PointLight(light_color, 5);
point_light.position.set(-1, -0.5, 0.25);
xbox_scene.add(point_light);
xbox_camera.position.z = 0.65;
var xbox_render = function () {
var t = clock.getElapsedTime();
var s = Math.sin(t * Math.PI / 50);
if (xbox != null) {
xbox.rotation.y = Math.PI * (0.1 + s / 10);
var new_color = new THREE.Color(xbox_base_color);
new_color.lerp(xbox_bright_color, Math.abs(Math.sin(t * Math.PI / 4 )));
xbox_material.color.set(new_color);
}
xbox_renderer.render(xbox_scene, xbox_camera);
};
2024-06-14 20:12:41 +00:00
var render = function () {
requestAnimationFrame( render );
sphere_render();
xbox_render();
logo_render(clock.getElapsedTime());
};
render();
2024-06-14 06:44:27 +00:00
const controls = new ArcballControls( xbox_camera, xbox_renderer.domElement, xbox_scene );
controls.addEventListener( 'change', function () {
xbox_renderer.render( xbox_scene, xbox_camera );
} );
controls.update();
window.addEventListener('resize', function(){
xbox_camera.aspect = xbox_canvas.offsetWidth/xbox_canvas.offsetHeight;
xbox_camera.updateProjectionMatrix();
xbox_renderer.setSize(xbox_canvas.offsetWidth, xbox_canvas.offsetHeight);
}, false);
</script>
2024-06-14 06:44:27 +00:00
<script type="text/javascript">
function updateNavbarTransparency() {
var nav = $(".navbar");
2024-06-14 06:44:27 +00:00
var t = $(document).scrollTop() < $("#xbox-scene").offset().top - nav.height();
nav.toggleClass('navbar-transparent', t);
}
$(document).scroll(updateNavbarTransparency);
$(function () {
$(".navbar-toggle").click(updateNavbarTransparency);
});
updateNavbarTransparency();
</script>
2022-06-24 20:49:49 +00:00
<script type="text/javascript" src="/apexcharts.js"></script>
<script type="text/javascript" src="/jquery.lazy-1.7.10.min.js"></script>
<script type="text/javascript" src="/jquery.lazy.plugins-1.7.10.min.js"></script>
2020-04-03 11:58:48 +00:00
<script type="text/javascript">
// Lazy-load images
var lazyInstance = $('img.lazy').Lazy({
scrollDirection: 'vertical',
visibleOnly: true,
chainable: false,
effect: "fadeIn",
effectTime: 333,
onError: function(element) {
console.log('error loading ' + element.data('src'));
}
});
// https://stackoverflow.com/a/1909508
function delay(fn, ms) {
let timer = 0
return function(...args) {
clearTimeout(timer)
timer = setTimeout(fn.bind(this, ...args), ms || 0)
}
}
var filter_title_str = null;
var filter_status_str = null;
var hidden_status_list = [];
2020-04-03 11:58:48 +00:00
// Simple filter via: https://stackoverflow.com/a/44736154
$("#filter").keyup(delay(function() {
filter_title_str = $(this).val();
filter_titles();
}, 250));
function toggle_single_status_filter(status)
{
filter_status_str = filter_status_str === status ? null : status;
filter_titles();
}
function toggle_hidden_status_filter(status)
{
if (hidden_status_list.includes(status)) {
// User has toggled a status that's already hidden, remove status from hidden filter list
hidden_status_list = hidden_status_list.filter(function(hidden_status) {
return hidden_status !== status;
});
} else {
hidden_status_list.push(status);
}
filter_titles();
}
function filter_titles()
{
2020-04-03 11:58:48 +00:00
$('.title-card').each(function() {
// Only show titles that match this critera:
// Status of title matches the filtered status if it's been set
// Status of title hasn't been excluded in the hidden status list
// Title name matches the user input
if ((filter_status_str != null && $(this).attr('data-title-status') !== filter_status_str) ||
(hidden_status_list.includes($(this).attr('data-title-status'))) ||
(filter_title_str != null && $(this).attr('data-title-name').search(new RegExp(filter_title_str, "i")) < 0 )) {
2020-04-03 11:58:48 +00:00
$(this).hide();
} else {
$(this).show();
}
});
lazyInstance.update();
}
2020-04-03 11:58:48 +00:00
var options = {
series: [
{% for status in game_status_counts: %}
{
name: '{{ status }}',
data: [
{{ game_status_counts[status] }},
]
},
{% endfor %}
],
chart: {
2020-04-05 02:26:14 +00:00
foreColor: '#a7a7a7', // text color
background: '#444',
2020-04-03 11:58:48 +00:00
type: 'bar',
height: 100,
stacked: true,
stackType: '100%',
toolbar: {
show: false
},
events : {
legendClick : function statustoggleclick(chartContext, seriesIndex, config) {
let status = config.globals.seriesNames[seriesIndex];
toggle_hidden_status_filter(status);
},
dataPointSelection : function statusclick(event) {
let status = event.currentTarget.parentNode.getAttribute("seriesName");
toggle_single_status_filter(status);
}
2020-04-03 11:58:48 +00:00
}
},
plotOptions: {
bar: {
horizontal: true,
},
},
stroke: {
2020-04-05 02:26:14 +00:00
show: false,
width: 0,
colors: ['#999']
},
grid: {
show: false
2020-04-03 11:58:48 +00:00
},
xaxis: {
categories: [
'Titles'
],
labels: {
show: false
2020-04-05 02:26:14 +00:00
},
axisBorder: {
show: false,
color: '#ffff00'
},
axisTicks: {
show: false,
2020-04-03 11:58:48 +00:00
}
},
yaxis: {
labels: {
2020-04-05 02:26:14 +00:00
show: true,
maxWidth: 0
},
axisBorder: {
show: false,
color: '#ff00ff'
},
axisTicks: {
show: false,
2020-04-03 11:58:48 +00:00
}
},
tooltip: {
y: {
formatter: function (val) {
return val
}
}
},
colors: [
{% for key in title_status_colors %}
'{{ title_status_colors[key] }}',
{% endfor %}
],
legend: {
position: 'top',
horizontalAlign: 'center',
2020-04-05 02:26:14 +00:00
offsetY: 20
2020-04-03 11:58:48 +00:00
}
};
var chart = new ApexCharts(document.querySelector("#title_stats"), options);
chart.render();
</script>
2020-04-03 11:58:48 +00:00
{% endblock %}