2026-03-21 14:49:10 +01:00
|
|
|
---
|
2026-04-04 09:21:34 +02:00
|
|
|
title: MWO
|
2026-03-21 14:49:10 +01:00
|
|
|
tags:
|
|
|
|
|
- game
|
|
|
|
|
---
|
2026-04-04 09:21:34 +02:00
|
|
|
{% assign bodyClass = 'body_mwo' -%}
|
|
|
|
|
{% layout 'hippie/game.liquid' %}
|
2026-03-21 14:49:10 +01:00
|
|
|
|
|
|
|
|
{% block links %}
|
|
|
|
|
{{ block.super -}}
|
|
|
|
|
<link href="/vendor/bootstrap-icons/font/bootstrap-icons.min.css" rel="stylesheet">
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{% block body %}
|
|
|
|
|
<canvas id="view"></canvas>
|
|
|
|
|
|
|
|
|
|
<header class="io controls">
|
2026-03-22 22:21:26 +01:00
|
|
|
<nav>
|
|
|
|
|
<button onclick="toggleAnimation()">Toggle</button>
|
|
|
|
|
</nav>
|
2026-03-21 14:49:10 +01:00
|
|
|
<nav>
|
|
|
|
|
<span>Color</span>
|
|
|
|
|
<button onclick="changeColor('black')">Black</button>
|
|
|
|
|
<button onclick="changeColor('white')">White</button>
|
|
|
|
|
<button onclick="changeColor('crimson')">Red</button>
|
|
|
|
|
<button onclick="changeColor('#00ffff')">Cyan</button>
|
|
|
|
|
</nav>
|
|
|
|
|
<nav>
|
|
|
|
|
<span>Crosshair</span>
|
|
|
|
|
<button onclick="changeCrosshairStyle('cross')"><i class="bi bi-plus-lg"></i></button>
|
|
|
|
|
<button onclick="changeCrosshairStyle('circle')"><i class="bi bi-circle"></i></button>
|
|
|
|
|
<button onclick="changeCrosshairStyle('dot')"><i class="bi bi-dot"></i></button>
|
2026-03-24 23:05:09 +01:00
|
|
|
<button onclick="changeCrosshairStyle('level')"><i class="bi bi-dash-circle"></i></button>
|
2026-03-21 14:49:10 +01:00
|
|
|
</nav>
|
|
|
|
|
<nav>
|
|
|
|
|
<span>Connector</span>
|
2026-03-24 20:59:14 +01:00
|
|
|
<button onclick="toggleConnector()">Toggle</button>
|
2026-03-21 14:49:10 +01:00
|
|
|
<hr class="vertical">
|
2026-03-24 20:59:14 +01:00
|
|
|
<button onclick="changeConnectorStyle('arrow')"><i class="bi bi-caret-up-fill"></i></button>
|
|
|
|
|
<button onclick="changeConnectorStyle('square')"><i class="bi bi-square-fill"></i></button>
|
|
|
|
|
<button onclick="changeConnectorStyle('circle')"><i class="bi bi-circle-fill"></i></button>
|
|
|
|
|
<button onclick="changeConnectorStyle('diamond')"><i class="bi bi-diamond-fill"></i></button>
|
2026-03-21 14:49:10 +01:00
|
|
|
</nav>
|
|
|
|
|
</header>
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{% block assets %}
|
|
|
|
|
<script src="/js/game.js"></script>
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{% block script %}
|
|
|
|
|
<script>
|
|
|
|
|
const canvas = document.getElementById('view');
|
|
|
|
|
canvas.width = window.innerWidth;
|
|
|
|
|
canvas.height = window.innerHeight;
|
|
|
|
|
|
|
|
|
|
const crosshair = new HippieCrosshair(canvas);
|
|
|
|
|
|
|
|
|
|
function changeCrosshairStyle(style) {
|
|
|
|
|
crosshair.setCrosshairStyle(style);
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-24 20:59:14 +01:00
|
|
|
function changeConnectorStyle(style) {
|
|
|
|
|
crosshair.setConnectorStyle(style);
|
2026-03-21 14:49:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function changeColor(color) {
|
2026-03-24 20:59:14 +01:00
|
|
|
crosshair.setCrosshairColor(color);
|
|
|
|
|
crosshair.setConnectorColor(color);
|
2026-03-21 14:49:10 +01:00
|
|
|
crosshair.lineColor = `rgba(${parseInt(color.slice(1, 3), 16)}, ${parseInt(color.slice(3, 5), 16)}, ${parseInt(color.slice(5, 7), 16)}, 0.3)`;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-24 20:59:14 +01:00
|
|
|
function toggleConnector() {
|
|
|
|
|
crosshair.setConnectorVisibility(!crosshair.connectorShow);
|
2026-03-21 14:49:10 +01:00
|
|
|
}
|
|
|
|
|
|
2026-03-22 22:21:26 +01:00
|
|
|
function toggleAnimation() {
|
|
|
|
|
crosshair.toggleAnimation();
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-21 14:49:10 +01:00
|
|
|
window.addEventListener('resize', () => {
|
|
|
|
|
canvas.width = window.innerWidth;
|
|
|
|
|
canvas.height = window.innerHeight;
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
{% endblock %}
|