MoxAlehin / TierList

Obsidian plugin for visually ranking and organizing content into customizable Tier Lists.
GNU General Public License v3.0
2 stars 0 forks source link

Replace Settings Tier List Width and Number of Slots and maybe Ratio textboxes with sliders #1

Open MoxAlehin opened 4 weeks ago

MoxAlehin commented 4 weeks ago

Excalidraw example

// Grid opacity slider (hex value between 00 and FF)
      let opacityValue: HTMLDivElement;
      new Setting(detailsEl)
        .setName(t("GRID_OPACITY_NAME"))
        .setDesc(fragWithHTML(t("GRID_OPACITY_DESC")))
        .addSlider((slider) =>
          slider
            .setLimits(0, 100, 1) // 0 to 100 in decimal
            .setValue(this.plugin.settings.gridSettings.OPACITY)
            .onChange(async (value) => {
              opacityValue.innerText = ` ${value.toString()}`;
              this.plugin.settings.gridSettings.OPACITY = value;
              this.applySettingsUpdate();
              updateGridColor();
            }),
        )
        .settingEl.createDiv("", (el) => {
          opacityValue = el;
          el.style.minWidth = "3em";
          el.style.textAlign = "right";
          el.innerText = ` ${this.plugin.settings.gridSettings.OPACITY}`;
        });