Skip to content

Commit

Permalink
iOS fixes (#68)
Browse files Browse the repository at this point in the history
* deeper light

* fix home

* more readable date and venue
  • Loading branch information
ryzizub authored Oct 4, 2019
1 parent 28a5b9d commit f8a7425
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<mat-sidenav-container [ngClass]="(currentRoute == '/' || currentRoute == '/home')? 'people-back': 'base-back'" class="main-holder people-back">
<mat-sidenav-container class="main-holder people-back">
<header class="navigation mat-elevation-z3">
<app-navigation (homeClicked)="sidenav.toggle()"></app-navigation>
</header>
Expand Down
47 changes: 38 additions & 9 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,61 @@
.main-holder {
min-height: 100%;
min-width: 100%;
background-color: $devfest-blue;
}

.people-back{
background-color: $devfest-blue;
background-position: top;
background-size: 100% 100vh;
background-repeat: no-repeat;
}

.people-back{
background-image: linear-gradient(to bottom, $devfest-blue-light, $devfest-blue),
url(../assets/background_image.jpg);
}

.base-back{
background-image: linear-gradient(to , $devfest-blue-light, $devfest-blue),
url(../assets/background_image.jpg);

@media (max-width: 1480px) {

.main-holder {
background-size: 170vw 100vh; /* Force the image to its minimum width */
}

}

@media (max-width: 1180px) {

@media (max-width: 1480px) {
.main-holder {
background-size: 200vw 100vh; /* Force the image to its minimum width */
}

}

@media (max-width: 880px) {

.main-holder {
background-size: 220vw 100vh; /* Force the image to its minimum width */
}

}


@media (max-width: 680px) {

.main-holder {
background-size: auto 100vh; /* Force the image to its minimum width */
background-size: 250vw 100vh; /* Force the image to its minimum width */
}

}


@media (max-width: 480px) {

.main-holder {
background-size: 300vw 100vh; /* Force the image to its minimum width */
}

}


.navigation {
z-index: 10;
position: fixed;
Expand Down
1 change: 0 additions & 1 deletion src/app/components/tickets/tickets.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export class TicketsComponent implements OnInit {
return titoTic.length > 0 ? { publicName: tic.publicName, ...titoTic[0] } : null;
});
group.url = url;
console.log(group);
return group;
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="logo-date-holder">
<img alt="Devfest logo" src="assets/devfest-logo.svg" />
<img alt="Devfest date" src="assets/devfest-date.svg" />
<img style="width:50%" alt="Devfest venue" src="assets/devfest-venue.svg" />
<img style="width:60%" alt="Devfest venue" src="assets/devfest-venue.svg" />
</div>
<div class="register-button">
<a class="info-button" href="home#tickets" color="primary" mat-flat-button>
Expand Down
1 change: 1 addition & 0 deletions src/app/pages/home/home.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@

.logo-date-holder {
max-width: 650px;
width: 100%;
}

}
Expand Down
45 changes: 28 additions & 17 deletions src/app/shared/directives/lazy.directive.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,50 @@
import { Directive, AfterViewInit, Output, EventEmitter, ElementRef } from '@angular/core';
import {
Directive,
AfterViewInit,
Output,
EventEmitter,
ElementRef,
} from '@angular/core';

@Directive({
selector: '[lazyLoad]'
selector: '[lazyLoad]',
})
export class LazyDirective implements AfterViewInit {

@Output() public lazyLoad: EventEmitter<any> = new EventEmitter();

private _intersectionObserver?: IntersectionObserver;

constructor(
private _element: ElementRef
) {
}
constructor(private _element: ElementRef) {}

public ngAfterViewInit() {
this._intersectionObserver = new IntersectionObserver(entries => {
this.checkForIntersection(entries);
}, {});
this._intersectionObserver.observe((this._element.nativeElement) as Element);
try {
this._intersectionObserver = new IntersectionObserver(entries => {
this.checkForIntersection(entries);
}, {});
this._intersectionObserver.observe(this._element
.nativeElement as Element);
} catch (e) {
this.lazyLoad.emit();
}
}

private checkForIntersection = (entries: Array<IntersectionObserverEntry>) => {
private checkForIntersection = (
entries: Array<IntersectionObserverEntry>
) => {
entries.forEach((entry: IntersectionObserverEntry) => {
if (this.checkIfIntersecting(entry)) {
this.lazyLoad.emit();
this._intersectionObserver.unobserve((this._element.nativeElement) as Element);
this._intersectionObserver.unobserve(this._element
.nativeElement as Element);
this._intersectionObserver.disconnect();
}
});
}
};

private checkIfIntersecting(entry: IntersectionObserverEntry) {
return (entry as any).isIntersecting && entry.target === this._element.nativeElement;
return (
(entry as any).isIntersecting &&
entry.target === this._element.nativeElement
);
}


}
6 changes: 3 additions & 3 deletions src/assets/devfest-date.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/assets/devfest-venue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/colors.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$devfest-blue: rgba(18, 42, 66, 1);
$devfest-blue-light: rgba(15, 35, 55, .43);
$devfest-blue-light: rgba(15, 35, 55, .63);

0 comments on commit f8a7425

Please sign in to comment.