Skip to content

Commit

Permalink
Added home-data component and refresh button animation (from Lior)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChananM committed Apr 3, 2018
1 parent 64b7a56 commit 18920aa
Show file tree
Hide file tree
Showing 22 changed files with 149,361 additions and 35 deletions.
2 changes: 1 addition & 1 deletion AgudaApp/.sourcemaps/main.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion AgudaApp/src/app/app.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<ion-nav [root]="rootPage"></ion-nav>
<ion-nav [root]="rootPage"></ion-nav>
5 changes: 4 additions & 1 deletion AgudaApp/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { GalleryPage } from '../pages/gallery/gallery';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { RefreshComponent } from '../components/refresh/refresh';
import { HomeDataComponent } from '../components/home-data/home-data';
import { ComponentsModule } from '../components/components.module';

@NgModule({
declarations: [
Expand All @@ -25,7 +27,8 @@ import { RefreshComponent } from '../components/refresh/refresh';
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
IonicModule.forRoot(MyApp),
ComponentsModule
],
bootstrap: [IonicApp],
entryComponents: [
Expand Down
16 changes: 0 additions & 16 deletions AgudaApp/src/app/app.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
// http://ionicframework.com/docs/theming/
// App Global Sass
.tabbar_red .tabbar {
background: red;
}

.tabbar a[aria-selected=true] {
background: brown;
}

.tabbar .tab-button-text {
color: azure;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
}

.tabbar .icon {
color: azure;
}

// --------------------------------------------------
// Put style rules here that you want to apply globally. These
Expand Down
9 changes: 9 additions & 0 deletions AgudaApp/src/components/components.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { NgModule } from '@angular/core';
import { HomeDataComponent } from './home-data/home-data';

@NgModule({
declarations: [HomeDataComponent],
imports: [],
exports: [HomeDataComponent]
})
export class ComponentsModule {}
8 changes: 8 additions & 0 deletions AgudaApp/src/components/home-data/home-data.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- Generated template for the HomeDataComponent component -->
<div class="data-header">
{{headline}}
</div>
<div class="data-content">
{{content}}
</div>
<p></p>
3 changes: 3 additions & 0 deletions AgudaApp/src/components/home-data/home-data.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
home-data {

}
29 changes: 29 additions & 0 deletions AgudaApp/src/components/home-data/home-data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Component, Input } from '@angular/core';

/**
* Generated class for the HomeDataComponent component.
*
* See https://angular.io/api/core/Component for more info on Angular
* Components.
*/
@Component({
selector: 'home-data',
templateUrl: 'home-data.html'
})
export class HomeDataComponent {

@Input() headline: string;
@Input() content: string;

constructor() {
}

ngOnInit(){

}

ngOnChange(data){

}

}
4 changes: 3 additions & 1 deletion AgudaApp/src/components/refresh/refresh.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
<!-- Generated template for the RefreshComponent component -->
<button (click)="doRefresh();"><i class="fas fa-sync"></i></button>
<button class='spinner' (click)="doRefresh();">
<i class="fas fa-sync"></i>
</button>
9 changes: 8 additions & 1 deletion AgudaApp/src/components/refresh/refresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { InfoPage } from '../../pages/info/info';
templateUrl: 'refresh.html'
})
export class RefreshComponent {

tab: string;

constructor(private events: Events, private h: HomePage, private c: CalendarPage, private g: GalleryPage, private i: InfoPage) {
Expand All @@ -20,7 +19,11 @@ export class RefreshComponent {
});
}


doRefresh(){

document.getElementsByClassName('spinner').item(0).classList.add('fa-spin');

if(this.tab == this.h.tabName)
this.h.doRefresh();

Expand All @@ -34,5 +37,9 @@ export class RefreshComponent {
this.i.doRefresh();

console.log('clicked');

setTimeout(function(){
document.getElementsByClassName('spinner').item(0).classList.remove('fa-spin');
},1000);
}
}
9 changes: 7 additions & 2 deletions AgudaApp/src/pages/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
</ion-header>

<ion-content padding>
<div style="text-align:center">
<main>
<h1>
Welcome to {{ title }}!
</h1>
<img src="./../../assets/imgs/logo.jpg" width="200" height="200">
</div>
<home-data [headline]="'headline test'" [content]="'content test'"></home-data>
<home-data [headline]="'headline test'" [content]="'content test'"></home-data>
<home-data [headline]="'headline test'" [content]="'content test'"></home-data>
<home-data [headline]="'headline test'" [content]="'content test'"></home-data>
<home-data [headline]="'headline test'" [content]="'content test'"></home-data>
</main>
</ion-content>
4 changes: 3 additions & 1 deletion AgudaApp/src/pages/home/home.scss
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
page-home {}
main {
text-align: center;
}
1 change: 1 addition & 0 deletions AgudaApp/src/pages/home/home.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component } from '@angular/core';
import { NavController, Events } from 'ionic-angular';
import { HomeDataComponent } from '../../components/home-data/home-data';

@Component({
selector: 'page-home',
Expand Down
8 changes: 4 additions & 4 deletions AgudaApp/src/pages/tabs/tabs.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ion-tabs class="tabbar_red">
<ion-tab [root]="tab1Root" tabTitle="בית" tabIcon="home"></ion-tab>
<ion-tab [root]="tab2Root" tabTitle="יומן" tabIcon="calendar"></ion-tab>
<ion-tab [root]="tab3Root" tabTitle="גלריה" tabIcon="images"></ion-tab>
<ion-tab [root]="tab4Root" tabTitle="מידע" tabIcon="information-circle"></ion-tab>
<ion-tab [root]="homeTab" tabTitle="בית" tabIcon="home"></ion-tab>
<ion-tab [root]="calendarTab" tabTitle="יומן" tabIcon="calendar"></ion-tab>
<ion-tab [root]="galleryTab" tabTitle="גלריה" tabIcon="images"></ion-tab>
<ion-tab [root]="infoTab" tabTitle="מידע" tabIcon="information-circle"></ion-tab>
</ion-tabs>
17 changes: 17 additions & 0 deletions AgudaApp/src/pages/tabs/tabs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.tabbar_red .tabbar {
background: red;
}

.tabbar a[aria-selected=true] {
background: brown;
}

.tabbar .tab-button-text {
color: azure;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
}

.tabbar .icon {
color: azure;
}
8 changes: 4 additions & 4 deletions AgudaApp/src/pages/tabs/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { CalendarPage } from '../calendar/calendar';
})
export class TabsPage {

tab1Root = HomePage;
tab2Root = CalendarPage;
tab3Root = GalleryPage;
tab4Root = InfoPage;
homeTab = HomePage;
calendarTab = CalendarPage;
galleryTab = GalleryPage;
infoTab = InfoPage;

constructor() {

Expand Down
25,710 changes: 25,709 additions & 1 deletion AgudaApp/www/build/main.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions AgudaApp/www/build/main.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 18920aa

Please sign in to comment.