Skip to content

Commit

Permalink
feat(stark-demo): improvement of the showcase
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallikki committed Oct 5, 2018
1 parent 98261d2 commit 76a7d67
Show file tree
Hide file tree
Showing 16 changed files with 224 additions and 153 deletions.
2 changes: 2 additions & 0 deletions showcase/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { MatButtonModule } from "@angular/material/button";
import { MatButtonToggleModule } from "@angular/material/button-toggle";
import { MatCardModule } from "@angular/material/card";
import { MatCheckboxModule } from "@angular/material/checkbox";
import { MatExpansionModule } from "@angular/material/expansion";
import { MatListModule } from "@angular/material/list";
import { MatSidenavModule } from "@angular/material/sidenav";
import { MatTooltipModule } from "@angular/material/tooltip";
Expand Down Expand Up @@ -180,6 +181,7 @@ export const metaReducers: MetaReducer<State>[] = ENV !== "production" ? [logger
MatButtonToggleModule,
MatCardModule,
MatCheckboxModule,
MatExpansionModule,
MatIconModule,
MatListModule,
MatSidenavModule,
Expand Down
67 changes: 67 additions & 0 deletions showcase/src/app/home/_home.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//custom title for the header. Keep in mind that we define the font-size and color here because it is an exceptional case.
//Should this style be reused elsewhere, it would be better to create a new style in stark-ui
.about-title {
font-size: 30px;
margin-left: 15px;
color: mat-color($grey-palette, 100);
}

//set the header image
.about-background {
background: url("/assets/images/banner/angular-banner.png") no-repeat center center;
background-size: cover;
height: 170px;
display: flex;
align-items: center;
margin-bottom: 20px;
}

.light-font {
font-weight: normal;
}

.bottom-margin {
margin-bottom: 20px;
}

//icon with a link to github
.github-link {
background-size: 100%;
height: 50px;
width: 50px;
float: right;
}

.information-title {
font-size: 21px;
color: mat-color($grey-palette, 900);
padding-bottom: 0;
display: inline-flex;
vertical-align: middle;
margin: 10px 0 10px 0;
}

@media #{$desktop-query} {
.about-title {
font-size: 55px;
margin-left: 25px;
}

.information-title {
font-size: 30px;
}

.about-background {
height: 250px;
}
}

@media #{$tablet-only-query} {
.list {
font-size: 17px;
}

.about-background {
height: 230px;
}
}
140 changes: 42 additions & 98 deletions showcase/src/app/home/home.component.html
Original file line number Diff line number Diff line change
@@ -1,100 +1,44 @@
<h1 class="mat-display-2" translate>Stark documentation</h1>
<section class="stark-section about-background">
<h1 class="about-title" [innerHTML]= "'SHOWCASE.HOMEPAGE.MAIN_TITLE' | translate"></h1>
</section>
<p class="mat-body-2 light-font" [innerHTML]="'SHOWCASE.HOMEPAGE.DESCRIPTION_BEFORE_DETAIL' | translate">
</p>
<p class="mat-h4" [innerHTML]="'SHOWCASE.HOMEPAGE.DESCRIPTION_DETAIL' | translate"></p>
<p class="mat-body-2 light-font" [innerHTML]="'SHOWCASE.HOMEPAGE.DESCRIPTION_AFTER_DETAIL' | translate">
</p>

<div fxLayout="column" fxLayout.gt-xs="row wrap" fxLayoutAlign.gt-md="space-between center" fxLayoutAlign.md="space-around center"
fxLayoutAlign.lt-md="center center" fxLayoutGap.lt-lg="20px">
<a href="https://stark.nbb.be/api-docs/stark-core/latest">
<mat-card class="stark-card">
<mat-card-header>
<mat-card-title fxLayout fxLayoutAlign="center">
<h4 translate>Stark Core - Latest</h4>
</mat-card-title>
</mat-card-header>
<mat-card-content>
<img src="/assets/images/logo/logo-blue.svg">
</mat-card-content>
</mat-card>
</a>
<a href="https://github.com/NationalBankBelgium/stark/tree/gh-pages/api-docs/stark-core">
<mat-card class="stark-card">
<mat-card-header>
<mat-card-title fxLayout fxLayoutAlign="center">
<h4 translate>Stark Core</h4>
</mat-card-title>
</mat-card-header>
<mat-card-content>
<img src="/assets/images/logo/core.png">
</mat-card-content>
</mat-card>
</a>
<a href="https://stark.nbb.be/api-docs/stark-ui/latest">
<mat-card class="stark-card">
<mat-card-header>
<mat-card-title fxLayout fxLayoutAlign="center">
<h4 translate>Stark UI - Latest</h4>
</mat-card-title>
</mat-card-header>
<mat-card-content>
<img src="/assets/images/logo/logo-blue.svg">
</mat-card-content>
</mat-card>
</a>
<a href="https://github.com/NationalBankBelgium/stark/tree/gh-pages/api-docs/stark-ui">
<mat-card class="stark-card">
<mat-card-header>
<mat-card-title fxLayout fxLayoutAlign="center">
<h4 translate>Stark UI</h4>
</mat-card-title>
</mat-card-header>
<mat-card-content>
<img src="/assets/images/logo/logo-ui.png">
</mat-card-content>
</mat-card>
</a>
<section class="stark-section bottom-margin">
<mat-accordion>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title class="information-title" [innerHTML]="'SHOWCASE.HOMEPAGE.NEWS_TITLE' | translate">
</mat-panel-title>
</mat-expansion-panel-header>
<h2 [innerHTML]="'SHOWCASE.HOMEPAGE.NEWS_DESCRIPTION' | translate"></h2>
<div [innerHTML]="'SHOWCASE.HOMEPAGE.NEWS_CONTENT' | translate"></div>
</mat-expansion-panel>
</mat-accordion>
</section>
<section class="stark-section bottom-margin">
<mat-accordion>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title class="information-title" [innerHTML]="'SHOWCASE.HOMEPAGE.DOCUMENTATION_MAIN_TITLE' | translate">
</mat-panel-title>
</mat-expansion-panel-header>
<h2 [innerHTML]="'SHOWCASE.HOMEPAGE.DOCUMENTATION_MAIN_DESC' | translate"></h2>

<a href="https://github.com/NationalBankBelgium/stark/tree/gh-pages/showcase">
<mat-card class="stark-card">
<mat-card-header>
<mat-card-title fxLayout fxLayoutAlign="center">
<h4 translate>Showcase</h4>
</mat-card-title>
</mat-card-header>
<mat-card-content>
<img src="/assets/images/logo/showcase.png">
</mat-card-content>
</mat-card>
</a>
</div>


<!--<div class="documentation-links">
<div>
<a href="https://stark.nbb.be/api-docs/stark-core/latest">
<img class="img-stark-core-latest">
<div>Stark Core - Latest</div>
</a>
</div>
<div>
<a href="https://github.com/NationalBankBelgium/stark/tree/gh-pages/api-docs/stark-core">
<img class="img-stark-core">
<div>Stark Core</div>
</a>
</div>
<div>
<a href="https://stark.nbb.be/api-docs/stark-ui/latest">
<img class="img-stark-ui-latest">
<div>Stark UI - Latest</div>
</a>
</div>
<div>
<a href="https://github.com/NationalBankBelgium/stark/tree/gh-pages/api-docs/stark-ui">
<img class="img-stark-ui">
<div>Stark UI</div>
</a>
</div>
<div>
<a href="https://github.com/NationalBankBelgium/stark/tree/gh-pages/showcase">
<img class="img-stark-showcase">
<div>Showcase</div>
</a>
</div>
</div>-->
<h2>Stark Core</h2>
<div [innerHTML]="'SHOWCASE.HOMEPAGE.DOCUMENTATION_CORE_DESC' | translate">
</div>
<br>
<h2>Stark UI</h2>
<div [innerHTML]="'SHOWCASE.HOMEPAGE.DOCUMENTATION_UI_DESC' | translate">
</div>
<br>
<h2>Showcase</h2>
<div [innerHTML]="'SHOWCASE.HOMEPAGE.DOCUMENTATION_SHOWCASE_DESC' | translate">
</div>
</mat-expansion-panel>
</mat-accordion>
</section>
53 changes: 0 additions & 53 deletions showcase/src/app/home/home.component.scss

This file was deleted.

3 changes: 2 additions & 1 deletion showcase/src/app/home/home.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
STARK_HTTP_SERVICE
} from "@nationalbankbelgium/stark-core";
import { MockStarkHttpService, MockStarkLoggingService } from "@nationalbankbelgium/stark-core/testing";
import { TranslateModule } from "@ngx-translate/core";
/**
* Load the implementations that should be tested.
*/
Expand Down Expand Up @@ -44,7 +45,7 @@ describe(`Home`, () => {
TestBed.configureTestingModule({
declarations: [HomeComponent],
schemas: [NO_ERRORS_SCHEMA],
imports: [StoreModule.forRoot({}), HttpClientTestingModule],
imports: [StoreModule.forRoot({}), HttpClientTestingModule, TranslateModule.forRoot()],
providers: [
{ provide: STARK_APP_CONFIG, useValue: mockStarkAppConfig },
{ provide: STARK_HTTP_SERVICE, useValue: MockStarkHttpService },
Expand Down
1 change: 0 additions & 1 deletion showcase/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { STARK_LOGGING_SERVICE, StarkErrorImpl, StarkLoggingService } from "@nat

@Component({
selector: "home", // <home></home>
styleUrls: ["./home.component.scss"],
templateUrl: "./home.component.html"
})
export class HomeComponent implements OnInit {
Expand Down
68 changes: 68 additions & 0 deletions showcase/src/assets/examples/flex-layout-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Example of the angular flex-layout

<h1 class="mat-display-2" translate>Stark documentation</h1>
<div fxLayout="column" fxLayout.gt-xs="row wrap" fxLayoutAlign.gt-md="space-between center"
fxLayoutAlign.md="space-around center"
fxLayoutAlign.lt-md="center center" fxLayoutGap.lt-lg="20px">
<a href="https://stark.nbb.be/api-docs/stark-core/latest">
<mat-card class="stark-card">
<mat-card-header>
<mat-card-title fxLayout fxLayoutAlign="center">
<h4 translate>Stark Core - Latest</h4>
</mat-card-title>
</mat-card-header>
<mat-card-content>
<img src="/assets/images/logo/logo-blue.svg">
</mat-card-content>
</mat-card>
</a>
<a href="https://github.com/NationalBankBelgium/stark/tree/gh-pages/api-docs/stark-core">
<mat-card class="stark-card">
<mat-card-header>
<mat-card-title fxLayout fxLayoutAlign="center">
<h4 translate>Stark Core</h4>
</mat-card-title>
</mat-card-header>
<mat-card-content>
<img src="/assets/images/logo/core.png">
</mat-card-content>
</mat-card>
</a>
<a href="https://stark.nbb.be/api-docs/stark-ui/latest">
<mat-card class="stark-card">
<mat-card-header>
<mat-card-title fxLayout fxLayoutAlign="center">
<h4 translate>Stark UI - Latest</h4>
</mat-card-title>
</mat-card-header>
<mat-card-content>
<img src="/assets/images/logo/logo-blue.svg">
</mat-card-content>
</mat-card>
</a>
<a href="https://github.com/NationalBankBelgium/stark/tree/gh-pages/api-docs/stark-ui">
<mat-card class="stark-card">
<mat-card-header>
<mat-card-title fxLayout fxLayoutAlign="center">
<h4 translate>Stark UI</h4>
</mat-card-title>
</mat-card-header>
<mat-card-content>
<img src="/assets/images/logo/logo-ui.png">
</mat-card-content>
</mat-card>
</a>

<a href="https://github.com/NationalBankBelgium/stark/tree/gh-pages/showcase">
<mat-card class="stark-card">
<mat-card-header>
<mat-card-title fxLayout fxLayoutAlign="center">
<h4 translate>Showcase</h4>
</mat-card-title>
</mat-card-header>
<mat-card-content>
<img src="/assets/images/logo/showcase.png">
</mat-card-content>
</mat-card>
</a>
</div>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed showcase/src/assets/images/logo/core.png
Binary file not shown.
Binary file added showcase/src/assets/images/logo/github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed showcase/src/assets/images/logo/logo-ui.png
Binary file not shown.
Binary file removed showcase/src/assets/images/logo/showcase.png
Binary file not shown.
14 changes: 14 additions & 0 deletions showcase/src/assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,20 @@
"TITLE": "Stark Typography"
}
},
"HOMEPAGE": {
"MAIN_TITLE": "About Stark",
"DESCRIPTION_BEFORE_DETAIL": "<p>Stark is an Angular 5+ based front-end framework built on top of Angular Stark features... An awesome reusable build using Webpack, built-in support for state of the art front-end tech.</p> <p>Stark provides main building blocks for accelerating front-end development:</p>",
"DESCRIPTION_DETAIL": "<ul><li>a solid reusable build based on Webpack</li><li>a starter project inspired by Angular Starter by AngularClass and Google's Web Starterk Kit</li><li>core modules providing useful APIs</li><li>UI modules providing interesting UI components </li><li>a showcase application containing: <ul><li>our living style guide</li><li>a showcase of all components/services along with their API</li><li>our developer guide</li></ul></li></ul>",
"DESCRIPTION_AFTER_DETAIL": "<p>Stark modules are like LEGO blocks: add what you need, no less, no more. If you don't like our defaults then you may replace/override/ignore anything you fancy.</p> <a href=\"https://github.com/NationalBankBelgium\" target=\"_blank\" rel=\"noopener noreferrer\"><img class=\"github-link\" src=\"/assets/images/logo/github.png\"></a><p> And even better, the Stark repository is available on the National Bank of Belgium page on Github!</p>Come and have a look at our amazing open sources projects!</p>",
"NEWS_TITLE": "Stark News",
"NEWS_DESCRIPTION": "Want to find the hottest news about the Stark framework?",
"NEWS_CONTENT": "Have a look at the news page right <a target=\"_blank\" href=\"news\" rel=\"noopener noreferrer\">here!</a>",
"DOCUMENTATION_MAIN_TITLE": "Stark Documentation",
"DOCUMENTATION_MAIN_DESC": "<p>Want some more info about Stark? Take a look at our links just below!</p>",
"DOCUMENTATION_CORE_DESC": "<p>Stark Core, aka stark-core, is a module providing reusable APIs, such as a routing, logging, log shipping, etc.</p><p>You can find the latest API documentation for stark-core <a href=\"https://stark.nbb.be/api-docs/stark-core/latest\" target=\"_blank\" rel=\"noopener noreferrer\" >here</a>.</p><p>Or check the API for previous releases right <a href=\"https://github.com/NationalBankBelgium/stark/tree/gh-pages/api-docs/stark-core \" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.</p>",
"DOCUMENTATION_UI_DESC": "<p>Stark UI provides reusable UI components, for example data table, message pane, ... but also themes.</p><p>The latest API doc for that module can be found <a href=\"https://stark.nbb.be/api-docs/stark-ui/latest\" target=\"_blank\" rel=\"noopener noreferrer\" >here</a>.</p><p>Or check the API for previous releases right <a href=\"https://github.com/NationalBankBelgium/stark/tree/gh-pages/api-docs/stark-ui \" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.</p>",
"DOCUMENTATION_SHOWCASE_DESC": "<p>The showcase application is the application you are actually browsing right now!</p><p> Enjoy roaming through our list of visual components (and their documentation) and have fun while discovering our design guidelines.</p>If you are interested in seeing the previous version of Stark showcase, have a look <a href=\"https://github.com/NationalBankBelgium/stark/tree/gh-pages/showcase\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.</p>"
},
"STYLEGUIDE": {
"TITLE": "Style guide"
}
Expand Down
Loading

0 comments on commit 76a7d67

Please sign in to comment.