-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
175 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
<router-outlet></router-outlet> | ||
<app-notification></app-notification> | ||
<app-cookie-message></app-cookie-message> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="message" *ngIf="isVisible()"> | ||
<p> | ||
This website uses cookies to ensure you get the best experience on our | ||
website. | ||
<a href="https://www.cookiesandyou.com/" target="_blank">Learn more</a> | ||
</p> | ||
<div class="btnBox"> | ||
<button (click)="rejectCookies()">Reject</button> | ||
<button (click)="acceptCookies()">Accept</button> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
.message { | ||
position: fixed; | ||
width: 100%; | ||
bottom: 0; | ||
left: 0; | ||
height: 300px; | ||
z-index: 100; | ||
background-color: var(--header-color); | ||
color: var(--text-color); | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
flex-direction: column; | ||
p { | ||
margin: 0; | ||
padding: 0; | ||
font-size: 25px; | ||
text-align: center; | ||
width: 90%; | ||
} | ||
.btnBox { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
flex-direction: row; | ||
margin-top: 20px; | ||
button { | ||
margin: 0 10px; | ||
border: none; | ||
background-color: var(--primary-color); | ||
color: var(--inverted-text-color); | ||
border-radius: 5px; | ||
padding: 10px; | ||
font-size: 20px; | ||
width: 100px; | ||
cursor: pointer; | ||
transition: 0.3s; | ||
&:hover { | ||
background-color: var(--secondary-color); | ||
transform: scale(1.1); | ||
} | ||
} | ||
} | ||
} | ||
@media screen and (max-width: 800px) { | ||
.message { | ||
p { | ||
font-size: 20px; | ||
} | ||
.btnBox { | ||
button { | ||
font-size: 17px; | ||
&:hover { | ||
background-color: var(--primary-color); | ||
transform: scale(1); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { CookieMessageComponent } from './cookie-message.component'; | ||
|
||
describe('CookieMessageComponent', () => { | ||
let component: CookieMessageComponent; | ||
let fixture: ComponentFixture<CookieMessageComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [CookieMessageComponent] | ||
}); | ||
fixture = TestBed.createComponent(CookieMessageComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Component } from '@angular/core'; | ||
import { LocalStorageService } from '../services/local-storage.service'; | ||
|
||
@Component({ | ||
selector: 'app-cookie-message', | ||
templateUrl: './cookie-message.component.html', | ||
styleUrls: ['./cookie-message.component.scss'], | ||
}) | ||
export class CookieMessageComponent { | ||
static visible = false; | ||
|
||
acceptCookies() { | ||
LocalStorageService.acceptCookies(); | ||
CookieMessageComponent.visible = false; | ||
} | ||
rejectCookies() { | ||
LocalStorageService.rejectCookies(); | ||
CookieMessageComponent.visible = false; | ||
} | ||
|
||
isVisible() { | ||
return CookieMessageComponent.visible; | ||
} | ||
|
||
static show() { | ||
CookieMessageComponent.visible = true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters