Skip to content

Commit e701672

Browse files
JeanMecheAndrewKushnir
authored andcommitted
docs: uwu (angular#55666)
PR Close angular#55666
1 parent 1296393 commit e701672

File tree

8 files changed

+97
-54
lines changed

8 files changed

+97
-54
lines changed

adev/src/app/app.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@defer (when isBrowser) {
2-
<adev-progress-bar />
2+
<adev-progress-bar />
33
}
44
<button (click)="focusFirstHeading()" class="adev-skip">Skip to main content</button>
55

66
<div class="adev-nav"></div>
77
@if (displaySecondaryNav()) {
8-
<adev-secondary-navigation />
8+
<adev-secondary-navigation />
99
}
1010
<div class="docs-app-main-content">
1111
<!--
@@ -22,9 +22,9 @@
2222
}
2323
}
2424
}
25-
<router-outlet />
25+
<router-outlet />
2626

2727
@if (displayFooter()) {
28-
<footer adev-footer></footer>
28+
<footer adev-footer></footer>
2929
}
3030
</div>

adev/src/app/core/layout/navigation/navigation.component.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@
8282
>
8383
<a aria-label="Angular homepage" routerLink="/">
8484
<!-- Logo Symbol -->
85-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 223 236" width="32">
85+
@if(!isUwu) {
86+
<svg class="angular-logo" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 223 236" width="32">
8687
<g clip-path="url(#a)">
8788
<path
8889
fill="url(#b)"
@@ -125,6 +126,14 @@
125126
</clipPath>
126127
</defs>
127128
</svg>
129+
} @else {
130+
<img
131+
src="assets/images/uwu.png"
132+
style="width: auto; margin: 0"
133+
class="uwu-logo"
134+
alt="Angular logo"
135+
height="34"/>
136+
}
128137
</a>
129138

130139
<!-- Version picker for v18+ -->

adev/src/app/core/layout/navigation/navigation.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@
251251
}
252252
}
253253

254+
.adev-nav-item--logo a {
255+
height: 34px;
256+
}
257+
254258
.adev-close-nav {
255259
display: none;
256260
@include mq.for-phone-only {

adev/src/app/core/layout/navigation/navigation.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
isApple,
2828
IS_SEARCH_DIALOG_OPEN,
2929
} from '@angular/docs';
30-
import {NavigationEnd, Router, RouterLink} from '@angular/router';
30+
import {ActivatedRoute, NavigationEnd, Router, RouterLink} from '@angular/router';
3131
import {filter, map, startWith} from 'rxjs/operators';
3232
import {DOCS_ROUTES, REFERENCE_ROUTES, TUTORIALS_ROUTES} from '../../../routes';
3333
import {GITHUB, MEDIUM, X, YOUTUBE} from '../../constants/links';
@@ -83,6 +83,9 @@ export class Navigation implements OnInit {
8383
readonly PRIMARY_NAV_ID = PRIMARY_NAV_ID;
8484
readonly SECONDARY_NAV_ID = SECONDARY_NAV_ID;
8585

86+
// We can't use the ActivatedRouter queryParams as we're outside the router outlet
87+
readonly isUwu = 'location' in globalThis ? location.search.includes('uwu') : false;
88+
8689
miniMenuPositions = [
8790
new ConnectionPositionPair(
8891
{originX: 'end', originY: 'center'},

adev/src/app/features/home/home.component.html

Lines changed: 55 additions & 45 deletions
Large diffs are not rendered by default.

adev/src/app/features/home/home.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
inject,
2222
} from '@angular/core';
2323
import {WINDOW, shouldReduceMotion, isIos} from '@angular/docs';
24-
import {RouterLink} from '@angular/router';
24+
import {ActivatedRoute, RouterLink} from '@angular/router';
2525

2626
import {injectAsync} from '../../core/services/inject-async';
2727

@@ -48,8 +48,10 @@ export default class Home implements OnInit, AfterViewInit, OnDestroy {
4848
private readonly ngZone = inject(NgZone);
4949
private readonly platformId = inject(PLATFORM_ID);
5050
private readonly window = inject(WINDOW);
51+
private readonly activatedRoute = inject(ActivatedRoute);
5152

5253
protected readonly tutorialFiles = TUTORIALS_HOMEPAGE_DIRECTORY;
54+
protected readonly isUwu = 'uwu' in this.activatedRoute.snapshot.queryParams;
5355
private element!: HTMLDivElement;
5456
private homeAnimation?: HomeAnimation;
5557
private intersectionObserver: IntersectionObserver | undefined;
@@ -74,7 +76,7 @@ export default class Home implements OnInit, AfterViewInit, OnDestroy {
7476
// at the end of the page, and to load the embedded editor.
7577
this.initIntersectionObserver();
7678

77-
if (this.isWebGLAvailable() && !shouldReduceMotion()) {
79+
if (this.isWebGLAvailable() && !shouldReduceMotion() && !this.isUwu) {
7880
this.ngZone.runOutsideAngular(async () => {
7981
await this.loadHomeAnimation();
8082
});

adev/src/assets/images/uwu.png

323 KB
Loading

adev/src/index.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<!-- We set all theme classes to allow critters to inline the theme styles and prevent flickering -->
33
<html lang="en" class="docs-dark-mode docs-light-mode">
44
<head>
@@ -24,7 +24,22 @@
2424
} else {
2525
documentClassList.add(LIGHT_MODE_CLASS_NAME);
2626
}
27+
28+
if(location.search.includes('uwu')) {
29+
documentClassList.add('uwu');
30+
}
2731
</script>
32+
<style>
33+
.uwu-logo {
34+
display: none;
35+
}
36+
html.uwu .angular-logo {
37+
display: none;
38+
}
39+
html.uwu .uwu-logo {
40+
display: block !important;
41+
}
42+
</style>
2843

2944
<meta charset="utf-8" />
3045
<title>Angular</title>

0 commit comments

Comments
 (0)