-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
85 lines (74 loc) · 3.19 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Authors: BlackRogue01 & Carolina123
Copyright: RogueSignal.io, 2022 - http://wwww.roguesignal.io
Git:
Note: Uses inline Blueimp MD5: https://github.com/blueimp/JavaScript-MD5
Use:
<script src="growler.js"></script>
<script>
// Instantiates two different growlers
var ogrowler, ogrowler2, overgrowler3
document.addEventListener("DOMContentLoaded", () => {
ogrowler = new OverGrowl();
ogrowler2 = new OverGrowl({public: 'growler2', unique: false, duration: 2000, fade: 0});
ogrowler3 = new OverGrowl();
})
</script>
...
OverGrowl Config Options (all optional):
duration: How long the notice is displayed for (ms)
fade: Fade duration (ms)
unique: true/false if duplicate messages are allowed on screen at the same time.
offset_x: Pixels to offset from right side towards left.
offset_y: Pixels to offset from top towards bottom
close_button: True | False (default), otherwise click bubble closes, unless no_close == true.
no_close: True | False (default), Bubble cannot be closed.
css: Append attached css, overriding the base css as needed.
type_config: { <type>: { <Options> }} Where options can be used to set type options (see below) per type.
public: global root name for DOM and CSS component, default = 'growler'. Using the same name across instances will use same CSS etc.
el: Name of the root dom element to create or use. Default is = 'overgrowl'
Examples:
overgrowl.success('Happy meow!')
overgrowl.alert('Sad meow!')
overgrowl.growl('Just meow!')
overgrowl.growl_type('error','Broken meow!')
Built in types are:
growl - Same as '*' (see below)
error - Styled as an error notice
alert - Styled as an alert notice
info - Styled as an informational notice
success = Styles as a successful notice
system - Styled as a system notice
* - Any other type or no type is basic styled.
New types can be created with styling (or without):
ogrowler.apply_style('yelp',`
border-color: rgb(255, 37, 137);
background-color: #ffffbb;
`,`
background-image: url('assets/overgrowl-gear.png')
background-size: cover
`)
Styling can be updated with:
ogrowler.apply_style('system',`
border-color: rgb(255, 37, 137);
background-color: #ffffbb;
`,`
width: 30px;
height: 30px;
background-image: url('assets/overgrowl-gear.png');
background-size: cover;
`)
Options can be passed to any of the growler message calls:
duration: How long the notice is displayed for (ms)
fade: Fade duration (ms)
unique: true/false if duplicate messages are allowed on screen at the same time.
close_button: True | False (default), otherwise click bubble closes, unless no_close == true.
no_close: True | False (default), Bubble cannot be closed.
Other options that will have a more global effect are:
offset_x: Pixels to offset from right side towards left.
offset_y: Pixels to offset from top towards bottom
css: Append attached css, overriding the base css as needed.
The latter list may cause undesired visual effects, so be aware you should set them on
instantiation.
Notes:
* Unique feature is not available across instances of growler component
* Clicking on growl will remove the message immediately.