Skip to content

Commit 02f292d

Browse files
committed
stage
1 parent 6fd43ae commit 02f292d

File tree

3 files changed

+360
-319
lines changed

3 files changed

+360
-319
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { Component, CUSTOM_ELEMENTS_SCHEMA, Input } from '@angular/core';
2+
import { Meta } from '@storybook/angular';
3+
import { NgtArgs } from 'angular-three';
4+
import { ENVIRONMENT_PRESETS, NgtsStage } from 'angular-three-soba/staging';
5+
import { makeDecorators, makeStoryObject, number, select } from '../setup-canvas';
6+
7+
enum presets {
8+
rembrandt = 'rembrandt',
9+
portrait = 'portrait',
10+
upfront = 'upfront',
11+
soft = 'soft',
12+
}
13+
14+
@Component({
15+
standalone: true,
16+
template: `
17+
<ngt-color attach="background" *args="['white']" />
18+
<ngts-stage [intensity]="intensity" [environment]="envPreset" [preset]="preset">
19+
<ngt-mesh>
20+
<ngt-sphere-geometry *args="[1, 64, 64]" />
21+
<ngt-mesh-standard-material roughness="0" color="royalblue" />
22+
</ngt-mesh>
23+
</ngts-stage>
24+
`,
25+
imports: [NgtsStage, NgtArgs],
26+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
27+
})
28+
class DefaultStageStory {
29+
@Input() intensity = 1;
30+
@Input() envPreset = Object.keys(ENVIRONMENT_PRESETS)[0];
31+
@Input() preset = Object.keys(presets)[0];
32+
}
33+
34+
export default {
35+
title: 'Staging/Stage',
36+
decorators: makeDecorators(),
37+
} as Meta;
38+
39+
export const Default = makeStoryObject(DefaultStageStory, {
40+
canvasOptions: { camera: { position: [0, 0, 3] } },
41+
argsOptions: {
42+
intensity: number(1),
43+
envPreset: select(Object.keys(ENVIRONMENT_PRESETS)[0], {
44+
options: Object.keys(ENVIRONMENT_PRESETS),
45+
}),
46+
preset: select(Object.keys(presets)[0], { options: Object.keys(presets) }),
47+
},
48+
});

libs/soba/staging/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ export * from './sky/sky';
1414
export * from './sparkles/sparkles';
1515
export { NgtsSpotLightShadow } from './spot-light/shadow-mesh';
1616
export * from './spot-light/spot-light';
17+
export * from './stage/stage';
1718
export * from './stars/stars';

0 commit comments

Comments
 (0)