Skip to content

Commit effd80f

Browse files
committed
feat(press-release): tooltip and hero
1 parent 32db7b6 commit effd80f

4 files changed

Lines changed: 78 additions & 4 deletions

File tree

-4.75 KB
Loading

libs/common-docs/src/services/seo.service.ts

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,44 @@ const ex: { [key: string]: { nameType: 'meta' | 'title', name: string, nameValue
578578
nameValue: 'title',
579579
content: 'Non-profit Organizations - Valor Software'
580580
}
581+
],
582+
'press-release/rs-pack-rust-based-web-bundler': [
583+
{
584+
nameType: 'meta',
585+
name: 'name',
586+
nameValue: 'description',
587+
content: 'The Rust-Based Web Bundler that Combines High Performance with webpack Interoperability'
588+
},
589+
{
590+
nameType: 'meta',
591+
name: 'property',
592+
nameValue: 'og:title',
593+
content: 'Announcing Rspack: A new and high-performance frontend bundler'
594+
},
595+
{
596+
nameType: 'meta',
597+
name: 'property',
598+
nameValue: 'og:description',
599+
content: 'The Rust-Based Web Bundler that Combines High Performance with webpack Interoperability'
600+
},
601+
{
602+
nameType: 'meta',
603+
name: 'property',
604+
nameValue: 'twitter:title',
605+
content: 'Announcing Rspack: A new and high-performance frontend bundler'
606+
},
607+
{
608+
nameType: 'meta',
609+
name: 'property',
610+
nameValue: 'twitter:description',
611+
content: 'The Rust-Based Web Bundler that Combines High Performance with webpack Interoperability'
612+
},
613+
{
614+
nameType: 'title',
615+
name: 'title',
616+
nameValue: 'title',
617+
content: 'Announcing Rspack: A new and high-performance frontend bundler'
618+
}
581619
]
582620
};
583621

@@ -587,7 +625,8 @@ enum routeValues {
587625
services = 'services',
588626
articles = 'articles',
589627
projects = 'projects',
590-
careers = 'careers'
628+
careers = 'careers',
629+
pressRelease = 'press-release',
591630

592631
};
593632

@@ -651,6 +690,14 @@ export class SeoService {
651690
}
652691
}
653692

693+
694+
if (value[0].path === 'press-release') {
695+
const tags = this.metaList[`${value[0].path}/${value[1].path}`];
696+
if (tags?.length) {
697+
this.addTags(tags);
698+
}
699+
}
700+
654701
return '';
655702
}
656703

libs/route-pages/press-release/src/press-release.component.html

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ <h2 class="!text-2xl !mt-9 !mb-5">About Valor Software</h2>
6161
contributors, and created ngx-bootstrap (an Angular component library with over 300 thousand downloads a week).</p>
6262

6363
<h2 class="!text-2xl !mt-9 !mb-5">"First Look" video</h2>
64-
64+
6565
<div class="videoblock">
6666
<div class="content">
6767
<iframe src="https://www.youtube.com/embed/rgLMfSYpn5s"
@@ -77,23 +77,36 @@ <h2 class="!text-2xl !mt-9 !mb-5">Additional Links</h2>
7777

7878
<div class="flex flex-wrap gap-8 lg:gap-0">
7979

80+
81+
8082
<div *ngFor="let link of additionalLinks; let firstLink = first; let lastLink = last"
8183
[class.lg:pr-7]="firstLink"
8284
[class.lg:pl-7]="lastLink"
8385
[class.lg:px-7]="!firstLink && !lastLink"
8486
[class.lg:border-l]="!firstLink"
8587
class="border-[#36363A]">
86-
<a [href]="link.href"
88+
<a (mouseenter)="onAdditionalLinkMouseEnter(link.src)"
89+
(mouseleave)="onAdditionalLinkMouseLeave()"
90+
[href]="link.href"
8791
target="_blank"
8892
rel="noopener noreferrer"
89-
class="flex flex-col items-center justify-center w-16 h-16 bg-[#0D0D0E] rounded">
93+
class="flex flex-col items-center justify-center w-16 h-16 bg-[#0D0D0E] rounded relative">
9094
<img class="!m-0 !h-8 !w-8 !w-auto"
9195
[src]="link.src"
9296
[alt]="link.alt">
97+
98+
99+
<div *ngIf="(activeTooltip$ | async) === link.src"
100+
class="absolute translate-y-[120%] mt-2 bottom-0 bg-light_grey_bg text-header_font_col text-base font-normal py-3 px-6 rounded-lg"> {{ link.alt }}</div>
101+
93102
</a>
103+
104+
105+
94106
</div>
95107

96108

109+
97110
</div>
98111

99112

libs/route-pages/press-release/src/press-release.component.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
import { Component } from "@angular/core";
2+
import { BehaviorSubject } from "rxjs";
23

34
@Component({
45
// eslint-disable-next-line @angular-eslint/component-selector
56
selector: "press-release",
67
templateUrl: "./press-release.component.html",
78
})
89
export class PressReleaseComponent {
10+
11+
private readonly _activeTooltip$ = new BehaviorSubject<string | null>(null);
12+
13+
public readonly activeTooltip$ = this._activeTooltip$.asObservable();
14+
915
public readonly additionalLinks = [
1016
{ src: "assets/press-releases/icons/discord.svg", href: "http://bit.ly/3F2nyOX", alt: "Discord" },
1117
{ src: "assets/press-releases/icons/github.svg", href: "https://github.com/web-infra-dev/rspack", alt: "Github" },
@@ -62,4 +68,12 @@ export class PressReleaseComponent {
6268
href: 'https://valor-software.com/'
6369
}
6470
];
71+
72+
onAdditionalLinkMouseEnter(linkSrc: string): void {
73+
this._activeTooltip$.next(linkSrc);
74+
}
75+
76+
onAdditionalLinkMouseLeave(): void {
77+
this._activeTooltip$.next(null);
78+
}
6579
}

0 commit comments

Comments
 (0)