An easy to use javascript api to make mod-menus for the web easily.
Psst! To see a full example, click here!
How to make a menu (Assuming you ran the code in ModMenuAPI.js):
First, create a list of tabs.
var tabs = new ModMenuTabList();
To add a tab to the list use the following code:
tabs.addTab("About",`
<p>Made by Me! Using ZXMushroom63's ModMenu API</p>
`);
Then create the mod menu, passing in the tabs variable from earlier.
var modmenu = new ModMenu("Mod Menu", tabs);
To run it, simply use:
modmenu.init()
To have multiple menus on one page you have to give each of them an id.
Modify the third line of code to have an id, where the third input is the id.
var modmenu = new ModMenu("Mod Menu", tabs, "exampleId");
First, to style the menu you have to create a new ModMenuStyle variable.
var style = new ModMenuStyle()
Then, set different aspects using it's functions:
style.setBackgroundColor("red");
style.setHeaderTextColor("#32a852");
style.setWidth("30%");
When you create the modmenu, give it an id and pass in the style object.
var modmenu = new ModMenu("Example Mod Menu", tabs, "InsertIdHere", style)
Then just initialize the mod menu as normal.
modmenu.init()
Certain sites will not allow tabs and buttons to be clicked.
Sites:
- github.com
- google.com
- nearly all *.google.com sites
- etc.