-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: trivernis <trivernis@protonmail.com>
- Loading branch information
Showing
7 changed files
with
162 additions
and
29 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
3 changes: 3 additions & 0 deletions
3
mediarepo-ui/src/app/components/shared/app-common/flap-button/flap-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,3 @@ | ||
<div [className]="'flap-' + this.attach + ' flap-' + this.align + ' flap-button'" matRipple> | ||
<ng-content></ng-content> | ||
</div> |
111 changes: 111 additions & 0 deletions
111
mediarepo-ui/src/app/components/shared/app-common/flap-button/flap-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,111 @@ | ||
@import "src/colors"; | ||
|
||
:host { | ||
position: absolute; | ||
|
||
&[attach='left'], &[attach='top'][align='start'], &[attach='bottom'][align='start'] { | ||
left: 0; | ||
} | ||
|
||
&[attach='right'], &[attach='top'][align='end'], &[attach='bottom'][align='end'] { | ||
right: 0; | ||
} | ||
|
||
&[attach='top'], &[attach='left'][align='start'], &[attach='right'][align='start'] { | ||
top: 0; | ||
} | ||
|
||
&[attach='bottom'], &[attach='left'][align='end'], &[attach='right'][align='end'] { | ||
bottom: 0; | ||
} | ||
|
||
&[attach='left'][align='center'], &[attach='right'][align='center'] { | ||
top: 50%; | ||
transform: translate(0, -50%); | ||
} | ||
|
||
&[attach='top'][align='center'], &[attach='bottom'][align='center'] { | ||
left: 50%; | ||
transform: translate(-50%, 0); | ||
} | ||
} | ||
|
||
.flap-button { | ||
display: flex; | ||
opacity: 0.5; | ||
background: $background-lighter-10; | ||
text-align: center; | ||
transition-duration: 0.1s; | ||
|
||
::ng-deep ng-icon { | ||
margin: auto; | ||
} | ||
|
||
&:hover { | ||
background: $background-lighter-10; | ||
opacity: 0.9; | ||
cursor: pointer; | ||
transition: 0.7s; | ||
} | ||
} | ||
|
||
.flap-top, .flap-bottom { | ||
height: 1.5em; | ||
width: 4em; | ||
} | ||
|
||
.flap-top:hover, .flap-bottom:hover { | ||
width: 10em; | ||
height: 2em; | ||
} | ||
|
||
.flap-left, .flap-right { | ||
height: 4em; | ||
width: 1.5em; | ||
} | ||
|
||
.flap-left:hover, .flap-right:hover { | ||
width: 2em; | ||
height: 10em; | ||
} | ||
|
||
.flap-start.flap-left, .flap-start.flap-top { | ||
border-bottom-right-radius: 1em; | ||
} | ||
|
||
.flap-start.flap-right, .flap-end.flap-top { | ||
border-bottom-left-radius: 1em; | ||
} | ||
|
||
.flap-end.flap-left, .flap-start.flap-bottom { | ||
border-top-right-radius: 1em; | ||
} | ||
|
||
.flap-end.flap-right, .flap-end.flap-bottom { | ||
border-top-left-radius: 1em; | ||
} | ||
|
||
.flap-center { | ||
|
||
&.flap-left { | ||
border-top-right-radius: 1em; | ||
border-bottom-right-radius: 1em; | ||
} | ||
|
||
&.flap-right { | ||
border-top-left-radius: 1em; | ||
border-bottom-left-radius: 1em; | ||
} | ||
|
||
&.flap-top { | ||
border-bottom-right-radius: 1em; | ||
border-bottom-left-radius: 1em; | ||
} | ||
|
||
&.flap-bottom { | ||
border-top-right-radius: 1em; | ||
border-top-left-radius: 1em; | ||
} | ||
} | ||
|
||
|
25 changes: 25 additions & 0 deletions
25
mediarepo-ui/src/app/components/shared/app-common/flap-button/flap-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 {FlapButtonComponent} from "./flap-button.component"; | ||
|
||
describe("FlapButtonComponent", () => { | ||
let component: FlapButtonComponent; | ||
let fixture: ComponentFixture<FlapButtonComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [FlapButtonComponent] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(FlapButtonComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it("should create", () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
mediarepo-ui/src/app/components/shared/app-common/flap-button/flap-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,19 @@ | ||
import {ChangeDetectionStrategy, Component, Input} from "@angular/core"; | ||
|
||
export type Attachment = "top" | "bottom" | "left" | "right"; | ||
export type Alignment = "start" | "center" | "end"; | ||
|
||
@Component({ | ||
selector: "app-flap-button", | ||
templateUrl: "./flap-button.component.html", | ||
styleUrls: ["./flap-button.component.scss"], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class FlapButtonComponent { | ||
|
||
@Input() attach: Attachment = "top"; | ||
@Input() align: Alignment = "center"; | ||
|
||
constructor() { | ||
} | ||
} |