style update

This commit is contained in:
Jan Gleytenhoover 2025-01-07 09:59:47 +01:00
parent fe3b957a47
commit 0986803583
Signed by: jank
GPG Key ID: B267751B8AE29EFE
8 changed files with 49 additions and 23 deletions

View File

@ -1,8 +1,8 @@
<p class="text-2xl font-bold text-gray-800 mb-2">Name: {{hotel.hotelName}}</p> <p class="text-2xl font-bold text-gray-800 mb-2">Name: {{hotel.hotelName}}</p>
<p class="text-base text-gray-600 mb-4">Description: {{hotel.description}}</p> <p class="text-base text-gray-600 mb-4">Description: {{hotel.description}}</p>
<p class="text-lg font-medium text-green-600 mb-4">Price: {{hotel.price | currency : getCurrencyCode(selectedLanguage) : "symbol" : "2.2-2" : selectedLanguage}}</p> <p class="text-lg font-medium text-green-600 mb-4">Price: {{hotel.price | currency : getCurrencyCode(selectedLanguage) : "symbol" : "2.2-2" : selectedLanguage}}</p>
<select [ngModel]="selectedLanguage" (ngModelChange)="languageChange($event)" class="block w-full p-2 border border-gray-300 rounded-md mb-4 focus:border-blue-500 focus:ring focus:ring-blue-200"> <select [ngModel]="selectedLanguage" (ngModelChange)="languageChange($event)" class="input-field block w-full p-2 border border-gray-300 rounded-md mb-4 focus:border-blue-500 focus:ring focus:ring-blue-200">
<option *ngFor="let lang of langs" [value]="lang.code" [selected]="lang.lang == 'de'">{{lang.lang}}</option> <option *ngFor="let lang of langs" [value]="lang.code" [selected]="lang.lang == 'de'">{{lang.lang}}</option>
</select> </select>
<img src="{{hotel.imageUrl}}" alt="Hotel" class="w-full h-auto rounded-lg shadow-lg mb-4"> <img src="{{hotel.imageUrl}}" alt="Hotel" class="w-full rounded-full h-auto animate-shake shadow-lg mb-4">
<a *ngIf="!isDetail" routerLink="/hotels/{{hotel.id}}" class="text-blue-600 hover:text-blue-800 hover:underline mb-4 block">Details</a> <a *ngIf="!isDetail" routerLink="/hotels/{{hotel.id}}" class="submit-button text-blue-600 hover:text-blue-800 hover:underline mb-4 block">Details</a>

View File

@ -1,5 +1,5 @@
@if (hotel != null) { @if (hotel) {
<app-hotel-item [hotel]="hotel" [isDetail]="true"></app-hotel-item> <app-hotel-item [hotel]="hotel" [isDetail]="true"></app-hotel-item>
<app-hotel-form [hotel]="hotel"></app-hotel-form> <app-hotel-form [hotel]="hotel"></app-hotel-form>
<button (click)="delete()">DELETE</button> <button class="delete-button" (click)="delete()">DELETE</button>
} }

View File

@ -2,17 +2,17 @@
<h1>{{errorMsg}}</h1> <h1>{{errorMsg}}</h1>
<form [formGroup]="hotelForm"> <form [formGroup]="hotelForm">
<label for="name">Name</label> <label for="name">Name</label>
<div class="text-red" *ngIf="errorMessages['name']">{{ errorMessages['name'] }}</div> <div class="text-red-500 text-5xl font-bold" *ngIf="errorMessages['name']">{{ errorMessages['name'] }}</div>
<input type="text" class="border-red-500" id="name" formControlName="name"> <input type="text" class="border-red-500 text-3xl border-3 rounded-full bg-gray-500 font-bold p-3 m-3 border-8" id="name" formControlName="name">
<label for="description">Description</label> <label for="description">Description</label>
<div class="text-red" *ngIf="errorMessages['description']">{{ errorMessages['description'] }}</div> <div class="text-red" *ngIf="errorMessages['description']">{{ errorMessages['description'] }}</div>
<input type="text" class="border-red-500" [class.border-8]='hotelForm.get("description")?.invalid' id="description" <input type="text" class="input-field" [class.border-8]='hotelForm.get("description")?.invalid' id="description"
formControlName="description"> formControlName="description">
<label for="price">Price</label> <label for="price">Price</label>
<div class="text-red" *ngIf="errorMessages['price']">{{ errorMessages['price'] }}</div> <div class="text-red" *ngIf="errorMessages['price']">{{ errorMessages['price'] }}</div>
<input type="number" class="border-red-500" <input type="number" class="input-field"
[class.border-8]='hotelForm.get("price")?.invalid && hotelForm.get("price")?.touched' id="price" [class.border-8]='hotelForm.get("price")?.invalid && hotelForm.get("price")?.touched' id="price"
formControlName="price"> formControlName="price">
<button (click)="submit()" [disabled]="!hotelForm.valid" type="submit">Submit</button> <button class="submit-button" (click)="submit()" [disabled]="!hotelForm.valid" type="submit">Submit</button>
<a routerLink="/">Cancel</a> <a class="back-button" routerLink="/">Cancel</a>
</form> </form>

View File

@ -1,6 +1,6 @@
<div class="container p-4 mx-auto max-w-4xl"> <div class="container p-4 mx-auto max-w-4xl">
<h1>{{'hello' | uppercase | text}}</h1> <h1>{{'hello' | uppercase | text}}</h1>
<a routerLink="/new">CREATE NEW HOTEL</a> <a class="submit-button" routerLink="/new">CREATE NEW HOTEL</a>
<app-search [(input)]="search"></app-search> <app-search [(input)]="search"></app-search>
@if (hotels[0].hotelName) { @if (hotels[0].hotelName) {
<div *ngFor="let hotel of hotels"> <div *ngFor="let hotel of hotels">

View File

@ -2,25 +2,25 @@
<form [formGroup]="hotelForm"> <form [formGroup]="hotelForm">
<label for="name">Name</label> <label for="name">Name</label>
<div class="text-red" *ngIf="errorMessages['name']">{{ errorMessages['name'] }}</div> <div class="text-red-500" *ngIf="errorMessages['name']">{{ errorMessages['name'] }}</div>
<input type="text" class="border-red-500" [class.border-8]='hotelForm.get("name")?.invalid && hotelForm.get("name")?.touched' id="name" formControlName="name"> <input type="text" class="border-red-500" [class.border-8]='hotelForm.get("name")?.invalid && hotelForm.get("name")?.touched' id="name" formControlName="name">
<label for="description">Description</label> <label for="description">Description</label>
<div class="text-red" *ngIf="errorMessages['description']">{{ errorMessages['description'] }}</div> <div class="text-red-500" *ngIf="errorMessages['description']">{{ errorMessages['description'] }}</div>
<input type="text" class="border-red-500" [class.border-8]='hotelForm.get("description")?.invalid && hotelForm.get("description")?.touched' id="description" formControlName="description"> <input type="text" class="border-red-500" [class.border-8]='hotelForm.get("description")?.invalid && hotelForm.get("description")?.touched' id="description" formControlName="description">
<label for="imageUrl">Image</label> <label for="imageUrl">Image</label>
<div class="text-red" *ngIf="errorMessages['imageUrl']">{{ errorMessages['imageUrl'] }}</div> <div class="text-red-500" *ngIf="errorMessages['imageUrl']">{{ errorMessages['imageUrl'] }}</div>
<input type="url" class="border-red-500" [class.border-8]='hotelForm.get("imageUel")?.invalid && hotelForm.get("imageUrl")?.touched' id="imageUrl" formControlName="imageUrl"> <input type="url" class="border-red-500" [class.border-8]='hotelForm.get("imageUel")?.invalid && hotelForm.get("imageUrl")?.touched' id="imageUrl" formControlName="imageUrl">
<label for="price">Price</label> <label for="price">Price</label>
<div class="text-red" *ngIf="errorMessages['price']">{{ errorMessages['price'] }}</div> <div class="text-red-500" *ngIf="errorMessages['price']">{{ errorMessages['price'] }}</div>
<input type="number" class="border-red-500" [class.border-8]='hotelForm.get("price")?.invalid' id="price" formControlName="price"> <input type="number" class="border-red-500" [class.border-8]='hotelForm.get("price")?.invalid' id="price" formControlName="price">
<label for="rating">Rating</label> <label for="rating">Rating</label>
<div class="text-red" *ngIf="errorMessages['rating']">{{ errorMessages['rating'] }}</div> <div class="text-red-500" *ngIf="errorMessages['rating']">{{ errorMessages['rating'] }}</div>
<input type="rating" class="border-red-500" [class.border-8]='hotelForm.get("rating")?.invalid' id="rating" formControlName="rating"> <input type="rating" class="border-red-500" [class.border-8]='hotelForm.get("rating")?.invalid' id="rating" formControlName="rating">
<button (click)="addTag()">Add Tag</button> <button class="submit-button" (click)="addTag()">Add Tag</button>
@for (tag of getTags().controls; track null) { @for (tag of getTags().controls; track null) {
<input type="tag" class="border-red-500" [class.border-8]='hotelForm.get("tag")?.invalid' id="tag" formControlName="tag"> <input type="tag" class="border-red-500" [class.border-8]='hotelForm.get("tag")?.invalid' id="tag" formControlName="tag">
<button (click)="deleteTag(tag)">delete</button> <button (click)="deleteTag(tag)" class="delete-button">delete</button>
} }
<button (click)="submit()" [disabled]="!hotelForm.valid" type="submit">Submit</button> <button class="submit-button" (click)="submit()" [disabled]="!hotelForm.valid" type="submit">Submit</button>
<a routerLink="/">Cancel</a> <a routerLink="/" class="delete-button">Cancel</a>
</form> </form>

View File

@ -8,7 +8,7 @@
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="./styles.css"> <link rel="stylesheet" href="./styles.css">
</head> </head>
<body class="bg-pink-600"> <body class="bg-pink-600 p-32">
<app-root></app-root> <app-root></app-root>
</body> </body>
</html> </html>

View File

@ -6,3 +6,19 @@
.button { .button {
@apply border-black rounded px-3 py-1 border-[3px]; @apply border-black rounded px-3 py-1 border-[3px];
} }
.input-field {
@apply border-red-500 text-3xl rounded-full bg-gray-500 font-bold p-3 m-3 border-8
}
.back-button {
@apply border-black rounded bg-blue-500 border-[30px] m-3 text-3xl font-bold p-3
}
.submit-button {
@apply border-black rounded-full bg-green-500 border-[30px] m-3 text-3xl font-bold p-3
}
.delete-button {
@apply border-black rounded bg-red-500 border-[30px] m-3 text-3xl font-bold p-3
}

View File

@ -10,7 +10,17 @@ module.exports = {
extend: { extend: {
colors: { colors: {
...colors, ...colors,
} },
keyframes: {
shake: {
'0%, 100%': { transform: 'translateX(0)' },
'25%': { transform: 'translateX(-30px)' },
'75%': { transform: 'translateX(30px)' },
},
},
animation: {
shake: 'shake 0.2s ease-in-out infinite',
},
}, },
}, },
plugins: [], plugins: [],