Skip to content

Commit

Permalink
better UI, bugfixing
Browse files Browse the repository at this point in the history
  • Loading branch information
Teun de Wijs committed Oct 11, 2019
1 parent 7ea184e commit 800cbb3
Show file tree
Hide file tree
Showing 13 changed files with 346 additions and 93 deletions.
2 changes: 2 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"src/assets"
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
"src/styles.scss"
],
"scripts": []
Expand Down Expand Up @@ -89,6 +90,7 @@
"src/assets"
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
"src/styles.css"
],
"scripts": []
Expand Down
98 changes: 98 additions & 0 deletions material-module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import {A11yModule} from '@angular/cdk/a11y';
import {DragDropModule} from '@angular/cdk/drag-drop';
import {PortalModule} from '@angular/cdk/portal';
import {ScrollingModule} from '@angular/cdk/scrolling';
import {CdkStepperModule} from '@angular/cdk/stepper';
import {CdkTableModule} from '@angular/cdk/table';
import {CdkTreeModule} from '@angular/cdk/tree';
import {NgModule} from '@angular/core';
import {
MatAutocompleteModule,
MatBadgeModule,
MatBottomSheetModule,
MatButtonModule,
MatButtonToggleModule,
MatCardModule,
MatCheckboxModule,
MatChipsModule,
MatDatepickerModule,
MatDialogModule,
MatDividerModule,
MatExpansionModule,
MatGridListModule,
MatIconModule,
MatInputModule,
MatListModule,
MatMenuModule,
MatNativeDateModule,
MatPaginatorModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSnackBarModule,
MatSortModule,
MatStepperModule,
MatTableModule,
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
MatTreeModule,
} from '@angular/material';

@NgModule({
exports: [
A11yModule,
CdkStepperModule,
CdkTableModule,
CdkTreeModule,
DragDropModule,
MatAutocompleteModule,
MatBadgeModule,
MatBottomSheetModule,
MatButtonModule,
MatButtonToggleModule,
MatCardModule,
MatCheckboxModule,
MatChipsModule,
MatStepperModule,
MatDatepickerModule,
MatDialogModule,
MatDividerModule,
MatExpansionModule,
MatGridListModule,
MatIconModule,
MatInputModule,
MatListModule,
MatMenuModule,
MatNativeDateModule,
MatPaginatorModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSnackBarModule,
MatSortModule,
MatTableModule,
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
MatTreeModule,
PortalModule,
ScrollingModule,
]
})
export class MaterialModule {}


/** Copyright 2019 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license */
43 changes: 43 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@
"private": true,
"dependencies": {
"@angular/animations": "~8.2.4",
"@angular/cdk": "^8.2.3",
"@angular/common": "~8.2.4",
"@angular/compiler": "~8.2.4",
"@angular/core": "~8.2.4",
"@angular/flex-layout": "^8.0.0-beta.27",
"@angular/forms": "~8.2.4",
"@angular/material": "^8.2.3",
"@angular/platform-browser": "~8.2.4",
"@angular/platform-browser-dynamic": "~8.2.4",
"@angular/router": "~8.2.4",
"commander": "^3.0.1",
"deflate-js": "^0.2.3",
"file-system": "^2.2.2",
"flex-layout": "^1.0.1",
"hammerjs": "^2.0.8",
"node-nailgun-client": "^0.1.2",
"node-nailgun-server": "^0.3.0",
"rxjs": "~6.4.0",
Expand Down
9 changes: 7 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HomeComponent } from './components/home/home.component';
import { HttpClientModule } from '@angular/common/http';
import { TrustHtmlPipe } from './trusthtmlpipe.pipe';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MaterialModule } from 'material-module';
import { FlexLayoutModule} from '@angular/flex-layout'
@NgModule({
declarations: [
AppComponent,
Expand All @@ -15,7 +17,10 @@ import { TrustHtmlPipe } from './trusthtmlpipe.pipe';
imports: [
BrowserModule,
HttpClientModule,
AppRoutingModule
AppRoutingModule,
BrowserAnimationsModule,
MaterialModule,
FlexLayoutModule
],
providers: [],
bootstrap: [AppComponent]
Expand Down
114 changes: 70 additions & 44 deletions src/app/components/home/home.component.html
Original file line number Diff line number Diff line change
@@ -1,45 +1,71 @@
<textarea #tA rows="16" cols="90" placeholder="Plant uml code"
(keyup)="generateSvg(tA.value)">Bob->Alice : hello</textarea>
<div class="right">
<p>
<input id="primary" #first type="color" value="#A80036" (click)="colorChange('primary', first.value)"
(change)="colorChange('primary', first.value)">
{{first.value}}
primary color, used for borders and lines
</p>
<p>
<input id="secondary" #second type="color" value="#FEFECE" (click)="colorChange('secondary', second.value)"
(change)="colorChange('secondary', second.value)">
{{second.value}}
secondary color, used for backgrounds
</p>
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutWrap fxLayoutGap="0.5%" fxLayoutAlign="center stretch"
fxLayoutAlign.xs="center" class="locationMiddle">
<ng-container>
<mat-card class="card">
<mat-card-header>
<div mat-card-avatar class="example-header-image"></div>
<mat-card-title>Style UML</mat-card-title>
<mat-card-subtitle>Sequence diagram styler</mat-card-subtitle>
</mat-card-header>
<mat-card-content>
<mat-form-field style="width: 100%">
<textarea #tA matInput style="width: 100%" rows="20" (keyup)="generateSvg(tA.value)"
placeholder="Plant uml code">Bob->Alice : hello</textarea>
</mat-form-field>
<div>
<input matInput id="primary" #first type="color" value="#A80036"
(click)="colorChange('primary', first.value)" (change)="colorChange('primary', first.value)">
{{first.value}}
primary color, used for borders and lines
<input matInput id="secondary" #second type="color" value="#FEFECE"
(click)="colorChange('secondary', second.value)"
(change)="colorChange('secondary', second.value)">
{{second.value}}
secondary color, used for backgrounds
<input matInput id="tertiary" #third type="color" value="#fbfb77"
(click)="colorChange('tertiary', third.value)" (change)="colorChange('tertiary', third.value)">
{{third.value}}
tertiary color, used for notes
<input matInput id="quaternary" #fourth type="color" value="#3a3a3a"
(click)="colorChange('quaternary', fourth.value)"
(change)="colorChange('quaternary', fourth.value)">
{{fourth.value}}
quaternary color, used for note borders
<input matInput id="text" #fifth type="color" value="#000000"
(click)="colorChange('text', fifth.value)" (change)="colorChange('text', fifth.value)">
{{fifth.value}}
text color
</div>
</mat-card-content>
<mat-card-actions>
<button mat-raised-button (click)="download()">download as png</button>
<button mat-raised-button (click)="isaacStyle()">ISAAC style</button>
<button mat-raised-button (click)="toRounded(tA.value)">Rounded corners</button>
<button mat-raised-button (click)="toCircles(tA.value)">Circles</button>
<button mat-raised-button (click)="toEllipse(tA.value)">Ellipses</button>
<button mat-raised-button (click)="toRectangle()">Rectangles</button>
&nbsp;
<label class="buttonClass" for="img">Images</label>
<input hidden #img id="img" type="file" accept="image/*" (change)="toImage(img, tA.value)"
value="Image"><br><br>
<!-- <section > -->
<mat-checkbox color="primary" class="example-margin" (change)="changeHidden(tA.value)">hide notes
</mat-checkbox>
<!-- </section> -->

<p>
<input id="tertiary" #third type="color" value="#fbfb77" (click)="colorChange('tertiary', third.value)"
(change)="colorChange('tertiary', third.value)">
{{third.value}}
tertiary color, used for notes
</p>
<p>
<input id="quaternary" #fourth type="color" value="#3a3a3a" (click)="colorChange('quaternary', fourth.value)"
(change)="colorChange('quaternary', fourth.value)">
{{fourth.value}}
quaternary color, used for note borders
</p>
<p>
<input id="text" #fifth type="color" value="#000000" (click)="colorChange('text', fifth.value)"
(change)="colorChange('text', fifth.value)">
{{fifth.value}}
text color
</p>
</div><br>
<a download="sequence.png" (mouseover)="download()" href="{{png}}"><button>download as png</button></a>
<button (click)="isaacStyle()">ISAAC style</button>
<button (click)="toCircles(tA.value)">Circles</button>
<button (click)="toEllipse(tA.value)">Ellipses</button>
<button (click)="toRounded(tA.value)">Rounded corners</button>
<button (click)="toRectangle()">Rectangles</button>
hide notes<input type="checkbox" (change)="changeHidden(tA.value)">
<input #img type="file" accept="image/*" (change)="toImage(img, tA.value)" value="Image">
<br><br>
<div [innerHTML]="svg | trustHtml"></div>

</mat-card-actions>
</mat-card>
<mat-card class="card">
<mat-card-header>
<mat-card-title>Diagram</mat-card-title>
</mat-card-header>
<mat-card-content>
<div [innerHTML]="svg | trustHtml"></div>
</mat-card-content>
<mat-card-actions>

</mat-card-actions>
</mat-card>
</ng-container>
</div>
11 changes: 8 additions & 3 deletions src/app/components/home/home.component.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
div.right {
position: relative;
float: right;
margin-right: 45%;
margin-right: 40%;
}
@media screen and (min-width: 1400px) and (max-width:1900px) {
div.right {
position: relative;
float: right;
margin-right: 25%;
margin-right: 20%;
}
}

@media (max-width: 1400px) {
div.right {
position: relative;
float: right;
margin-right: 5%;
margin-right: 0%;
}
}
.card {
max-width: 900px;
margin: 8px;
}

Loading

0 comments on commit 800cbb3

Please sign in to comment.