Skip to content

Commit 289ea30

Browse files
authored
Merge branch 'master' into feature/sidemenu
2 parents 6289fa9 + 7f0573f commit 289ea30

32 files changed

+465
-191
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
**I'm submitting a ...** (check one with "x")
2+
3+
[ ] bug report
4+
[ ] feature request
5+
[ ] support request
6+
7+
<!-- Please be clear when explaining what behavior is expected -->
8+
**Steps to reproduce the bug:**
9+
10+
11+
**Related code:**
12+
```
13+
insert any relevant code here
14+
```
15+
16+
**Important information:**
17+
<!-- State important information if needed, such as OS version, hardware info, ionic info, etc. -->

src/app/app.component.ts

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ import { StatusBar, Splashscreen } from 'ionic-native';
1515

1616
import { HomePage } from '../pages/_home/home';
1717

18+
import { Subject } from 'rxjs';
19+
1820
@Component({
1921
templateUrl: 'app.html'
2022
})
2123
export class MyApp {
2224
@ViewChild(Nav) nav: Nav;
2325

2426
rootPage: any = HomePage;
27+
activePage = new Subject();
2528

26-
pages: Array<{ title: string, component: any, icon: string }>;
29+
pages: Array<{ title: string, component: any, active: boolean, icon: string }>;
2730
rightMenuItems: Array<{ icon: string, active: boolean }>;
2831
state: any;
2932

@@ -43,20 +46,25 @@ export class MyApp {
4346
]
4447

4548
this.pages = [
46-
{ title: 'Home', component: HomePage, icon: 'home' },
47-
{ title: 'Ionic Official Components', component: IonicOfficialComponentsPage, icon: 'alarm' },
48-
{ title: 'Login', component: LoginListPage, icon: 'archive' },
49-
{ title: 'Lists', component: ListsPage, icon: 'body' },
50-
{ title: 'Popup Modal', component: PopupModalsPage, icon: 'basket' },
51-
{ title: 'Miscellaneous', component: MiscellaneousListPage, icon: 'bookmarks' },
52-
{ title: 'Popup Menu', component: PopupMenuListPage, icon: 'beer' },
53-
{ title: 'Profile', component: ProfileListPage, icon: 'camera' },
49+
{ title: 'Home', component: HomePage, active: true, icon: 'home' },
50+
{ title: 'Ionic Official Components', component: IonicOfficialComponentsPage, active: false, icon: 'alarm' },
51+
{ title: 'Login', component: LoginListPage, active: false, icon: 'archive' },
52+
{ title: 'Lists', component: ListsPage, active: false },
53+
{ title: 'Popup Modal', component: PopupModalsPage, active: false, icon: 'basket' },
54+
{ title: 'Miscellaneous', component: MiscellaneousListPage, active: false, icon: 'bookmarks' },
55+
{ title: 'Popup Menu', component: PopupMenuListPage, active: false, icon: 'beer' },
56+
{ title: 'Profile', component: ProfileListPage, active: false, icon: 'camera' },
5457
{ title: 'Side Menu', component: SideMenuPage, icon: 'bookmark' },
5558
// Removed for now as there were breaking changes in slides
56-
// { title: 'Slides', component: SlidesPage, icon: 'home' },
57-
{ title: 'Theming', component: ThemingPage, icon: 'power' },
59+
// { title: 'Slides', component: SlidesPage },
60+
{ title: 'Theming', component: ThemingPage, active: false, icon: 'power' },
5861
];
5962

63+
this.activePage.subscribe((selectedPage: any) => {
64+
this.pages.map(page => {
65+
page.active = page.title === selectedPage.title;
66+
});
67+
});
6068
}
6169

6270
initializeApp() {
@@ -73,6 +81,7 @@ export class MyApp {
7381
// Reset the content nav to have just this page
7482
// we wouldn't want the back button to show in this scenario
7583
this.nav.setRoot(page.component);
84+
this.activePage.next(page);
7685
}
7786

7887
rightMenuClick(item) {

src/app/app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</ion-header>
99
<ion-content>
1010
<ion-list>
11-
<button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
11+
<button menuClose ion-item *ngFor="let p of pages" [class.highlight]="p.active" (click)="openPage(p)">
1212
{{p.title}}
1313
</button>
1414
</ion-list>

src/app/app.imports.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { LoginListPage } from '../pages/login/login';
2828
import { LoginOnePage } from '../pages/login/login-one/login-one';
2929
import { LoginInstagramPage } from '../pages/login/login-instagram/login-instagram';
3030
import { LoginSliderPage } from '../pages/login/login-slider/login-slider';
31+
import { LoginBackgroundVideoPage } from '../pages/login/login-background-video/login-background-video';
3132

3233
// Popup Menu list
3334
import { PopupMenuListPage } from '../pages/popup-menu/popup-menu';
@@ -85,6 +86,8 @@ import { CreditCardScanPage } from '../pages/miscellaneous/credit-card-scan/cred
8586
import { RuntimePermissionsPage } from '../pages/miscellaneous/runtime-permissions/runtime-permissions';
8687
import { ChartsPage } from '../pages/miscellaneous/charts/charts';
8788
import { GetImagePage } from '../pages/miscellaneous/get-image/get-image';
89+
import { BarcodescannerPage } from '../pages/miscellaneous/barcodescanner/barcodescanner';
90+
import { FlashCardPage } from '../pages/miscellaneous/flash-card/flash-card';
8891

8992
// Providers
9093
import { WeatherService } from '../pages/miscellaneous/weather/weather.service';
@@ -93,9 +96,12 @@ import { AlertService } from '../providers/util/alert.service';
9396
import { CameraProvider } from '../providers/util/camera.provider';
9497

9598
// Directives
96-
import { Timer } from '../components/countdown-timer/timer';
9799
import { SlidingDrawer } from '../components/sliding-drawer/sliding-drawer';
100+
101+
// Components
102+
import { Timer } from '../components/countdown-timer/timer';
98103
import { TypingEffect } from '../components/typing-effect/typing-effect';
104+
import { FlashCardComponent } from '../components/flash-card/flash-card';
99105

100106
// Pipes
101107
import { MomentPipe } from '../pipes/moment.pipe';
@@ -149,6 +155,7 @@ export const Pages = [
149155
LoginOnePage,
150156
LoginInstagramPage,
151157
LoginSliderPage,
158+
LoginBackgroundVideoPage,
152159

153160
// Side Menu
154161
SideMenuPage,
@@ -170,6 +177,8 @@ export const Pages = [
170177
ChartsPage,
171178
RuntimePermissionsPage,
172179
GetImagePage,
180+
FlashCardPage,
181+
BarcodescannerPage,
173182

174183
// Modals
175184
PopupModalsPage,
@@ -204,6 +213,10 @@ export const Providers = [
204213
WeatherService, AlertService, ToastService, AppState, CameraProvider
205214
]
206215

216+
export const Components = [
217+
FlashCardComponent,
218+
]
219+
207220
export const Directives = [
208221
SlidingDrawer,
209222
Timer,

src/app/app.module.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,15 @@ import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
33
import { MyApp } from './app.component';
44
import { SwingModule } from 'angular2-swing';
55

6-
import { Pages, Directives, Pipes, Providers } from './app.imports';
6+
import { Pages, Directives, Pipes, Providers, Components } from './app.imports';
77

88
@NgModule({
99
declarations: [
1010
// App Core
1111
MyApp,
12-
13-
// Pages
1412
Pages,
15-
16-
// directives
13+
Components,
1714
Directives,
18-
19-
// pipes
2015
Pipes
2116
],
2217
imports: [

src/app/app.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
text-align: center;
2020
}
2121

22+
.highlight {
23+
background-color: #f4f4f4;
24+
}
25+
2226
.center {
2327
display: block;
2428
margin: 0 auto;
97.4 KB
Loading

src/assets/img/flashcards/namaste.jpg

31.2 KB
Loading

src/assets/img/flashcards/sorry.jpg

78.8 KB
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<ion-card class="fc-container" (click)="toggle()" [class.fc-back]="toggled" #fcContainer>
2+
<div class="front" #front>
3+
<ng-content class="" select=".fc-front"></ng-content>
4+
</div>
5+
6+
<div class="back" #back>
7+
<ng-content select=".fc-back"></ng-content>
8+
</div>
9+
</ion-card>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
flash-card {
2+
&{
3+
perspective: 1000px;
4+
}
5+
.fc-container{
6+
transition: 0.6s;
7+
transform-style: preserve-3d;
8+
position: relative;
9+
&.fc-back {
10+
transform: rotateY(180deg);
11+
}
12+
13+
.front {
14+
position: absolute;
15+
top:0;
16+
left:0;
17+
width: 100%;
18+
z-index: 2;
19+
backface-visibility: hidden;
20+
padding: 20px;
21+
background: #f2f2f2;
22+
transform: rotateY(0deg);
23+
}
24+
25+
.back {
26+
width: 100%;
27+
position: absolute;
28+
top:0;
29+
left:0;
30+
background: #f2f2f2;
31+
padding: 20px;
32+
transform: rotateY(180deg);
33+
}
34+
35+
}
36+
.fc-back {
37+
.front {
38+
z-index: 0;
39+
}
40+
.back {
41+
z-index: 2;
42+
}
43+
44+
}
45+
46+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Component, ElementRef, ViewChild } from '@angular/core';
2+
3+
@Component({
4+
selector: 'flash-card',
5+
templateUrl: 'flash-card.html'
6+
})
7+
export class FlashCardComponent {
8+
@ViewChild('fcContainer') fcContainer;
9+
@ViewChild('front') fcFront;
10+
@ViewChild('back') fcBack;
11+
toggled: boolean = false;
12+
13+
constructor(private flashCard: ElementRef) {
14+
}
15+
ngAfterViewChecked(){
16+
let frontH = this.fcFront.nativeElement.querySelector('.fc-front').offsetHeight + 40;
17+
let backH = this.fcBack.nativeElement.querySelector('.fc-back').offsetHeight + 40;
18+
let h = ((frontH > backH)? frontH:backH) + 'px';
19+
this.fcContainer.nativeElement.style.height = h;
20+
this.fcBack.nativeElement.style.height = h;
21+
this.fcFront.nativeElement.style.height = h;
22+
}
23+
toggle() {
24+
this.toggled = !this.toggled;
25+
}
26+
27+
}

src/pages/login/home-login/home-login.html

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/pages/login/home-login/home-login.scss

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)