@@ -41,6 +41,10 @@ const routes: Routes = [ | |||||
{ | { | ||||
path: 'chat', | path: 'chat', | ||||
loadChildren: () => import('./chat/chat.module').then( m => m.ChatPageModule) | loadChildren: () => import('./chat/chat.module').then( m => m.ChatPageModule) | ||||
}, | |||||
{ | |||||
path: 'collections', | |||||
loadChildren: () => import('./collections/collections.module').then( m => m.CollectionsPageModule) | |||||
} | } | ||||
]; | ]; | ||||
@NgModule({ | @NgModule({ | ||||
@@ -0,0 +1,17 @@ | |||||
import { NgModule } from '@angular/core'; | |||||
import { Routes, RouterModule } from '@angular/router'; | |||||
import { CollectionsPage } from './collections.page'; | |||||
const routes: Routes = [ | |||||
{ | |||||
path: '', | |||||
component: CollectionsPage | |||||
} | |||||
]; | |||||
@NgModule({ | |||||
imports: [RouterModule.forChild(routes)], | |||||
exports: [RouterModule], | |||||
}) | |||||
export class CollectionsPageRoutingModule {} |
@@ -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 { CollectionsPageRoutingModule } from './collections-routing.module'; | |||||
import { CollectionsPage } from './collections.page'; | |||||
@NgModule({ | |||||
imports: [ | |||||
CommonModule, | |||||
FormsModule, | |||||
IonicModule, | |||||
CollectionsPageRoutingModule | |||||
], | |||||
declarations: [CollectionsPage] | |||||
}) | |||||
export class CollectionsPageModule {} |
@@ -0,0 +1,23 @@ | |||||
<ion-content> | |||||
<section class="collections"> | |||||
<img class="glass-box" src="assets/collections/glassbox.png" alt=""> | |||||
<ion-slides [options]="slideOpts"> | |||||
<ion-slide *ngFor="let collection of collections"> | |||||
<img [ngClass]="{'bat' : collection.type === 'BAT' || collection.type === 'INVERTED BAT', | |||||
'ball' : collection.type === 'BALL', | |||||
'inverted' : collection.type === 'INVERTED BAT' }" | |||||
[src]="collection.image"> | |||||
<header class="box-heading"> | |||||
<h5> {{ collection.name }} </h5> | |||||
<p> {{ collection.details }} </p> | |||||
</header> | |||||
</ion-slide> | |||||
</ion-slides> | |||||
</section> | |||||
</ion-content> |
@@ -0,0 +1,92 @@ | |||||
.collections { | |||||
height: calc(100vh - 56px); | |||||
background-image: url('../../assets/collections/museum_background.png'); | |||||
background-position: center; | |||||
background-size: 100% 100%; | |||||
} | |||||
.glass-box { | |||||
width: 55vw; | |||||
height: 40vh; | |||||
position: fixed; | |||||
left: calc(50vw - (55vw / 2)); | |||||
bottom: 36vh; | |||||
} | |||||
ion-slides { | |||||
width: 100%; | |||||
height: calc(100vh - 56px); | |||||
ion-slide { | |||||
height: 100%; | |||||
display: block; | |||||
position: relative; | |||||
width: 100%; | |||||
opacity: 0; | |||||
&.swiper-slide-active { | |||||
animation: fadeUp 0.5s forwards; | |||||
animation-delay: 0.2s; | |||||
} | |||||
} | |||||
@keyframes fadeUp { | |||||
0% { | |||||
opacity: 0; | |||||
transform: translateY(10px); | |||||
} | |||||
100% { | |||||
opacity: 1; | |||||
transform: translateY(0vh); | |||||
} | |||||
} | |||||
.box-heading { | |||||
position: absolute; | |||||
left: 25vw; | |||||
width: 50vw; | |||||
background-color: rgba(white, 0.1); | |||||
border-radius: 7px; | |||||
overflow: hidden; | |||||
padding: 15px; | |||||
top: 58vh; | |||||
h5 { | |||||
margin: 0; | |||||
font-size: 1rem; | |||||
font-weight: 500; | |||||
color: rgb(63, 63, 63); | |||||
} | |||||
p { | |||||
margin: 0; | |||||
font-size: 0.8rem; | |||||
line-height: 1.5; | |||||
color: rgb(93, 93, 93); | |||||
} | |||||
} | |||||
img { | |||||
position: absolute; | |||||
left: 40vw; | |||||
bottom: 49.7vh; | |||||
object-fit: contain; | |||||
object-position: bottom; | |||||
&.bat { | |||||
width: 20.5vw; | |||||
height: 20.5vh; | |||||
&.inverted { | |||||
left: 42vw; | |||||
} | |||||
} | |||||
&.ball { | |||||
width: 10vw; | |||||
height: 10vh; | |||||
left: 45vw; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,24 @@ | |||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
import { IonicModule } from '@ionic/angular'; | |||||
import { CollectionsPage } from './collections.page'; | |||||
describe('CollectionsPage', () => { | |||||
let component: CollectionsPage; | |||||
let fixture: ComponentFixture<CollectionsPage>; | |||||
beforeEach(async(() => { | |||||
TestBed.configureTestingModule({ | |||||
declarations: [ CollectionsPage ], | |||||
imports: [IonicModule.forRoot()] | |||||
}).compileComponents(); | |||||
fixture = TestBed.createComponent(CollectionsPage); | |||||
component = fixture.componentInstance; | |||||
fixture.detectChanges(); | |||||
})); | |||||
it('should create', () => { | |||||
expect(component).toBeTruthy(); | |||||
}); | |||||
}); |
@@ -0,0 +1,48 @@ | |||||
import { Component, OnInit } from '@angular/core'; | |||||
@Component({ | |||||
selector: 'app-collections', | |||||
templateUrl: './collections.page.html', | |||||
styleUrls: ['./collections.page.scss'], | |||||
}) | |||||
export class CollectionsPage implements OnInit { | |||||
slideOpts = { | |||||
slidesPerView: 1, | |||||
spaceBetween: 0, | |||||
initialSlide: 0, | |||||
centeredSlides: true, | |||||
simulateTouch: false, | |||||
followFinger: false, | |||||
loop: true, | |||||
}; | |||||
collections: Array<{ | |||||
name: string, | |||||
details: string, | |||||
image: string, | |||||
type: 'BAT' | 'BALL' | 'INVERTED BAT' | |||||
}> | |||||
constructor() { } | |||||
ngOnInit() { | |||||
this.collections = [{ | |||||
name: 'Wooden Bat', | |||||
details: 'Signed by Sehwag', | |||||
image: 'assets/collections/bat.png', | |||||
type: 'BAT' | |||||
}, { | |||||
name: 'Leather Ball', | |||||
details: 'Signed by Sehwag', | |||||
image: 'assets/collections/ball.png', | |||||
type: 'BALL' | |||||
}, { | |||||
name: 'Golden Bat', | |||||
details: 'Oracle of IPL award', | |||||
image: 'assets/collections/golden-bat.png', | |||||
type: 'INVERTED BAT' | |||||
}]; | |||||
} | |||||
} |
@@ -19,13 +19,13 @@ const routes: Routes = [ | |||||
path: 'more', | path: 'more', | ||||
loadChildren: () => import('../more/more.module').then(m => m.MorePageModule) | loadChildren: () => import('../more/more.module').then(m => m.MorePageModule) | ||||
}, | }, | ||||
{ | |||||
path: 'player-stats', | |||||
loadChildren: () => import('../player-stats/player-stats.module').then( m => m.PlayerStatsPageModule) | |||||
}, | |||||
{ | { | ||||
path: 'booking', | path: 'booking', | ||||
loadChildren: () => import('../booking/booking.module').then( m => m.BookingPageModule) | loadChildren: () => import('../booking/booking.module').then( m => m.BookingPageModule) | ||||
}, | |||||
{ | |||||
path: 'collections', | |||||
loadChildren: () => import('../collections/collections.module').then( m => m.CollectionsPageModule) | |||||
} | } | ||||
] | ] | ||||
}, | }, | ||||
@@ -15,5 +15,11 @@ | |||||
<ion-icon name="ticket-outline"></ion-icon> | <ion-icon name="ticket-outline"></ion-icon> | ||||
<ion-icon name="ticket"></ion-icon> | <ion-icon name="ticket"></ion-icon> | ||||
</ion-tab-button> | </ion-tab-button> | ||||
<ion-tab-button tab="collections"> | |||||
<ion-icon name="trophy-outline"></ion-icon> | |||||
<ion-icon name="trophy"></ion-icon> | |||||
</ion-tab-button> | |||||
</ion-tab-bar> | </ion-tab-bar> | ||||
</ion-tabs> | </ion-tabs> |