Initial commit
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>
|
||||
About
|
||||
</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding>
|
||||
|
||||
</ion-content>
|
||||
@@ -1,3 +0,0 @@
|
||||
page-about {
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
selector: 'page-about',
|
||||
templateUrl: 'about.html'
|
||||
})
|
||||
export class AboutPage {
|
||||
|
||||
constructor(public navCtrl: NavController) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
32
src/pages/chat/chat.html
Normal file
32
src/pages/chat/chat.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons left>
|
||||
<button ion-button icon-only (tap)="closeChat($event)">
|
||||
<ion-icon name="arrow-back"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
|
||||
<ion-title><img [src]="this.profile.details.pic.thumb" height="24" width="24"> {{this.profile.details.name}}</ion-title>
|
||||
|
||||
<!--ion-buttons right>
|
||||
<button ion-button icon-only>
|
||||
<ion-icon name="more"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons-->
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
<ion-item class="message-bubble" *ngFor="let message of this.profile.messages" [ngClass]="{ 'user': (message.isUser == true) }">
|
||||
<img *ngIf="message.image" [src]="message.image" (press)="showLightbox($event, message.image)">
|
||||
<p *ngIf="message.text != ''">{{message.text}}</p>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
|
||||
<ion-footer>
|
||||
<ion-toolbar>
|
||||
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
3
src/pages/chat/chat.scss
Normal file
3
src/pages/chat/chat.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
page-chat {
|
||||
|
||||
}
|
||||
28
src/pages/chat/chat.ts
Normal file
28
src/pages/chat/chat.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController, NavParams } from 'ionic-angular';
|
||||
|
||||
import { LightboxPage } from '../lightbox/lightbox';
|
||||
|
||||
@Component({
|
||||
selector: 'page-chat',
|
||||
templateUrl: 'chat.html'
|
||||
})
|
||||
|
||||
export class ChatPage {
|
||||
|
||||
profile: any;
|
||||
|
||||
constructor(public navCtrl: NavController, private navParams: NavParams) {
|
||||
this.profile = navParams.get('profile');
|
||||
}
|
||||
|
||||
closeChat(event) {
|
||||
this.navCtrl.pop();
|
||||
}
|
||||
|
||||
showLightbox(event, image) {
|
||||
this.navCtrl.push(LightboxPage, {
|
||||
image: image
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>
|
||||
Contact
|
||||
</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
<ion-list-header>Follow us on Twitter</ion-list-header>
|
||||
<ion-item>
|
||||
<ion-icon name="ionic" item-start></ion-icon>
|
||||
@ionicframework
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
@@ -1,3 +0,0 @@
|
||||
page-contact {
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
selector: 'page-contact',
|
||||
templateUrl: 'contact.html'
|
||||
})
|
||||
export class ContactPage {
|
||||
|
||||
constructor(public navCtrl: NavController) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
9
src/pages/grid/grid.html
Normal file
9
src/pages/grid/grid.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<ion-content no-padding>
|
||||
<ion-grid no-padding>
|
||||
<ion-row align-items-stretch>
|
||||
<ion-col col-4 *ngFor="let current of profiles" (tap)="profileTapped($event, current)">
|
||||
<img [src]="current.details.pic.thumb">
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-content>
|
||||
7
src/pages/grid/grid.scss
Normal file
7
src/pages/grid/grid.scss
Normal file
@@ -0,0 +1,7 @@
|
||||
page-grid {
|
||||
|
||||
ion-col {
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #000000;
|
||||
}
|
||||
}
|
||||
27
src/pages/grid/grid.ts
Normal file
27
src/pages/grid/grid.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController } from 'ionic-angular';
|
||||
|
||||
import { ProfileService } from '../../services/profiles';
|
||||
import { ProfilePage } from '../profile/profile';
|
||||
|
||||
@Component({
|
||||
selector: 'page-grid',
|
||||
templateUrl: 'grid.html',
|
||||
providers: [ ProfileService ]
|
||||
})
|
||||
export class GridPage {
|
||||
|
||||
profiles: any;
|
||||
|
||||
constructor(public navCtrl: NavController, public profileService: ProfileService) {
|
||||
profileService.load().then((data) => {
|
||||
this.profiles = data;
|
||||
});
|
||||
}
|
||||
|
||||
profileTapped(event, profile) {
|
||||
this.navCtrl.push(ProfilePage, {
|
||||
profile: profile
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Home</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding>
|
||||
<h2>Welcome to Ionic!</h2>
|
||||
<p>
|
||||
This starter project comes with simple tabs-based layout for apps
|
||||
that are going to primarily use a Tabbed UI.
|
||||
</p>
|
||||
<p>
|
||||
Take a look at the <code>src/pages/</code> directory to add or change tabs,
|
||||
update any existing page or create new pages.
|
||||
</p>
|
||||
</ion-content>
|
||||
@@ -1,3 +0,0 @@
|
||||
page-home {
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
selector: 'page-home',
|
||||
templateUrl: 'home.html'
|
||||
})
|
||||
export class HomePage {
|
||||
|
||||
constructor(public navCtrl: NavController) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
13
src/pages/lightbox/lightbox.html
Normal file
13
src/pages/lightbox/lightbox.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons left>
|
||||
<button ion-button icon-only (tap)="close($event)">
|
||||
<ion-icon name="arrow-back"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content (click)="close($event)">
|
||||
<img [src]="this.image">
|
||||
</ion-content>
|
||||
3
src/pages/lightbox/lightbox.scss
Normal file
3
src/pages/lightbox/lightbox.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
page-lightbox {
|
||||
|
||||
}
|
||||
20
src/pages/lightbox/lightbox.ts
Normal file
20
src/pages/lightbox/lightbox.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController, NavParams } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
selector: 'page-lightbox',
|
||||
templateUrl: 'lightbox.html'
|
||||
})
|
||||
|
||||
export class LightboxPage {
|
||||
|
||||
image: string;
|
||||
|
||||
constructor(public navCtrl: NavController, private navParams: NavParams) {
|
||||
this.image = navParams.get('image');
|
||||
}
|
||||
|
||||
close(event) {
|
||||
this.navCtrl.pop();
|
||||
}
|
||||
}
|
||||
37
src/pages/messages/messages.html
Normal file
37
src/pages/messages/messages.html
Normal file
@@ -0,0 +1,37 @@
|
||||
<ion-header no-border>
|
||||
<ion-row>
|
||||
<ion-col text-center>
|
||||
<button ion-button clear small>
|
||||
Messages
|
||||
</button>
|
||||
</ion-col>
|
||||
<ion-col text-center>
|
||||
<button ion-button clear small>
|
||||
Taps
|
||||
</button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-header>
|
||||
|
||||
<ion-content no-padding>
|
||||
<ion-list>
|
||||
<ion-item no-padding *ngFor="let profile of profiles">
|
||||
<ion-thumbnail item-start (tap)="profilePictureTapped($event, profile)">
|
||||
<img [src]="profile.details.pic.thumb">
|
||||
</ion-thumbnail>
|
||||
<ion-grid (tap)="interviewTapped($event, profile)">
|
||||
<ion-row nowrap justify-content-between>
|
||||
<ion-col>
|
||||
{{profile.details.name}}
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
23h ago
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row nowrap>
|
||||
<ion-col [innerHTML]="getLatestMessage(profile.messages)"></ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
3
src/pages/messages/messages.scss
Normal file
3
src/pages/messages/messages.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
page-messages {
|
||||
|
||||
}
|
||||
39
src/pages/messages/messages.ts
Normal file
39
src/pages/messages/messages.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController } from 'ionic-angular';
|
||||
|
||||
import { ProfileService } from '../../services/profiles';
|
||||
import { ProfilePage } from '../profile/profile';
|
||||
import { ChatPage } from '../chat/chat';
|
||||
|
||||
@Component({
|
||||
selector: 'page-messages',
|
||||
templateUrl: 'messages.html',
|
||||
providers: [ ProfileService ]
|
||||
})
|
||||
export class MessagesPage {
|
||||
|
||||
profiles: any;
|
||||
|
||||
constructor(public navCtrl: NavController, public profileService: ProfileService) {
|
||||
profileService.load().then((data) => {
|
||||
this.profiles = data;
|
||||
});
|
||||
}
|
||||
|
||||
getLatestMessage(messages) {
|
||||
var latest = Math.max.apply(Math, messages.map(function(o){ return o.order; }));
|
||||
return messages[latest].text != '' ? messages[latest].text : '<em>Picture</em>';
|
||||
}
|
||||
|
||||
interviewTapped(event, profile) {
|
||||
this.navCtrl.push(ChatPage, {
|
||||
profile: profile
|
||||
});
|
||||
}
|
||||
|
||||
profilePictureTapped(event, profile) {
|
||||
this.navCtrl.push(ProfilePage, {
|
||||
profile: profile
|
||||
});
|
||||
}
|
||||
}
|
||||
77
src/pages/profile/profile.html
Normal file
77
src/pages/profile/profile.html
Normal file
@@ -0,0 +1,77 @@
|
||||
<ion-content no-padding [style.backgroundImage]="getBackground(profile.details.pic)" (tap)="showLightbox($event, profile.details.pic.detail)">
|
||||
<ion-toolbar>
|
||||
<ion-buttons left>
|
||||
<button ion-button icon-only (tap)="closeProfile($event)">
|
||||
<ion-icon name="arrow-back"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
|
||||
<!--ion-buttons right>
|
||||
<button ion-button icon-only>
|
||||
<ion-icon name="cog"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons-->
|
||||
</ion-toolbar>
|
||||
|
||||
<div id="detail-overlay" class="details" swipeAll (swipedown)="closeProfileDetails($event)" (swipeup)="openProfileDetails($event)">
|
||||
<ion-grid>
|
||||
<ion-row nowrap align-items-center justify-content-between>
|
||||
<ion-col col-8>
|
||||
<h2>{{this.profile.details.name}}</h2>
|
||||
</ion-col>
|
||||
<ion-col col-4 class="actions">
|
||||
<button ion-button icon-only clear (tap)="openChat($event, this.profile)">
|
||||
<ion-icon name='ios-chatboxes-outline'></ion-icon>
|
||||
</button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="this.profile.details.about">
|
||||
<ion-col col-12>{{this.profile.details.about}}</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="this.profile.details.height">
|
||||
<ion-col col-4>Height</ion-col>
|
||||
<ion-col col-8>{{this.profile.details.height}}</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="this.profile.details.weight">
|
||||
<ion-col col-4>Weight</ion-col>
|
||||
<ion-col col-8>{{this.profile.details.weight}}</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="this.profile.details.ethnicity">
|
||||
<ion-col col-4>Ethnicity</ion-col>
|
||||
<ion-col col-8>{{this.profile.details.ethnicity}}</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="this.profile.details.body">
|
||||
<ion-col col-4>Body Type</ion-col>
|
||||
<ion-col col-8>{{this.profile.details.body}}</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="this.profile.details.gender">
|
||||
<ion-col col-4>Gender</ion-col>
|
||||
<ion-col col-8>{{this.profile.details.gender}}</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="this.profile.details.pronouns">
|
||||
<ion-col col-4>Pronouns</ion-col>
|
||||
<ion-col col-8>{{this.profile.details.pronouns}}</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="this.profile.details.tribe">
|
||||
<ion-col col-4>Tribes</ion-col>
|
||||
<ion-col col-8>{{this.profile.details.tribe}}</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="this.profile.details.position">
|
||||
<ion-col col-4>Position</ion-col>
|
||||
<ion-col col-8>{{this.profile.details.position}}</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="this.profile.details.looking">
|
||||
<ion-col col-4>I'm Looking For</ion-col>
|
||||
<ion-col col-8>{{this.profile.details.looking}}</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="this.profile.details.status">
|
||||
<ion-col col-4>HIV Status</ion-col>
|
||||
<ion-col col-8>{{this.profile.details.status}}</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="this.profile.details.tested">
|
||||
<ion-col col-4>Last Tested</ion-col>
|
||||
<ion-col col-8>{{this.profile.details.tested}}</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</div>
|
||||
</ion-content>
|
||||
46
src/pages/profile/profile.scss
Normal file
46
src/pages/profile/profile.scss
Normal file
@@ -0,0 +1,46 @@
|
||||
page-profile {
|
||||
|
||||
ion-content {
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
ion-toolbar {
|
||||
|
||||
.toolbar-background {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.bar-button {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.details {
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
bottom: 0;
|
||||
height: 75px;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
transition: all 250ms 125ms ease-in-out;
|
||||
|
||||
h2 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
&.open {
|
||||
height: 100%;
|
||||
padding-top: 35px;
|
||||
}
|
||||
|
||||
.actions {
|
||||
text-align: right;
|
||||
|
||||
.button-clear {
|
||||
color: #fdb315;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
60
src/pages/profile/profile.ts
Normal file
60
src/pages/profile/profile.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { NavController, NavParams } from 'ionic-angular';
|
||||
|
||||
import { ChatPage } from '../chat/chat';
|
||||
import { LightboxPage } from '../lightbox/lightbox';
|
||||
|
||||
@Component({
|
||||
selector: 'page-profile',
|
||||
templateUrl: 'profile.html'
|
||||
})
|
||||
export class ProfilePage {
|
||||
|
||||
detailsOpen: boolean = false;
|
||||
profile: any;
|
||||
|
||||
constructor(public navCtrl: NavController, public navParams: NavParams, private _sanitizer: DomSanitizer) {
|
||||
this.profile = navParams.get('profile');
|
||||
}
|
||||
|
||||
closeProfile(event) {
|
||||
this.navCtrl.pop();
|
||||
}
|
||||
|
||||
closeProfileDetails(event) {
|
||||
if (this.detailsOpen) {
|
||||
this.detailsOpen = false;
|
||||
document.getElementById('detail-overlay').classList.remove('open');
|
||||
}
|
||||
}
|
||||
|
||||
getBackground(pics) {
|
||||
return this._sanitizer.bypassSecurityTrustStyle('url(' + pics.detail + ')');
|
||||
}
|
||||
|
||||
markFavorite(event, profile) {
|
||||
console.debug('favorite profile', { event: event, profile: profile });
|
||||
}
|
||||
|
||||
openChat(event, profile) {
|
||||
this.navCtrl.push(ChatPage, {
|
||||
profile: profile
|
||||
});
|
||||
}
|
||||
|
||||
openProfileDetails(event) {
|
||||
if (!this.detailsOpen) {
|
||||
this.detailsOpen = true;
|
||||
document.getElementById('detail-overlay').classList.add('open');
|
||||
}
|
||||
}
|
||||
|
||||
showLightbox(event, image) {
|
||||
if (event.target.classList.contains('content')) {
|
||||
this.navCtrl.push(LightboxPage, {
|
||||
image: image
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<ion-tabs>
|
||||
<ion-tab [root]="tab1Root" tabTitle="Home" tabIcon="home"></ion-tab>
|
||||
<ion-tab [root]="tab2Root" tabTitle="About" tabIcon="information-circle"></ion-tab>
|
||||
<ion-tab [root]="tab3Root" tabTitle="Contact" tabIcon="contacts"></ion-tab>
|
||||
<ion-tabs selectedIndex="1">
|
||||
<!--ion-tab [root]="tab1Root" tabIcon="star"></ion-tab-->
|
||||
<ion-tab [root]="tab1Root" tabIcon="contacts"></ion-tab>
|
||||
<ion-tab [root]="tab2Root" tabIcon="chatboxes"></ion-tab>
|
||||
</ion-tabs>
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
import { AboutPage } from '../about/about';
|
||||
import { ContactPage } from '../contact/contact';
|
||||
import { HomePage } from '../home/home';
|
||||
import { GridPage } from '../grid/grid';
|
||||
import { MessagesPage } from '../messages/messages';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'tabs.html'
|
||||
})
|
||||
export class TabsPage {
|
||||
|
||||
tab1Root = HomePage;
|
||||
tab2Root = AboutPage;
|
||||
tab3Root = ContactPage;
|
||||
tab1Root = GridPage;
|
||||
tab2Root = MessagesPage;
|
||||
|
||||
constructor() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user