ImmediateGUI

An IMGUI inspired GUI Framework for javascript thats designed to be as simple to use as IMGUI.

目前為 2025-05-17 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.cn-greasyfork.org/scripts/535798/1590637/ImmediateGUI.js

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
TetteDev
版本
0.0.1.20250517080456
建立日期
2025-05-12
更新日期
2025-05-17
尺寸
37.3 KB
授權條款
未知

About ImmediateGUI

An IMGUI inspired GUI Framework for javascript thats designed to be as simple to use as IMGUI. Its actively developed, which means stuff might change and bugs (most definitely) will occur when using this

Supports most of the default controls one could need, can drag the gui around with the mouse, toggle between light/dark mode etc.

For how to use it, check the example code down below (and look at the code of the library)

Example Images (and pseudo code how they were made)

Example 1, Dark Mode

Example 1, Light Mode

const gui = new ImmediateGUI({
    theme: 'dark', /* or 'light' depending on what you want */
    position: 'right', /* what side of the screen the form should display at by default */
    width: 400, 
    draggable: true, /* true by default, so this can be omitted */
});

gui.Header("Image Downloader", 5);
gui.Separator();

gui.BeginSection("Filename Options");
    const cbPreserveOriginalFilename = gui.Checkbox("Preserve original filename", false);
    const txtNamePrefix = gui.Textbox("Filename Prefix");
    const txtNameSuffix = gui.Textbox("Filename Suffix");
gui.EndSection();

gui.BeginSection("Advanced Options");
    const cbHumanize = gui.Checkbox("Humanize Downloads", true);
    const cbRequestlessDownload = gui.Checkbox("Attempt a requestless download for images", true);
    gui.BeginIndentation();
        const cbRequestLessParallel = gui.Checkbox("Use parallelism for requestless downloads", cbRequestlessDownload.checked);
    gui.EndIndentation();

    gui.BeginIndentation(2); // Custom indentation levels supported, this is 2 levels deep which is calculated as 2 * this.indentationSize (which defaults to 10 pixels)
        const inputParallelChunkCount = gui.NumberInput("Parallel Chunk Count", 3, 1, (25 / 3) + 1);
    gui.EndIndentation();
    const cbRequestLessParallelModeCompability = gui.Checkbox("Parallel Compability Mode", true);
    cbRequestLessParallelModeCompability.disabled = true;
    gui.BeginIndentation();
        const cbPreferWebpIfSupported = gui.Checkbox("Prefer WEBP images (if supported)", true);
    gui.EndIndentation();
gui.EndSection();

gui.BeginSection();
    const numFilenameIndexStart = gui.NumberInput("Start filename index at", -1, -1, 9999);
    gui.Separator();

    const inpStart = gui.NumberInput("Download Start Range", 1, 1, 25);
    const inpEnd = gui.NumberInput("Download End Range", 25, 1, 25);

    const btnDownload = gui.Button(`Download 25 Images`, async () => { 
        // Your button click event here
    });
    const btnDownloadRange = gui.Button(`Download Range (25 Images)`, async () => { 
        // Your button click event here
    }); 
gui.EndSection();
gui.BeginIndentation();
    gui.Checkbox("Play sound when downloads are done", true);
gui.EndIndentation();

// This shows the GUI to the user
gui.Show();

Supported Controls in ImmediateGUI Framework

Container Controls

  • Sections - Create collapsible content areas with headers
  • Indentation - Hierarchical layout with customizable levels

Basic UI Elements

  • Button - Standard clickable button with callback support
  • Textbox - Single-line text input field
  • TextArea - Multi-line text input with customizable rows
  • Label - Text display element
  • Header - Section titles with customizable heading levels (h1-h6)
  • Separator - Horizontal dividing line

Form Inputs

  • Checkbox - Boolean toggle with label
  • Dropdown - Selection from predefined options
  • Slider - Range input with visual value display
  • NumberInput - Numeric input with min/max constraints
  • DatePicker - Calendar date selection
  • ColorPicker - Visual color selection tool
  • ProgressBar - Visual progress indicator with percentage

Layout Utilities

  • LabelControlPair - Combines a label with any control
  • Section Management - Organized grouping of controls

Dialog Systems

  • Modal - Customizable popup dialogs with various button options

Appearance

  • Themes - Light and dark mode support
  • Draggable Interface - Repositionable UI panel

General Functions

  • Show/Hide/Remove - Control panel visibility
  • GetControlContainer - Access to the main container element
  • GetControls - Retrieve all control elements