-
Notifications
You must be signed in to change notification settings - Fork 288
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
6 changed files
with
193 additions
and
127 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export class Card { | ||
value: string = ''; | ||
|
||
active: boolean; | ||
confirmed: boolean; | ||
|
||
// Optional name of the card | ||
name: string; | ||
|
||
constructor() { | ||
} | ||
} |
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,122 @@ | ||
/* | ||
* Cards style | ||
*/ | ||
div.card-container { | ||
margin-bottom: 20px; | ||
} | ||
|
||
div.card-container h2 { | ||
font-weight: bold; | ||
width: 100px; | ||
min-height: 70px; | ||
text-align: center; | ||
} | ||
@media(min-width: 992px){ | ||
div.card-container h2 { | ||
width: 130px; | ||
} | ||
} | ||
|
||
div.card { | ||
border: 2px solid #0F1593; | ||
border-radius: 15px; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
div.card .inner { | ||
margin: 3px 3px 0; | ||
border-radius: 12px; | ||
background-image: linear-gradient(to bottom, #0F1593, #161ec9); | ||
background-image: -webkit-linear-gradient(top, #0F1593, #161ec9); | ||
text-align: center; | ||
} | ||
|
||
span.card-label { | ||
display: block; | ||
font-size: 2em; | ||
font-weight: bold; | ||
padding: 50px 0 50px; | ||
color: #FFFFFF; | ||
} | ||
@media (min-width: 992px) { | ||
span.card-label { | ||
padding: 75px 0 75px; | ||
} | ||
} | ||
|
||
div.card, div.card-flip { | ||
height: 150px; | ||
width: 100px; | ||
} | ||
@media (min-width: 992px) { | ||
div.card, div.card-flip { | ||
height: 200px; | ||
width: 130px; | ||
} | ||
} | ||
|
||
|
||
div.card.front, div.card.back { | ||
-webkit-backface-visibility: hidden; | ||
backface-visibility: hidden; | ||
position: absolute; | ||
top: 15px; | ||
left: 0; | ||
} | ||
div.deletable-card{ | ||
position: relative; | ||
height: 212px; | ||
width: 142px; | ||
} | ||
div.card.back { | ||
transform: rotateY(180deg); | ||
} | ||
div.card-flip{ | ||
transition: 1s; | ||
transform-style: preserve-3d; | ||
position: relative; | ||
} | ||
div.card-flip.flipped { | ||
transform: rotateY(180deg); | ||
} | ||
|
||
div.card.active { | ||
box-shadow: 0px 0px 20px 5px #c80020; | ||
} | ||
div.card.confirmed { | ||
box-shadow: 0px 0px 20px 5px #7ec500; | ||
} | ||
|
||
div.delete-member { | ||
top: 3px; | ||
left: 85px; | ||
height: 25px; | ||
width: 25px; | ||
} | ||
@media (min-width: 992px) { | ||
div.delete-member { | ||
left: 115px; | ||
} | ||
} | ||
|
||
div.remove { | ||
display: block; | ||
position: absolute; | ||
color: white; | ||
text-shadow: 0 1px rgba(0, 0, 0, 0.25); | ||
border: 1px solid; | ||
border-radius: 3px; | ||
box-shadow: inset 0 1px rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.08); | ||
-webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.08); | ||
background: #fa623f; | ||
border-color: #fa5a35; | ||
background-image: linear-gradient(to bottom, #fc9f8a, #fa623f); | ||
background-image: -webkit-linear-gradient(top, #fc9f8a, #fa623f); | ||
} | ||
|
||
div.remove span { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
} |
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,18 @@ | ||
<div class="card-container"> | ||
<div class="deletable-card"> | ||
<div class="card-flip" [class.flipped]="flipped"> | ||
<div class="card front"> | ||
<div *ngIf="backfaceVisible" class="inner"><span class="card-label">?</span></div> | ||
</div> | ||
<div class="card back" | ||
[class.selectable]="canSelect" [class.active]="card.active" [class.confirmed]="card.confirmed" | ||
(click)="select()"> | ||
<div class="inner"><span class="card-label" [innerHtml]="card.value"></span></div> | ||
</div> | ||
</div> | ||
<div *ngIf="canDelete" class="delete-member remove selectable" (click)="delete()"> | ||
<span class="glyphicon glyphicon-remove"></span> | ||
</div> | ||
</div> | ||
<h2 *ngIf="card.name">{{ card.name }}</h2> | ||
</div> |
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,38 @@ | ||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; | ||
import { Card } from '../card'; | ||
|
||
@Component({ | ||
selector: 'app-card', | ||
templateUrl: './card.component.html', | ||
styleUrls: ['./card.component.css'] | ||
}) | ||
export class CardComponent implements OnInit { | ||
|
||
@Input() card: Card; | ||
|
||
@Input() flipped: boolean; | ||
|
||
@Input() backfaceVisible: boolean; | ||
|
||
@Input() canDelete: boolean; | ||
|
||
@Input() canSelect: boolean; | ||
|
||
@Output() selected: EventEmitter<Card> = new EventEmitter<Card>(); | ||
|
||
@Output() delete: EventEmitter<Card> = new EventEmitter<Card>(); | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
select() { | ||
if (this.canSelect) | ||
this.selected.emit(this.card); | ||
} | ||
|
||
callDelete() { | ||
this.delete.emit(this.card); | ||
} | ||
} |
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