-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend: Added shared-call-components project and configure application
- Loading branch information
Showing
63 changed files
with
1,542 additions
and
251 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,24 @@ | ||
# SharedCallComponents | ||
|
||
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.2.0. | ||
|
||
## Code scaffolding | ||
|
||
Run `ng generate component component-name --project shared-call-components` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project shared-call-components`. | ||
> Note: Don't forget to add `--project shared-call-components` or else it will be added to the default project in your `angular.json` file. | ||
## Build | ||
|
||
Run `ng build shared-call-components` to build the project. The build artifacts will be stored in the `dist/` directory. | ||
|
||
## Publishing | ||
|
||
After building your library with `ng build shared-call-components`, go to the dist folder `cd dist/shared-call-components` and run `npm publish`. | ||
|
||
## Running unit tests | ||
|
||
Run `ng test shared-call-components` to execute the unit tests via [Karma](https://karma-runner.github.io). | ||
|
||
## Further help | ||
|
||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page. |
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,7 @@ | ||
{ | ||
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json", | ||
"dest": "../../dist/shared-call-components", | ||
"lib": { | ||
"entryFile": "src/public-api.ts" | ||
} | ||
} |
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,12 @@ | ||
{ | ||
"name": "shared-call-components", | ||
"version": "0.0.1", | ||
"peerDependencies": { | ||
"@angular/common": "^18.2.0", | ||
"@angular/core": "^18.2.0" | ||
}, | ||
"dependencies": { | ||
"tslib": "^2.3.0" | ||
}, | ||
"sideEffects": false | ||
} |
14 changes: 14 additions & 0 deletions
14
...rojects/shared-call-components/src/lib/components/card/logo-card/logo-card.component.html
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,14 @@ | ||
<mat-card class="logo-card" [style.background-color]="cardBackgroundColor"> | ||
<div class="card-content" (mouseenter)="onMouseEnter()" (mouseleave)="onMouseLeave()"> | ||
<div class="logo-container"> | ||
<img [src]="logoSrc" alt="App Logo" class="app-logo" /> | ||
@if (isHovering && isEnabled) { | ||
<mat-icon class="select-icon">add_a_photo</mat-icon> | ||
} | ||
</div> | ||
<div class="text-container"> | ||
<div class="card-title">{{ title || '' }}</div> | ||
<div class="card-subtitle">{{ description || 'Select your app logo' }}</div> | ||
</div> | ||
</div> | ||
</mat-card> |
61 changes: 61 additions & 0 deletions
61
...rojects/shared-call-components/src/lib/components/card/logo-card/logo-card.component.scss
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,61 @@ | ||
.logo-card { | ||
max-width: 100%; | ||
border-radius: 8px; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | ||
transition: box-shadow 0.3s ease-in-out; | ||
position: relative; // Para posicionar el icono de selección | ||
|
||
&:hover { | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); | ||
} | ||
} | ||
|
||
.card-content { | ||
display: flex; | ||
align-items: center; | ||
gap: 16px; | ||
padding: 20px; | ||
} | ||
|
||
.logo-container { | ||
position: relative; // Para posicionar el icono de selección | ||
border-radius: 4px; | ||
} | ||
|
||
.app-logo { | ||
width: 64px; // Ajusta el tamaño del logo | ||
height: 64px; // Ajusta el tamaño del logo | ||
border-radius: 4px; // Opcional: para esquinas redondeadas | ||
object-fit: cover; // Mantiene la proporción de la imagen | ||
} | ||
|
||
.select-icon { | ||
position: absolute; // Para que el icono se superponga al logo | ||
top: 50%; // Centrado verticalmente | ||
left: 50%; // Centrado horizontalmente | ||
transform: translate(-50%, -50%); // Ajuste del centro | ||
color: #673ab7; // Color del icono | ||
font-size: 36px; // Tamaño del icono | ||
opacity: 0; // Inicialmente oculto | ||
transition: opacity 0.2s ease; // Transición suave | ||
} | ||
|
||
.logo-card:hover .select-icon { | ||
opacity: 1; // Mostrar el icono al hacer hover | ||
} | ||
|
||
.text-container { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.card-title { | ||
font-size: 1.2rem; | ||
font-weight: 600; | ||
color: #333; | ||
} | ||
|
||
.card-subtitle { | ||
font-size: 0.9rem; | ||
color: #666; | ||
} |
23 changes: 23 additions & 0 deletions
23
...ects/shared-call-components/src/lib/components/card/logo-card/logo-card.component.spec.ts
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,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { LogoCardComponent } from './logo-card.component'; | ||
|
||
describe('LogoCardComponent', () => { | ||
let component: LogoCardComponent; | ||
let fixture: ComponentFixture<LogoCardComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [LogoCardComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(LogoCardComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
32 changes: 32 additions & 0 deletions
32
.../projects/shared-call-components/src/lib/components/card/logo-card/logo-card.component.ts
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,32 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { Component, Input } from '@angular/core'; | ||
import { MatCardModule } from '@angular/material/card'; | ||
import { MatIconModule } from '@angular/material/icon'; | ||
|
||
@Component({ | ||
selector: 'ov-logo-card', | ||
standalone: true, | ||
imports: [CommonModule, MatCardModule, MatIconModule], | ||
templateUrl: './logo-card.component.html', | ||
styleUrl: './logo-card.component.scss' | ||
}) | ||
export class LogoCardComponent { | ||
@Input() title: string = ''; | ||
@Input() description: string = ''; | ||
@Input() logoSrc: string = ''; // URL de la imagen del logo | ||
@Input() cardBackgroundColor: string = '#ffffff'; | ||
@Input() isEnabled: boolean = true; | ||
|
||
isHovering: boolean = false; // Estado para controlar el hover | ||
|
||
// Métodos para manejar el mouseenter y mouseleave | ||
onMouseEnter() { | ||
if (this.isEnabled) { | ||
this.isHovering = true; | ||
} | ||
} | ||
|
||
onMouseLeave() { | ||
this.isHovering = false; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...cts/shared-call-components/src/lib/components/card/toggle-card/toggle-card.component.html
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,16 @@ | ||
<mat-card class="toggle-card" [style.background-color]="cardBackgroundColor"> | ||
<div class="card-content"> | ||
<div class="icon-container" [style.background-color]="iconBackgroundColor"> | ||
<mat-icon class="card-icon">{{ icon }}</mat-icon> | ||
</div> | ||
<div class="text-container"> | ||
<div class="card-title">{{ title || '' }}</div> | ||
<div class="card-subtitle">{{ description || 'OpenVidu' }}</div> | ||
</div> | ||
</div> | ||
|
||
<div class="card-footer"> | ||
<span>{{ title }} is {{ toggleValue ? 'active' : 'disabled' }}</span> | ||
<mat-slide-toggle [checked]="toggleValue" (change)="onToggleChange($event)"></mat-slide-toggle> | ||
</div> | ||
</mat-card> |
67 changes: 67 additions & 0 deletions
67
...cts/shared-call-components/src/lib/components/card/toggle-card/toggle-card.component.scss
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,67 @@ | ||
.toggle-card { | ||
max-width: 100%; | ||
border-radius: 8px; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | ||
transition: box-shadow 0.3s ease-in-out; | ||
} | ||
|
||
.toggle-card:hover { | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); | ||
} | ||
|
||
.card-content { | ||
display: flex; | ||
align-items: center; | ||
gap: 16px; | ||
padding: 20px; | ||
} | ||
|
||
.icon-container { | ||
background-color: #673ab7; /* Color de fondo del icono */ | ||
padding: 16px; | ||
border-radius: 4px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.card-icon { | ||
color: white; | ||
font-size: 24px; | ||
} | ||
|
||
.text-container { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.card-title { | ||
font-size: 1.2rem; | ||
font-weight: 600; | ||
color: #333; | ||
} | ||
|
||
.card-subtitle { | ||
font-size: 0.9rem; | ||
color: #666; | ||
} | ||
|
||
.card-footer { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding-top: 8px; | ||
padding: 10px; | ||
background-color: #f8f9fa; | ||
border-top: 1px solid #e9ecef; | ||
} | ||
|
||
.view-more { | ||
font-size: 0.9rem; | ||
color: #007bff; | ||
text-decoration: none; | ||
} | ||
|
||
.view-more:hover { | ||
text-decoration: underline; | ||
} |
Oops, something went wrong.