Skip to content

Commit c7416a6

Browse files
committed
docs: fix some layout
1 parent d92c5a3 commit c7416a6

File tree

5 files changed

+56
-41
lines changed

5 files changed

+56
-41
lines changed
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
<ng-doc-root
2-
[sidebar]="!hideSidebar()"
3-
[noWidthLimit]="hideSidebar()"
4-
[footerContent]="footerContent"
5-
>
6-
<ng-doc-navbar>
1+
<ng-doc-root [noWidthLimit]="!!hideSidebar()" [footerContent]="footerContent">
2+
<ng-doc-navbar [ngClass]="{ 'hide-sidebar': hideSidebar() }">
73
<a class="brand" routerLink="/" ngDocNavbarLeft>
84
<h3>
95
<!--&lt;!&ndash; <img src="assets/images/ng-doc.svg" />&ndash;&gt;-->
@@ -18,20 +14,22 @@ <h3>
1814
ng-doc-button-icon
1915
ngDocTooltip="Repository on GitHub"
2016
size="large"
21-
target="_blank">
17+
target="_blank"
18+
>
2219
<ng-doc-icon [size]="24" customIcon="github"></ng-doc-icon>
2320
</a>
2421
</div>
25-
2622
</ng-doc-navbar>
27-
<ng-doc-sidebar></ng-doc-sidebar>
23+
<ng-doc-sidebar *ngIf="!hideSidebar()"></ng-doc-sidebar>
2824
<router-outlet></router-outlet>
2925
</ng-doc-root>
3026

31-
3227
<ng-template #footerContent>
3328
<div class="ng-doc-footer">
34-
MIT © {{ currentDate | date: 'yyyy' }}
35-
&nbsp;<a href="https://www.linkedin.com/in/aleksandr-kharkovey/" target="_blank">Aleksandr Kharkovey</a>
29+
MIT © {{ currentDate | date : 'yyyy' }} &nbsp;<a
30+
href="https://www.linkedin.com/in/aleksandr-kharkovey/"
31+
target="_blank"
32+
>Aleksandr Kharkovey</a
33+
>
3634
</div>
3735
</ng-template>

apps/example-ng-pixijs/src/app/app.component.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
h3{
1+
h3 {
22
cursor: pointer;
33
}
44
:host {
@@ -83,3 +83,10 @@ h3{
8383
}
8484
}
8585
}
86+
ng-doc-navbar.hide-sidebar {
87+
::ng-deep {
88+
.ng-doc-menu {
89+
display: none;
90+
}
91+
}
92+
}

apps/example-ng-pixijs/src/app/app.component.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import { Component, inject } from '@angular/core';
2+
import { Location } from '@angular/common';
23
import { NavigationEnd, Router, RouterModule } from '@angular/router';
34
import {
45
NgDocNavbarComponent,
56
NgDocRootComponent,
67
NgDocSidebarComponent,
7-
NgDocThemeToggleComponent
8+
NgDocThemeToggleComponent,
89
} from '@ng-doc/app';
910
import {
1011
NgDocButtonIconComponent,
1112
NgDocIconComponent,
1213
NgDocTooltipDirective,
13-
preventInitialChildAnimations
14+
preventInitialChildAnimations,
1415
} from '@ng-doc/ui-kit';
15-
import { DatePipe } from '@angular/common';
16+
import { DatePipe, NgClass, NgIf } from '@angular/common';
1617
import { filter, map } from 'rxjs';
1718
import { toSignal } from '@angular/core/rxjs-interop';
1819

@@ -28,20 +29,29 @@ import { toSignal } from '@angular/core/rxjs-interop';
2829
DatePipe,
2930
NgDocButtonIconComponent,
3031
NgDocTooltipDirective,
32+
NgIf,
33+
NgClass,
3134
],
3235
selector: 'app-root',
3336
templateUrl: './app.component.html',
3437
styleUrl: './app.component.scss',
3538
standalone: true,
3639
})
3740
export class AppComponent {
41+
location = inject(Location);
3842
router = inject(Router);
3943
title = 'NgPixiJS ';
4044
hideSidebar$ = this.router.events.pipe(
4145
filter((e) => e instanceof NavigationEnd),
42-
map(() => this.router.url.split('/').filter((i) => !!i).length === 0)
46+
map(() => this.isHideSidebar(this.router.url))
4347
);
4448

45-
hideSidebar = toSignal(this.hideSidebar$, { initialValue: true });
49+
hideSidebar = toSignal(this.hideSidebar$, {
50+
initialValue: this.isHideSidebar(this.location.path()),
51+
});
4652
currentDate = new Date();
53+
54+
isHideSidebar(path: string) {
55+
return !new URL(path, 'http://localhost').pathname.slice(1);
56+
}
4757
}

apps/example-ng-pixijs/src/app/example/example.component.scss

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
:host{
1+
:host {
22
position: relative;
3+
width: 520px;
4+
height: 540px;
35
}
4-
.game-bg{
6+
.game-bg {
57
position: absolute;
68
left: 0;
79
top: 0;
@@ -11,18 +13,8 @@
1113
opacity: 0.5;
1214
z-index: 0;
1315
}
14-
//.game-action{
15-
// position: absolute;
16-
// left: 0;
17-
// top: 32px;
18-
// right: 0;
19-
// bottom: 0;
20-
// display: flex;
21-
// justify-content: center;
22-
// align-items: center;
23-
// z-index: 1;
24-
//}
25-
.game-info{
16+
17+
.game-info {
2618
position: absolute;
2719
left: 0;
2820
top: 0;
@@ -32,13 +24,13 @@
3224
justify-content: center;
3325
align-items: center;
3426
z-index: 1;
35-
&.start{
27+
&.start {
3628
justify-content: right;
3729
bottom: auto;
3830
height: 40px;
3931
}
4032
}
41-
.game-speed{
33+
.game-speed {
4234
height: 40px;
4335
display: flex;
4436
align-items: center;

apps/example-ng-pixijs/src/app/main/main.component.scss

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
:host {
2+
@media (max-width: 500px) {
3+
.try-it {
4+
display: none;
5+
}
6+
}
27
section {
38
position: relative;
49

@@ -55,19 +60,24 @@
5560
margin-top: calc(var(--ng-doc-base-gutter) * 2);
5661
justify-content: center;
5762
a {
58-
--ng-doc-button-padding: var(--ng-doc-base-gutter) calc(var(--ng-doc-base-gutter) * 2);
63+
--ng-doc-button-padding: var(--ng-doc-base-gutter)
64+
calc(var(--ng-doc-base-gutter) * 2);
5965
--ng-doc-font-size: 22px;
6066
--ng-doc-line-height: 32px;
6167
--ng-doc-font-weight: 600;
6268

63-
background: linear-gradient(-45deg, #ffa63d, #ff3d77, #338aff, #3cf0c5);
69+
background: linear-gradient(
70+
-45deg,
71+
#ffa63d,
72+
#ff3d77,
73+
#338aff,
74+
#3cf0c5
75+
);
6476
background-size: 600%;
6577
-webkit-animation: anime 16s linear infinite;
6678
animation: scale 16s linear infinite;
6779
box-shadow: 0 0 23px 1px rgba(0, 0, 0, 0.2);
68-
transition:
69-
var(--ng-doc-transition) transform,
70-
box-shadow;
80+
transition: var(--ng-doc-transition) transform, box-shadow;
7181

7282
&:hover {
7383
transform: scale(1.05);
@@ -144,5 +154,3 @@
144154
figure {
145155
margin: 0;
146156
}
147-
148-

0 commit comments

Comments
 (0)