You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -68,19 +70,49 @@ The fourth parameter *"type"* (optional) chooses what type of alert should be sh
68
70
1. "notification" - (default) The standard slim variant.
69
71
2. "dialog" - The full-sized variant allowing user input via programmable buttons.
70
72
71
-
The fifth parameter *"confirmButtonText"* (optional) sets the text shown inside the "confirm" dialog button.
72
-
- Example value: "I got it!"
73
+
The fifth parameter *"options"* (optional) is an object containing different properties which are used to configure the alert visually. Create an object containing the options you want and pass it as a parameter to the *Ozone.fire()* method.
74
+
An example of the options object:
73
75
74
-
The sixt parameter *"cancelButtonText"* (optional) sets the text shown inside the "cancel" dialog button.
75
-
- Example value: "No thanks!"
76
+
```javascript
77
+
let options = {backgroundColor:"green", fontColor:"#8b0000"};
78
+
```
76
79
77
-
The seventh and eight parameters *"onConfirm"* (optional) and *"onCancel"* (optional) controls what should happen when each of the two dialog buttons are pressed.
78
-
These parameters take a function containing whatever code you want.
80
+
The sixt and seventh parameters *"onConfirm"* (optional) and *"onCancel"* (optional) controls what should happen when each of the two dialog buttons are pressed.
81
+
These parameters take a function containing whatever code you want. If no code is provided and the buttons are clicked, the button will close the dialog only.
79
82
- See the "advanced usage" example under the *Usage* section for an exact example of how these parameters can be used.
80
83
81
84
## Visual customization
82
85
83
-
The alerts can be easily customized via the *OzoneAlerts.css* style sheet. This requires basic knowledge of CSS, however.
86
+
**OzoneAlerts.js** can be visually customized using the *"options"* parameter, using an object containing the wanted properties. These options are split into two categories. One that is relevant for both types ("notification" and "dialog"), and one that is only applied for the "dialog" type alert. All standard CSS values are valid for the specified properties.
87
+
88
+
The general customization options available are:
89
+
1.**backgroundColor** - Sets the "background-color" CSS property for the alert element.
90
+
- Example value: "green", "#8b0000" etc.
91
+
2.**fontColor** - Sets the "font-color" CSS property for the alert element.
92
+
- Example value: "red", "#FFFF00" etc.
93
+
3.**iconColor** - Sets the color CSS property for the icon in the alert element.
94
+
- Example value: "black", "#000000" etc.
95
+
4.**borderRadius** - Sets the "border-radius" CSS property for the alert element.
96
+
- Example value: "5px"
97
+
5.**border** - Sets the "border" CSS property for the alert element.
98
+
- Example value: "5px solid white"
99
+
100
+
The "dialog" specific customization options available are:
101
+
1.**confirmButtonText** - Sets the inner text of the confirmation button.
102
+
- Example value: "Hello, world!"
103
+
2.**cancelButtonText** - Sets the inner text of the cancellation button.
104
+
- Example value: "Goodbye, world!"
105
+
3.**confirmButtonColor** - Sets the "background-color" CSS property for the confirmation button.
106
+
- Example value: "green", "#8b0000" etc.
107
+
4.**cancelButtonColor** - Sets the "background-color" CSS property for the cancellation button.
108
+
- Example value: "red", "#008080" etc.
109
+
5.**confirmButtonRadius** - Sets the "border-radius" CSS property for the confirmation button.
110
+
- Example value: "5px"
111
+
6.**cancelButtonRadius** - Sets the "border-radius" CSS property for the cancellation button.
112
+
- Example value: "15px"
113
+
114
+
115
+
If you require more control over the visuals, the alerts can be customized via the *OzoneAlerts.css* style sheet. This requires basic knowledge of CSS, however.
84
116
85
117
## Dependencies
86
118
- Font Awesome (https://fontawesome.com/) - Needed for icons to appear. Include it within the head tag of your HTML.
0 commit comments