Skip to content

Commit ffb12d2

Browse files
committed
docs: add nx-cloud logo as well
1 parent 878b25f commit ffb12d2

File tree

5 files changed

+113
-4
lines changed

5 files changed

+113
-4
lines changed

apps/kitchen-sink/public/nx-cloud.glb

182 KB
Binary file not shown.

apps/kitchen-sink/src/app/soba/inverted-stencil-buffer/angular.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type AngularGLTF = GLTF & {
1414
standalone: true,
1515
template: `
1616
@if (gltf(); as gltf) {
17-
<ngt-group [dispose]="null" [scale]="scale()" [position]="[-2.5, -3, 0]" [rotation]="[Math.PI / 2, 0, 0]">
17+
<ngt-group [dispose]="null" [scale]="scale()" [position]="[-2.75, -3, 0]" [rotation]="[Math.PI / 2, 0, 0]">
1818
<ngt-mesh
1919
[castShadow]="true"
2020
[receiveShadow]="true"

apps/kitchen-sink/src/app/soba/inverted-stencil-buffer/experience.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import { NgtsBounds, NgtsEnvironment, NgtsFloat, NgtsMask } from 'angular-three-
66
import { ColorRepresentation } from 'three';
77
import { Angular } from './angular';
88
import { Nx } from './nx';
9+
import { NxCloud } from './nx-cloud';
910

1011
export const invert = signal(false);
11-
export const logo = signal<'angular' | 'nx'>('angular');
12+
export const logo = signal<'angular' | 'nx' | 'nx-cloud'>('nx');
1213

1314
@Component({
1415
selector: 'app-frame',
@@ -99,6 +100,9 @@ export class Box {
99100
@case ('nx') {
100101
<app-nx [invert]="invert()" [scale]="20" />
101102
}
103+
@case ('nx-cloud') {
104+
<app-nx-cloud [invert]="invert()" [scale]="160" />
105+
}
102106
}
103107
</ngts-float>
104108
<app-box
@@ -119,7 +123,18 @@ export class Box {
119123
schemas: [CUSTOM_ELEMENTS_SCHEMA],
120124
changeDetection: ChangeDetectionStrategy.OnPush,
121125
host: { class: 'inverted-stencil-buffer-soba-experience' },
122-
imports: [CircularMask, NgtsBounds, NgtsFloat, Box, NgtsEnvironment, NgtsOrbitControls, NgtArgs, Nx, Angular],
126+
imports: [
127+
CircularMask,
128+
NgtsBounds,
129+
NgtsFloat,
130+
Box,
131+
NgtsEnvironment,
132+
NgtsOrbitControls,
133+
NgtArgs,
134+
Nx,
135+
Angular,
136+
NxCloud,
137+
],
123138
})
124139
export class Experience {
125140
protected readonly Math = Math;

apps/kitchen-sink/src/app/soba/inverted-stencil-buffer/inverted-stencil-buffer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { Experience, invert, logo } from './experience';
1616
<select [value]="logo()" (change)="onLogoChange($event)">
1717
<option value="angular">Angular</option>
1818
<option value="nx">Nx</option>
19+
<option value="nx-cloud">Nx Cloud</option>
1920
</select>
2021
</div>
2122
@@ -43,6 +44,6 @@ export default class InvertedStencilBuffer {
4344

4445
onLogoChange(event: Event) {
4546
const target = event.target as HTMLSelectElement;
46-
this.logo.set(target.value as 'angular' | 'nx');
47+
this.logo.set(target.value as 'angular' | 'nx' | 'nx-cloud');
4748
}
4849
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import { ChangeDetectionStrategy, Component, computed, CUSTOM_ELEMENTS_SCHEMA, input, Signal } from '@angular/core';
2+
import { injectGLTF } from 'angular-three-soba/loaders';
3+
import { injectMask } from 'angular-three-soba/staging';
4+
import { Mesh, MeshPhongMaterial, MeshStandardMaterial } from 'three';
5+
import { GLTF } from 'three-stdlib';
6+
7+
type NxCloudGLTF = GLTF & {
8+
nodes: {
9+
Curve012: Mesh;
10+
Curve013: Mesh;
11+
Curve014: Mesh;
12+
Curve015: Mesh;
13+
Curve016: Mesh;
14+
Curve017: Mesh;
15+
Curve018: Mesh;
16+
Curve019: Mesh;
17+
};
18+
materials: { 'SVGMat.007': MeshStandardMaterial };
19+
};
20+
@Component({
21+
selector: 'app-nx-cloud',
22+
standalone: true,
23+
template: `
24+
@if (gltf(); as gltf) {
25+
<ngt-group [dispose]="null" [scale]="scale()" [position]="[-3, -0.5, 0]" [rotation]="[Math.PI / 2, 0, 0]">
26+
<ngt-mesh
27+
[castShadow]="true"
28+
[receiveShadow]="true"
29+
[geometry]="gltf.nodes.Curve012.geometry"
30+
[material]="material()"
31+
/>
32+
<ngt-mesh
33+
[castShadow]="true"
34+
[receiveShadow]="true"
35+
[geometry]="gltf.nodes.Curve013.geometry"
36+
[material]="material()"
37+
/>
38+
<ngt-mesh
39+
[castShadow]="true"
40+
[receiveShadow]="true"
41+
[geometry]="gltf.nodes.Curve014.geometry"
42+
[material]="material()"
43+
/>
44+
<ngt-mesh
45+
[castShadow]="true"
46+
[receiveShadow]="true"
47+
[geometry]="gltf.nodes.Curve015.geometry"
48+
[material]="material()"
49+
/>
50+
<ngt-mesh
51+
[castShadow]="true"
52+
[receiveShadow]="true"
53+
[geometry]="gltf.nodes.Curve016.geometry"
54+
[material]="material()"
55+
/>
56+
<ngt-mesh
57+
[castShadow]="true"
58+
[receiveShadow]="true"
59+
[geometry]="gltf.nodes.Curve017.geometry"
60+
[material]="material()"
61+
/>
62+
<ngt-mesh
63+
[castShadow]="true"
64+
[receiveShadow]="true"
65+
[geometry]="gltf.nodes.Curve018.geometry"
66+
[material]="material()"
67+
/>
68+
<ngt-mesh
69+
[castShadow]="true"
70+
[receiveShadow]="true"
71+
[geometry]="gltf.nodes.Curve019.geometry"
72+
[material]="material()"
73+
/>
74+
</ngt-group>
75+
}
76+
`,
77+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
78+
changeDetection: ChangeDetectionStrategy.OnPush,
79+
})
80+
export class NxCloud {
81+
protected readonly Math = Math;
82+
83+
invert = input(false);
84+
scale = input(1);
85+
86+
protected gltf = injectGLTF(() => './nx-cloud.glb') as Signal<NxCloudGLTF | null>;
87+
protected stencilParameters = injectMask(() => 1, this.invert);
88+
89+
protected material = computed(() => {
90+
const stencilParameters = this.stencilParameters();
91+
return new MeshPhongMaterial({ color: '#002f56', ...stencilParameters });
92+
});
93+
}

0 commit comments

Comments
 (0)