Fixed ability searching and made table header sticky for melding

master
Wynd 2026-01-17 00:55:22 +02:00
parent 697ab3296d
commit 472a6f8c95
4 changed files with 74 additions and 67 deletions

View File

@ -77,7 +77,7 @@ function filter() {
}
} else if (searchType === "abilities") {
// Abilities
hasLine = false;
var hasLine = false;
for (let i = 0; i < 7; i++) {
const id = i + 6;
const ablName = tds[id].innerText.toLowerCase();

View File

@ -1,4 +1,13 @@
table {
th {
position: sticky;
top: 0;
&.crystal {
top: 3.3vh;
}
}
.charlist {
display: inline-grid;
grid-template-columns: repeat(3, 1fr);

View File

@ -2,7 +2,7 @@
<html lang="en">
<head>
<title>{% block title %}{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0, minimum-scale=1.0" />
<link rel="stylesheet" href="{{ crate::find_hash("/public/styles/common/base.css") }}"></link>
{% block head %}{% endblock %}

View File

@ -3,73 +3,71 @@
{% block title %}BBS - Command Melding{% endblock %}
{% block head %}
<link rel="stylesheet" href="{{ crate::find_hash("/public/styles/bbs/melding.css") }}"></link>
<script
type="module"
src="{{ crate::find_hash("/public/scripts/bbs/melding.js") }}"
></script>
<link rel="stylesheet" href="{{ crate::find_hash("/public/styles/bbs/melding.css") }}">
</link>
<script type="module" src="{{ crate::find_hash("/public/scripts/bbs/melding.js") }}"></script>
{% endblock %}
{% block content %}
<div class="filters">
{% include "components/bbs/search.html" %}
<div class="row">{% include "components/bbs/type-filters.html" %}</div>
<div class="row">{% include "components/bbs/char-filters.html" %}</div>
</div>
<div class="filters">
{% include "components/bbs/search.html" %}
<div class="row">{% include "components/bbs/type-filters.html" %}</div>
<div class="row">{% include "components/bbs/char-filters.html" %}</div>
</div>
<table>
<thead>
<tr>
<th rowspan="2">Character</th>
<th rowspan="2">Command</th>
<th rowspan="2">Ingredient A</th>
<th rowspan="2">Ingredient B</th>
<th rowspan="2">Type</th>
<th rowspan="2">Chance</th>
<th colspan="7">Abilities</th>
</tr>
<tr>
{% for crystal in crystals %}
<th>{{ crystal }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for cmd in commands %}
{% for recipe in cmd.recipes %}
<tr class="{{ recipe.get_unlock_chars() }}">
<td>
<div class="charlist">
<!-- RGB moment -->
<span class="terra">
{% if recipe.can_unlock(Character::Terra) %}T{% endif %}
</span>
<span class="ventus">
{% if recipe.can_unlock(Character::Ventus) %}V{% endif %}
</span>
<span class="aqua">
{% if recipe.can_unlock(Character::Aqua) %}A{% endif %}
</span>
</div>
</td>
<td class="{{ cmd.category }}">{{ cmd.name }}</td>
<td>{{ recipe.ingredients.0 }}</td>
<td>{{ recipe.ingredients.1 }}</td>
<td>{{ recipe.type }}</td>
<td>{{ recipe.chance }}%</td>
{% for crystal in crystals %}
{% let ability = recipe.get_ability(crystal) %}
<td>
{% if ability.is_some() %}
{{ ability.unwrap().name }}
{% else %}
-
{% endif %}
</td>
{% endfor %}
</tr>
{% endfor %}
<table>
<thead>
<tr>
<th rowspan="2">Character</th>
<th rowspan="2">Command</th>
<th rowspan="2">Ingredient A</th>
<th rowspan="2">Ingredient B</th>
<th rowspan="2">Type</th>
<th rowspan="2">Chance</th>
<th colspan="7">Abilities</th>
</tr>
<tr>
{% for crystal in crystals %}
<th class="crystal">{{ crystal }}</th>
{% endfor %}
</tbody>
</table>
</tr>
</thead>
<tbody>
{% for cmd in commands %}
{% for recipe in cmd.recipes %}
<tr class="{{ recipe.get_unlock_chars() }}">
<td>
<div class="charlist">
<!-- RGB moment -->
<span class="terra">
{% if recipe.can_unlock(Character::Terra) %}T{% endif %}
</span>
<span class="ventus">
{% if recipe.can_unlock(Character::Ventus) %}V{% endif %}
</span>
<span class="aqua">
{% if recipe.can_unlock(Character::Aqua) %}A{% endif %}
</span>
</div>
</td>
<td class="{{ cmd.category }}">{{ cmd.name }}</td>
<td>{{ recipe.ingredients.0 }}</td>
<td>{{ recipe.ingredients.1 }}</td>
<!-- <td>{{ recipe.type }}</td> -->
<td>{{ recipe.chance }}%</td>
{% for crystal in crystals %}
{% let ability = recipe.get_ability(crystal) %}
<td>
{% if ability.is_some() %}
{{ ability.unwrap().name }}
{% else %}
-
{% endif %}
</td>
{% endfor %}
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
{% endblock %}