diff --git a/Client/src/app/components/app/app.component.spec.ts b/Client/src/app/components/app/app.component.spec.ts new file mode 100644 index 0000000..5be2cb3 --- /dev/null +++ b/Client/src/app/components/app/app.component.spec.ts @@ -0,0 +1,34 @@ +/* tslint:disable:no-unused-variable */ + +import { TestBed, async } from '@angular/core/testing'; +import { AppComponent } from './app.component'; + +describe('AppComponent', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [ + AppComponent + ], + }); + TestBed.compileComponents(); + }); + + it('should create the app', async(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app).toBeTruthy(); + })); + + it(`should have as title 'app works!'`, async(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app.title).toEqual('app works!'); + })); + + it('should render title in a h1 tag', async(() => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + const compiled = fixture.debugElement.nativeElement; + expect(compiled.querySelector('h1').textContent).toContain('app works!'); + })); +}); diff --git a/Client/src/app/components/app/app.component.ts b/Client/src/app/components/app/app.component.ts new file mode 100644 index 0000000..a927116 --- /dev/null +++ b/Client/src/app/components/app/app.component.ts @@ -0,0 +1,87 @@ +import { GoogleAnalyticsService } from './../../services/google-analytics.service'; +import { Component, Inject, Injectable, HostListener } from '@angular/core'; +import { Router, NavigationEnd, Event } from '@angular/router'; +import { EventService } from '../../services/event.service'; +import { AudioPlayerService } from '../../services/audio-player.service'; +import { BibleVerseService } from '../../services/bible-verse.service'; + + +@Injectable() +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.css'], + providers:[EventService, AudioPlayerService, BibleVerseService] +}) +export class AppComponent { + title = 'app works w!'; + menuOpen: boolean = false; + headerOpacity: number = 0; + fadeHeader: boolean = true; + copyrightYear: number = (new Date()).getUTCFullYear(); + lastRoute: string = ''; + currRoute: string = ''; + lastScrollPos: number = 0; + showAudioPlayer: boolean = false; + + constructor(private router: Router, + private audioPlayerService: AudioPlayerService, + private googleAnalyticsService: GoogleAnalyticsService){ + this.router.events.subscribe((event:Event) => { + if(event instanceof NavigationEnd) { + this.lastRoute = this.currRoute; + this.currRoute = event.urlAfterRedirects; + + + let doc = document.documentElement; + let scrollPos = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0); + + let url = event.urlAfterRedirects; + + if (url === '/home'){ + this.fadeHeader = true; + this.headerOpacity = 0; + } else { + this.fadeHeader = false; + this.headerOpacity = 1; + } + if (this.lastRoute === event.url){ + window.scrollTo(0,this.lastScrollPos); + } else { + window.scrollTo(0, 0); + } + this.lastRoute = event.url; + this.lastScrollPos = scrollPos; + // Google Analytics + googleAnalyticsService.pageView(url.substr(1),url); + } + + }); + } + + mainMenuClick(){ + this.menuOpen = !this.menuOpen; + } + + audioPlayerClosed(): void{ + this.showAudioPlayer = false; + this.audioPlayerService.updateAudioPlayerOpen(this.showAudioPlayer); + } + + audioPlayerStarted(): void{ + this.showAudioPlayer = true; + this.audioPlayerService.updateAudioPlayerOpen(this.showAudioPlayer); + } + + @HostListener('window:scroll', ['$event']) + onScroll(event){ + if (!this.fadeHeader){ + return; + } + //this.scrollElement = event.target.documentElement || event.target.body || window; + let scrollTop = event.target.documentElement.scrollTop || event.target.body.scrollTop || window.pageYOffset; + let allIn = 100; + this.headerOpacity = scrollTop / allIn; + this.headerOpacity = this.headerOpacity > 1 ? 1 : this.headerOpacity; + } +} diff --git a/Client/src/app/components/audio-player/audio-player.component.css b/Client/src/app/components/audio-player/audio-player.component.css new file mode 100644 index 0000000..d1a916c --- /dev/null +++ b/Client/src/app/components/audio-player/audio-player.component.css @@ -0,0 +1,45 @@ +.wrapper{ + text-align: left; +} + +.audio-control-button{ + font-size: 40px; + margin: 10px; + display: table-cell; + vertical-align: middle; +} + +.padding5{ + padding: 5px; +} + +.duration{ + display: table-cell; + vertical-align: middle; +} + +.audio-control-button:hover{ + cursor: pointer; +} + +.audio-control-button-c{ + display: table-cell; + vertical-align: middle; +} + +.slider{ + width: 100%; + max-width: 1000px; + display: table; +} + +.slider-control{ + width: 100%; + display: table-cell; + vertical-align: middle; +} +.text{ + text-align: center; + margin-top: -15px; + padding-bottom: 20px; +} \ No newline at end of file diff --git a/Client/src/app/components/audio-player/audio-player.component.html b/Client/src/app/components/audio-player/audio-player.component.html new file mode 100644 index 0000000..9a0a8c5 --- /dev/null +++ b/Client/src/app/components/audio-player/audio-player.component.html @@ -0,0 +1,28 @@ +
Thank You!
+Your message has been sent.
++ {{ description }} +
+Loading upcoming events...
+Loading Google Map...
+ +Add Event
+Salvation
++ Salvation put simply means being saved from sin, from Satan and from Hell. The truth is that + we are all sinners and we have fallen short. The punishment or wage for our sin is eternal death + and seperation from God. So, how does someone receive salvation? +
+ +God says we won't arrive
+God says the road ends
+God says that we need to turn around
+God says there is only one way
+God says we need to change drivers
++ {{ description }} +
+{{ title }}
+{{ author }} | {{ date |date:'yyyy-MM-dd' }}
+Service Times
++ Join Us every Sunday and Wednesday for challenging messages from the Bible and fellowship with others! + Bring the whole family! +
+
+ Sunday School 10 AM
++ During the Sunday morning service, kids are allowed to separate from the adults to attend a class that is appropriate for thier age group. We have a nursery and Sunday School classes for all age groups. +
+ +Sunday Morning 11 AM
++ Sunday Morning church service immediately follows Sunday School service with a short break in between. Nursery and childrens church is available during the Sunday morning hour. +
+ +Sunday Evening 7 PM
++ Sunday night is the last opportunity to hear a great message before the work week starts. We encourage you to come fellowship with us each sunday night at 7 P.M. Nursery services are available. +
+ +Wednesday Evening 7 PM
++ Join us on Wednesday night for a Bible study that will challenge you in your walk with the Lord. Wednesday evening is a great time to come and hear a great message from the Bible to stay focused during the week. Nursery and childrens church are also available. +
+ +Not forsaking the assembling of ourselves together, as the manner of some is; but exhorting one another: and so much the more, as ye see the day approaching.
+Hebrews 10:25
+Upcoming Events
+Loading...
+Who We Are
+
+ What to expect
+
+ Sometimes it can be difficult to attend if you are not familiar with church and don't know what to expect.
+ One thing you can always expect is to be welcomed at Old Fashion Baptist. We count it a privalege to have
+ visitors attend our church services so the first thing you will find is a friendly church family.
+
+ Each service begins with a few songs along with prayer. Prayer and praise are a great way to help prepare
+ our hearts for the message that follows. You can expect the message to last aproximately 45 - 60
+ minutes and will be straight from the Bible. We want you to know that the message is from the Bible and will
+ turn to verses throughout the service. You are welcome to just listen or follow along in your Bible.
+
Nursery
++ Nursery workers are available for every service. Our nursery is available so that you can attend the church service + without interruption. +
+ +Kids
++ We also offer Sunday School classes for all age groups of kids. This is a great opportunity for + children to recieve a message that is appropriate for their age. +
+ +Jesus
+
+ Jesus, God who became flesh and dwelt among us by being born of the virgin Mary is our only hope for eternal life.
+ Because of the sin and wickedness of mankind a wage was earned - that wage is death. Out of His great love
+ for us God sent his only begotten Son who lived on this earth as a man who "was in all points tempted like as we are, yet without sin" Hebrews 4:15.
+
+ He was sinless - He layed down His life and became the sacrifice for all! Have you accepted Him?
+
The Bible
+
+ In the beginning was the Word, and the Word was with God, and the Word was God. John 1:1
+
+ All scripture is given by inspiration of God, and is profitable for doctrine, for reproof, for correction, for instruction in righteousness:
+ That the man of God may be perfect, thoroughly furnished unto all good works. 2 Timothy 3:16 - 17
+
+ But he answered and said, It is written, Man shall not live by bread alone, but by every word that proceedeth out of the mouth of God. Matthew 4:4
+
+ The words of the LORD are pure words: as silver tried in a furnace of earth, purified seven times.
+ Thou shalt keep them, O LORD, thou shalt preserve them from this generation for ever. Psalm 12:6 - 7
+
+ Heaven and earth shall pass away, but my words shall not pass away. Matthew 24:35
+
+