1
|
import {Component, HostBinding, Input} from '@angular/core';
|
2
|
import {DomSanitizer} from '@angular/platform-browser';
|
3
|
import {ButtonsCustomization} from '../../openaireLibrary/connect/community/CustomizationOptions';
|
4
|
|
5
|
|
6
|
@Component({
|
7
|
selector: 'quick-look-backgrounds',
|
8
|
template: `
|
9
|
<div class="uk-margin-top uk-margin-small-bottom uk-text-bold uk-text-large">Dark background</div>
|
10
|
|
11
|
<div class="uk-padding-small uk-text-center darkBackground uk-height-medium uk-light uk-flex uk-flex-center uk-flex-middle" >
|
12
|
<div>
|
13
|
<h1 >Heading</h1>
|
14
|
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent mollis velit ornare, auctor lectus at, rutrum magna. Aenean vehicula elementum lacinia.</div>
|
15
|
<a class="">Link</a>
|
16
|
<quick-look-buttons
|
17
|
[buttons]="buttonsOnDark"
|
18
|
></quick-look-buttons>
|
19
|
</div>
|
20
|
</div>
|
21
|
|
22
|
<div class="uk-margin-top">
|
23
|
|
24
|
<div class="uk-margin-top uk-margin-small-bottom uk-text-bold uk-text-large">Light background</div>
|
25
|
<div class="uk-padding-small uk-text-center uk-width-1-1 uk-height-medium lightBackground uk-flex uk-flex-center uk-flex-middle" >
|
26
|
<div>
|
27
|
<h1 >Heading</h1>
|
28
|
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent mollis velit ornare, auctor lectus at, rutrum magna. Aenean vehicula elementum lacinia.</div>
|
29
|
<a class="portal-link">Link</a>
|
30
|
<br>
|
31
|
<quick-look-buttons
|
32
|
[buttons]="buttonsOnLight" ></quick-look-buttons>
|
33
|
</div>
|
34
|
</div>
|
35
|
</div>
|
36
|
`,
|
37
|
styles:[`
|
38
|
.darkBackground{
|
39
|
background-color: var(--background-dark-color);
|
40
|
}
|
41
|
.lightBackground{
|
42
|
background-color: var(--background-low-color);
|
43
|
}
|
44
|
`]
|
45
|
|
46
|
})
|
47
|
|
48
|
export class QuickLookBackgroundsComponent {
|
49
|
@Input() primaryColor;
|
50
|
@Input() secondaryColor;
|
51
|
@Input() darkBackgroundColor;
|
52
|
@Input() lightBackgroundColor;
|
53
|
@Input() buttonsOnDark:ButtonsCustomization;
|
54
|
@Input() buttonsOnLight:ButtonsCustomization;
|
55
|
constructor( private sanitizer: DomSanitizer) {
|
56
|
}
|
57
|
|
58
|
@HostBinding("attr.style")
|
59
|
public get valueAsStyle(): any {
|
60
|
return this.sanitizer.bypassSecurityTrustStyle(`--portal-main-color: ${this.primaryColor}; --portal-dark-color: ${this.secondaryColor};
|
61
|
--background-dark-color: ${this.darkBackgroundColor}; --background-low-color: ${this.lightBackgroundColor};`);
|
62
|
}
|
63
|
}
|