diff --git a/Cargo.toml b/Cargo.toml index 2ce0fb9..7d68c8f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "khguide" -version = "1.1.0" +version = "1.2.0" edition = "2021" [dependencies] diff --git a/src/kh2.rs b/src/kh2.rs index 35d45c6..08af02f 100644 --- a/src/kh2.rs +++ b/src/kh2.rs @@ -5,6 +5,21 @@ use serde::Deserialize; use crate::create_file; +pub const MATERIAL_KINDS: &[&str] = &[ + "blazing", + "bright", + "dark", + "dense", + "energy", + "frost", + "lightning", + "lucid", + "power", + "remembrance", + "serenity", + "twilight", +]; + #[derive(Debug, Deserialize, PartialEq, Eq)] pub struct MaterialDrops { kind: String, diff --git a/templates/components/kh2/kind-filters.html b/templates/components/kh2/kind-filters.html new file mode 100644 index 0000000..ac31661 --- /dev/null +++ b/templates/components/kh2/kind-filters.html @@ -0,0 +1,13 @@ +{% for kind in MATERIAL_KINDS %} + + + {% if loop.index0 == 6 %} +
+ {% endif %} +{% endfor %} diff --git a/templates/components/kh2/only-tracked-filter.html b/templates/components/kh2/only-tracked-filter.html new file mode 100644 index 0000000..5de3895 --- /dev/null +++ b/templates/components/kh2/only-tracked-filter.html @@ -0,0 +1,8 @@ + + diff --git a/templates/layouts/base.html b/templates/layouts/base.html index 7c4c8d5..c6691f7 100644 --- a/templates/layouts/base.html +++ b/templates/layouts/base.html @@ -58,6 +58,32 @@ } } } + + button { + margin-left: 16px; + background: #444; + color: #fff; + padding: 8px; + border-color: #555; + border-bottom-color: rgb(85, 85, 85); + border-style: groove; + border-bottom-color: #0a0; + transition-duration: 0.1s; + + &:hover { + background: #4f4f4f; + } + + &:active { + background: #3f3f3f; + transform: translateY(1px); + } + + &.disabled { + opacity: 0.6; + cursor: not-allowed; + } + } {% block head %}{% endblock %} diff --git a/templates/macros/kh2/macros.html b/templates/macros/kh2/macros.html index 6eff7a3..c8dc684 100644 --- a/templates/macros/kh2/macros.html +++ b/templates/macros/kh2/macros.html @@ -1,21 +1,28 @@ {% macro drop(label) %} -
- -

{{ category.kind|capitalize +}} {{+ label|capitalize }}

-
-
- {% for drop in category.drops(label) %} -
-
- {{ drop.from +}} - {{+ drop.chance }}% -
- {% endfor %} +
+
+ +

{{ category.kind|capitalize +}} {{+ label|capitalize }}

+ +
+
+ {% for drop in category.drops(label) %} +
+
+ {{ drop.from +}} + {{+ drop.chance }}% +
+ {% endfor %} +
{% endmacro %} diff --git a/templates/pages/index.html b/templates/pages/index.html index a4b3aa2..f44b9e4 100644 --- a/templates/pages/index.html +++ b/templates/pages/index.html @@ -26,4 +26,11 @@
  • Food Simulator
  • {% endif %} + + {% if cfg!(feature = "kh2") %} +

    Kingdom Hearts II

    + + {% endif %} {% endblock %} diff --git a/templates/pages/kh2/drops.html b/templates/pages/kh2/drops.html index 9f75509..dfd2e7e 100644 --- a/templates/pages/kh2/drops.html +++ b/templates/pages/kh2/drops.html @@ -46,9 +46,76 @@ } } + {% endblock %} {% block content %} + {% include "components/kh2/only-tracked-filter.html" %} +
    + {% include "components/kh2/kind-filters.html" %} +
    {% for category in drops %} {% call macros::drop("shard") %}