-
Notifications
You must be signed in to change notification settings - Fork 166
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
9 changed files
with
247 additions
and
43 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
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 +1,2 @@ | ||
export * from './page-not-found/page-not-found.component'; | ||
export * from './main-button/main-button.component'; |
5 changes: 5 additions & 0 deletions
5
src/app/shared/components/main-button/main-button.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,5 @@ | ||
<!-- <div matRipple class="btn" fxLayout="row" fxLayoutAlign="center center">{{buttonText}}</div> --> | ||
|
||
<button mat-button class="btn" (click)="onClick()" [disabled]="disabled"> | ||
<span style="padding: 10px 20px">{{buttonText}}</span> | ||
</button> |
70 changes: 70 additions & 0 deletions
70
src/app/shared/components/main-button/main-button.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,70 @@ | ||
.btn { | ||
background: linear-gradient(to right, #6fbbee 0%, #047ef0 100%); | ||
-webkit-background-clip: text; | ||
background-clip: text; | ||
-webkit-text-fill-color: transparent; | ||
color: transparent; | ||
font-weight: 600; | ||
border-radius: 40px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
font-size: 0.9rem; | ||
margin: 0 auto; | ||
outline: none; | ||
position: relative; | ||
z-index: 0; | ||
text-decoration: none; | ||
cursor: pointer; | ||
user-select: none; | ||
} | ||
|
||
button { | ||
outline:none; | ||
border: none; | ||
} | ||
|
||
|
||
|
||
.btn::before { | ||
content:""; | ||
position:absolute; | ||
z-index:-1; | ||
top:0; | ||
left:0; | ||
right:0; | ||
bottom:0; | ||
border-radius: 40px; | ||
border: 2px solid transparent; | ||
border-radius: 40px; | ||
background: inherit; | ||
background-origin:border-box; | ||
background-clip:border-box; | ||
-webkit-mask: | ||
linear-gradient(#fff 0 0) padding-box, | ||
linear-gradient(#fff 0 0); | ||
-webkit-mask-composite:destination-out; | ||
mask-composite: exclude; | ||
-webkit-mask-repeat:no-repeat; | ||
} | ||
/**/ | ||
.btn:hover:enabled { | ||
color: #fff; | ||
-webkit-text-fill-color: #fff; | ||
-webkit-background-clip: border-box; | ||
background-clip: border-box; | ||
} | ||
|
||
.btn:disabled { | ||
color: gray; | ||
border: 2px solid gray; | ||
background: transparent; | ||
-webkit-text-fill-color: gray; | ||
-webkit-background-clip: border-box; | ||
background-clip: border-box; | ||
} | ||
|
||
.btn:hover::before { | ||
-webkit-mask:none; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/app/shared/components/main-button/main-button.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,25 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { MainButtonComponent } from './main-button.component'; | ||
|
||
describe('MainButtonComponent', () => { | ||
let component: MainButtonComponent; | ||
let fixture: ComponentFixture<MainButtonComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ MainButtonComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(MainButtonComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
22 changes: 22 additions & 0 deletions
22
src/app/shared/components/main-button/main-button.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,22 @@ | ||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-main-button', | ||
templateUrl: './main-button.component.html', | ||
styleUrls: ['./main-button.component.scss'] | ||
}) | ||
export class MainButtonComponent implements OnInit { | ||
@Input() buttonText: string = ""; | ||
@Input() disabled: boolean = false; | ||
@Output() customClick = new EventEmitter(); | ||
|
||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
onClick() { | ||
this.customClick.emit(); | ||
} | ||
|
||
} |
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
Oops, something went wrong.