Malayala Kit

MalayalaKit: JavaScript library for creating customizable web menus with tabs, buttons, switches, and input elements.

目前為 2024-01-19 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/482771/1314237/Malayala%20Kit.js

作者
garticio
版本
0.0.1.20240119145303
建立日期
2023-12-20
更新日期
2024-01-19
尺寸
69.4 KB
授權條款
未知

MalayalaKit is a lightweight JavaScript library designed to facilitate the creation of customizable and interactive menus for web applications. It offers a simple and intuitive API for constructing menus with tabs, buttons, switches, and input elements. The library provides a set of predefined styles for a sleek and modern appearance.

Key Features:

  1. Tabs: Easily organize content into tabs for a structured user interface.
  2. Buttons: Add interactive buttons with customizable labels and actions.
  3. Switches: Incorporate toggle switches for binary options.
  4. Input Elements: Create input fields with various types and customizable attributes.

The library's design allows developers to quickly integrate and configure menus within their web projects. It includes built-in styling for a visually appealing experience, but developers can also customize the appearance to suit their application's design.

To use MalayalaKit, developers can instantiate a menu, add tabs with associated content, and include buttons, switches, and input elements within each tab. The library simplifies the process of creating dynamic and responsive menus for web applications.

Example

var toastManager = new MalayalaKit.ToastManager();

var kit = new MalayalaKit.CreateMenu({
    title: "MalayalaKit",
    icon: "",
    size: { width: 500, height: 400 },
    position: { top: 50, left: 50 },
    hotkey: { keyCode: 77, ctrlKey: true, altKey: false, shiftKey: false }
});

var general = new MalayalaKit.Tab("General");
general.addButton({ label: "Show All Toasts", buttonLabel: "Show Toasts", onclick: function () {
        toastManager.showToast({ message: 'Toast Message!', duration: 5000});
        toastManager.showToast({ message: 'Toast Message!' });
        toastManager.showToast({ message: 'Toast Message!', type: 'info' });
        toastManager.showToast({ message: 'Toast Message!', type: 'warning' });
        toastManager.showToast({ message: 'Toast Message!', type: 'error' });
    }
});
general.addButton({ label: "Button Label", style: "border", buttonLabel: "Buton Text", onclick: function () {
        toastManager.showToast({ message: 'Clicked', type: 'info' });
    }
});
general.addSwitch({ label: "Switch Label", value: true, onchange: function (value) {
        toastManager.showToast({ message: 'Switch value: ' + value, type: 'info' });
    }
});
general.addInput({ label: "Number Input", placeholder: "Enter a Number", type: "number", value: 0, onchange: function (value) {
    toastManager.showToast({ message: 'Number input value: ' + value, type: 'info' });
}
});
general.addHotkey({
    label: "Hotkey",
    value: { keyCode: 77, ctrlKey: true, altKey: false, shiftKey: false },
    onlistener: function (event) {
        toastManager.showToast({ message: 'Hotkey value: ' + event, type: 'info' });
    }
});
kit.addTab(general);

var tab2 = new MalayalaKit.Tab("Tab 2");
tab2.addButton({ buttonLabel: "Hide", onclick: function () {
        kit.toggleMenu();
    }
});
tab2.addSlider({ label: 'Slider Label', min: 0, max: 100, value: 50, oninput: function (value) {
        toastManager.showToast({ message: 'Slider Value:  ' + value, type: 'info' });
    }
});
tab2.addColorPicker({ label: 'Color Picker Label', value: '#ff0000', oninput: function (color) {
        toastManager.showToast({ message: 'Selected Color: ' + color, type: 'info' });
    }
});
kit.addTab(tab2);

MalayalaKit.setLanguage('ml'); // Supported languages: en, tr, ml, ta, hi, ko, ja, it, ar, fr

kit.render();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址