diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..cfe2ca41c4bbde3073d23eaa32fcf54a8bfb59ef --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 yana.help + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 6dc1f2843292b711eafb41c640116a12da20bb57..9e6d7ce7c223fb35640bb35370d1092a1cbd9613 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -58,6 +58,8 @@ import { ResetpasswordComponent } from './resetpassword/resetpassword.component' import { ThankyouComponent } from './thankyou/thankyou.component'; import { ClickOutsideDirective } from './directives/click-outside.directive'; import { EuropeanDatePipe } from './community/european-date.pipe'; +import { CantonboxComponent } from './sub-components/cantonbox/cantonbox.component'; +import { EmergencyBoxComponent } from './sub-components/emergency-box/emergency-box.component'; @NgModule({ @@ -76,7 +78,9 @@ import { EuropeanDatePipe } from './community/european-date.pipe'; ClickOutsideDirective, ResetpasswordComponent, ThankyouComponent, - EuropeanDatePipe + EuropeanDatePipe, + CantonboxComponent, + EmergencyBoxComponent, ], imports: [ BrowserModule, diff --git a/src/app/getting-started/getting-started.component.css b/src/app/getting-started/getting-started.component.css index 3bdb06d8c44d1413c1e3b258bce409da91dfe4ee..b767b6c18fdbe1416dddd0ca851ca066f0219b1d 100644 --- a/src/app/getting-started/getting-started.component.css +++ b/src/app/getting-started/getting-started.component.css @@ -1,10 +1,10 @@ #background{ position: relative; height: 100vh; - width: -webkit-fill-available; background: #8C93D8; padding: 0 6%; - overflow: hidden; + overflow-x: hidden; + overflow-y: auto; } .overflow{ @@ -12,8 +12,6 @@ right: 0%; top: 0; width: 50%; - height: 110vh; - overflow: hidden; pointer-events: none; } @@ -95,11 +93,11 @@ position: relative; padding: 2%; - margin: 5% 0; + margin: 3% 0; border: 4px solid #FF9848; box-sizing: border-box; - border-radius: 28.9474px; + border-radius: 29px; font-family: 'Montserrat', sans-serif; font-style: normal; @@ -111,7 +109,7 @@ color: #FFFAE7; } -.emergency span{ +.emergency a{ color: #FF9848; font-size: 1.25vw; } @@ -267,88 +265,4 @@ .selected > p{ color: #FFFFFF; -} - - - - -/*auto-suggest form*/ - - -.filter-wrapper, -.keyword-wrapper { - display: flex; - justify-content: center; -} -.filter-wrapper { - min-height: 100%; - flex-flow: column wrap; - position: relative; -} -.keyword-wrapper { - width: 100%; - position: relative; -} -#keyword { - border: 1px solid #ccc; - box-sizing: border-box; - border-radius: 30px; - padding: .5vw; - font-family: 'Montserrat', sans-serif; - font-style: normal; - font-weight: normal; - font-size: 1.25vw; - text-align: center; - width: 50%; - outline: none; - transition: border 0.5s ease-in-out -} -#keyword:focus { - border-color : rgba(81, 203, 238, 1);; -} - -.filter-select { - width: 50%; - margin-top: 1%; - font-family: 'Montserrat', sans-serif; - font-style: normal; - font-weight: normal; - font-size: 1.25vw; - text-align: center; - font-size: 1.1em; - color: rgb(105, 105, 105); - border: 1px solid #ccc; - box-sizing: border-box; - border-radius: 50; - - position: absolute; - z-index: 99; - left: 25%; - top: calc(50% + 25px); - max-height: 400%; - overflow-y: auto; - background: #fff; - padding-inline-start: 0px; - } - - - .filter-select-list:hover .tags { - color: #fff; - } - .filter-select-list { - cursor: pointer; - padding: 10px 10px; - } - .artist-name { - display: inline-block; - position: absolute; - } - .filter-select-list:hover { - background: #C0C0C0; - color: #fff - } - .list-highlight, - .list-highlight:hover { - background: rgb(55, 55, 55); - color: #fff - } +} \ No newline at end of file diff --git a/src/app/getting-started/getting-started.component.html b/src/app/getting-started/getting-started.component.html index 858d0bf5e606b7357603d623893e1784bb3ee31e..6ef327b5352919d7137a6fce0419e71b99423831 100644 --- a/src/app/getting-started/getting-started.component.html +++ b/src/app/getting-started/getting-started.component.html @@ -5,7 +5,7 @@

You Are Not Alone

Welcome to the safe place ! Here you can find help and useful information. Come and join the community !

-
Are you in an emergency ? Call 147 or find help near you
+
Are you in an emergency ? Call 147 or find help near you

Find help

@@ -17,15 +17,7 @@
-
-
- -
- -
+
@@ -36,7 +28,7 @@
-
+

Get Started

diff --git a/src/app/getting-started/getting-started.component.ts b/src/app/getting-started/getting-started.component.ts index 617ecfc44cfb09f5e56a105ff69170d09a762741..e4a246e054c7c89142417e67cdfb9e5a5bb1d19b 100644 --- a/src/app/getting-started/getting-started.component.ts +++ b/src/app/getting-started/getting-started.component.ts @@ -1,8 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { LangService } from '../services/lang.service'; -import { FormControl } from '@angular/forms'; -import * as sampleData from '../../assets/maps/cantons.json'; @Component({ selector: 'app-getting-started', @@ -15,11 +13,7 @@ export class GettingStartedComponent implements OnInit { translate: TranslateService; langSelector: any = null; ageSelector: any = null; - cantonSelector: String = null; - queryField: FormControl = new FormControl(); - show: boolean = false; - results: any[] = []; - cantons: String[] = (sampleData as any).default; + cantonSelector: string = null; constructor(public lang: LangService) { this.translate = lang.getTranslateService(); @@ -41,30 +35,13 @@ export class GettingStartedComponent implements OnInit { } } - suggest(data : string){ - var newArr = this.cantons.filter(canton => canton.toLowerCase().includes(data.toLowerCase())); - console.log(newArr); - return newArr; - } - - send(){ - console.log(this.queryField.value + " waw"); - if(this.queryField.value == null){ - this.results = this.cantons; - this.show = true; - console.log("sent"); - } - } - - change(result){ - this.cantonSelector = result; - this.queryField.setValue(result); - this.show = false; + receiveCanton($event) { + console.log($event) + this.cantonSelector = $event } ngOnInit(): void { - this.queryField.valueChanges - .subscribe(query => this.results = this.suggest(query)); + } } diff --git a/src/app/maps/maps.component.css b/src/app/maps/maps.component.css index 5151363a6eb1fd826a9ecff68f9b1f543e7a5454..fc50022e2c74bcd0255f6fb822d2b9f7e2a95eb8 100644 --- a/src/app/maps/maps.component.css +++ b/src/app/maps/maps.component.css @@ -9,8 +9,10 @@ align-content: center; padding: 0 3%; justify-content: center; + background-color: #FFFAE7; + overflow-y: auto; } - +/* .select-container, .details-container { display: flex; max-width: calc(100vw - 26rem); @@ -20,6 +22,10 @@ padding: .5em 0; overflow-x: hidden; margin: 0 auto; +}*/ + +app-cantonbox{ + margin: 2em; } .map-container { @@ -29,8 +35,10 @@ } .details-container { - overflow-y: scroll; - overflow-x: hidden; + /*overflow-y: scroll; + overflow-x: hidden;*/ + display: flex; + flex-direction: column; } .custom-select { @@ -49,30 +57,60 @@ agm-map { background-color: lightblue; } -.description { - width: 100%; - background-color: lightgreen +.content-box{ + margin: 2vh 0; + display: flex; + flex-direction: column; } .content-header { - background-color: lightcoral; - padding: 10px; align-items: middle; font-size: 18pt; + margin-top: 2em; +} + +.line1{ + margin-top: 1em; + height: 0px; + border: 1px solid #BEBEBE; } .content-grid { - display: grid; - grid-template-columns: repeat(3, 1fr); - background-color: whitesmoke; + display: flex; + flex-direction: row; + flex-wrap: wrap; + /*flex-direction: column;*/ +} + +.bubble { + text-decoration: none; + box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4); + border-radius: 65px; + display: flex; + flex-direction: column; + width: 30vw; + margin-top: 2em; + margin-right: 2em; /*for flex row with wrap*/ + padding: 2em; + background-color: white; + /* text-align: start; */ } -.content-grid > * { - padding: 5px; - border-radius: 5px; - border: 1px solid lightslategray; +.bubble > p { } -.content-grid > * > p { - word-wrap: break-word; +.bubble-content{ + margin: 0 1em; } + +.info { + margin: 1em 0; +} + +#title{ + font-weight: bold; + font-size: x-large; + color: #FC5C14; + margin: 1em 0; +} + diff --git a/src/app/maps/maps.component.html b/src/app/maps/maps.component.html index c4469a227bc32923632456fed14ba9508a3945fe..9f59c7f4f70ab429663c06a602c4f1f9d8c7090a 100644 --- a/src/app/maps/maps.component.html +++ b/src/app/maps/maps.component.html @@ -1,14 +1,16 @@
+
- +
+ + diff --git a/src/app/sub-components/cantonbox/cantonbox.component.spec.ts b/src/app/sub-components/cantonbox/cantonbox.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..8ba026c10d4e96eea7a9b49dff3af856e6d138e5 --- /dev/null +++ b/src/app/sub-components/cantonbox/cantonbox.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CantonboxComponent } from './cantonbox.component'; + +describe('CantonboxComponent', () => { + let component: CantonboxComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CantonboxComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CantonboxComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/sub-components/cantonbox/cantonbox.component.ts b/src/app/sub-components/cantonbox/cantonbox.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..35b071eb7fcb21952f007098c3341aa5b4e40014 --- /dev/null +++ b/src/app/sub-components/cantonbox/cantonbox.component.ts @@ -0,0 +1,48 @@ +import { Component, OnInit, Output, EventEmitter } from '@angular/core'; +import { FormControl } from '@angular/forms'; +import { FirebaseDataService } from '../../services/firebase-data.service'; + + +@Component({ + selector: 'app-cantonbox', + templateUrl: './cantonbox.component.html', + styleUrls: ['./cantonbox.component.css'] +}) +export class CantonboxComponent implements OnInit { + + cantonSelector: string = null; + queryField: FormControl = new FormControl(); + show: boolean = false; + results: any[] = []; + cantons: String[] =this.firebaseDB.getCantons(); + + @Output() messageEvent = new EventEmitter(); + + constructor(private firebaseDB: FirebaseDataService) { } + + suggest(data : string){ + var newArr = this.cantons.filter(canton => canton.toLowerCase().includes(data.toLowerCase())); + return newArr; + } + + change(result){ + this.cantonSelector = result; + this.queryField.setValue(result); + this.show = false; + this.messageEvent.emit(this.cantonSelector) + } + + /*checks if empty and shows all cantons in that case*/ + send(){ + if(this.queryField.value == null){ + this.results = this.cantons; + this.show = true; + } + } + + ngOnInit(): void { + this.queryField.valueChanges + .subscribe(query => this.results = this.suggest(query)); + } + +} diff --git a/src/app/sub-components/emergency-box/emergency-box.component.css b/src/app/sub-components/emergency-box/emergency-box.component.css new file mode 100644 index 0000000000000000000000000000000000000000..9c79eb0914c2eda6f5df1009f6348001d089e959 --- /dev/null +++ b/src/app/sub-components/emergency-box/emergency-box.component.css @@ -0,0 +1,33 @@ +div { + position: relative; + + padding: 1%; + margin-bottom: 5%; + margin-top: 2%; + + border: .2vw solid #FF9848; + box-sizing: border-box; + border-radius: 10vw; + + font-family: 'Montserrat', sans-serif; + font-style: normal; + font-weight: normal; + font-size: 1vw; + align-items: center; + text-align: center; + + color: #FF9848; +} + +div > a{ + color: #FF9848; + font-size: 1vw; +} + +#number{ + font-weight: bold; +} + +#maplink{ + text-decoration: underline; +} \ No newline at end of file diff --git a/src/app/sub-components/emergency-box/emergency-box.component.html b/src/app/sub-components/emergency-box/emergency-box.component.html new file mode 100644 index 0000000000000000000000000000000000000000..319963c58c7ccabc162bf490489b06c0395d7388 --- /dev/null +++ b/src/app/sub-components/emergency-box/emergency-box.component.html @@ -0,0 +1 @@ +
Are you in an emergency ? Call 147 or find help near you
diff --git a/src/app/sub-components/emergency-box/emergency-box.component.spec.ts b/src/app/sub-components/emergency-box/emergency-box.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..53edf0b583d4d935df33f5b4ae4a089ffcf4707e --- /dev/null +++ b/src/app/sub-components/emergency-box/emergency-box.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EmergencyBoxComponent } from './emergency-box.component'; + +describe('EmergencyBoxComponent', () => { + let component: EmergencyBoxComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EmergencyBoxComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EmergencyBoxComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/sub-components/emergency-box/emergency-box.component.ts b/src/app/sub-components/emergency-box/emergency-box.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..eaa392e04ad41d4f88205c4f83538aa0ac70fbe3 --- /dev/null +++ b/src/app/sub-components/emergency-box/emergency-box.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-emergency-box', + templateUrl: './emergency-box.component.html', + styleUrls: ['./emergency-box.component.css'] +}) +export class EmergencyBoxComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +}