Welcome to the Ape Design Language demonstration website. The Ape Design Language, or adl for short, is the UI design used by Ape Apps for multiple projects across platforms. It is made to give a consistent look and feel across the entire Ape Apps ecosystem. Although the adl is meant for use in Ape Apps products, you may freely use the styles and functions in your own works.
adl uses the Fluent UI System Icons icon font for various menus and toolbars. When the adl module is properly imported, this iconset will be available to your project. You can see a list of all supported icons in the Icon Font section of the sidebar.
The adl library is provided as a module that you import into your project. It utilizes npm and webpack for easy integration into modern web development workflows. You can find the source code and implementation documentation at the adl GitHub repository.
Theme and Style
Theme Color
let theme = "default"; // default, light or dark
let color = "#1565C0";
adl.setTheme(color,theme);
Menus and Toolbars
Toolbars
The way to create a toolbar is through code, and this example shows how and demonstrates many of the options and capabilities available for toolbar creation.
The iconWeight icon property lets you choose different weights for some of the icon fonts. Property name is iconWeight in all instances.
Iconography
The adl library supports image icons, emoji icons, or font icons using the Fluent UI System Icons icon set. The font icons are specified by using their icon name. To see a list of all available font icons, see the Icon Font section in the main sidebar.
Popup Menu
A nice popup menu that can be used as a context menu or in other situations.
The ADL modal dialog boxes come in a variety of styles and can be customized to fit many scenarios. There are also several helper functions to make creating a dialog a lot easier.
Alert Box (simple)
adl.showAlert("This is an alert box!");
Alert Box With Title (simple)
adl.showAlertWithTitle("This is the message!","This is the Title");
The above functions were all wrappers for the more complete showDialog function.
adl.showDialog({
title: "Dialog Box",
message: "This is the basic usage of the showDialog function. There are a lot of available options, allowing for complete customization of the dialog box. This one is using an ionic icon, but you can also specify an image URL for an icon.",
icon: "ic_fluent_animal_rabbit_20_regular",
iconColor: "#33691E",
buttons: [
{
text: "Button A"
},
{
text: "Button B",
color: "#4DB6AC"
},
{
text: "Button C",
color: "#f44336",
func: function(){ adl.showAlert("You picked C!"); }
}
],
});
Input Box (simple)
adl.inputBox({
title: "Input Box",
message: "An input box is an easy way to gather user input!",
multiline: false,
password: false,
placeholder: "Type something here!",
func: function(result) {
adl.showAlert("You typed: " + result);
}
});
Multiline Input Box (simple)
adl.inputBox({
title: "Multiline Input Box",
message: "A multiline input box, for those times when you want to let the user type in a bit more info.",
multiline: true,
password: false,
placeholder: "Type something here!",
func: function(result) {
adl.showAlert("You typed: " + result);
}
});
Password Box (simple)
adl.inputBox({
title: "Enter Password",
message: "Use the password flag to make an input box work as a password input.",
multiline: false,
password: true,
placeholder: "Enter password",
func: function(result) {
adl.showAlert("You typed: " + result);
}
});
Custom Input Box
Ultimately, the inputBox function is another wrapper for the showDialog function, which can become an input box using the input related options below.
adl.showDialog({
title: "Custom Input Box",
message: "The showDialog function can also be used to create an input box. One of the buttons must have the inputResult option set in order to recieve the result text from the input.",
icon: "ic_fluent_drink_beer_20_regular",
iconColor: "#FFA000",
input: {
multiline: false,
password: false,
placeholder: "What ales you?"
},
buttons: [
{
text: "NOTHING!!",
color: "#f44336"
},
{
text: "Submit",
color: "#4CAF50",
inputResult: true,
func: function(result){ adl.showAlert("You typed: " + result); }
}
],
});
Slider Dialog
The dialog window can also be configured to provide a horizontal slider for selection of a number between two defined values.
adl.showDialog({
title: "Slider Dialog",
message: "Choose a value based on the slider. The onChange callback gives you the current value and an update function that allows you to change the status display as the user manipulates the slider. Give a button the sliderResult attribute to be passed the result of the slider.",
slider: {
min: 0,
max: 100,
value: 50,
status: "50 out of 100",
onChange: function(value,update) { update(value + " out of 100"); },
},
buttons: [
{
text: "Dismiss",
},
{
text: "Save",
color: "#AB47BC",
sliderResult: true,
func: function(result){ adl.showAlert("You choose: " + result); }
}
],
});
You can pass in a 2d array of hex colors to use as custom color swatches. Each array represents a row of swatches, and each must have the same number of colors.
These are more helper functions for the showDialog interface that let you easily display and manipulate a Please Wait type dialog that can be updated and dismissed on your command.
Just like the color picker, the list can also be embedded right into the document so that it's always available. Just pass in a dom element in your options. Items can also be added in "compact" mode.
Using the flyout options, the dialog box can also be positioned as a flyout element. When used as a flyout, clicking/tapping outside of the dialog will dismiss it. The flyout can take all of the same options as the regular dialog window.
adl.showDialog({
title: "Dialog Flyout",
message: "Flyout dialogs can come in handy in many situations. They can be used for settings screens, 'hamburger' type menus, or small informational popups.",
icon: "",
iconColor: "#FBC02D",
flyout: {
position: "bottom"
}
});