2026-04-04 08:17:56 +02:00
|
|
|
---
|
|
|
|
|
title: TFW
|
2026-04-04 09:21:34 +02:00
|
|
|
tags:
|
|
|
|
|
- game
|
2026-04-04 08:17:56 +02:00
|
|
|
---
|
|
|
|
|
{% assign bodyClass = 'body_tfw' -%}
|
2026-04-04 09:21:34 +02:00
|
|
|
{% layout 'hippie/game.liquid' %}
|
2026-04-04 08:17:56 +02:00
|
|
|
|
|
|
|
|
{% block body %}
|
|
|
|
|
<header class="io">
|
|
|
|
|
<button data-action="escape">☰</button>
|
2026-04-04 12:12:21 +02:00
|
|
|
<button data-direction="previous"><</button>
|
|
|
|
|
<button data-view="quest">Quests</button>
|
|
|
|
|
<button data-view="region">Regions</button>
|
|
|
|
|
<button data-view="vendor">Vendors</button>
|
|
|
|
|
<button data-view="manufacture">Manufacture</button>
|
|
|
|
|
<button data-view="character">Characters</button>
|
|
|
|
|
<button data-view="stash">Stash</button>
|
|
|
|
|
<button data-view="secret">Secret Storage</button>
|
|
|
|
|
<button data-view="squad">Squads</button>
|
|
|
|
|
<button data-view="ready">Ready Room</button>
|
|
|
|
|
<button data-direction="next">></button>
|
2026-04-04 08:17:56 +02:00
|
|
|
</header>
|
2026-04-04 13:03:59 +02:00
|
|
|
<div id="viewQuest" class="view">
|
|
|
|
|
<main>
|
2026-04-04 08:17:56 +02:00
|
|
|
<nav>
|
|
|
|
|
<div class="important">Filter</div>
|
|
|
|
|
<input placeholder="Search" type="text">
|
2026-04-04 10:22:04 +02:00
|
|
|
<select name="type">
|
|
|
|
|
<option value="" selected>Type</option>
|
|
|
|
|
<option value="all">All</option>
|
|
|
|
|
<option value="assasin">Assasination</option>
|
|
|
|
|
<option value="loot">Looting</option>
|
|
|
|
|
<option value="extract">Extract</option>
|
|
|
|
|
<option value="fetch">Fetch</option>
|
|
|
|
|
<option value="kill">Kill</option>
|
|
|
|
|
</select>
|
2026-04-04 08:17:56 +02:00
|
|
|
</nav>
|
|
|
|
|
<div>
|
|
|
|
|
<div>
|
|
|
|
|
<table>
|
|
|
|
|
<colgroup>
|
|
|
|
|
<col class="l">
|
|
|
|
|
<col class="q">
|
|
|
|
|
<col class="t">
|
|
|
|
|
</colgroup>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>Location</th>
|
|
|
|
|
<th>Quest</th>
|
|
|
|
|
<th>Type</th>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
2026-04-04 10:22:04 +02:00
|
|
|
<td class="background">
|
2026-04-04 08:17:56 +02:00
|
|
|
<span>Scorched Earth</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td>...</td>
|
|
|
|
|
<td class="subtle">Available</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
2026-04-04 10:22:04 +02:00
|
|
|
<td class="background">
|
2026-04-04 08:17:56 +02:00
|
|
|
<span>Location name</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td>...</td>
|
|
|
|
|
<td class="subtle">Available</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<table>
|
|
|
|
|
<colgroup>
|
|
|
|
|
<col class="l">
|
|
|
|
|
<col class="q">
|
|
|
|
|
<col class="s">
|
|
|
|
|
</colgroup>
|
|
|
|
|
<tr>
|
|
|
|
|
<th colspan="3">Active quests (Max.: 4)</th>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
2026-04-04 10:22:04 +02:00
|
|
|
<td class="background"></td>
|
2026-04-04 08:17:56 +02:00
|
|
|
<td>King Of Kings</td>
|
|
|
|
|
<td class="subtle">Active</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
2026-04-04 10:22:04 +02:00
|
|
|
<td class="background"></td>
|
2026-04-04 08:17:56 +02:00
|
|
|
<td>Garage Days Pt. 1</td>
|
|
|
|
|
<td class="subtle success">Complete</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
2026-04-04 10:22:04 +02:00
|
|
|
<div class="background">
|
|
|
|
|
<h2>King Of Kings</h2>
|
|
|
|
|
</div>
|
2026-04-04 08:17:56 +02:00
|
|
|
<p>A hijacked medium mech dubbed the "Rat King" ...</p>
|
|
|
|
|
<hr class="dotted">
|
|
|
|
|
<p>Collect Rat King residue.</p>
|
|
|
|
|
<hr>
|
|
|
|
|
<p>Multiple rig container upgrades, 5000 CR, 5000 XP, 2 days of water, + Scav faction
|
|
|
|
|
rating</p>
|
|
|
|
|
</div>
|
|
|
|
|
</main>
|
|
|
|
|
<footer class="io">
|
|
|
|
|
<button data-action="back">Back</button>
|
|
|
|
|
<button data-action="accept">Accept</button>
|
|
|
|
|
</footer>
|
|
|
|
|
</div>
|
2026-04-04 13:03:59 +02:00
|
|
|
<div id="viewRegion" class="view"></div>
|
|
|
|
|
<div id="viewVendor" class="view"></div>
|
2026-04-04 08:17:56 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{%- block script %}
|
|
|
|
|
{{ block.super -}}
|
|
|
|
|
<script>
|
|
|
|
|
const menu = document.querySelector('body > header');
|
2026-04-04 10:22:04 +02:00
|
|
|
const placeholder = document.querySelectorAll('.background');
|
2026-04-04 08:17:56 +02:00
|
|
|
|
2026-04-04 11:17:54 +02:00
|
|
|
class Menu {
|
2026-04-04 13:03:59 +02:00
|
|
|
constructor(element, options = {}) {
|
2026-04-04 12:12:21 +02:00
|
|
|
this._element = element;
|
2026-04-04 13:03:59 +02:00
|
|
|
this._siblings = element.querySelectorAll('button[data-view]');
|
|
|
|
|
this.default = options.default || 'quest';
|
|
|
|
|
|
2026-04-04 11:17:54 +02:00
|
|
|
element.addEventListener('click', this.onClick.bind(this)); // Bind to get the clicked element and not the DOM element of the class
|
2026-04-04 13:03:59 +02:00
|
|
|
|
|
|
|
|
this.#init();
|
2026-04-04 11:17:54 +02:00
|
|
|
}
|
2026-04-04 08:17:56 +02:00
|
|
|
|
2026-04-04 11:17:54 +02:00
|
|
|
escape() {
|
|
|
|
|
console.log('escape');
|
|
|
|
|
}
|
2026-04-04 08:17:56 +02:00
|
|
|
|
2026-04-04 13:03:59 +02:00
|
|
|
#init() {
|
|
|
|
|
const currentBtn = Array.from(this._siblings).find(
|
|
|
|
|
el => el.dataset.view === this.default
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
currentBtn.classList.add('active');
|
|
|
|
|
this.changeView(this.default);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
changeView(type) {
|
|
|
|
|
console.debug(type);
|
|
|
|
|
const id = 'view' + capitalizeFirstLetter(type);
|
|
|
|
|
const views = document.querySelectorAll('.view');
|
|
|
|
|
|
|
|
|
|
for (const view of views) {
|
|
|
|
|
view.style.display = 'none';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
document.getElementById(id).style.display = 'flex';
|
2026-04-04 08:17:56 +02:00
|
|
|
}
|
2026-04-04 11:17:54 +02:00
|
|
|
|
|
|
|
|
onClick(event) {
|
2026-04-04 13:03:59 +02:00
|
|
|
const siblings = this._siblings;
|
2026-04-04 11:17:54 +02:00
|
|
|
const action = event.target.dataset.action;
|
2026-04-04 12:12:21 +02:00
|
|
|
const view = event.target.dataset.view;
|
|
|
|
|
const direction = event.target.dataset.direction;
|
|
|
|
|
|
|
|
|
|
if (event.button !== 0) return;
|
|
|
|
|
|
|
|
|
|
if (direction) {
|
2026-04-04 13:03:59 +02:00
|
|
|
const currentBtn = this._element.querySelector('.active');
|
|
|
|
|
let newButton, newView = undefined;
|
2026-04-04 11:17:54 +02:00
|
|
|
|
2026-04-04 13:03:59 +02:00
|
|
|
if (currentBtn === null) return;
|
2026-04-04 12:12:21 +02:00
|
|
|
|
2026-04-04 13:03:59 +02:00
|
|
|
if (direction === 'next') {
|
|
|
|
|
newButton = currentBtn.nextElementSibling;
|
|
|
|
|
newView = currentBtn.nextElementSibling.dataset.view;
|
2026-04-04 12:12:21 +02:00
|
|
|
} else {
|
2026-04-04 13:03:59 +02:00
|
|
|
newButton = currentBtn.previousElementSibling;
|
|
|
|
|
newView = currentBtn.previousElementSibling.dataset.view;
|
2026-04-04 12:12:21 +02:00
|
|
|
}
|
2026-04-04 13:03:59 +02:00
|
|
|
|
|
|
|
|
if (!newButton.dataset.view) {
|
|
|
|
|
newButton = direction === 'next' ? siblings[0] : siblings[siblings.length - 1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
currentBtn.classList.remove('active');
|
|
|
|
|
newButton.classList.add('active');
|
|
|
|
|
this.changeView(newView);
|
2026-04-04 12:12:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (view) {
|
2026-04-04 11:17:54 +02:00
|
|
|
for (const sibling of siblings) {
|
|
|
|
|
sibling.classList.remove('active');
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-04 13:03:59 +02:00
|
|
|
this.changeView(view);
|
2026-04-04 11:17:54 +02:00
|
|
|
event.target.classList.add('active');
|
|
|
|
|
}
|
2026-04-04 12:12:21 +02:00
|
|
|
|
|
|
|
|
if (action) this[action]();
|
2026-04-04 11:17:54 +02:00
|
|
|
};
|
|
|
|
|
}
|
2026-04-04 08:17:56 +02:00
|
|
|
|
2026-04-04 10:22:04 +02:00
|
|
|
placeholder.forEach(element => {
|
|
|
|
|
const hue = randomIntFrom(0, 360);
|
2026-04-04 08:17:56 +02:00
|
|
|
const grayscale = randomFloatFrom(0, 1);
|
|
|
|
|
|
|
|
|
|
new RandomPixelCanvas(element, {
|
|
|
|
|
width: Math.floor(element.parentElement.clientWidth),
|
|
|
|
|
height: Math.floor(element.parentElement.clientHeight),
|
|
|
|
|
colors: ['#fad803', '#d30a51', '#273f8b', '#b7e0f0', '#52bed1', '#0c85ff'],
|
2026-04-04 10:22:04 +02:00
|
|
|
filter: 'grayscale(' + grayscale + ') hue-rotate(' + hue + 'deg)'
|
2026-04-04 08:17:56 +02:00
|
|
|
});
|
|
|
|
|
});
|
2026-04-04 11:17:54 +02:00
|
|
|
|
|
|
|
|
new Menu(menu);
|
2026-04-04 08:17:56 +02:00
|
|
|
</script>
|
|
|
|
|
{% endblock %}
|