Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
Probably thinking about code

Matt Eland IntegerMan

🤔
Probably thinking about code
View GitHub Profile
View GameObject.ts
import {CommandContext} from '../CommandContext';
export type ContextAction = (context: CommandContext) => void;
export type ObjectResponse = ContextAction | string;
export interface GameObject {
name: ObjectResponse;
look: ObjectResponse;
smell: ObjectResponse;
lick?: ObjectResponse;
View Sentence.ts
export class Sentence {
public text: string;
constructor() { }
public get verbWord(): Word {
if (this.words.length <= 0 || !this.words[0].isVerb) {
return undefined;
}
View StoryView.component.ts
import {LiveAnnouncer} from '@angular/cdk/a11y';
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
import {Subscription} from 'rxjs';
import {StoryEntry} from '../../Model/StoryEntry';
import {StoryService} from '../story.service';
@Component({
selector: 'app-story-view',
templateUrl: './story-view.component.html',
styleUrls: ['./story-view.component.scss']
View app.stories.ts
import {moduleMetadata, storiesOf} from '@storybook/angular';
import {AppModule} from './app.module';
import {AppComponent} from './app.component';
import { withA11y } from '@storybook/addon-a11y';
storiesOf('App', module)
.addDecorator(moduleMetadata({ imports: [ AppModule ]}))
.addDecorator(withA11y)
.add('App Basic Tests', () => ({
component: AppComponent,
View story-entry.stories.ts
import {select, text, withKnobs} from '@storybook/addon-knobs';
import {moduleMetadata, storiesOf} from '@storybook/angular';
import {StoryEntry} from '../../Model/StoryEntry';
import {StoryEntryType} from '../../Model/StoryEntryType';
import {AppModule} from '../app.module';
import {StoryEntryComponent} from './story-entry.component';
storiesOf('StoryEntry', module)
.addDecorator(moduleMetadata({ imports: [ AppModule ]}))
.addDecorator(withKnobs)
View main.js
module.exports = {
stories: ['../src/**/*.stories.ts'],
addons: ['@storybook/addon-actions',
'@storybook/addon-links',
'@storybook/addon-notes',
'@storybook/addon-knobs'],
};
View manager.ts
import { addons } from '@storybook/addons';
import { themes } from '@storybook/theming';
addons.setConfig({
theme: themes.dark,
});
View preview-head.html
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<style type="text/css">
body {
background: #303030;
color: #ffffff;
}
</style>
View header.stories.ts
import {moduleMetadata, storiesOf} from '@storybook/angular';
import {AppModule} from '../app.module';
import {HeaderComponent} from './header.component';
storiesOf('Header', module)
.addDecorator(moduleMetadata({ imports: [ AppModule ]}))
.add('Score 0', () => ({
component: HeaderComponent,
props: {
Score: 0
View story-view.component.ts
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
import {Subscription} from 'rxjs';
import {StoryEntry} from '../../Model/StoryEntry';
import {StoryEntryType} from '../../Model/StoryEntryType';
import {StoryService} from '../story.service';
@Component({
selector: 'app-story-view',
templateUrl: './story-view.component.html',
styleUrls: ['./story-view.component.scss']
You can’t perform that action at this time.