Primer commit des-de l'inicialitzacio del repositori
16
src/app/api.service.spec.ts
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ApiService } from './api.service';
|
||||||
|
|
||||||
|
describe('ApiService', () => {
|
||||||
|
let service: ApiService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(ApiService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
25
src/app/api.service.ts
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class ApiService {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
public http: HttpClient
|
||||||
|
) { }
|
||||||
|
|
||||||
|
addCountry(data) {
|
||||||
|
// return this.http.post('./insert.php', data);
|
||||||
|
return this.http.post('http://localhost/backend/insert.php', data);
|
||||||
|
}
|
||||||
|
getCountries() {
|
||||||
|
return this.http.get('http://localhost/backend/read.php');
|
||||||
|
}
|
||||||
|
delCountry(countryId) {
|
||||||
|
// return this.http.post('./insert.php', data);
|
||||||
|
return this.http.post('http://localhost/backend/delete.php', countryId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
34
src/app/app-routing.module.ts
Executable file
|
@ -0,0 +1,34 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: 'home',
|
||||||
|
loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
redirectTo: 'home',
|
||||||
|
pathMatch: 'full'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'main',
|
||||||
|
loadChildren: () => import('./pages/main/main.module').then( m => m.MainPageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'form',
|
||||||
|
loadChildren: () => import('./pages/form/form.module').then( m => m.FormPageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'list',
|
||||||
|
loadChildren: () => import('./pages/list/list.module').then( m => m.ListPageModule)
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
||||||
|
],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class AppRoutingModule { }
|
22
src/app/app.component.html
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
<ion-app>
|
||||||
|
|
||||||
|
<ion-menu side="start" menuId="menu" contentId="mainmenu">
|
||||||
|
<ion-header>
|
||||||
|
<ion-toolbar color="secondary">
|
||||||
|
<ion-title>Start Menu</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
<ion-content>
|
||||||
|
<ion-list>
|
||||||
|
<ion-menu-toggle>
|
||||||
|
<ion-item routerLink="/main">Main Page</ion-item>
|
||||||
|
<ion-item routerLink="/form">Form Page</ion-item>
|
||||||
|
<ion-item routerLink="/list">Result Page</ion-item>
|
||||||
|
</ion-menu-toggle>
|
||||||
|
</ion-list>
|
||||||
|
</ion-content>
|
||||||
|
</ion-menu>
|
||||||
|
|
||||||
|
<ion-router-outlet id="mainmenu"></ion-router-outlet>
|
||||||
|
|
||||||
|
</ion-app>
|
7
src/app/app.component.scss
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
:root {
|
||||||
|
--ion-color-secondary: #4CAF50;
|
||||||
|
}
|
||||||
|
ion-button {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
23
src/app/app.component.spec.ts
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
|
import { TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
|
describe('AppComponent', () => {
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [AppComponent],
|
||||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
|
}).compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create the app', () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
const app = fixture.debugElement.componentInstance;
|
||||||
|
expect(app).toBeTruthy();
|
||||||
|
});
|
||||||
|
// TODO: add more tests!
|
||||||
|
|
||||||
|
});
|
10
src/app/app.component.ts
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-root',
|
||||||
|
templateUrl: 'app.component.html',
|
||||||
|
styleUrls: ['app.component.scss'],
|
||||||
|
})
|
||||||
|
export class AppComponent {
|
||||||
|
constructor() {}
|
||||||
|
}
|
20
src/app/app.module.ts
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
|
import { RouteReuseStrategy } from '@angular/router';
|
||||||
|
|
||||||
|
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { AppComponent } from './app.component';
|
||||||
|
import { AppRoutingModule } from './app-routing.module';
|
||||||
|
import { ComponentsModule } from './components/components.module';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [AppComponent],
|
||||||
|
entryComponents: [],
|
||||||
|
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule, HttpClientModule, ComponentsModule],
|
||||||
|
providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
|
||||||
|
bootstrap: [AppComponent],
|
||||||
|
})
|
||||||
|
export class AppModule {}
|
12
src/app/components/components.module.ts
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [],
|
||||||
|
imports: [
|
||||||
|
CommonModule
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class ComponentsModule { }
|
16
src/app/home/home-routing.module.ts
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
import { HomePage } from './home.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: HomePage,
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class HomePageRoutingModule {}
|
19
src/app/home/home.module.ts
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { HomePage } from './home.page';
|
||||||
|
|
||||||
|
import { HomePageRoutingModule } from './home-routing.module';
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
HomePageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [HomePage]
|
||||||
|
})
|
||||||
|
export class HomePageModule {}
|
21
src/app/home/home.page.html
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
<ion-header [translucent]="true">
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="start">
|
||||||
|
<ion-menu-button></ion-menu-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Blank</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content [fullscreen]="true">
|
||||||
|
<ion-header collapse="condense">
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title size="large">Blank</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<div id="container">
|
||||||
|
<strong>Ready to create an app?</strong>
|
||||||
|
<p>Start with Ionic <a target="_blank" rel="noopener noreferrer" href="https://ionicframework.com/docs/components">UI Components</a></p>
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
27
src/app/home/home.page.scss
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#container {
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#container strong {
|
||||||
|
font-size: 20px;
|
||||||
|
line-height: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container p {
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 22px;
|
||||||
|
|
||||||
|
color: #8c8c8c;
|
||||||
|
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
24
src/app/home/home.page.spec.ts
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { HomePage } from './home.page';
|
||||||
|
|
||||||
|
describe('HomePage', () => {
|
||||||
|
let component: HomePage;
|
||||||
|
let fixture: ComponentFixture<HomePage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ HomePage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(HomePage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
12
src/app/home/home.page.ts
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-home',
|
||||||
|
templateUrl: 'home.page.html',
|
||||||
|
styleUrls: ['home.page.scss'],
|
||||||
|
})
|
||||||
|
export class HomePage {
|
||||||
|
|
||||||
|
constructor() {}
|
||||||
|
|
||||||
|
}
|
24
src/app/insert.php
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
include "config.php";
|
||||||
|
$input = file_get_contents('php://input');
|
||||||
|
$data = json_decode($input, true);
|
||||||
|
$response = array();
|
||||||
|
|
||||||
|
$countryName = $data["countryName"];
|
||||||
|
$countryContinent = $data["countryContinent"];
|
||||||
|
$countryArea = $data["countryArea"];
|
||||||
|
$countryPopulation = $data["countryPopulation"];
|
||||||
|
$countryDrivingSide = $data["countryDrivingSide"];
|
||||||
|
|
||||||
|
$sqlQuery = "INSERT INTO `cs_countries` (`cs_country_id`, `cs_country_name`, `cs_country_continent`,";
|
||||||
|
$sqlQuery += " `cs_country_area`, `cs_country_population`, `cs_country_drivingSide`";
|
||||||
|
$sqlQuery += " VALUES (NULL, '$countryName', ' $countryContinent', $countryArea, $countryPopulation, '$countryDrivingSide')";
|
||||||
|
|
||||||
|
$sql = mysqli_query($con, $sqlQuery);
|
||||||
|
if($sql){
|
||||||
|
$response["message"] = "OK";
|
||||||
|
}else{
|
||||||
|
$response["message"] = "KO";
|
||||||
|
}
|
||||||
|
echo json_encode($response);
|
||||||
|
?>
|
17
src/app/pages/form/form-routing.module.ts
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { FormPage } from './form.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: FormPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class FormPageRoutingModule {}
|
20
src/app/pages/form/form.module.ts
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { FormPageRoutingModule } from './form-routing.module';
|
||||||
|
|
||||||
|
import { FormPage } from './form.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
FormPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [FormPage]
|
||||||
|
})
|
||||||
|
export class FormPageModule {}
|
50
src/app/pages/form/form.page copy.html
Executable file
|
@ -0,0 +1,50 @@
|
||||||
|
<ion-header>
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="start">
|
||||||
|
<ion-menu-button></ion-menu-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Form Page</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
<div class="formDiv">
|
||||||
|
<ion-label for="inputName">Country Name:</ion-label><br><br>
|
||||||
|
<ion-input type="text" id="inputName" [(ngModel)]="inputName"></ion-input><br><br><br>
|
||||||
|
|
||||||
|
<label for="inputOptions">Continent:</label><br><br>
|
||||||
|
<select id="inputOptions" name="inputOptions">
|
||||||
|
<option value="empty" selected>Select</option>
|
||||||
|
<option value="language">Africa</option>
|
||||||
|
<option value="language">Antarctica</option>
|
||||||
|
<option value="country">Asia</option>
|
||||||
|
<option value="city">Europe</option>
|
||||||
|
<option value="language">North America</option>
|
||||||
|
<option value="language">South America</option>
|
||||||
|
<option value="language">Oceania</option>
|
||||||
|
</select><br><br><br>
|
||||||
|
|
||||||
|
|
||||||
|
<label for="inputArea">Surface Area (km2):</label><br><br>
|
||||||
|
<ion-input type="text" id="inputArea" name="inputArea"></ion-input><br><br><br>
|
||||||
|
|
||||||
|
<label for="inputPop">Population :</label><br><br>
|
||||||
|
<ion-input type="text" id="inputPop" name="inputPop"></ion-input><br><br><br>
|
||||||
|
|
||||||
|
<label for="inputDriveSide">Driving Side:</label><br><br>
|
||||||
|
<option name="inputDriveSide">
|
||||||
|
<label for="rightSide">Right Side</label>
|
||||||
|
<ion-input type="radio" id="inputDrive" name="rightSide"></ion-input>
|
||||||
|
<label for="leftSide">Left Side</label>
|
||||||
|
<ion-input type="radio" id="inputDrive" name="leftSide"></ion-input>
|
||||||
|
</option><br>
|
||||||
|
|
||||||
|
<ion-button type="button" (click)="addCountry()">Add Country</ion-button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="bigButtonDiv">
|
||||||
|
<div class="buttonDiv" routerLink="/main">Go to home page</div>
|
||||||
|
<div class="buttonDiv" routerLink="/list">Go to result page</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ion-content>
|
42
src/app/pages/form/form.page copy.scss
Executable file
|
@ -0,0 +1,42 @@
|
||||||
|
ion-label {
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
text-indent: 15px;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
input-input[type=text], select {
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px 20px;
|
||||||
|
margin: 8px 0;
|
||||||
|
display: inline-block;
|
||||||
|
border: 1px solid rgb(0, 0, 0);
|
||||||
|
border-radius: 4px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
ion-input[type=submit]:hover {
|
||||||
|
background-color: #45a049;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formDiv {
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
.bigButtonDiv, ion-button {
|
||||||
|
width: 100%;
|
||||||
|
display:flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.buttonDiv {
|
||||||
|
width: 375px;
|
||||||
|
max-width: 45%;
|
||||||
|
background-color: #4CAF50;
|
||||||
|
color: white;
|
||||||
|
padding: 14px 20px;
|
||||||
|
margin: 8px, 0px;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
55
src/app/pages/form/form.page.html
Executable file
|
@ -0,0 +1,55 @@
|
||||||
|
|
||||||
|
<ion-header>
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="start">
|
||||||
|
<ion-menu-button></ion-menu-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Form Page</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
<ion-label for="countryName">Country Name:</ion-label><br>
|
||||||
|
<ion-input [(ngModel)]="countryName" type="text"></ion-input><br><br>
|
||||||
|
|
||||||
|
<ion-label for="countryContinent">Continent:</ion-label><br>
|
||||||
|
<ion-item>
|
||||||
|
<ion-select [(ngModel)]="countryContinent" interface="popover" placeholder="Select">
|
||||||
|
<ion-select-option value="africa">Africa</ion-select-option>
|
||||||
|
<ion-select-option value="antarctica">Antarctica</ion-select-option>
|
||||||
|
<ion-select-option value="asia">Asia</ion-select-option>
|
||||||
|
<ion-select-option value="europe">Europe</ion-select-option>
|
||||||
|
<ion-select-option value="northAmerica">North America</ion-select-option>
|
||||||
|
<ion-select-option value="southAmerica">South America</ion-select-option>
|
||||||
|
<ion-select-option value="oceania">Oceania</ion-select-option>
|
||||||
|
</ion-select>
|
||||||
|
</ion-item><br><br>
|
||||||
|
|
||||||
|
<ion-label for="countryArea">Surface Area (km2):</ion-label><br>
|
||||||
|
<ion-input [(ngModel)]="countryArea" type="text"></ion-input><br><br>
|
||||||
|
|
||||||
|
<ion-label for="countryPopulation">Population</ion-label><br>
|
||||||
|
<ion-input [(ngModel)]="countryPopulation" type="text"></ion-input><br><br>
|
||||||
|
|
||||||
|
<ion-label for="countryDrivingSide">Driving Side:</ion-label><br>
|
||||||
|
<ion-radio-group [(ngModel)]="countryDrivingSide">
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Right</ion-label>
|
||||||
|
<ion-radio slot="start" color="success" value="right"></ion-radio>
|
||||||
|
</ion-item>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Left</ion-label>
|
||||||
|
<ion-radio slot="start" color="success" value="left"></ion-radio>
|
||||||
|
</ion-item>
|
||||||
|
</ion-radio-group><br><br>
|
||||||
|
<ion-item>
|
||||||
|
<input type="file" [(ngModel)]="countryFlag" (change)="selectedFile($event)" />
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-button id="submit-button" type="button" (click)="addCountry()">Add Country</ion-button>
|
||||||
|
<div class="bigButtonDiv">
|
||||||
|
<div class="buttonDiv" routerLink="/main">Go to home page</div>
|
||||||
|
<div class="buttonDiv" routerLink="/list">Go to result page</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ion-content>
|
50
src/app/pages/form/form.page.scss
Executable file
|
@ -0,0 +1,50 @@
|
||||||
|
ion-label {
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
text-indent: 15px;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
ion-input[type=text], select {
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px 20px;
|
||||||
|
margin: 8px 0;
|
||||||
|
display: inline-block;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
#submit-button {
|
||||||
|
width: 100%;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type=submit]:hover {
|
||||||
|
background-color: #45a049;
|
||||||
|
}
|
||||||
|
|
||||||
|
ion-content {
|
||||||
|
--padding-end : 25px;
|
||||||
|
--padding-start : 25px;
|
||||||
|
--padding-top : 25px;
|
||||||
|
}
|
||||||
|
.bigButtonDiv {
|
||||||
|
width: 100%;
|
||||||
|
display:flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.buttonDiv {
|
||||||
|
width: 375px;
|
||||||
|
max-width: 45%;
|
||||||
|
background-color: #4CAF50;
|
||||||
|
color: white;
|
||||||
|
padding: 14px 20px;
|
||||||
|
margin: 8px, 0px;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
24
src/app/pages/form/form.page.spec.ts
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { FormPage } from './form.page';
|
||||||
|
|
||||||
|
describe('FormPage', () => {
|
||||||
|
let component: FormPage;
|
||||||
|
let fixture: ComponentFixture<FormPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ FormPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(FormPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
47
src/app/pages/form/form.page.ts
Executable file
|
@ -0,0 +1,47 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ApiService } from 'src/app/api.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-form',
|
||||||
|
templateUrl: './form.page.html',
|
||||||
|
styleUrls: ['./form.page.scss'],
|
||||||
|
})
|
||||||
|
export class FormPage implements OnInit {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
public _apiService: ApiService
|
||||||
|
) { }
|
||||||
|
|
||||||
|
countryName;
|
||||||
|
countryContinent;
|
||||||
|
countryArea;
|
||||||
|
countryPopulation;
|
||||||
|
countryDrivingSide;
|
||||||
|
countryFlag;
|
||||||
|
|
||||||
|
selectedFile(event){
|
||||||
|
this.countryFlag = event.target.files[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
addCountry(){
|
||||||
|
var data = new FormData();
|
||||||
|
data.append("countryName", this.countryName);
|
||||||
|
data.append("countryContinent", this.countryContinent);
|
||||||
|
data.append("countryArea", this.countryArea);
|
||||||
|
data.append("countryArea", this.countryPopulation);
|
||||||
|
data.append("countryDrivingSide", this.countryDrivingSide);
|
||||||
|
data.append("countryFlag", this.countryFlag);
|
||||||
|
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
|
this._apiService.addCountry(data).subscribe((response) => {
|
||||||
|
console.log(response);
|
||||||
|
});
|
||||||
|
// window.location.reload();
|
||||||
|
|
||||||
|
}
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
17
src/app/pages/list/list-routing.module.ts
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { ListPage } from './list.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: ListPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class ListPageRoutingModule {}
|
20
src/app/pages/list/list.module.ts
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { ListPageRoutingModule } from './list-routing.module';
|
||||||
|
|
||||||
|
import { ListPage } from './list.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
ListPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [ListPage]
|
||||||
|
})
|
||||||
|
export class ListPageModule {}
|
40
src/app/pages/list/list.page.html
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
<ion-header>
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="start">
|
||||||
|
<ion-menu-button></ion-menu-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Result Page</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
<ion-list *ngFor="let country of countries; let i=index;">
|
||||||
|
<ion-item-sliding>
|
||||||
|
<ion-item-options side="start">
|
||||||
|
<ion-item-option >Favorite</ion-item-option>
|
||||||
|
<ion-item-option color="danger">Share</ion-item-option>
|
||||||
|
</ion-item-options>
|
||||||
|
<ion-item routerLink="">
|
||||||
|
<ion-avatar slot="start">
|
||||||
|
<img src="assets/img/flags/iconfinder.com.png">
|
||||||
|
</ion-avatar>
|
||||||
|
<ion-label>
|
||||||
|
<h2>{{country.cs_country_name}}</h2>
|
||||||
|
<p>Continent: {{country.cs_country_continent}}</p>
|
||||||
|
<p>Surface Area: {{country.cs_country_area}}</p>
|
||||||
|
<p>Population: {{country.cs_country_population}}</p>
|
||||||
|
<p>Driving Side: {{country.cs_country_drivingSide}}</p>
|
||||||
|
<p></p>
|
||||||
|
</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
<ion-item-options side="end">
|
||||||
|
<ion-item-option (click)="delCountry(country.cs_country_id, i)" color="danger" expandable>Delete</ion-item-option>
|
||||||
|
</ion-item-options>
|
||||||
|
</ion-item-sliding>
|
||||||
|
|
||||||
|
</ion-list>
|
||||||
|
<div class="bigButtonDiv">
|
||||||
|
<div class="buttonDiv" routerLink="/main">Go to home page</div>
|
||||||
|
<div class="buttonDiv" routerLink="/form">Go to form page</div>
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
17
src/app/pages/list/list.page.scss
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
.bigButtonDiv {
|
||||||
|
width: 100%;
|
||||||
|
display:flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.buttonDiv {
|
||||||
|
width: 375px;
|
||||||
|
max-width: 45%;
|
||||||
|
background-color: #4CAF50;
|
||||||
|
color: white;
|
||||||
|
padding: 14px 20px;
|
||||||
|
margin: 8px, 0px;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
24
src/app/pages/list/list.page.spec.ts
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { ListPage } from './list.page';
|
||||||
|
|
||||||
|
describe('ListPage', () => {
|
||||||
|
let component: ListPage;
|
||||||
|
let fixture: ComponentFixture<ListPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ ListPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(ListPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
39
src/app/pages/list/list.page.ts
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ApiService } from 'src/app/api.service';
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-list',
|
||||||
|
templateUrl: './list.page.html',
|
||||||
|
styleUrls: ['./list.page.scss'],
|
||||||
|
})
|
||||||
|
export class ListPage implements OnInit {
|
||||||
|
countries;
|
||||||
|
|
||||||
|
ionViewWillEnter() {
|
||||||
|
this.getCountries();
|
||||||
|
}
|
||||||
|
constructor(
|
||||||
|
public _apiService: ApiService
|
||||||
|
|
||||||
|
) { }
|
||||||
|
getCountries(){
|
||||||
|
this._apiService.getCountries().subscribe((data) => {
|
||||||
|
this.countries = data;
|
||||||
|
console.log(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
delCountry(countryId, i){
|
||||||
|
this._apiService.delCountry(countryId).subscribe((response) => {
|
||||||
|
console.log(response);
|
||||||
|
});
|
||||||
|
this.countries.splice(i, 1);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
17
src/app/pages/main/main-routing.module.ts
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { MainPage } from './main.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: MainPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class MainPageRoutingModule {}
|
20
src/app/pages/main/main.module.ts
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { MainPageRoutingModule } from './main-routing.module';
|
||||||
|
|
||||||
|
import { MainPage } from './main.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
MainPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [MainPage]
|
||||||
|
})
|
||||||
|
export class MainPageModule {}
|
50
src/app/pages/main/main.page.html
Executable file
|
@ -0,0 +1,50 @@
|
||||||
|
<ion-header>
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons slot="start">
|
||||||
|
<ion-menu-button></ion-menu-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Main Page</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
<br>
|
||||||
|
<ion-slides pager="true">
|
||||||
|
<ion-slide>
|
||||||
|
<div class="slideDiv">
|
||||||
|
<div class="slideTitle"><p>Country Stats</p></div>
|
||||||
|
<img src="/assets/img/slides/slide1.jpg" />
|
||||||
|
</div>
|
||||||
|
</ion-slide>
|
||||||
|
<ion-slide>
|
||||||
|
<div class="slideDiv">
|
||||||
|
<div class="slideTitle"><p>Save Stats from any Country</p></div>
|
||||||
|
<img src="/assets/img/slides/slide2.jpg" />
|
||||||
|
</div>
|
||||||
|
</ion-slide>
|
||||||
|
<ion-slide>
|
||||||
|
<div class="slideDiv">
|
||||||
|
<div class="slideTitle"><p>They'll probably never be useful</p></div>
|
||||||
|
<img src="/assets/img/slides/slide3.jpg" />
|
||||||
|
</div>
|
||||||
|
</ion-slide>
|
||||||
|
<ion-slide>
|
||||||
|
<div class="slideDiv">
|
||||||
|
<div class="slideTitle"><p>But that's not why you learn them, right?</p></div>
|
||||||
|
<img src="/assets/img/slides/slide4.jpg" />
|
||||||
|
</div>
|
||||||
|
</ion-slide>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ion-slides>
|
||||||
|
|
||||||
|
<br><br>
|
||||||
|
<div class="bigButtonDiv">
|
||||||
|
<div class="buttonDiv" routerLink="/form">Go to form page</div>
|
||||||
|
<div class="buttonDiv" routerLink="/list">Go to result page</div>
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
38
src/app/pages/main/main.page.scss
Executable file
|
@ -0,0 +1,38 @@
|
||||||
|
img {
|
||||||
|
width: 750px;
|
||||||
|
max-width: 90%;
|
||||||
|
}
|
||||||
|
.slideTitle {
|
||||||
|
background-color:#4CAF50;
|
||||||
|
width: 750px;
|
||||||
|
max-width: 90%;
|
||||||
|
}
|
||||||
|
.slideDiv{
|
||||||
|
width: 100%;
|
||||||
|
display:flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.bigButtonDiv {
|
||||||
|
width: 100%;
|
||||||
|
display:flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.buttonDiv {
|
||||||
|
width: 375px;
|
||||||
|
max-width: 45%;
|
||||||
|
background-color: #4CAF50;
|
||||||
|
color: white;
|
||||||
|
padding: 14px 20px;
|
||||||
|
margin: 8px, 0px;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
ion-menu-button{
|
||||||
|
display: block;
|
||||||
|
}
|
24
src/app/pages/main/main.page.spec.ts
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { MainPage } from './main.page';
|
||||||
|
|
||||||
|
describe('MainPage', () => {
|
||||||
|
let component: MainPage;
|
||||||
|
let fixture: ComponentFixture<MainPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ MainPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(MainPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
15
src/app/pages/main/main.page.ts
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-main',
|
||||||
|
templateUrl: './main.page.html',
|
||||||
|
styleUrls: ['./main.page.scss'],
|
||||||
|
})
|
||||||
|
export class MainPage implements OnInit {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
BIN
src/assets/icon/favicon.png
Executable file
After Width: | Height: | Size: 930 B |
BIN
src/assets/img/flags/freesvg.org.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/assets/img/flags/iconfinder.com.png
Normal file
After Width: | Height: | Size: 82 KiB |
107
src/assets/img/slides/.comments/slide1 (copy).jpeg.xml
Executable file
|
@ -0,0 +1,107 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<comment version="3.0">
|
||||||
|
<caption>World map.</caption>
|
||||||
|
<note>Front view of steel world map. Wide image.</note>
|
||||||
|
<place/>
|
||||||
|
<categories>
|
||||||
|
<category value="steel"/>
|
||||||
|
<category value="world"/>
|
||||||
|
<category value="earth"/>
|
||||||
|
<category value="continent"/>
|
||||||
|
<category value="global"/>
|
||||||
|
<category value="symbol"/>
|
||||||
|
<category value="globe"/>
|
||||||
|
<category value="international"/>
|
||||||
|
<category value="concept"/>
|
||||||
|
<category value="map"/>
|
||||||
|
<category value="africa"/>
|
||||||
|
<category value="europe"/>
|
||||||
|
<category value="america"/>
|
||||||
|
<category value="countries"/>
|
||||||
|
<category value="3d"/>
|
||||||
|
<category value="white"/>
|
||||||
|
<category value="sign"/>
|
||||||
|
<category value="icon"/>
|
||||||
|
<category value="graphic"/>
|
||||||
|
<category value="asia"/>
|
||||||
|
<category value="metallic"/>
|
||||||
|
<category value="globalization"/>
|
||||||
|
<category value="metal"/>
|
||||||
|
<category value="geography"/>
|
||||||
|
<category value="render"/>
|
||||||
|
<category value="silver"/>
|
||||||
|
<category value="planet"/>
|
||||||
|
<category value="travel"/>
|
||||||
|
<category value="middle east"/>
|
||||||
|
<category value="country"/>
|
||||||
|
<category value="shiny"/>
|
||||||
|
<category value="brushed"/>
|
||||||
|
<category value="abstract"/>
|
||||||
|
<category value="textured"/>
|
||||||
|
<category value="aluminum"/>
|
||||||
|
<category value="texture"/>
|
||||||
|
<category value="surface"/>
|
||||||
|
<category value="gray"/>
|
||||||
|
<category value="iron"/>
|
||||||
|
<category value="stainless"/>
|
||||||
|
<category value="blank"/>
|
||||||
|
<category value="polished"/>
|
||||||
|
<category value="flat"/>
|
||||||
|
<category value="abstract"/>
|
||||||
|
<category value="front view"/>
|
||||||
|
<category value="extruded"/>
|
||||||
|
<category value="bevel"/>
|
||||||
|
<category value="hard light"/>
|
||||||
|
<category value="Wide image"/>
|
||||||
|
<category value="sparse"/>
|
||||||
|
<category value="wide image"/>
|
||||||
|
<category value="map"/>
|
||||||
|
<category value="geography"/>
|
||||||
|
<category value="front view"/>
|
||||||
|
<category value="steel"/>
|
||||||
|
<category value="world"/>
|
||||||
|
<category value="earth"/>
|
||||||
|
<category value="continent"/>
|
||||||
|
<category value="global"/>
|
||||||
|
<category value="symbol"/>
|
||||||
|
<category value="globe"/>
|
||||||
|
<category value="international"/>
|
||||||
|
<category value="concept"/>
|
||||||
|
<category value="africa"/>
|
||||||
|
<category value="europe"/>
|
||||||
|
<category value="america"/>
|
||||||
|
<category value="countries"/>
|
||||||
|
<category value="3d"/>
|
||||||
|
<category value="white"/>
|
||||||
|
<category value="sign"/>
|
||||||
|
<category value="icon"/>
|
||||||
|
<category value="graphic"/>
|
||||||
|
<category value="asia"/>
|
||||||
|
<category value="metallic"/>
|
||||||
|
<category value="globalization"/>
|
||||||
|
<category value="metal"/>
|
||||||
|
<category value="render"/>
|
||||||
|
<category value="silver"/>
|
||||||
|
<category value="planet"/>
|
||||||
|
<category value="travel"/>
|
||||||
|
<category value="middle east"/>
|
||||||
|
<category value="country"/>
|
||||||
|
<category value="shiny"/>
|
||||||
|
<category value="brushed"/>
|
||||||
|
<category value="abstract"/>
|
||||||
|
<category value="textured"/>
|
||||||
|
<category value="aluminum"/>
|
||||||
|
<category value="texture"/>
|
||||||
|
<category value="surface"/>
|
||||||
|
<category value="gray"/>
|
||||||
|
<category value="iron"/>
|
||||||
|
<category value="stainless"/>
|
||||||
|
<category value="blank"/>
|
||||||
|
<category value="polished"/>
|
||||||
|
<category value="flat"/>
|
||||||
|
<category value="extruded"/>
|
||||||
|
<category value="bevel"/>
|
||||||
|
<category value="hard light"/>
|
||||||
|
<category value="sparse"/>
|
||||||
|
</categories>
|
||||||
|
</comment>
|
107
src/assets/img/slides/.comments/slide1.jpeg.xml
Executable file
|
@ -0,0 +1,107 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<comment version="3.0">
|
||||||
|
<caption>World map.</caption>
|
||||||
|
<note>Front view of steel world map. Wide image.</note>
|
||||||
|
<place/>
|
||||||
|
<categories>
|
||||||
|
<category value="metallic"/>
|
||||||
|
<category value="wide image"/>
|
||||||
|
<category value="asia"/>
|
||||||
|
<category value="graphic"/>
|
||||||
|
<category value="icon"/>
|
||||||
|
<category value="sign"/>
|
||||||
|
<category value="white"/>
|
||||||
|
<category value="3d"/>
|
||||||
|
<category value="countries"/>
|
||||||
|
<category value="america"/>
|
||||||
|
<category value="europe"/>
|
||||||
|
<category value="africa"/>
|
||||||
|
<category value="concept"/>
|
||||||
|
<category value="international"/>
|
||||||
|
<category value="globe"/>
|
||||||
|
<category value="symbol"/>
|
||||||
|
<category value="global"/>
|
||||||
|
<category value="continent"/>
|
||||||
|
<category value="earth"/>
|
||||||
|
<category value="world"/>
|
||||||
|
<category value="steel"/>
|
||||||
|
<category value="front view"/>
|
||||||
|
<category value="geography"/>
|
||||||
|
<category value="map"/>
|
||||||
|
<category value="aluminum"/>
|
||||||
|
<category value="sparse"/>
|
||||||
|
<category value="hard light"/>
|
||||||
|
<category value="bevel"/>
|
||||||
|
<category value="extruded"/>
|
||||||
|
<category value="flat"/>
|
||||||
|
<category value="polished"/>
|
||||||
|
<category value="blank"/>
|
||||||
|
<category value="stainless"/>
|
||||||
|
<category value="iron"/>
|
||||||
|
<category value="gray"/>
|
||||||
|
<category value="surface"/>
|
||||||
|
<category value="texture"/>
|
||||||
|
<category value="globalization"/>
|
||||||
|
<category value="textured"/>
|
||||||
|
<category value="abstract"/>
|
||||||
|
<category value="brushed"/>
|
||||||
|
<category value="shiny"/>
|
||||||
|
<category value="country"/>
|
||||||
|
<category value="middle east"/>
|
||||||
|
<category value="travel"/>
|
||||||
|
<category value="planet"/>
|
||||||
|
<category value="silver"/>
|
||||||
|
<category value="render"/>
|
||||||
|
<category value="metal"/>
|
||||||
|
<category value="europe"/>
|
||||||
|
<category value="geography"/>
|
||||||
|
<category value="metal"/>
|
||||||
|
<category value="globalization"/>
|
||||||
|
<category value="metallic"/>
|
||||||
|
<category value="asia"/>
|
||||||
|
<category value="graphic"/>
|
||||||
|
<category value="icon"/>
|
||||||
|
<category value="sign"/>
|
||||||
|
<category value="white"/>
|
||||||
|
<category value="3d"/>
|
||||||
|
<category value="countries"/>
|
||||||
|
<category value="america"/>
|
||||||
|
<category value="Wide image"/>
|
||||||
|
<category value="africa"/>
|
||||||
|
<category value="map"/>
|
||||||
|
<category value="concept"/>
|
||||||
|
<category value="international"/>
|
||||||
|
<category value="globe"/>
|
||||||
|
<category value="symbol"/>
|
||||||
|
<category value="global"/>
|
||||||
|
<category value="continent"/>
|
||||||
|
<category value="earth"/>
|
||||||
|
<category value="world"/>
|
||||||
|
<category value="steel"/>
|
||||||
|
<category value="silver"/>
|
||||||
|
<category value="sparse"/>
|
||||||
|
<category value="hard light"/>
|
||||||
|
<category value="bevel"/>
|
||||||
|
<category value="extruded"/>
|
||||||
|
<category value="front view"/>
|
||||||
|
<category value="abstract"/>
|
||||||
|
<category value="flat"/>
|
||||||
|
<category value="polished"/>
|
||||||
|
<category value="blank"/>
|
||||||
|
<category value="stainless"/>
|
||||||
|
<category value="iron"/>
|
||||||
|
<category value="gray"/>
|
||||||
|
<category value="texture"/>
|
||||||
|
<category value="render"/>
|
||||||
|
<category value="planet"/>
|
||||||
|
<category value="travel"/>
|
||||||
|
<category value="middle east"/>
|
||||||
|
<category value="country"/>
|
||||||
|
<category value="shiny"/>
|
||||||
|
<category value="brushed"/>
|
||||||
|
<category value="abstract"/>
|
||||||
|
<category value="textured"/>
|
||||||
|
<category value="aluminum"/>
|
||||||
|
<category value="surface"/>
|
||||||
|
</categories>
|
||||||
|
</comment>
|
107
src/assets/img/slides/.comments/slide1.jpg.xml
Executable file
|
@ -0,0 +1,107 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<comment version="3.0">
|
||||||
|
<caption>World map.</caption>
|
||||||
|
<note>Front view of steel world map. Wide image.</note>
|
||||||
|
<place/>
|
||||||
|
<categories>
|
||||||
|
<category value="metallic"/>
|
||||||
|
<category value="wide image"/>
|
||||||
|
<category value="asia"/>
|
||||||
|
<category value="graphic"/>
|
||||||
|
<category value="icon"/>
|
||||||
|
<category value="sign"/>
|
||||||
|
<category value="white"/>
|
||||||
|
<category value="3d"/>
|
||||||
|
<category value="countries"/>
|
||||||
|
<category value="america"/>
|
||||||
|
<category value="europe"/>
|
||||||
|
<category value="africa"/>
|
||||||
|
<category value="concept"/>
|
||||||
|
<category value="international"/>
|
||||||
|
<category value="globe"/>
|
||||||
|
<category value="symbol"/>
|
||||||
|
<category value="global"/>
|
||||||
|
<category value="continent"/>
|
||||||
|
<category value="earth"/>
|
||||||
|
<category value="world"/>
|
||||||
|
<category value="steel"/>
|
||||||
|
<category value="front view"/>
|
||||||
|
<category value="geography"/>
|
||||||
|
<category value="map"/>
|
||||||
|
<category value="aluminum"/>
|
||||||
|
<category value="sparse"/>
|
||||||
|
<category value="hard light"/>
|
||||||
|
<category value="bevel"/>
|
||||||
|
<category value="extruded"/>
|
||||||
|
<category value="flat"/>
|
||||||
|
<category value="polished"/>
|
||||||
|
<category value="blank"/>
|
||||||
|
<category value="stainless"/>
|
||||||
|
<category value="iron"/>
|
||||||
|
<category value="gray"/>
|
||||||
|
<category value="surface"/>
|
||||||
|
<category value="texture"/>
|
||||||
|
<category value="globalization"/>
|
||||||
|
<category value="textured"/>
|
||||||
|
<category value="abstract"/>
|
||||||
|
<category value="brushed"/>
|
||||||
|
<category value="shiny"/>
|
||||||
|
<category value="country"/>
|
||||||
|
<category value="middle east"/>
|
||||||
|
<category value="travel"/>
|
||||||
|
<category value="planet"/>
|
||||||
|
<category value="silver"/>
|
||||||
|
<category value="render"/>
|
||||||
|
<category value="metal"/>
|
||||||
|
<category value="europe"/>
|
||||||
|
<category value="geography"/>
|
||||||
|
<category value="metal"/>
|
||||||
|
<category value="globalization"/>
|
||||||
|
<category value="metallic"/>
|
||||||
|
<category value="asia"/>
|
||||||
|
<category value="graphic"/>
|
||||||
|
<category value="icon"/>
|
||||||
|
<category value="sign"/>
|
||||||
|
<category value="white"/>
|
||||||
|
<category value="3d"/>
|
||||||
|
<category value="countries"/>
|
||||||
|
<category value="america"/>
|
||||||
|
<category value="Wide image"/>
|
||||||
|
<category value="africa"/>
|
||||||
|
<category value="map"/>
|
||||||
|
<category value="concept"/>
|
||||||
|
<category value="international"/>
|
||||||
|
<category value="globe"/>
|
||||||
|
<category value="symbol"/>
|
||||||
|
<category value="global"/>
|
||||||
|
<category value="continent"/>
|
||||||
|
<category value="earth"/>
|
||||||
|
<category value="world"/>
|
||||||
|
<category value="steel"/>
|
||||||
|
<category value="silver"/>
|
||||||
|
<category value="sparse"/>
|
||||||
|
<category value="hard light"/>
|
||||||
|
<category value="bevel"/>
|
||||||
|
<category value="extruded"/>
|
||||||
|
<category value="front view"/>
|
||||||
|
<category value="abstract"/>
|
||||||
|
<category value="flat"/>
|
||||||
|
<category value="polished"/>
|
||||||
|
<category value="blank"/>
|
||||||
|
<category value="stainless"/>
|
||||||
|
<category value="iron"/>
|
||||||
|
<category value="gray"/>
|
||||||
|
<category value="texture"/>
|
||||||
|
<category value="render"/>
|
||||||
|
<category value="planet"/>
|
||||||
|
<category value="travel"/>
|
||||||
|
<category value="middle east"/>
|
||||||
|
<category value="country"/>
|
||||||
|
<category value="shiny"/>
|
||||||
|
<category value="brushed"/>
|
||||||
|
<category value="abstract"/>
|
||||||
|
<category value="textured"/>
|
||||||
|
<category value="aluminum"/>
|
||||||
|
<category value="surface"/>
|
||||||
|
</categories>
|
||||||
|
</comment>
|
7
src/assets/img/slides/.comments/slide3.jpg.xml
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<comment version="3.0">
|
||||||
|
<caption/>
|
||||||
|
<note>world flags</note>
|
||||||
|
<place/>
|
||||||
|
<categories/>
|
||||||
|
</comment>
|
BIN
src/assets/img/slides/slide1.jpg
Executable file
After Width: | Height: | Size: 55 KiB |
BIN
src/assets/img/slides/slide2.jpg
Executable file
After Width: | Height: | Size: 174 KiB |
BIN
src/assets/img/slides/slide3.jpg
Executable file
After Width: | Height: | Size: 206 KiB |
BIN
src/assets/img/slides/slide4.jpg
Executable file
After Width: | Height: | Size: 76 KiB |
1
src/assets/shapes.svg
Executable file
|
@ -0,0 +1 @@
|
||||||
|
<svg width="350" height="140" xmlns="http://www.w3.org/2000/svg" style="background:#f6f7f9"><g fill="none" fill-rule="evenodd"><path fill="#F04141" style="mix-blend-mode:multiply" d="M61.905-34.23l96.194 54.51-66.982 54.512L22 34.887z"/><circle fill="#10DC60" style="mix-blend-mode:multiply" cx="155.5" cy="135.5" r="57.5"/><path fill="#3880FF" style="mix-blend-mode:multiply" d="M208.538 9.513l84.417 15.392L223.93 93.93z"/><path fill="#FFCE00" style="mix-blend-mode:multiply" d="M268.625 106.557l46.332-26.75 46.332 26.75v53.5l-46.332 26.75-46.332-26.75z"/><circle fill="#7044FF" style="mix-blend-mode:multiply" cx="299.5" cy="9.5" r="38.5"/><rect fill="#11D3EA" style="mix-blend-mode:multiply" transform="rotate(-60 148.47 37.886)" x="143.372" y="-7.056" width="10.196" height="89.884" rx="5.098"/><path d="M-25.389 74.253l84.86 8.107c5.498.525 9.53 5.407 9.004 10.905a10 10 0 0 1-.057.477l-12.36 85.671a10.002 10.002 0 0 1-11.634 8.42l-86.351-15.226c-5.44-.959-9.07-6.145-8.112-11.584l13.851-78.551a10 10 0 0 1 10.799-8.219z" fill="#7044FF" style="mix-blend-mode:multiply"/><circle fill="#0CD1E8" style="mix-blend-mode:multiply" cx="273.5" cy="106.5" r="20.5"/></g></svg>
|
After Width: | Height: | Size: 1.1 KiB |
15
src/backend/config.php
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
<?php
|
||||||
|
header('Access-Control-Allow-Origin: *');
|
||||||
|
header('Access-Control-Allow-Methods: POST, GET, DELETE, PUT, PATCH, OPTIONS');
|
||||||
|
header('Access-Control-Allow-Headers: token, Content-Type');
|
||||||
|
header('Access-Control-Max-Age: 1728000');
|
||||||
|
header('Content-Length:0');
|
||||||
|
header('Content-Type: text/plain');
|
||||||
|
|
||||||
|
$host = "localhost";
|
||||||
|
$user = "country_stats";
|
||||||
|
$password = "country_stats";
|
||||||
|
$db = "country_stats";
|
||||||
|
|
||||||
|
$con = mysqli_connect($host, $user, $password, $db) or die ("could not connect to DB");
|
||||||
|
?>
|
73
src/backend/country_stats.sql
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
-- phpMyAdmin SQL Dump
|
||||||
|
-- version 5.1.1
|
||||||
|
-- https://www.phpmyadmin.net/
|
||||||
|
--
|
||||||
|
-- Host: localhost
|
||||||
|
-- Generation Time: Jan 19, 2022 at 08:10 PM
|
||||||
|
-- Server version: 10.5.12-MariaDB-0+deb11u1
|
||||||
|
-- PHP Version: 8.0.14
|
||||||
|
|
||||||
|
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||||
|
START TRANSACTION;
|
||||||
|
SET time_zone = "+00:00";
|
||||||
|
|
||||||
|
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||||
|
/*!40101 SET NAMES utf8mb4 */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Database: `country_stats`
|
||||||
|
--
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `cs_countries`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `cs_countries` (
|
||||||
|
`cs_country_id` int(11) NOT NULL,
|
||||||
|
`cs_country_name` varchar(32) NOT NULL,
|
||||||
|
`cs_country_continent` varchar(16) NOT NULL,
|
||||||
|
`cs_country_area` int(32) NOT NULL,
|
||||||
|
`cs_country_population` int(32) NOT NULL,
|
||||||
|
`cs_country_drivingSide` enum('left','right') NOT NULL,
|
||||||
|
`cs_country_flag` varchar(64) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `cs_countries`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `cs_countries` (`cs_country_id`, `cs_country_name`, `cs_country_continent`, `cs_country_area`, `cs_country_population`, `cs_country_drivingSide`, `cs_country_flag`) VALUES
|
||||||
|
(8, 'saf', 'antarctica', 243234, 24234, 'right', ''),
|
||||||
|
(11, 'adasd', 'africa', 123, 1132, 'right', ''),
|
||||||
|
(12, 'jorge', 'europe', 2, 1, 'right', '');
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indexes for dumped tables
|
||||||
|
--
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indexes for table `cs_countries`
|
||||||
|
--
|
||||||
|
ALTER TABLE `cs_countries`
|
||||||
|
ADD PRIMARY KEY (`cs_country_id`),
|
||||||
|
ADD UNIQUE KEY `cs_country_name` (`cs_country_name`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT for dumped tables
|
||||||
|
--
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT for table `cs_countries`
|
||||||
|
--
|
||||||
|
ALTER TABLE `cs_countries`
|
||||||
|
MODIFY `cs_country_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
15
src/backend/delete.php
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
<?php
|
||||||
|
include "config.php";
|
||||||
|
$input = file_get_contents('php://input');
|
||||||
|
$response = array();
|
||||||
|
$sqlString = "DELETE FROM cs_countries WHERE cs_country_id = $input";
|
||||||
|
$sql = mysqli_query($con, $sqlString);
|
||||||
|
if($sql){
|
||||||
|
$response["message"] = "OK";
|
||||||
|
}else{
|
||||||
|
$response["message"] = "KO";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode($response);
|
||||||
|
|
||||||
|
?>
|
60
src/backend/insert.php
Executable file
|
@ -0,0 +1,60 @@
|
||||||
|
<?php
|
||||||
|
include "config.php";
|
||||||
|
$response = array();
|
||||||
|
|
||||||
|
$name = $_POST["countryName"];
|
||||||
|
$continent = $_POST["countryContinent"];
|
||||||
|
$area = $_POST["countryArea"];
|
||||||
|
$population = $_POST["countryPopulation"];
|
||||||
|
$drivingSide = $_POST["countryDrivingSide"];
|
||||||
|
// $flag = $_FILES["countryFlag"];
|
||||||
|
|
||||||
|
// $target_dir = "../assets/img/flags/";
|
||||||
|
// $target_file = $target_dir . fileNamer();
|
||||||
|
// $uploadOk = 1;
|
||||||
|
// $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
|
||||||
|
// // Check if image file is a actual image or fake image
|
||||||
|
// if(true) {
|
||||||
|
// $check = getimagesize($flag["tmp_name"]);
|
||||||
|
// if($check !== false) {
|
||||||
|
// echo "File is an image - " . $check["mime"] . ".";
|
||||||
|
// $uploadOk = 1;
|
||||||
|
// } else {
|
||||||
|
// echo "File is not an image.";
|
||||||
|
// $uploadOk = 0;
|
||||||
|
// }
|
||||||
|
// if (move_uploaded_file($flag["tmp_name"], $target_file)) {
|
||||||
|
// echo "The file ". htmlspecialchars( basename( $flag["name"])). " has been uploaded.";
|
||||||
|
// $response["message"] = "OK";
|
||||||
|
|
||||||
|
// } else {
|
||||||
|
// echo "Sorry, there was an error uploading your file.";
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
$sqlString = "INSERT INTO cs_countries (cs_country_name, cs_country_continent, cs_country_area, cs_country_population, cs_country_drivingSide)";
|
||||||
|
$sqlString .= " VALUES ('$name', '$continent', $area, $population, '$drivingSide')";
|
||||||
|
$sql = mysqli_query($con, $sqlString);
|
||||||
|
if($sql){
|
||||||
|
$response["message"] = "OK";
|
||||||
|
}else{
|
||||||
|
$response["message"] = "KO";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// function fileNamer(){
|
||||||
|
// $today = date('YmdHi');
|
||||||
|
// $startDate = date('YmdHi', strtotime('2012-03-14 09:06:00'));
|
||||||
|
// $range = $today - $startDate;
|
||||||
|
// $rand = rand(0, $range);
|
||||||
|
// return $startDate + $rand;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// $response["message"] = "OK";
|
||||||
|
|
||||||
|
|
||||||
|
echo json_encode($response);
|
||||||
|
echo json_encode($_POST);
|
||||||
|
// echo json_encode($_FILE);
|
||||||
|
?>
|
14
src/backend/read.php
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
include "config.php";
|
||||||
|
|
||||||
|
$sqlString = "SELECT * FROM cs_countries";
|
||||||
|
$sth = mysqli_query($con, $sqlString);
|
||||||
|
$output = array();
|
||||||
|
|
||||||
|
while ($row = mysqli_fetch_assoc($sth)) {
|
||||||
|
$output[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode($output);
|
||||||
|
|
||||||
|
?>
|
10
src/backend/test.php
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
function fileNamer(){
|
||||||
|
$today = date('YmdHi');
|
||||||
|
$startDate = date('YmdHi', strtotime('2012-03-14 09:06:00'));
|
||||||
|
$range = $today - $startDate;
|
||||||
|
$rand = rand(0, $range);
|
||||||
|
return $startDate + $rand;
|
||||||
|
}
|
||||||
|
echo fileNamer();
|
||||||
|
?>
|
3
src/environments/environment.prod.ts
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
export const environment = {
|
||||||
|
production: true
|
||||||
|
};
|
16
src/environments/environment.ts
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
// This file can be replaced during build by using the `fileReplacements` array.
|
||||||
|
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
|
||||||
|
// The list of file replacements can be found in `angular.json`.
|
||||||
|
|
||||||
|
export const environment = {
|
||||||
|
production: false
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For easier debugging in development mode, you can import the following file
|
||||||
|
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
||||||
|
*
|
||||||
|
* This import should be commented out in production mode because it will have a negative impact
|
||||||
|
* on performance if an error is thrown.
|
||||||
|
*/
|
||||||
|
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
|
26
src/global.scss
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* App Global CSS
|
||||||
|
* ----------------------------------------------------------------------------
|
||||||
|
* Put style rules here that you want to apply globally. These styles are for
|
||||||
|
* the entire app and not just one component. Additionally, this file can be
|
||||||
|
* used as an entry point to import other CSS/Sass files to be included in the
|
||||||
|
* output CSS.
|
||||||
|
* For more information on global stylesheets, visit the documentation:
|
||||||
|
* https://ionicframework.com/docs/layout/global-stylesheets
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Core CSS required for Ionic components to work properly */
|
||||||
|
@import "~@ionic/angular/css/core.css";
|
||||||
|
|
||||||
|
/* Basic CSS for apps built with Ionic */
|
||||||
|
@import "~@ionic/angular/css/normalize.css";
|
||||||
|
@import "~@ionic/angular/css/structure.css";
|
||||||
|
@import "~@ionic/angular/css/typography.css";
|
||||||
|
@import '~@ionic/angular/css/display.css';
|
||||||
|
|
||||||
|
/* Optional CSS utils that can be commented out */
|
||||||
|
@import "~@ionic/angular/css/padding.css";
|
||||||
|
@import "~@ionic/angular/css/float-elements.css";
|
||||||
|
@import "~@ionic/angular/css/text-alignment.css";
|
||||||
|
@import "~@ionic/angular/css/text-transformation.css";
|
||||||
|
@import "~@ionic/angular/css/flex-utils.css";
|
26
src/index.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>Ionic App</title>
|
||||||
|
|
||||||
|
<base href="/" />
|
||||||
|
|
||||||
|
<meta name="color-scheme" content="light dark" />
|
||||||
|
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||||
|
<meta name="format-detection" content="telephone=no" />
|
||||||
|
<meta name="msapplication-tap-highlight" content="no" />
|
||||||
|
|
||||||
|
<link rel="icon" type="image/png" href="assets/icon/favicon.png" />
|
||||||
|
|
||||||
|
<!-- add to homescreen for ios -->
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<app-root></app-root>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
12
src/main.ts
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
import { enableProdMode } from '@angular/core';
|
||||||
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||||
|
|
||||||
|
import { AppModule } from './app/app.module';
|
||||||
|
import { environment } from './environments/environment';
|
||||||
|
|
||||||
|
if (environment.production) {
|
||||||
|
enableProdMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
platformBrowserDynamic().bootstrapModule(AppModule)
|
||||||
|
.catch(err => console.log(err));
|
65
src/polyfills.ts
Executable file
|
@ -0,0 +1,65 @@
|
||||||
|
/**
|
||||||
|
* This file includes polyfills needed by Angular and is loaded before the app.
|
||||||
|
* You can add your own extra polyfills to this file.
|
||||||
|
*
|
||||||
|
* This file is divided into 2 sections:
|
||||||
|
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
|
||||||
|
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
|
||||||
|
* file.
|
||||||
|
*
|
||||||
|
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
||||||
|
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
|
||||||
|
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
|
||||||
|
*
|
||||||
|
* Learn more in https://angular.io/guide/browser-support
|
||||||
|
*/
|
||||||
|
|
||||||
|
/***************************************************************************************************
|
||||||
|
* BROWSER POLYFILLS
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** IE11 requires the following for NgClass support on SVG elements */
|
||||||
|
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Web Animations `@angular/platform-browser/animations`
|
||||||
|
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
|
||||||
|
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
|
||||||
|
*/
|
||||||
|
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* By default, zone.js will patch all possible macroTask and DomEvents
|
||||||
|
* user can disable parts of macroTask/DomEvents patch by setting following flags
|
||||||
|
* because those flags need to be set before `zone.js` being loaded, and webpack
|
||||||
|
* will put import in the top of bundle, so user need to create a separate file
|
||||||
|
* in this directory (for example: zone-flags.ts), and put the following flags
|
||||||
|
* into that file, and then add the following code before importing zone.js.
|
||||||
|
* import './zone-flags';
|
||||||
|
*
|
||||||
|
* The flags allowed in zone-flags.ts are listed here.
|
||||||
|
*
|
||||||
|
* The following flags will work for all browsers.
|
||||||
|
*
|
||||||
|
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
|
||||||
|
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
||||||
|
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
|
||||||
|
*
|
||||||
|
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
||||||
|
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
||||||
|
*
|
||||||
|
* (window as any).__Zone_enable_cross_context_check = true;
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
import './zone-flags';
|
||||||
|
|
||||||
|
/***************************************************************************************************
|
||||||
|
* Zone JS is required by default for Angular itself.
|
||||||
|
*/
|
||||||
|
import 'zone.js/dist/zone'; // Included with Angular CLI.
|
||||||
|
|
||||||
|
|
||||||
|
/***************************************************************************************************
|
||||||
|
* APPLICATION IMPORTS
|
||||||
|
*/
|
25
src/test.ts
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
||||||
|
|
||||||
|
import 'zone.js/dist/zone-testing';
|
||||||
|
import { getTestBed } from '@angular/core/testing';
|
||||||
|
import {
|
||||||
|
BrowserDynamicTestingModule,
|
||||||
|
platformBrowserDynamicTesting
|
||||||
|
} from '@angular/platform-browser-dynamic/testing';
|
||||||
|
|
||||||
|
declare const require: {
|
||||||
|
context(path: string, deep?: boolean, filter?: RegExp): {
|
||||||
|
keys(): string[];
|
||||||
|
<T>(id: string): T;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// First, initialize the Angular testing environment.
|
||||||
|
getTestBed().initTestEnvironment(
|
||||||
|
BrowserDynamicTestingModule,
|
||||||
|
platformBrowserDynamicTesting()
|
||||||
|
);
|
||||||
|
// Then we find all the tests.
|
||||||
|
const context = require.context('./', true, /\.spec\.ts$/);
|
||||||
|
// And load the modules.
|
||||||
|
context.keys().map(context);
|
236
src/theme/variables.scss
Executable file
|
@ -0,0 +1,236 @@
|
||||||
|
// Ionic Variables and Theming. For more info, please see:
|
||||||
|
// http://ionicframework.com/docs/theming/
|
||||||
|
|
||||||
|
/** Ionic CSS Variables **/
|
||||||
|
:root {
|
||||||
|
/** primary **/
|
||||||
|
--ion-color-primary: #3880ff;
|
||||||
|
--ion-color-primary-rgb: 56, 128, 255;
|
||||||
|
--ion-color-primary-contrast: #ffffff;
|
||||||
|
--ion-color-primary-contrast-rgb: 255, 255, 255;
|
||||||
|
--ion-color-primary-shade: #3171e0;
|
||||||
|
--ion-color-primary-tint: #4c8dff;
|
||||||
|
|
||||||
|
/** secondary **/
|
||||||
|
--ion-color-secondary: #3dc2ff;
|
||||||
|
--ion-color-secondary-rgb: 61, 194, 255;
|
||||||
|
--ion-color-secondary-contrast: #ffffff;
|
||||||
|
--ion-color-secondary-contrast-rgb: 255, 255, 255;
|
||||||
|
--ion-color-secondary-shade: #36abe0;
|
||||||
|
--ion-color-secondary-tint: #50c8ff;
|
||||||
|
|
||||||
|
/** tertiary **/
|
||||||
|
--ion-color-tertiary: #5260ff;
|
||||||
|
--ion-color-tertiary-rgb: 82, 96, 255;
|
||||||
|
--ion-color-tertiary-contrast: #ffffff;
|
||||||
|
--ion-color-tertiary-contrast-rgb: 255, 255, 255;
|
||||||
|
--ion-color-tertiary-shade: #4854e0;
|
||||||
|
--ion-color-tertiary-tint: #6370ff;
|
||||||
|
|
||||||
|
/** success **/
|
||||||
|
--ion-color-success: #2dd36f;
|
||||||
|
--ion-color-success-rgb: 45, 211, 111;
|
||||||
|
--ion-color-success-contrast: #ffffff;
|
||||||
|
--ion-color-success-contrast-rgb: 255, 255, 255;
|
||||||
|
--ion-color-success-shade: #28ba62;
|
||||||
|
--ion-color-success-tint: #42d77d;
|
||||||
|
|
||||||
|
/** warning **/
|
||||||
|
--ion-color-warning: #ffc409;
|
||||||
|
--ion-color-warning-rgb: 255, 196, 9;
|
||||||
|
--ion-color-warning-contrast: #000000;
|
||||||
|
--ion-color-warning-contrast-rgb: 0, 0, 0;
|
||||||
|
--ion-color-warning-shade: #e0ac08;
|
||||||
|
--ion-color-warning-tint: #ffca22;
|
||||||
|
|
||||||
|
/** danger **/
|
||||||
|
--ion-color-danger: #eb445a;
|
||||||
|
--ion-color-danger-rgb: 235, 68, 90;
|
||||||
|
--ion-color-danger-contrast: #ffffff;
|
||||||
|
--ion-color-danger-contrast-rgb: 255, 255, 255;
|
||||||
|
--ion-color-danger-shade: #cf3c4f;
|
||||||
|
--ion-color-danger-tint: #ed576b;
|
||||||
|
|
||||||
|
/** dark **/
|
||||||
|
--ion-color-dark: #222428;
|
||||||
|
--ion-color-dark-rgb: 34, 36, 40;
|
||||||
|
--ion-color-dark-contrast: #ffffff;
|
||||||
|
--ion-color-dark-contrast-rgb: 255, 255, 255;
|
||||||
|
--ion-color-dark-shade: #1e2023;
|
||||||
|
--ion-color-dark-tint: #383a3e;
|
||||||
|
|
||||||
|
/** medium **/
|
||||||
|
--ion-color-medium: #92949c;
|
||||||
|
--ion-color-medium-rgb: 146, 148, 156;
|
||||||
|
--ion-color-medium-contrast: #ffffff;
|
||||||
|
--ion-color-medium-contrast-rgb: 255, 255, 255;
|
||||||
|
--ion-color-medium-shade: #808289;
|
||||||
|
--ion-color-medium-tint: #9d9fa6;
|
||||||
|
|
||||||
|
/** light **/
|
||||||
|
--ion-color-light: #f4f5f8;
|
||||||
|
--ion-color-light-rgb: 244, 245, 248;
|
||||||
|
--ion-color-light-contrast: #000000;
|
||||||
|
--ion-color-light-contrast-rgb: 0, 0, 0;
|
||||||
|
--ion-color-light-shade: #d7d8da;
|
||||||
|
--ion-color-light-tint: #f5f6f9;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
/*
|
||||||
|
* Dark Colors
|
||||||
|
* -------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
--ion-color-primary: #428cff;
|
||||||
|
--ion-color-primary-rgb: 66,140,255;
|
||||||
|
--ion-color-primary-contrast: #ffffff;
|
||||||
|
--ion-color-primary-contrast-rgb: 255,255,255;
|
||||||
|
--ion-color-primary-shade: #3a7be0;
|
||||||
|
--ion-color-primary-tint: #5598ff;
|
||||||
|
|
||||||
|
--ion-color-secondary: #50c8ff;
|
||||||
|
--ion-color-secondary-rgb: 80,200,255;
|
||||||
|
--ion-color-secondary-contrast: #ffffff;
|
||||||
|
--ion-color-secondary-contrast-rgb: 255,255,255;
|
||||||
|
--ion-color-secondary-shade: #46b0e0;
|
||||||
|
--ion-color-secondary-tint: #62ceff;
|
||||||
|
|
||||||
|
--ion-color-tertiary: #6a64ff;
|
||||||
|
--ion-color-tertiary-rgb: 106,100,255;
|
||||||
|
--ion-color-tertiary-contrast: #ffffff;
|
||||||
|
--ion-color-tertiary-contrast-rgb: 255,255,255;
|
||||||
|
--ion-color-tertiary-shade: #5d58e0;
|
||||||
|
--ion-color-tertiary-tint: #7974ff;
|
||||||
|
|
||||||
|
--ion-color-success: #2fdf75;
|
||||||
|
--ion-color-success-rgb: 47,223,117;
|
||||||
|
--ion-color-success-contrast: #000000;
|
||||||
|
--ion-color-success-contrast-rgb: 0,0,0;
|
||||||
|
--ion-color-success-shade: #29c467;
|
||||||
|
--ion-color-success-tint: #44e283;
|
||||||
|
|
||||||
|
--ion-color-warning: #ffd534;
|
||||||
|
--ion-color-warning-rgb: 255,213,52;
|
||||||
|
--ion-color-warning-contrast: #000000;
|
||||||
|
--ion-color-warning-contrast-rgb: 0,0,0;
|
||||||
|
--ion-color-warning-shade: #e0bb2e;
|
||||||
|
--ion-color-warning-tint: #ffd948;
|
||||||
|
|
||||||
|
--ion-color-danger: #ff4961;
|
||||||
|
--ion-color-danger-rgb: 255,73,97;
|
||||||
|
--ion-color-danger-contrast: #ffffff;
|
||||||
|
--ion-color-danger-contrast-rgb: 255,255,255;
|
||||||
|
--ion-color-danger-shade: #e04055;
|
||||||
|
--ion-color-danger-tint: #ff5b71;
|
||||||
|
|
||||||
|
--ion-color-dark: #f4f5f8;
|
||||||
|
--ion-color-dark-rgb: 244,245,248;
|
||||||
|
--ion-color-dark-contrast: #000000;
|
||||||
|
--ion-color-dark-contrast-rgb: 0,0,0;
|
||||||
|
--ion-color-dark-shade: #d7d8da;
|
||||||
|
--ion-color-dark-tint: #f5f6f9;
|
||||||
|
|
||||||
|
--ion-color-medium: #989aa2;
|
||||||
|
--ion-color-medium-rgb: 152,154,162;
|
||||||
|
--ion-color-medium-contrast: #000000;
|
||||||
|
--ion-color-medium-contrast-rgb: 0,0,0;
|
||||||
|
--ion-color-medium-shade: #86888f;
|
||||||
|
--ion-color-medium-tint: #a2a4ab;
|
||||||
|
|
||||||
|
--ion-color-light: #222428;
|
||||||
|
--ion-color-light-rgb: 34,36,40;
|
||||||
|
--ion-color-light-contrast: #ffffff;
|
||||||
|
--ion-color-light-contrast-rgb: 255,255,255;
|
||||||
|
--ion-color-light-shade: #1e2023;
|
||||||
|
--ion-color-light-tint: #383a3e;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* iOS Dark Theme
|
||||||
|
* -------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
.ios body {
|
||||||
|
--ion-background-color: #000000;
|
||||||
|
--ion-background-color-rgb: 0,0,0;
|
||||||
|
|
||||||
|
--ion-text-color: #ffffff;
|
||||||
|
--ion-text-color-rgb: 255,255,255;
|
||||||
|
|
||||||
|
--ion-color-step-50: #0d0d0d;
|
||||||
|
--ion-color-step-100: #1a1a1a;
|
||||||
|
--ion-color-step-150: #262626;
|
||||||
|
--ion-color-step-200: #333333;
|
||||||
|
--ion-color-step-250: #404040;
|
||||||
|
--ion-color-step-300: #4d4d4d;
|
||||||
|
--ion-color-step-350: #595959;
|
||||||
|
--ion-color-step-400: #666666;
|
||||||
|
--ion-color-step-450: #737373;
|
||||||
|
--ion-color-step-500: #808080;
|
||||||
|
--ion-color-step-550: #8c8c8c;
|
||||||
|
--ion-color-step-600: #999999;
|
||||||
|
--ion-color-step-650: #a6a6a6;
|
||||||
|
--ion-color-step-700: #b3b3b3;
|
||||||
|
--ion-color-step-750: #bfbfbf;
|
||||||
|
--ion-color-step-800: #cccccc;
|
||||||
|
--ion-color-step-850: #d9d9d9;
|
||||||
|
--ion-color-step-900: #e6e6e6;
|
||||||
|
--ion-color-step-950: #f2f2f2;
|
||||||
|
|
||||||
|
--ion-item-background: #000000;
|
||||||
|
|
||||||
|
--ion-card-background: #1c1c1d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ios ion-modal {
|
||||||
|
--ion-background-color: var(--ion-color-step-100);
|
||||||
|
--ion-toolbar-background: var(--ion-color-step-150);
|
||||||
|
--ion-toolbar-border-color: var(--ion-color-step-250);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Material Design Dark Theme
|
||||||
|
* -------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
.md body {
|
||||||
|
--ion-background-color: #121212;
|
||||||
|
--ion-background-color-rgb: 18,18,18;
|
||||||
|
|
||||||
|
--ion-text-color: #ffffff;
|
||||||
|
--ion-text-color-rgb: 255,255,255;
|
||||||
|
|
||||||
|
--ion-border-color: #222222;
|
||||||
|
|
||||||
|
--ion-color-step-50: #1e1e1e;
|
||||||
|
--ion-color-step-100: #2a2a2a;
|
||||||
|
--ion-color-step-150: #363636;
|
||||||
|
--ion-color-step-200: #414141;
|
||||||
|
--ion-color-step-250: #4d4d4d;
|
||||||
|
--ion-color-step-300: #595959;
|
||||||
|
--ion-color-step-350: #656565;
|
||||||
|
--ion-color-step-400: #717171;
|
||||||
|
--ion-color-step-450: #7d7d7d;
|
||||||
|
--ion-color-step-500: #898989;
|
||||||
|
--ion-color-step-550: #949494;
|
||||||
|
--ion-color-step-600: #a0a0a0;
|
||||||
|
--ion-color-step-650: #acacac;
|
||||||
|
--ion-color-step-700: #b8b8b8;
|
||||||
|
--ion-color-step-750: #c4c4c4;
|
||||||
|
--ion-color-step-800: #d0d0d0;
|
||||||
|
--ion-color-step-850: #dbdbdb;
|
||||||
|
--ion-color-step-900: #e7e7e7;
|
||||||
|
--ion-color-step-950: #f3f3f3;
|
||||||
|
|
||||||
|
--ion-item-background: #1e1e1e;
|
||||||
|
|
||||||
|
--ion-toolbar-background: #1f1f1f;
|
||||||
|
|
||||||
|
--ion-tab-bar-background: #1f1f1f;
|
||||||
|
|
||||||
|
--ion-card-background: #1e1e1e;
|
||||||
|
}
|
||||||
|
}
|
6
src/zone-flags.ts
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
/**
|
||||||
|
* Prevents Angular change detection from
|
||||||
|
* running with certain Web Component callbacks
|
||||||
|
*/
|
||||||
|
// eslint-disable-next-line no-underscore-dangle
|
||||||
|
(window as any).__Zone_disable_customElements = true;
|