├── src
├── app
│ ├── app.html
│ ├── main.ts
│ ├── app.scss
│ ├── app.component.ts
│ └── app.module.ts
├── pages
│ ├── about
│ │ ├── about.scss
│ │ ├── about.html
│ │ └── about.ts
│ ├── contact
│ │ ├── contact.scss
│ │ ├── contact.ts
│ │ └── contact.html
│ ├── settings
│ │ ├── settings.scss
│ │ ├── settings.module.ts
│ │ ├── settings.html
│ │ └── settings.ts
│ ├── home
│ │ ├── home.scss
│ │ ├── home.html
│ │ └── home.ts
│ └── tabs
│ │ ├── tabs.html
│ │ └── tabs.ts
├── assets
│ ├── imgs
│ │ └── logo.png
│ └── icon
│ │ └── favicon.ico
├── manifest.json
├── components
│ └── expandable
│ │ ├── expandable.scss
│ │ ├── expandable.html
│ │ └── expandable.ts
├── service-worker.js
├── providers
│ └── weather
│ │ └── weather.ts
├── index.html
└── theme
│ └── variables.scss
├── resources
├── icon.png
├── splash.png
├── ios
│ ├── icon
│ │ ├── icon.png
│ │ ├── icon-40.png
│ │ ├── icon-50.png
│ │ ├── icon-60.png
│ │ ├── icon-72.png
│ │ ├── icon-76.png
│ │ ├── icon@2x.png
│ │ ├── icon-1024.png
│ │ ├── icon-40@2x.png
│ │ ├── icon-40@3x.png
│ │ ├── icon-50@2x.png
│ │ ├── icon-60@2x.png
│ │ ├── icon-60@3x.png
│ │ ├── icon-72@2x.png
│ │ ├── icon-76@2x.png
│ │ ├── icon-83.5@2x.png
│ │ ├── icon-small.png
│ │ ├── icon-small@2x.png
│ │ └── icon-small@3x.png
│ └── splash
│ │ ├── Default-667h.png
│ │ ├── Default-736h.png
│ │ ├── Default~iphone.png
│ │ ├── Default@2x~iphone.png
│ │ ├── Default-568h@2x~iphone.png
│ │ ├── Default-Landscape-736h.png
│ │ ├── Default-Landscape~ipad.png
│ │ ├── Default-Portrait~ipad.png
│ │ ├── Default-Landscape@2x~ipad.png
│ │ ├── Default-Portrait@2x~ipad.png
│ │ ├── Default-Portrait@~ipadpro.png
│ │ ├── Default-Landscape@~ipadpro.png
│ │ └── Default@2x~universal~anyany.png
├── android
│ ├── icon
│ │ ├── drawable-hdpi-icon.png
│ │ ├── drawable-ldpi-icon.png
│ │ ├── drawable-mdpi-icon.png
│ │ ├── drawable-xhdpi-icon.png
│ │ ├── drawable-xxhdpi-icon.png
│ │ └── drawable-xxxhdpi-icon.png
│ └── splash
│ │ ├── drawable-land-hdpi-screen.png
│ │ ├── drawable-land-ldpi-screen.png
│ │ ├── drawable-land-mdpi-screen.png
│ │ ├── drawable-land-xhdpi-screen.png
│ │ ├── drawable-port-hdpi-screen.png
│ │ ├── drawable-port-ldpi-screen.png
│ │ ├── drawable-port-mdpi-screen.png
│ │ ├── drawable-port-xhdpi-screen.png
│ │ ├── drawable-land-xxhdpi-screen.png
│ │ ├── drawable-land-xxxhdpi-screen.png
│ │ ├── drawable-port-xxhdpi-screen.png
│ │ └── drawable-port-xxxhdpi-screen.png
└── README.md
├── ionic.config.json
├── tslint.json
├── .editorconfig
├── .gitignore
├── tsconfig.json
├── package.json
└── config.xml
/src/app/app.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/pages/about/about.scss:
--------------------------------------------------------------------------------
1 | page-about {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/contact/contact.scss:
--------------------------------------------------------------------------------
1 | page-contact {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/settings/settings.scss:
--------------------------------------------------------------------------------
1 | page-settings {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/home/home.scss:
--------------------------------------------------------------------------------
1 | page-home {
2 | }
3 | .home {
4 | margin-top: 15px;
5 | }
--------------------------------------------------------------------------------
/resources/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/icon.png
--------------------------------------------------------------------------------
/resources/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/splash.png
--------------------------------------------------------------------------------
/src/assets/imgs/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/src/assets/imgs/logo.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon.png
--------------------------------------------------------------------------------
/src/assets/icon/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/src/assets/icon/favicon.ico
--------------------------------------------------------------------------------
/resources/ios/icon/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-40.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-50.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-60.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-72.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-76.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-1024.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-40@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-40@3x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-50@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-60@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-60@3x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-72@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-76@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-83.5@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-small.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-small@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/icon/icon-small@3x.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-667h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/splash/Default-667h.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-736h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/splash/Default-736h.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/splash/Default~iphone.png
--------------------------------------------------------------------------------
/ionic.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "SoToolbox",
3 | "integrations": {
4 | "cordova": {}
5 | },
6 | "type": "ionic-angular"
7 | }
--------------------------------------------------------------------------------
/resources/ios/splash/Default@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/splash/Default@2x~iphone.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-hdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/icon/drawable-hdpi-icon.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-ldpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/icon/drawable-ldpi-icon.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-mdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/icon/drawable-mdpi-icon.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-xhdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/icon/drawable-xhdpi-icon.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-xxhdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/icon/drawable-xxhdpi-icon.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-568h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/splash/Default-568h@2x~iphone.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Landscape-736h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/splash/Default-Landscape-736h.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Landscape~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/splash/Default-Landscape~ipad.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Portrait~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/splash/Default-Portrait~ipad.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-xxxhdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/icon/drawable-xxxhdpi-icon.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Landscape@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/splash/Default-Landscape@2x~ipad.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Portrait@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/splash/Default-Portrait@2x~ipad.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Portrait@~ipadpro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/splash/Default-Portrait@~ipadpro.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Landscape@~ipadpro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/splash/Default-Landscape@~ipadpro.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default@2x~universal~anyany.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/ios/splash/Default@2x~universal~anyany.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-hdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/splash/drawable-land-hdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-ldpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/splash/drawable-land-ldpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-mdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/splash/drawable-land-mdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-xhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/splash/drawable-land-xhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-hdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/splash/drawable-port-hdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-ldpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/splash/drawable-port-ldpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-mdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/splash/drawable-port-mdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-xhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/splash/drawable-port-xhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-xxhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/splash/drawable-land-xxhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-xxxhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/splash/drawable-land-xxxhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-xxhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/splash/drawable-port-xxhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-xxxhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NansD/SoToolBox/master/resources/android/splash/drawable-port-xxxhdpi-screen.png
--------------------------------------------------------------------------------
/src/app/main.ts:
--------------------------------------------------------------------------------
1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2 |
3 | import { AppModule } from './app.module';
4 |
5 | platformBrowserDynamic().bootstrapModule(AppModule);
6 |
--------------------------------------------------------------------------------
/src/pages/about/about.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | About
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | "no-duplicate-variable": true,
4 | "no-unused-variable": [
5 | true
6 | ]
7 | },
8 | "rulesDirectory": [
9 | "node_modules/tslint-eslint-rules/dist/rules"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/pages/tabs/tabs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/pages/about/about.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { NavController } from 'ionic-angular';
3 |
4 | @Component({
5 | selector: 'page-about',
6 | templateUrl: 'about.html'
7 | })
8 | export class AboutPage {
9 |
10 | constructor(public navCtrl: NavController) {
11 |
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Ionic",
3 | "short_name": "Ionic",
4 | "start_url": "index.html",
5 | "display": "standalone",
6 | "icons": [{
7 | "src": "assets/imgs/logo.png",
8 | "sizes": "512x512",
9 | "type": "image/png"
10 | }],
11 | "background_color": "#4e8ef7",
12 | "theme_color": "#4e8ef7"
13 | }
--------------------------------------------------------------------------------
/src/pages/contact/contact.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { NavController } from 'ionic-angular';
3 |
4 | @Component({
5 | selector: 'page-contact',
6 | templateUrl: 'contact.html'
7 | })
8 | export class ContactPage {
9 |
10 | constructor(public navCtrl: NavController) {
11 |
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/pages/settings/settings.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { SettingsPage } from './settings';
4 |
5 | @NgModule({
6 | declarations: [
7 | SettingsPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(SettingsPage),
11 | ],
12 | })
13 | export class SettingsPageModule {}
14 |
--------------------------------------------------------------------------------
/src/pages/settings/settings.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 | settings
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/pages/contact/contact.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Contact
5 |
6 |
7 |
8 |
9 |
10 |
11 | Follow us on Twitter
12 |
13 |
14 | @ionicframework
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
2 | # editorconfig.org
3 |
4 | root = true
5 |
6 | [*]
7 | indent_style = space
8 | indent_size = 2
9 |
10 | # We recommend you to keep these unchanged
11 | end_of_line = lf
12 | charset = utf-8
13 | trim_trailing_whitespace = true
14 | insert_final_newline = true
15 |
16 | [*.md]
17 | trim_trailing_whitespace = false
--------------------------------------------------------------------------------
/src/components/expandable/expandable.scss:
--------------------------------------------------------------------------------
1 | expandable {
2 | ion-card-header{
3 | padding-left: 3px !important;
4 | }
5 | ion-label {
6 | width: 100%;
7 | }
8 | .expanded {
9 | height: auto;
10 | flex-direction: column;
11 | }
12 | .weather-icon {
13 | height: 15px;
14 | overflow-y: visible;
15 | img {
16 | margin-top: -15px;
17 | }
18 | }
19 | .hidden {
20 | display: none;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/resources/README.md:
--------------------------------------------------------------------------------
1 | These are Cordova resources. You can replace icon.png and splash.png and run
2 | `ionic cordova resources` to generate custom icons and splash screens for your
3 | app. See `ionic cordova resources --help` for details.
4 |
5 | Cordova reference documentation:
6 |
7 | - Icons: https://cordova.apache.org/docs/en/latest/config_ref/images.html
8 | - Splash Screens: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/
9 |
--------------------------------------------------------------------------------
/src/pages/tabs/tabs.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | import { AboutPage } from "../about/about";
4 | import { ContactPage } from "../contact/contact";
5 | import { HomePage } from "../home/home";
6 | import { SettingsPage } from "../settings/settings";
7 |
8 | @Component({
9 | templateUrl: "tabs.html"
10 | })
11 | export class TabsPage {
12 | tab1Root = HomePage;
13 | tab2Root = AboutPage;
14 | tab3Root = SettingsPage;
15 |
16 | constructor() {}
17 | }
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Specifies intentionally untracked files to ignore when using Git
2 | # http://git-scm.com/docs/gitignore
3 |
4 | *~
5 | *.sw[mnpcod]
6 | *.log
7 | *.tmp
8 | *.tmp.*
9 | log.txt
10 | *.sublime-project
11 | *.sublime-workspace
12 | .vscode/
13 | npm-debug.log*
14 |
15 | .idea/
16 | .ionic/
17 | .sourcemaps/
18 | .sass-cache/
19 | .tmp/
20 | .versions/
21 | coverage/
22 | dist/
23 | node_modules/
24 | tmp/
25 | temp/
26 | platforms/
27 | plugins/
28 | plugins/android.json
29 | plugins/ios.json
30 | www/
31 | $RECYCLE.BIN/
32 |
33 | .DS_Store
34 | Thumbs.db
35 | UserInterfaceState.xcuserstate
36 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowSyntheticDefaultImports": true,
4 | "declaration": false,
5 | "emitDecoratorMetadata": true,
6 | "experimentalDecorators": true,
7 | "lib": [
8 | "dom",
9 | "es2015"
10 | ],
11 | "module": "es2015",
12 | "moduleResolution": "node",
13 | "sourceMap": true,
14 | "target": "es5"
15 | },
16 | "include": [
17 | "src/**/*.ts"
18 | ],
19 | "exclude": [
20 | "node_modules",
21 | "src/**/*.spec.ts",
22 | "src/**/__tests__/*.ts"
23 | ],
24 | "compileOnSave": false,
25 | "atom": {
26 | "rewriteTsconfig": false
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/pages/settings/settings.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { IonicPage, NavController, NavParams } from 'ionic-angular';
3 |
4 | /**
5 | * Generated class for the SettingsPage page.
6 | *
7 | * See https://ionicframework.com/docs/components/#navigation for more info on
8 | * Ionic pages and navigation.
9 | */
10 |
11 | @IonicPage()
12 | @Component({
13 | selector: 'page-settings',
14 | templateUrl: 'settings.html',
15 | })
16 | export class SettingsPage {
17 |
18 | constructor(public navCtrl: NavController, public navParams: NavParams) {
19 | }
20 |
21 | ionViewDidLoad() {
22 | console.log('ionViewDidLoad SettingsPage');
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/pages/home/home.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Météo
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Lieu
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/app/app.scss:
--------------------------------------------------------------------------------
1 | // http://ionicframework.com/docs/theming/
2 |
3 |
4 | // App Global Sass
5 | // --------------------------------------------------
6 | // Put style rules here that you want to apply globally. These
7 | // styles are for the entire app and not just one component.
8 | // Additionally, this file can be also used as an entry point
9 | // to import other Sass files to be included in the output CSS.
10 | //
11 | // Shared Sass variables, which can be used to adjust Ionic's
12 | // default Sass variables, belong in "theme/variables.scss".
13 | //
14 | // To declare rules for a specific mode, create a child rule
15 | // for the .md, .ios, or .wp mode classes. The mode class is
16 | // automatically applied to the
element in the app.
17 |
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { Platform } from 'ionic-angular';
3 | import { StatusBar } from '@ionic-native/status-bar';
4 | import { SplashScreen } from '@ionic-native/splash-screen';
5 |
6 | import { TabsPage } from '../pages/tabs/tabs';
7 |
8 | @Component({
9 | templateUrl: 'app.html'
10 | })
11 | export class MyApp {
12 | rootPage:any = TabsPage;
13 |
14 | constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
15 | platform.ready().then(() => {
16 | // Okay, so the platform is ready and our plugins are available.
17 | // Here you can do any higher level native things you might need.
18 | statusBar.styleDefault();
19 | splashScreen.hide();
20 | });
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/service-worker.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Check out https://googlechromelabs.github.io/sw-toolbox/ for
3 | * more info on how to use sw-toolbox to custom configure your service worker.
4 | */
5 |
6 |
7 | 'use strict';
8 | importScripts('./build/sw-toolbox.js');
9 |
10 | self.toolbox.options.cache = {
11 | name: 'ionic-cache'
12 | };
13 |
14 | // pre-cache our key assets
15 | self.toolbox.precache(
16 | [
17 | './build/main.js',
18 | './build/vendor.js',
19 | './build/main.css',
20 | './build/polyfills.js',
21 | 'index.html',
22 | 'manifest.json'
23 | ]
24 | );
25 |
26 | // dynamically cache any other local assets
27 | self.toolbox.router.any('/*', self.toolbox.fastest);
28 |
29 | // for any other requests go to the network, cache,
30 | // and then only use that cached resource if your user goes offline
31 | self.toolbox.router.default = self.toolbox.networkFirst;
32 |
--------------------------------------------------------------------------------
/src/providers/weather/weather.ts:
--------------------------------------------------------------------------------
1 | import { HttpClient } from "@angular/common/http";
2 | import { Injectable } from "@angular/core";
3 | import "rxjs/add/operator/map";
4 |
5 | /*
6 | Generated class for the WeatherProvider provider.
7 |
8 | See https://angular.io/guide/dependency-injection for more info on providers
9 | and Angular DI.
10 | */
11 | @Injectable()
12 | export class WeatherProvider {
13 | apiKey = "c28fe68add7c58df27936f66d361f1f3"; // TODO: hide this!!!
14 | url;
15 |
16 | constructor(public http: HttpClient) {
17 | }
18 |
19 | getWeather(cityName, countryCode) {
20 | this.buildUrl(cityName, countryCode);
21 | console.log("get request " + this.url);
22 | return this.http.get(this.url).map(res => JSON.stringify(res));
23 | }
24 |
25 | buildUrl(cityName, countryCode, units = "metric") {
26 | // https://openweathermap.org/forecast5
27 | // paremeters : city name and country code divided by comma, use ISO 3166 country codes
28 | this.url = `http://api.openweathermap.org/data/2.5/forecast?q=${cityName},${countryCode}&mode=json&APPID=${
29 | this.apiKey
30 | }&units=${units}`;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/components/expandable/expandable.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "SoToolbox",
3 | "version": "0.0.1",
4 | "author": "Ionic Framework",
5 | "homepage": "http://ionicframework.com/",
6 | "private": true,
7 | "scripts": {
8 | "start": "ionic-app-scripts serve",
9 | "clean": "ionic-app-scripts clean",
10 | "build": "ionic-app-scripts build",
11 | "lint": "ionic-app-scripts lint"
12 | },
13 | "dependencies": {
14 | "@angular/animations": "5.2.11",
15 | "@angular/common": "5.2.11",
16 | "@angular/compiler": "5.2.11",
17 | "@angular/compiler-cli": "5.2.11",
18 | "@angular/core": "5.2.11",
19 | "@angular/forms": "5.2.11",
20 | "@angular/http": "5.2.11",
21 | "@angular/platform-browser": "5.2.11",
22 | "@angular/platform-browser-dynamic": "5.2.11",
23 | "@ionic-native/core": "~4.11.0",
24 | "@ionic-native/splash-screen": "~4.11.0",
25 | "@ionic-native/status-bar": "~4.11.0",
26 | "@ionic/storage": "2.1.3",
27 | "ionic-angular": "3.9.2",
28 | "ionicons": "3.0.0",
29 | "rxjs": "5.5.11",
30 | "sw-toolbox": "3.6.0",
31 | "zone.js": "0.8.26"
32 | },
33 | "devDependencies": {
34 | "@ionic/app-scripts": "3.1.11",
35 | "typescript": "~2.6.2"
36 | },
37 | "description": "An Ionic project"
38 | }
39 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, ErrorHandler } from "@angular/core";
2 | import { BrowserModule } from "@angular/platform-browser";
3 | import { IonicApp, IonicModule, IonicErrorHandler } from "ionic-angular";
4 | import { MyApp } from "./app.component";
5 | import { HttpClientModule } from "@angular/common/http";
6 |
7 | import { AboutPage } from "../pages/about/about";
8 | import { ContactPage } from "../pages/contact/contact";
9 | import { HomePage } from "../pages/home/home";
10 | import { TabsPage } from "../pages/tabs/tabs";
11 | import { SettingsPage } from "../pages/settings/settings";
12 |
13 | import { StatusBar } from "@ionic-native/status-bar";
14 | import { SplashScreen } from "@ionic-native/splash-screen";
15 | import { WeatherProvider } from "../providers/weather/weather";
16 | import { ExpandableComponent} from "../components/expandable/expandable";
17 |
18 | @NgModule({
19 | declarations: [
20 | MyApp,
21 | AboutPage,
22 | ContactPage,
23 | HomePage,
24 | TabsPage,
25 | SettingsPage,
26 | ExpandableComponent
27 | ],
28 | imports: [BrowserModule, HttpClientModule, IonicModule.forRoot(MyApp)],
29 | bootstrap: [IonicApp],
30 | entryComponents: [MyApp, AboutPage, ContactPage, HomePage, TabsPage, ExpandableComponent],
31 | providers: [
32 | StatusBar,
33 | SplashScreen,
34 | { provide: ErrorHandler, useClass: IonicErrorHandler },
35 | WeatherProvider
36 | ]
37 | })
38 | export class AppModule {}
39 |
--------------------------------------------------------------------------------
/src/components/expandable/expandable.ts:
--------------------------------------------------------------------------------
1 | import { Component, Input } from "@angular/core";
2 |
3 | @Component({
4 | selector: "expandable",
5 | templateUrl: "expandable.html"
6 | })
7 | export class ExpandableComponent {
8 | @Input() weatherItem: Object;
9 | @Input() weatherList: any;
10 |
11 | constructor() {
12 | }
13 |
14 | ngOnInit() {
15 | this.selectWeatherTitle();
16 | }
17 |
18 | buildIconUrl(iconName: string): string {
19 | return `http://openweathermap.org/img/w/${iconName}.png`;
20 | }
21 |
22 | expand(event) {
23 | let element = event.srcElement ? event.srcElement : event.target;
24 | element.classList.toggle("expanded");
25 | for (let item of element.lastElementChild.children) {
26 | if (item.tagName != "ION-CARD-HEADER") item.classList.toggle("hidden");
27 | }
28 | }
29 |
30 | inRange(x, min, max): boolean {
31 | return (x - min) * (x - max) <= 0;
32 | }
33 |
34 | selectWeatherTitle() {
35 | let self: ExpandableComponent = this;
36 | let time: number = new Date().getHours() * 60 + new Date().getMinutes();
37 | var found: Object = this.weatherList.find(function(weather) {
38 | let weatherTime: number =
39 | weather.date.getHours() * 60 + weather.date.getMinutes();
40 | return self.inRange(weatherTime, time - 120, time + 120);
41 | });
42 | if (found == undefined) {
43 | found = this.weatherList.find(function(weather) {
44 | let weatherTime: number =
45 | weather.date.getHours() * 60 + weather.date.getMinutes();
46 | return self.inRange(weatherTime, time - 360, time + 360);
47 | });
48 | }
49 | if (!!found) {
50 | this.weatherItem = found;
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Ionic App
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/src/theme/variables.scss:
--------------------------------------------------------------------------------
1 | // Ionic Variables and Theming. For more info, please see:
2 | // http://ionicframework.com/docs/theming/
3 |
4 | // Font path is used to include ionicons,
5 | // roboto, and noto sans fonts
6 | $font-path: "../assets/fonts";
7 |
8 |
9 | // The app direction is used to include
10 | // rtl styles in your app. For more info, please see:
11 | // http://ionicframework.com/docs/theming/rtl-support/
12 | $app-direction: ltr;
13 |
14 |
15 | @import "ionic.globals";
16 |
17 |
18 | // Shared Variables
19 | // --------------------------------------------------
20 | // To customize the look and feel of this app, you can override
21 | // the Sass variables found in Ionic's source scss files.
22 | // To view all the possible Ionic variables, see:
23 | // http://ionicframework.com/docs/theming/overriding-ionic-variables/
24 |
25 |
26 |
27 |
28 | // Named Color Variables
29 | // --------------------------------------------------
30 | // Named colors makes it easy to reuse colors on various components.
31 | // It's highly recommended to change the default colors
32 | // to match your app's branding. Ionic uses a Sass map of
33 | // colors so you can add, rename and remove colors as needed.
34 | // The "primary" color is the only required color in the map.
35 |
36 | $colors: (
37 | primary: #488aff,
38 | secondary: #32db64,
39 | danger: #f53d3d,
40 | light: #f4f4f4,
41 | dark: #222
42 | );
43 |
44 |
45 | // App iOS Variables
46 | // --------------------------------------------------
47 | // iOS only Sass variables can go here
48 |
49 |
50 |
51 |
52 | // App Material Design Variables
53 | // --------------------------------------------------
54 | // Material Design only Sass variables can go here
55 |
56 |
57 |
58 |
59 | // App Windows Variables
60 | // --------------------------------------------------
61 | // Windows only Sass variables can go here
62 |
63 |
64 |
65 |
66 | // App Theme
67 | // --------------------------------------------------
68 | // Ionic apps can have different themes applied, which can
69 | // then be future customized. This import comes last
70 | // so that the above variables are used and Ionic's
71 | // default are overridden.
72 |
73 | @import "ionic.theme.default";
74 |
75 |
76 | // Ionicons
77 | // --------------------------------------------------
78 | // The premium icon font for Ionic. For more info, please see:
79 | // http://ionicframework.com/docs/ionicons/
80 |
81 | @import "ionic.ionicons";
82 |
83 |
84 | // Fonts
85 | // --------------------------------------------------
86 |
87 | @import "roboto";
88 | @import "noto-sans";
89 |
--------------------------------------------------------------------------------
/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | SoToolbox
4 | An awesome Ionic/Cordova app.
5 | Ionic Framework Team
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/src/pages/home/home.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 | import { NavController } from "ionic-angular";
3 | import { WeatherProvider } from "../../providers/weather/weather";
4 |
5 | @Component({
6 | selector: "page-home",
7 | templateUrl: "home.html"
8 | })
9 | export class HomePage {
10 | weather: any;
11 | weatherListProps: any;
12 | // TODO: refactor this
13 | location: {
14 | cityName: string;
15 | countryCode: string;
16 | };
17 | units: string;
18 |
19 | constructor(
20 | public navCtrl: NavController,
21 | private weatherProvider: WeatherProvider
22 | ) {}
23 |
24 | setFakeWeather() {
25 | this.weather = JSON.parse(
26 | '{"cod":"200","message":0.0402,"cnt":40,"list":[{"dt":1533578400,"main":{"temp":28.5,"temp_min":28.5,"temp_max":30.25,"pressure":1018.69,"sea_level":1025.7,"grnd_level":1018.69,"humidity":43,"temp_kf":-1.75},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":1.4,"deg":213.001},"sys":{"pod":"d"},"dt_txt":"2018-08-06 18:00:00"},{"dt":1533589200,"main":{"temp":20.94,"temp_min":20.94,"temp_max":22.26,"pressure":1018.92,"sea_level":1026,"grnd_level":1018.92,"humidity":46,"temp_kf":-1.31},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"clouds":{"all":0},"wind":{"speed":2.64,"deg":270.003},"sys":{"pod":"n"},"dt_txt":"2018-08-06 21:00:00"},{"dt":1533600000,"main":{"temp":16.51,"temp_min":16.51,"temp_max":17.39,"pressure":1018.26,"sea_level":1025.34,"grnd_level":1018.26,"humidity":80,"temp_kf":-0.88},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"clouds":{"all":0},"wind":{"speed":1.22,"deg":283.004},"sys":{"pod":"n"},"dt_txt":"2018-08-07 00:00:00"},{"dt":1533610800,"main":{"temp":14.72,"temp_min":14.72,"temp_max":15.15,"pressure":1017.13,"sea_level":1024.16,"grnd_level":1017.13,"humidity":81,"temp_kf":-0.44},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"clouds":{"all":0},"wind":{"speed":1.16,"deg":165.001},"sys":{"pod":"n"},"dt_txt":"2018-08-07 03:00:00"},{"dt":1533621600,"main":{"temp":18.14,"temp_min":18.14,"temp_max":18.14,"pressure":1016.88,"sea_level":1023.92,"grnd_level":1016.88,"humidity":74,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":1.24,"deg":136.5},"sys":{"pod":"d"},"dt_txt":"2018-08-07 06:00:00"},{"dt":1533632400,"main":{"temp":29.1,"temp_min":29.1,"temp_max":29.1,"pressure":1016.07,"sea_level":1022.94,"grnd_level":1016.07,"humidity":46,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":3.41,"deg":151.501},"sys":{"pod":"d"},"dt_txt":"2018-08-07 09:00:00"},{"dt":1533643200,"main":{"temp":33.18,"temp_min":33.18,"temp_max":33.18,"pressure":1014.6,"sea_level":1021.43,"grnd_level":1014.6,"humidity":37,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":5.01,"deg":176.503},"sys":{"pod":"d"},"dt_txt":"2018-08-07 12:00:00"},{"dt":1533654000,"main":{"temp":31.91,"temp_min":31.91,"temp_max":31.91,"pressure":1013.49,"sea_level":1020.44,"grnd_level":1013.49,"humidity":43,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":88},"wind":{"speed":5.67,"deg":233.503},"rain":{"3h":0.19},"sys":{"pod":"d"},"dt_txt":"2018-08-07 15:00:00"},{"dt":1533664800,"main":{"temp":30.65,"temp_min":30.65,"temp_max":30.65,"pressure":1012.84,"sea_level":1020.04,"grnd_level":1012.84,"humidity":42,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":64},"wind":{"speed":1.45,"deg":231.003},"rain":{"3h":0.18},"sys":{"pod":"d"},"dt_txt":"2018-08-07 18:00:00"},{"dt":1533675600,"main":{"temp":24.58,"temp_min":24.58,"temp_max":24.58,"pressure":1013.28,"sea_level":1020.24,"grnd_level":1013.28,"humidity":57,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"clouds":{"all":68},"wind":{"speed":1.61,"deg":210.001},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-08-07 21:00:00"},{"dt":1533686400,"main":{"temp":20.17,"temp_min":20.17,"temp_max":20.17,"pressure":1013.86,"sea_level":1020.82,"grnd_level":1013.86,"humidity":67,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":20},"wind":{"speed":3.66,"deg":293.501},"rain":{"3h":0.04},"sys":{"pod":"n"},"dt_txt":"2018-08-08 00:00:00"},{"dt":1533697200,"main":{"temp":17.22,"temp_min":17.22,"temp_max":17.22,"pressure":1015.11,"sea_level":1022.14,"grnd_level":1015.11,"humidity":87,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":0},"wind":{"speed":2.8,"deg":258.501},"rain":{"3h":0.02},"sys":{"pod":"n"},"dt_txt":"2018-08-08 03:00:00"},{"dt":1533708000,"main":{"temp":17.66,"temp_min":17.66,"temp_max":17.66,"pressure":1016.32,"sea_level":1023.43,"grnd_level":1016.32,"humidity":88,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":5.07,"deg":232.502},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-08-08 06:00:00"},{"dt":1533718800,"main":{"temp":23.47,"temp_min":23.47,"temp_max":23.47,"pressure":1017.78,"sea_level":1024.94,"grnd_level":1017.78,"humidity":62,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":5.12,"deg":246.502},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-08-08 09:00:00"},{"dt":1533729600,"main":{"temp":26.01,"temp_min":26.01,"temp_max":26.01,"pressure":1018.62,"sea_level":1025.73,"grnd_level":1018.62,"humidity":51,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":5.71,"deg":253},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-08-08 12:00:00"},{"dt":1533740400,"main":{"temp":26.13,"temp_min":26.13,"temp_max":26.13,"pressure":1019.13,"sea_level":1026.15,"grnd_level":1019.13,"humidity":46,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":5.11,"deg":262.001},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-08-08 15:00:00"},{"dt":1533751200,"main":{"temp":24.42,"temp_min":24.42,"temp_max":24.42,"pressure":1019.48,"sea_level":1026.5,"grnd_level":1019.48,"humidity":43,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":3.76,"deg":269.503},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-08-08 18:00:00"},{"dt":1533762000,"main":{"temp":19.1,"temp_min":19.1,"temp_max":19.1,"pressure":1020.37,"sea_level":1027.42,"grnd_level":1020.37,"humidity":50,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"clouds":{"all":0},"wind":{"speed":3.11,"deg":306.005},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-08-08 21:00:00"},{"dt":1533772800,"main":{"temp":16.03,"temp_min":16.03,"temp_max":16.03,"pressure":1020.14,"sea_level":1027.11,"grnd_level":1020.14,"humidity":63,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"clouds":{"all":0},"wind":{"speed":3.01,"deg":343.507},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-08-09 00:00:00"},{"dt":1533783600,"main":{"temp":15.09,"temp_min":15.09,"temp_max":15.09,"pressure":1018.83,"sea_level":1026.05,"grnd_level":1018.83,"humidity":69,"temp_kf":0},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"clouds":{"all":24},"wind":{"speed":2.67,"deg":15.0026},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-08-09 03:00:00"},{"dt":1533794400,"main":{"temp":17.29,"temp_min":17.29,"temp_max":17.29,"pressure":1017.58,"sea_level":1024.54,"grnd_level":1017.58,"humidity":63,"temp_kf":0},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"clouds":{"all":12},"wind":{"speed":4.31,"deg":42.5012},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-08-09 06:00:00"},{"dt":1533805200,"main":{"temp":23.78,"temp_min":23.78,"temp_max":23.78,"pressure":1015.06,"sea_level":1022.21,"grnd_level":1015.06,"humidity":66,"temp_kf":0},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":{"all":92},"wind":{"speed":4.27,"deg":137.5},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-08-09 09:00:00"},{"dt":1533816000,"main":{"temp":25.82,"temp_min":25.82,"temp_max":25.82,"pressure":1013.14,"sea_level":1020.1,"grnd_level":1013.14,"humidity":68,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":76},"wind":{"speed":2.4,"deg":146.002},"rain":{"3h":0.29},"sys":{"pod":"d"},"dt_txt":"2018-08-09 12:00:00"},{"dt":1533826800,"main":{"temp":25.85,"temp_min":25.85,"temp_max":25.85,"pressure":1010.93,"sea_level":1017.92,"grnd_level":1010.93,"humidity":82,"temp_kf":0},"weather":[{"id":501,"main":"Rain","description":"moderate rain","icon":"10d"}],"clouds":{"all":44},"wind":{"speed":5.41,"deg":190},"rain":{"3h":3.45},"sys":{"pod":"d"},"dt_txt":"2018-08-09 15:00:00"},{"dt":1533837600,"main":{"temp":23.92,"temp_min":23.92,"temp_max":23.92,"pressure":1011.02,"sea_level":1018.33,"grnd_level":1011.02,"humidity":74,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":68},"wind":{"speed":7.07,"deg":186.503},"rain":{"3h":1.78},"sys":{"pod":"d"},"dt_txt":"2018-08-09 18:00:00"},{"dt":1533848400,"main":{"temp":18.63,"temp_min":18.63,"temp_max":18.63,"pressure":1011.93,"sea_level":1019.17,"grnd_level":1011.93,"humidity":99,"temp_kf":0},"weather":[{"id":501,"main":"Rain","description":"moderate rain","icon":"10n"}],"clouds":{"all":92},"wind":{"speed":5.12,"deg":219.504},"rain":{"3h":6.27},"sys":{"pod":"n"},"dt_txt":"2018-08-09 21:00:00"},{"dt":1533859200,"main":{"temp":13.97,"temp_min":13.97,"temp_max":13.97,"pressure":1016.72,"sea_level":1023.83,"grnd_level":1016.72,"humidity":99,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":88},"wind":{"speed":8.72,"deg":285.5},"rain":{"3h":1.02},"sys":{"pod":"n"},"dt_txt":"2018-08-10 00:00:00"},{"dt":1533870000,"main":{"temp":12.87,"temp_min":12.87,"temp_max":12.87,"pressure":1020.57,"sea_level":1027.72,"grnd_level":1020.57,"humidity":91,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":0},"wind":{"speed":5.37,"deg":260.002},"rain":{"3h":0.06},"sys":{"pod":"n"},"dt_txt":"2018-08-10 03:00:00"},{"dt":1533880800,"main":{"temp":14.53,"temp_min":14.53,"temp_max":14.53,"pressure":1022.74,"sea_level":1029.95,"grnd_level":1022.74,"humidity":91,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":20},"wind":{"speed":5.6,"deg":248.001},"rain":{"3h":0.0099999999999998},"sys":{"pod":"d"},"dt_txt":"2018-08-10 06:00:00"},{"dt":1533891600,"main":{"temp":17.42,"temp_min":17.42,"temp_max":17.42,"pressure":1024.76,"sea_level":1031.87,"grnd_level":1024.76,"humidity":81,"temp_kf":0},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"clouds":{"all":32},"wind":{"speed":5.91,"deg":244.003},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-08-10 09:00:00"},{"dt":1533902400,"main":{"temp":18.31,"temp_min":18.31,"temp_max":18.31,"pressure":1026,"sea_level":1032.98,"grnd_level":1026,"humidity":73,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":64},"wind":{"speed":5.82,"deg":238},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-08-10 12:00:00"},{"dt":1533913200,"main":{"temp":16.65,"temp_min":16.65,"temp_max":16.65,"pressure":1026.05,"sea_level":1032.99,"grnd_level":1026.05,"humidity":80,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":56},"wind":{"speed":5.11,"deg":242},"rain":{"3h":0.32},"sys":{"pod":"d"},"dt_txt":"2018-08-10 15:00:00"},{"dt":1533924000,"main":{"temp":17.24,"temp_min":17.24,"temp_max":17.24,"pressure":1026.07,"sea_level":1033.12,"grnd_level":1026.07,"humidity":74,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":36},"wind":{"speed":4.96,"deg":237.502},"rain":{"3h":0.049999999999999},"sys":{"pod":"d"},"dt_txt":"2018-08-10 18:00:00"},{"dt":1533934800,"main":{"temp":13.58,"temp_min":13.58,"temp_max":13.58,"pressure":1026.31,"sea_level":1033.49,"grnd_level":1026.31,"humidity":86,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":0},"wind":{"speed":3.01,"deg":218.008},"rain":{"3h":0.0099999999999998},"sys":{"pod":"n"},"dt_txt":"2018-08-10 21:00:00"},{"dt":1533945600,"main":{"temp":11.79,"temp_min":11.79,"temp_max":11.79,"pressure":1026.21,"sea_level":1033.43,"grnd_level":1026.21,"humidity":93,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"clouds":{"all":0},"wind":{"speed":4.17,"deg":199.501},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-08-11 00:00:00"},{"dt":1533956400,"main":{"temp":11.63,"temp_min":11.63,"temp_max":11.63,"pressure":1024.96,"sea_level":1032.13,"grnd_level":1024.96,"humidity":94,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"clouds":{"all":68},"wind":{"speed":5.47,"deg":199.501},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-08-11 03:00:00"},{"dt":1533967200,"main":{"temp":12.7,"temp_min":12.7,"temp_max":12.7,"pressure":1024.07,"sea_level":1031.28,"grnd_level":1024.07,"humidity":91,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":68},"wind":{"speed":7.25,"deg":204.002},"rain":{"3h":0.24},"sys":{"pod":"d"},"dt_txt":"2018-08-11 06:00:00"},{"dt":1533978000,"main":{"temp":15.06,"temp_min":15.06,"temp_max":15.06,"pressure":1023.83,"sea_level":1030.98,"grnd_level":1023.83,"humidity":89,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":80},"wind":{"speed":8.87,"deg":219.501},"rain":{"3h":0.92},"sys":{"pod":"d"},"dt_txt":"2018-08-11 09:00:00"},{"dt":1533988800,"main":{"temp":15.37,"temp_min":15.37,"temp_max":15.37,"pressure":1023.87,"sea_level":1030.92,"grnd_level":1023.87,"humidity":96,"temp_kf":0},"weather":[{"id":501,"main":"Rain","description":"moderate rain","icon":"10d"}],"clouds":{"all":100},"wind":{"speed":7.21,"deg":234.002},"rain":{"3h":4.2125},"sys":{"pod":"d"},"dt_txt":"2018-08-11 12:00:00"},{"dt":1533999600,"main":{"temp":15.69,"temp_min":15.69,"temp_max":15.69,"pressure":1024.29,"sea_level":1031.31,"grnd_level":1024.29,"humidity":100,"temp_kf":0},"weather":[{"id":501,"main":"Rain","description":"moderate rain","icon":"10d"}],"clouds":{"all":92},"wind":{"speed":5.21,"deg":262.001},"rain":{"3h":3.6375},"sys":{"pod":"d"},"dt_txt":"2018-08-11 15:00:00"}],"city":{"id":2998324,"name":"Lille","coord":{"lat":50.6305,"lon":3.0706},"country":"FR","population":228328}}'
27 | );
28 | }
29 |
30 | ionViewWillEnter() {
31 | this.location = {
32 | cityName: "Lille",
33 | countryCode: "fr"
34 | };
35 | this.units = "metric";
36 | this.setFakeWeather();
37 | this.processWeather();
38 |
39 | }
40 |
41 | processWeather() {
42 | let weather = this.weather;
43 | this.weather.list.map(item => {
44 | item.date = new Date(item.dt * 1000);
45 | item.dt = new Date(item.dt * 1000).getDate();
46 | });
47 |
48 | // TODO: move this to a helper class
49 | // helper function to group items by prop
50 | let groupBy = function(array, prop) {
51 | return array.reduce(function(groups, item) {
52 | let val = item[prop];
53 | groups[val] = groups[val] || [];
54 | groups[val].push(item);
55 | return groups;
56 | }, {});
57 | };
58 | this.weather.list = groupBy(this.weather.list, "dt");
59 | this.weatherListProps = Object.keys(this.weather.list);
60 | }
61 |
62 | getWeather(){
63 | console.log("getWeather");
64 | // this.weatherProvider.getWeather(this.location.cityName, this.location.countryCode).subscribe(weather =>{
65 | // console.log(weather);
66 | // })
67 | }
68 | }
69 |
--------------------------------------------------------------------------------