Added colors with persistence based on local storage #10
@@ -4,14 +4,22 @@
|
||||
</button>
|
||||
@if (showControls) {
|
||||
<div class="controls">
|
||||
<mat-button-toggle-group vertical multiple>
|
||||
<mat-button-toggle-group vertical multiple class="generator-toggles">
|
||||
<mat-button-toggle [checked]="showRegon" (change)="showRegon = $event.source.checked">REGON</mat-button-toggle>
|
||||
<mat-button-toggle [checked]="showNip" (change)="showNip = $event.source.checked">NIP</mat-button-toggle>
|
||||
<mat-button-toggle [checked]="showPesel" (change)="showPesel = $event.source.checked">PESEL</mat-button-toggle>
|
||||
<mat-button-toggle [checked]="showIdentityCard" (change)="showIdentityCard = $event.source.checked">DOWÓD</mat-button-toggle>
|
||||
<mat-button-toggle [checked]="showMobile" (change)="showMobile = $event.source.checked">MOBILNY</mat-button-toggle>
|
||||
<mat-button-toggle [checked]="showMobile" (change)="showMobile = $event.source.checked">KOMÓRA</mat-button-toggle>
|
||||
<mat-button-toggle [checked]="showIban" (change)="showIban = $event.source.checked">IBAN</mat-button-toggle>
|
||||
</mat-button-toggle-group>
|
||||
|
||||
<mat-button-toggle-group vertical class="theme-toggles">
|
||||
@for (theme of themes; track theme.value) {
|
||||
<mat-button-toggle [checked]="selectedTheme === theme.value" (change)="setTheme(theme.value)">
|
||||
{{theme.name}}
|
||||
</mat-button-toggle>
|
||||
}
|
||||
</mat-button-toggle-group>
|
||||
</div>
|
||||
}
|
||||
<div class="generators">
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
z-index: 11;
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 50%;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
@@ -24,7 +24,7 @@
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(255, 255, 255, 0.3);
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
transform: rotate(30deg);
|
||||
}
|
||||
|
||||
@@ -37,8 +37,9 @@
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
padding: 0;
|
||||
position: fixed;
|
||||
top: 60px;
|
||||
@@ -52,21 +53,22 @@
|
||||
}
|
||||
|
||||
mat-button-toggle-group {
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 16px 0 rgba(0, 38, 135, 0.2);
|
||||
box-shadow: 0 4px 16px 0 var(--shadow-color);
|
||||
overflow: hidden;
|
||||
flex-direction: column;
|
||||
transition: box-shadow 0.5s ease;
|
||||
}
|
||||
|
||||
mat-button-toggle {
|
||||
color: white;
|
||||
font-family: 'Comfortaa', sans-serif;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
|
||||
border-left: none !important;
|
||||
background-color: rgba(51, 98, 188, 0.4);
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
width: 100%;
|
||||
|
||||
&:last-child {
|
||||
@@ -74,8 +76,9 @@
|
||||
}
|
||||
|
||||
&.mat-button-toggle-checked {
|
||||
background-color: rgba(255, 255, 255, 0.3);
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
|
||||
@@ -17,17 +17,49 @@ export class AppComponent implements OnInit {
|
||||
|
||||
showControls = false;
|
||||
isInitialVisible = true;
|
||||
selectedTheme = '';
|
||||
|
||||
themes = [
|
||||
{ name: 'BŁĘKITNY', value: '' },
|
||||
{ name: 'AMARANTOWY', value: 'theme-light-blue' },
|
||||
{ name: 'MIEDZIANY', value: 'theme-light-orange' },
|
||||
{ name: 'ŁOSOSIOWY', value: 'theme-light-pink' },
|
||||
{ name: 'OLIWKOWY', value: 'theme-dark-grey' }
|
||||
];
|
||||
|
||||
constructor(private cdr: ChangeDetectorRef, private eRef: ElementRef) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
const savedTheme = localStorage.getItem('selectedTheme');
|
||||
if (savedTheme) {
|
||||
this.selectedTheme = savedTheme;
|
||||
this.applyTheme(savedTheme);
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.isInitialVisible = false;
|
||||
this.cdr.detectChanges();
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
setTheme(theme: string) {
|
||||
this.selectedTheme = theme;
|
||||
localStorage.setItem('selectedTheme', theme);
|
||||
this.applyTheme(theme);
|
||||
}
|
||||
|
||||
private applyTheme(theme: string) {
|
||||
const body = document.body;
|
||||
this.themes.forEach(t => {
|
||||
if (t.value) {
|
||||
body.classList.remove(t.value);
|
||||
}
|
||||
});
|
||||
if (theme) {
|
||||
body.classList.add(theme);
|
||||
}
|
||||
}
|
||||
|
||||
@HostListener('document:click', ['$event'])
|
||||
clickout(event: Event) {
|
||||
const settingsButton = this.eRef.nativeElement.querySelector('.settings-button');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="generator">
|
||||
<div class="title">
|
||||
<span>DOWÓD OSOBISTY</span>
|
||||
<span>DOWÓD</span>
|
||||
</div>
|
||||
<div class="container">
|
||||
<input type="text" [formControl]="valueField" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="generator">
|
||||
<div class="title">
|
||||
<span>KOMÓRKA</span>
|
||||
<span>KOMÓRA</span>
|
||||
<div class="titleButtons">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
:root {
|
||||
--primary-gradient: linear-gradient(to bottom, #3362bc, #4f7cd1, #3362bc);
|
||||
--shadow-color: rgba(1, 29, 96, 0.37);
|
||||
}
|
||||
|
||||
.theme-light-blue {
|
||||
--primary-gradient: linear-gradient(to bottom, #2a0f39, #491375, #241345);
|
||||
--shadow-color: rgb(10, 1, 43);
|
||||
}
|
||||
|
||||
.theme-light-orange {
|
||||
--primary-gradient: linear-gradient(to bottom, #673e1b, #9c6b37, #633718);
|
||||
--shadow-color: rgb(43, 19, 1);
|
||||
}
|
||||
|
||||
.theme-light-pink {
|
||||
--primary-gradient: linear-gradient(to bottom, #78424c, #7a4d54, #90505a);
|
||||
--shadow-color: rgb(32, 16, 18);
|
||||
}
|
||||
|
||||
.theme-dark-grey {
|
||||
--primary-gradient: linear-gradient(to bottom, #2f4f37, #456c37, #2f4f37);
|
||||
--shadow-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Comfortaa';
|
||||
src: url('assets/Comfortaa-VariableFont_wght.ttf');
|
||||
@@ -14,6 +39,7 @@ body {
|
||||
border: none;
|
||||
font-size: 150%;
|
||||
font-family: 'Comfortaa', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
transition: background 0.5s ease;
|
||||
}
|
||||
|
||||
.gradient {
|
||||
@@ -23,7 +49,8 @@ body {
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: -1;
|
||||
background-image: linear-gradient(to bottom, #3362bc, #3d6cc7, #4776d1, #5181dc, #5a8be7, #5a8be7, #5b8ae7, #5b8ae7, #527fdc, #4975d1, #406ac7, #3760bc);
|
||||
background-image: var(--primary-gradient);
|
||||
transition: background-image 0.5s ease;
|
||||
}
|
||||
|
||||
.generators {
|
||||
@@ -38,9 +65,10 @@ body {
|
||||
.generator {
|
||||
margin: 1em;
|
||||
background: rgba( 255, 255, 255, 0.15 );
|
||||
box-shadow: 0 8px 32px 0 rgba( 0, 38, 135, 0.37 );
|
||||
box-shadow: 0 8px 32px 0 var(--shadow-color);
|
||||
border-radius: 3px;
|
||||
border: 1px solid rgba( 255, 255, 255, 0.18 );
|
||||
transition: box-shadow 0.5s ease;
|
||||
}
|
||||
|
||||
.container {
|
||||
@@ -138,9 +166,10 @@ input[type="text"] {
|
||||
color: white;
|
||||
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
box-shadow: 0 8px 32px 0 rgba( 0, 38, 135, 0.37 );
|
||||
box-shadow: 0 8px 32px 0 var(--shadow-color);
|
||||
border-radius: 3px;
|
||||
border: 1px solid rgba( 255, 255, 255, 0.20 );
|
||||
border: 1px solid rgba(255, 255, 255, 0.20);
|
||||
transition: box-shadow 0.5s ease;
|
||||
|
||||
&.ng-valid {
|
||||
border-bottom: 3px solid #87e17a
|
||||
@@ -165,9 +194,10 @@ input[type="number"] {
|
||||
color: white;
|
||||
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
box-shadow: 0 8px 32px 0 rgba( 0, 38, 135, 0.37 );
|
||||
box-shadow: 0 8px 32px 0 var(--shadow-color);
|
||||
border-radius: 3px;
|
||||
border: 1px solid rgba( 255, 255, 255, 0.20 );
|
||||
border: 1px solid rgba(255, 255, 255, 0.20);
|
||||
transition: box-shadow 0.5s ease;
|
||||
}
|
||||
|
||||
input::-webkit-outer-spin-button,
|
||||
|
||||
Reference in New Issue
Block a user