Skip to content

Commit 0c2361d

Browse files
authored
Merge pull request #202 from valor-software/development
fix(main): fix expandable card visual, video double click to play
2 parents 7aba50d + f861d82 commit 0c2361d

4 files changed

Lines changed: 40 additions & 37 deletions

File tree

libs/common-docs/src/components/expandable-card/expandable-card.component.html

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
<div class="lg:flex flex-column justify-between gap-4">
22
<div *ngFor="let card of cards; let i = index" class="bg-grey lg:py-10 py-6 px-6 lg:mb-0 mb-4"
33
[style.flex]="card.isExpanded ? '2.5' : '1'" (click)="selectCard(i)">
4-
<div class="lg:flex-auto lg:flex flex-column justify-between align-center h-full items-center"
5-
*ngIf="card.isExpanded">
4+
<div class="lg:flex-auto lg:flex flex-col justify-between align-center h-full items-center" *ngIf="card.isExpanded">
65
<div [@enterBigCard]>
7-
<img [src]="card.imgSource" class="block lg:hidden w-2/4 h-2/4 md:w-1/3 lg:w-2/4 lg:h-2/4 md:h-1/3 m-auto mb-6" alt="slide img">
8-
<h3 [innerHTML]="card.title" class="lg:text-large text-2xl text-light_title_col leading-28 lg:leading-44 mb-8">
9-
</h3>
10-
<ul class="list-disc text-grey_font_col pl-5 ">
11-
<li *ngFor="let item of card.list" class="mb-4 ">{{item}}</li>
12-
</ul>
13-
<button class="flex justify-center lg:justify-between mt-10 w-full lg:w-auto">
14-
<a [routerLink]="['articles']" class="btn-pink flex justify-center w-full">Visit blog <img
15-
src="assets/img/icons/arrow.svg" class="ml-2" alt=""></a>
16-
</button>
17-
</div>
18-
<div class="hidden lg:block max-w-140 lg:max-w-full mb-6 lg:mb-0 h-full">
19-
<img [src]="card.imgSource" class="w-full h-full" alt="slide img">
6+
<div class="flex flex-row items-center">
7+
<div class="flex-col">
8+
<img [src]="card.imgSource"
9+
class="block lg:hidden w-2/4 h-2/4 md:w-1/3 lg:w-2/4 lg:h-2/4 md:h-1/3 m-auto mb-6" alt="slide img">
10+
<h3 [innerHTML]="card.title"
11+
class="lg:text-large text-2xl text-light_title_col leading-28 lg:leading-44 mb-8">
12+
</h3>
13+
<ul class="list-disc text-grey_font_col pl-5 ">
14+
<li *ngFor="let item of card.list" class="mb-4 ">{{item}}</li>
15+
</ul>
16+
<button class="flex justify-center lg:justify-between mt-10 w-full lg:w-auto">
17+
<a [routerLink]="['articles']" class="btn-pink flex justify-center w-full">Visit blog <img
18+
src="assets/img/icons/arrow.svg" class="ml-2" alt=""></a>
19+
</button>
20+
</div>
21+
<div class="hidden lg:block max-w-140 lg:max-w-full mb-6 lg:mb-0 h-full">
22+
<img [src]="card.imgSource" class="w-full h-full" alt="slide img">
23+
</div>
24+
</div>
2025
</div>
2126
</div>
22-
23-
<div class="flex justify-between align-center md:h-full h-106 items-center gap-6"
24-
*ngIf="!card.isExpanded" (click)="selectCard(i)" [@enterSmallCard]>
25-
<div class="max-w-140 md:max-w-full mb-6 md:h-1/2 w-1/2 md:w-1/4 m-auto ">
27+
<div class="flex justify-between align-center md:h-full h-106 items-center gap-6" *ngIf="!card.isExpanded"
28+
(click)="selectCard(i)" [@enterSmallCard]>
29+
<div class="lg:hidden block max-w-140 md:max-w-full mb-6 md:h-1/2 w-1/2 md:w-1/4 m-auto ">
2630
<img [src]="card.imgSource" class="w-full m-auto h-106" alt="slide img">
2731
</div>
2832
<div class="md:h-1/2 ">

libs/route-pages/ashes-page/src/lib/ashes-page.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<ng-container *ngIf="(project$ | async) as project">
1+
<ng-container *ngIf="project">
22
<section class="first-section-half landing-section">
33
<div class="container">
44
<ng-container *ngIf="changeBreadCrumbTitle?.length">
@@ -201,9 +201,9 @@ <h1 class="main-title">Feedback</h1>
201201
</div>
202202
</section>
203203

204-
<div *ngIf="project.video" class="container cursor-pointer" (click)="activateFrame()">
205-
<iframe [src]="getSafeUrl(project.video)" style=" width: 100%; height:80vh;" allowfullscreen
206-
[style.pointer-events]="isFrameActive ? 'auto' : 'none'"></iframe>
204+
<div class="container cursor-pointer">
205+
<iframe [src]="videoUrl" style=" width: 100%; height:80vh;" allowfullscreen
206+
allow="autoplay"></iframe>
207207
</div>
208208

209209
<next-project></next-project>

libs/route-pages/ashes-page/src/lib/ashes-page.component.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { ChangeDetectorRef, Component } from "@angular/core";
1+
import { ChangeDetectorRef, Component, OnInit } from "@angular/core";
22
import { GetPortfolioService, IPortfolio, MappedTechnology, Technologies, titleRefactoring } from "@valor-software/common-docs";
33
import { Observable } from "rxjs";
4-
import { DomSanitizer } from '@angular/platform-browser';
4+
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
55
import { ITechnologiesCard, technologiesAndServices } from '@valor-software/common-docs';
66

77
const ROUTE = 'ashes-of-creation';
@@ -36,15 +36,14 @@ type AshesPortfolio = IPortfolio & {
3636
selector: "ashes-page",
3737
templateUrl: "./ashes-page.component.html"
3838
})
39-
export class AshesPageComponent {
39+
export class AshesPageComponent implements OnInit {
4040
changeBreadCrumbTitle?: { path: string, title: string }[] = [{ path: ROUTE, title: "Ashes of Creation" }];
4141

4242
imageSliderButtonClasses = 'bg-yellow_bg_col color-black';
4343

4444
project$: Observable<AshesPortfolio> = this.getProjectsServ.getPortfolioRequest(ROUTE);
45-
46-
isFrameActive = false;
47-
45+
videoUrl: SafeResourceUrl = '';
46+
project?: AshesPortfolio;
4847
technologiesCard: ITechnologiesCard[] = [
4948
{
5049
smJustify: "between",
@@ -95,6 +94,13 @@ export class AshesPageComponent {
9594
) {
9695
}
9796

97+
ngOnInit(): void {
98+
this.getProjectsServ.getPortfolioRequest(ROUTE).subscribe((project) => {
99+
this.project = project;
100+
this.videoUrl = this.getSafeUrl(this.project?.video);
101+
});
102+
}
103+
98104
getRouteLink(link: string): string {
99105
return titleRefactoring(link);
100106
}
@@ -109,13 +115,6 @@ export class AshesPageComponent {
109115
this.cdr.detectChanges();
110116
}
111117

112-
activateFrame() {
113-
// start from inactive iframe to allow scrolling over iframe
114-
if (!this.isFrameActive) {
115-
this.isFrameActive = true;
116-
}
117-
}
118-
119118
getSafeUrl(url?: string) {
120119
if (!url) {
121120
return '';

libs/route-pages/blog-portfolio/src/article.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
</div>
2222
</section>
2323
<section class="landing-section">
24+
<h1 class="main-title">More Articles</h1>
2425
<div class="container">
25-
<h1 class="main-title double">More Articles</h1>
2626
<blog-preview [currentArticle]="article"></blog-preview>
2727
</div>
2828
</section>

0 commit comments

Comments
 (0)