@@ -6,6 +6,8 @@ interface Options {
6
6
fps : number ,
7
7
position : string ,
8
8
direction : string ,
9
+ x_offset : string ,
10
+ y_offset : string ,
9
11
}
10
12
11
13
export default class TemplateFactory implements FlasherInterface {
@@ -14,6 +16,8 @@ export default class TemplateFactory implements FlasherInterface {
14
16
fps : 30 ,
15
17
position : 'top-right' ,
16
18
direction : 'top' ,
19
+ x_offset : '0.5em' ,
20
+ y_offset : '0' ,
17
21
} ;
18
22
19
23
render ( envelope : Envelope ) : void {
@@ -41,21 +45,21 @@ export default class TemplateFactory implements FlasherInterface {
41
45
42
46
switch ( this . options . position ) {
43
47
case 'top-left' :
44
- container . style . top = '0' ;
45
- container . style . left = '0.5em' ;
48
+ container . style . top = this . options . y_offset ;
49
+ container . style . left = this . options . x_offset ;
46
50
break ;
47
51
case 'top-right' :
48
- container . style . top = '0' ;
49
- container . style . right = '0.5em' ;
52
+ container . style . top = this . options . y_offset ;
53
+ container . style . right = this . options . x_offset ;
50
54
break ;
51
55
case 'bottom-left' :
52
- container . style . bottom = '0' ;
53
- container . style . left = '0.5em' ;
56
+ container . style . bottom = this . options . y_offset ;
57
+ container . style . left = this . options . x_offset ;
54
58
break ;
55
59
case 'bottom-right' :
56
60
default :
57
- container . style . bottom = '0' ;
58
- container . style . right = '0.5em' ;
61
+ container . style . bottom = this . options . y_offset ;
62
+ container . style . right = this . options . x_offset ;
59
63
break ;
60
64
}
61
65
document . getElementsByTagName ( 'body' ) [ 0 ] . appendChild ( container ) ;
0 commit comments