diff --git a/.gitignore b/.gitignore index f4f46a5..b90f6eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ # See http://help.github.com/ignore-files/ for more about ignoring files. +# CAVALLIUM SPECIFIC +*.generated.html +angular.json + # compiled output /dist /tmp diff --git a/angular.json b/angular.json index 7da03cc..ea7c008 100644 --- a/angular.json +++ b/angular.json @@ -27,7 +27,8 @@ "src/assets" ], "styles": [ - "src/styles.scss" + "src/styles.scss", + "src/styles-fonts.scss" ], "scripts": [], "es5BrowserSupport": true, @@ -58,13 +59,14 @@ "maximumError": "5mb" } ], + "index": "src/index.it.generated.html", "outputPath": "dist/italian/", "i18nFile": "src/locale/messages.it.xlf", "i18nLocale": "it" }, "serve_it": { "aot": true, - "baseHref": "/it/", + "index": "src/index.it.generated.html", "outputPath": "dist/italian/", "i18nFile": "src/locale/messages.it.xlf", "i18nLocale": "it" @@ -92,13 +94,14 @@ "maximumError": "5mb" } ], + "index": "src/index.en.generated.html", "outputPath": "dist/english/", "i18nFile": "src/locale/messages.en.xlf", "i18nLocale": "en" }, "serve_en": { "aot": true, - "baseHref": "/en/", + "index": "src/index.en.generated.html", "outputPath": "dist/english/", "i18nFile": "src/locale/messages.en.xlf", "i18nLocale": "en" @@ -138,7 +141,8 @@ "tsConfig": "src/tsconfig.spec.json", "karmaConfig": "src/karma.conf.js", "styles": [ - "src/styles.scss" + "src/styles.scss", + "src/styles-fonts.scss" ], "scripts": [], "assets": [ diff --git a/build.js b/build.js index 0338459..26ef98a 100644 --- a/build.js +++ b/build.js @@ -1,3 +1,5 @@ +#! /usr/bin/env node + const fs = require("fs"); const { spawn } = require('cross-spawn'); var execOptions = { @@ -7,26 +9,39 @@ var execOptions = { const argument0 = process.argv[2]; async function main(runMode) { - const angularSourceText = fs.readFileSync("buildconfig.json"); - const angularSource = JSON.parse(angularSourceText); + const angularSourceBuffer = fs.readFileSync("buildconfig.json"); + const angularSource = JSON.parse(angularSourceBuffer); const productionConfiguration = angularSource.angular.projects[angularSource.projectName].architect.build.configurations["production"]; delete angularSource.angular.projects[angularSource.projectName].architect.build.configurations["production"]; angularSource.languages.forEach((language, languageIndex) => { - const languageConfiguration = angularSource.angular.projects[angularSource.projectName].architect.build.configurations[language]; + const defaultIndex = angularSource.angular.projects[angularSource.projectName].architect.build.options.index; + const defaultIndexName = defaultIndex.split(".").slice(0, -1).join("."); + const defaultIndexExtension = defaultIndex.split(".").pop(); + const languageSpecificIndex = defaultIndexName + "." + language + ".generated." + defaultIndexExtension; + + const languageConfiguration = { + "index": languageSpecificIndex, + ...angularSource.angular.projects[angularSource.projectName].architect.build.configurations[language] + }; delete angularSource.angular.projects[angularSource.projectName].architect.build.configurations[language]; + angularSource.angular.projects[angularSource.projectName].architect.build.configurations["production_" + language] = { ...productionConfiguration, ...languageConfiguration }; angularSource.angular.projects[angularSource.projectName].architect.build.configurations["serve_" + language] = { "aot": true, - "baseHref": "/"+language+"/", ...languageConfiguration, }; angularSource.angular.projects[angularSource.projectName].architect.serve.configurations[language] = { "browserTarget": "cavallium-website:build:serve_"+language, "port": 4200 + languageIndex }; + + // Create index.language.html + let indexText = fs.readFileSync(defaultIndex).toString("utf8"); + indexText = indexText.replace("", ""); + fs.writeFileSync(languageSpecificIndex, indexText); }); fs.writeFileSync("angular.json", JSON.stringify(angularSource.angular, null, "\t"), "utf8"); @@ -45,7 +60,7 @@ async function main(runMode) { case "serve": await Promise.all(angularSource.languages.map((language, index) => { console.log("Building for language " + JSON.stringify(language) + (index > 0 ? " (hidden)" : "")); - const childProcess = spawn("ng", ["serve", "--configuration=" + language], + const childProcess = spawn("ng", ["serve", "--configuration=" + language, "--host=0.0.0.0"], { stdio: [process.stdin, index == 0 ? process.stdout : null, process.stderr] }); return onExit(childProcess); })); diff --git a/buildconfig.json b/buildconfig.json index 670ab55..a0c3d7c 100644 --- a/buildconfig.json +++ b/buildconfig.json @@ -31,7 +31,8 @@ "src/assets" ], "styles": [ - "src/styles.scss" + "src/styles.scss", + "src/styles-fonts.scss" ], "scripts": [], "es5BrowserSupport": true, @@ -106,7 +107,8 @@ "tsConfig": "src/tsconfig.spec.json", "karmaConfig": "src/karma.conf.js", "styles": [ - "src/styles.scss" + "src/styles.scss", + "src/styles-fonts.scss" ], "scripts": [], "assets": [ diff --git a/e2e/src/app.e2e-spec.ts b/e2e/src/app.e2e-spec.ts index 451bb6c..8d7166c 100644 --- a/e2e/src/app.e2e-spec.ts +++ b/e2e/src/app.e2e-spec.ts @@ -1,16 +1,16 @@ -import { AppPage } from './app.po'; -import { browser, logging } from 'protractor'; +import { AppPage } from "./app.po"; +import { browser, logging } from "protractor"; -describe('workspace-project App', () => { +describe("workspace-project App", () => { let page: AppPage; beforeEach(() => { page = new AppPage(); }); - it('should display welcome message', () => { + it("should display welcome message", () => { page.navigateTo(); - expect(page.getTitleText()).toEqual('Welcome to cavallium-website!'); + expect(page.getTitleText()).toEqual("Welcome to cavallium-website!"); }); afterEach(async () => { diff --git a/e2e/src/app.po.ts b/e2e/src/app.po.ts index 5776aa9..f3a9c0a 100644 --- a/e2e/src/app.po.ts +++ b/e2e/src/app.po.ts @@ -1,4 +1,4 @@ -import { browser, by, element } from 'protractor'; +import { browser, by, element } from "protractor"; export class AppPage { navigateTo() { @@ -6,6 +6,6 @@ export class AppPage { } getTitleText() { - return element(by.css('app-root h1')).getText() as Promise; + return element(by.css("app-root h1")).getText() as Promise; } } diff --git a/package.json b/package.json index 2b822b2..13a2230 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "scripts": { "ng": "ng", "start": "node build.js serve", + "serve": "node build.js serve", "build": "node build.js build", "test": "ng test", "lint": "ng lint", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index d425c6f..5362b85 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,10 +1,21 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; +import { ArticleComponent } from "./article/article.component"; +import { RouterEmptyComponent } from "./gui/router-empty/router-empty.component"; -const routes: Routes = []; +const routes: Routes = [ + { + path: "article", + component: RouterEmptyComponent, + children: [{ + path: "**", + component: ArticleComponent + }] + } +]; @NgModule({ - imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] + imports: [RouterModule.forRoot(routes)], + exports: [RouterModule] }) export class AppRoutingModule { } diff --git a/src/app/app.component.html b/src/app/app.component.html index a154ac5..9fde759 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,22 +1,8 @@ - -
-

- Welcome to {{ title }}! -

-

Welcome to

- Angular Logo -
-

Here are some links to help you start:

- - + +

+ Welcome to {{ title }}! +

+

Welcome to

diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 95e0865..b57e44d 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,8 +1,8 @@ -import { TestBed, async } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { AppComponent } from './app.component'; +import { TestBed, async } from "@angular/core/testing"; +import { RouterTestingModule } from "@angular/router/testing"; +import { AppComponent } from "./app.component"; -describe('AppComponent', () => { +describe("AppComponent", () => { beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ @@ -14,7 +14,7 @@ describe('AppComponent', () => { }).compileComponents(); })); - it('should create the app', () => { + it("should create the app", () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); @@ -23,13 +23,13 @@ describe('AppComponent', () => { it(`should have as title 'cavallium-website'`, () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; - expect(app.title).toEqual('cavallium-website'); + expect(app.title).toEqual("cavallium-website"); }); - it('should render title in a h1 tag', () => { + it("should render title in a h1 tag", () => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.debugElement.nativeElement; - expect(compiled.querySelector('h1').textContent).toContain('Welcome to cavallium-website!'); + expect(compiled.querySelector("h1").textContent).toContain("Welcome to cavallium-website!"); }); }); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 0358874..af8c30c 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,10 +1,10 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] + selector: "app-root", + templateUrl: "./app.component.html", + styleUrls: ["./app.component.scss"] }) export class AppComponent { - title = 'cavallium-website'; + title = "cavallium-website"; } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index c2d9935..7b906a3 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,18 +1,22 @@ -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; +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 './pages/home/home.component'; -import { NavbarComponent } from './gui/navbar/navbar.component'; -import { FooterComponent } from './gui/footer/footer.component'; +import { AppRoutingModule } from "./app-routing.module"; +import { AppComponent } from "./app.component"; +import { HomeComponent } from "./pages/home/home.component"; +import { NavbarComponent } from "./gui/navbar/navbar.component"; +import { FooterComponent } from "./gui/footer/footer.component"; +import { ArticleComponent } from "./article/article.component"; +import { RouterEmptyComponent } from "./gui/router-empty/router-empty.component"; @NgModule({ declarations: [ AppComponent, HomeComponent, NavbarComponent, - FooterComponent + FooterComponent, + ArticleComponent, + RouterEmptyComponent ], imports: [ BrowserModule, diff --git a/src/app/article/article.component.html b/src/app/article/article.component.html new file mode 100644 index 0000000..684915b --- /dev/null +++ b/src/app/article/article.component.html @@ -0,0 +1,3 @@ +

+ article works! +

diff --git a/src/app/article/article.component.scss b/src/app/article/article.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/article/article.component.spec.ts b/src/app/article/article.component.spec.ts new file mode 100644 index 0000000..19b11ab --- /dev/null +++ b/src/app/article/article.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { ArticleComponent } from "./article.component"; + +describe("ArticleComponent", () => { + let component: ArticleComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ArticleComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ArticleComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/article/article.component.ts b/src/app/article/article.component.ts new file mode 100644 index 0000000..abadd4c --- /dev/null +++ b/src/app/article/article.component.ts @@ -0,0 +1,19 @@ +import { Component, OnInit } from "@angular/core"; +import { ActivatedRoute, UrlSegment } from "@angular/router"; + +@Component({ + selector: "app-article", + templateUrl: "./article.component.html", + styleUrls: ["./article.component.scss"] +}) +export class ArticleComponent implements OnInit { + + constructor(private activatedRoute: ActivatedRoute) { } + + ngOnInit() { + this.activatedRoute.data.subscribe(console.log); + this.activatedRoute.params.subscribe(console.log); + this.activatedRoute.url.subscribe((url: UrlSegment[]) => console.log(url.map((urlSegment) => urlSegment.path).join("/"))); + } + +} diff --git a/src/app/gui/footer/footer.component.spec.ts b/src/app/gui/footer/footer.component.spec.ts index 2ca6c45..f21c586 100644 --- a/src/app/gui/footer/footer.component.spec.ts +++ b/src/app/gui/footer/footer.component.spec.ts @@ -1,8 +1,8 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { async, ComponentFixture, TestBed } from "@angular/core/testing"; -import { FooterComponent } from './footer.component'; +import { FooterComponent } from "./footer.component"; -describe('FooterComponent', () => { +describe("FooterComponent", () => { let component: FooterComponent; let fixture: ComponentFixture; @@ -19,7 +19,7 @@ describe('FooterComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/gui/footer/footer.component.ts b/src/app/gui/footer/footer.component.ts index da17d82..2fe22bd 100644 --- a/src/app/gui/footer/footer.component.ts +++ b/src/app/gui/footer/footer.component.ts @@ -1,9 +1,9 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-footer', - templateUrl: './footer.component.html', - styleUrls: ['./footer.component.scss'] + selector: "app-footer", + templateUrl: "./footer.component.html", + styleUrls: ["./footer.component.scss"] }) export class FooterComponent implements OnInit { diff --git a/src/app/gui/navbar/navbar.component.html b/src/app/gui/navbar/navbar.component.html index 387751c..cf7832c 100644 --- a/src/app/gui/navbar/navbar.component.html +++ b/src/app/gui/navbar/navbar.component.html @@ -1,3 +1,18 @@ -

- navbar works! -

+ + +
+ +
+ + \ No newline at end of file diff --git a/src/app/gui/navbar/navbar.component.spec.ts b/src/app/gui/navbar/navbar.component.spec.ts index 9032ad2..318e875 100644 --- a/src/app/gui/navbar/navbar.component.spec.ts +++ b/src/app/gui/navbar/navbar.component.spec.ts @@ -1,8 +1,8 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { async, ComponentFixture, TestBed } from "@angular/core/testing"; -import { NavbarComponent } from './navbar.component'; +import { NavbarComponent } from "./navbar.component"; -describe('NavbarComponent', () => { +describe("NavbarComponent", () => { let component: NavbarComponent; let fixture: ComponentFixture; @@ -19,7 +19,7 @@ describe('NavbarComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/gui/navbar/navbar.component.ts b/src/app/gui/navbar/navbar.component.ts index a1b4d25..015e37d 100644 --- a/src/app/gui/navbar/navbar.component.ts +++ b/src/app/gui/navbar/navbar.component.ts @@ -1,15 +1,38 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit } from "@angular/core"; +import { NavigationLink } from "src/app/symbols/NavigationLink"; @Component({ - selector: 'app-navbar', - templateUrl: './navbar.component.html', - styleUrls: ['./navbar.component.scss'] + selector: "app-navbar", + templateUrl: "./navbar.component.html", + styleUrls: ["./navbar.component.scss"] }) export class NavbarComponent implements OnInit { - constructor() { } + public navigationLinks: NavigationLink[] = [ + { + text: "Software", + address: "/article/software" + }, + { + text: "Midi23D", + address: "/article/midi23d" + }, + { + text: "Calculator", + address: "/article/calculator", + newtab: true + }, + { + text: "Github", + address: "https://github.com/Cavallium/WarpPI", + external: true, + newtab: false + }, + ]; - ngOnInit() { - } + constructor() { } + + ngOnInit() { + } } diff --git a/src/app/gui/router-empty/router-empty.component.html b/src/app/gui/router-empty/router-empty.component.html new file mode 100644 index 0000000..90c6b64 --- /dev/null +++ b/src/app/gui/router-empty/router-empty.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/app/gui/router-empty/router-empty.component.scss b/src/app/gui/router-empty/router-empty.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/gui/router-empty/router-empty.component.spec.ts b/src/app/gui/router-empty/router-empty.component.spec.ts new file mode 100644 index 0000000..267430a --- /dev/null +++ b/src/app/gui/router-empty/router-empty.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from "@angular/core/testing"; + +import { RouterEmptyComponent } from "./router-empty.component"; + +describe("RouterEmptyComponent", () => { + let component: RouterEmptyComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RouterEmptyComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RouterEmptyComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/gui/router-empty/router-empty.component.ts b/src/app/gui/router-empty/router-empty.component.ts new file mode 100644 index 0000000..a8faf24 --- /dev/null +++ b/src/app/gui/router-empty/router-empty.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from "@angular/core"; + +@Component({ + selector: "app-router-empty", + templateUrl: "./router-empty.component.html", + styleUrls: ["./router-empty.component.scss"] +}) +export class RouterEmptyComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/pages/home/home.component.spec.ts b/src/app/pages/home/home.component.spec.ts index 490e81b..dc3acde 100644 --- a/src/app/pages/home/home.component.spec.ts +++ b/src/app/pages/home/home.component.spec.ts @@ -1,8 +1,8 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { async, ComponentFixture, TestBed } from "@angular/core/testing"; -import { HomeComponent } from './home.component'; +import { HomeComponent } from "./home.component"; -describe('HomeComponent', () => { +describe("HomeComponent", () => { let component: HomeComponent; let fixture: ComponentFixture; @@ -19,7 +19,7 @@ describe('HomeComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/home/home.component.ts b/src/app/pages/home/home.component.ts index f56c8c1..5ba21b5 100644 --- a/src/app/pages/home/home.component.ts +++ b/src/app/pages/home/home.component.ts @@ -1,9 +1,9 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-home', - templateUrl: './home.component.html', - styleUrls: ['./home.component.scss'] + selector: "app-home", + templateUrl: "./home.component.html", + styleUrls: ["./home.component.scss"] }) export class HomeComponent implements OnInit { diff --git a/src/app/services/document-fetch.service.spec.ts b/src/app/services/document-fetch.service.spec.ts new file mode 100644 index 0000000..aed0b5f --- /dev/null +++ b/src/app/services/document-fetch.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from "@angular/core/testing"; + +import { DocumentFetchService } from "./document-fetch.service"; + +describe("DocumentFetchService", () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it("should be created", () => { + const service: DocumentFetchService = TestBed.get(DocumentFetchService); + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/document-fetch.service.ts b/src/app/services/document-fetch.service.ts new file mode 100644 index 0000000..ced52d9 --- /dev/null +++ b/src/app/services/document-fetch.service.ts @@ -0,0 +1,44 @@ +import { Injectable } from "@angular/core"; +import { Observable } from "rxjs"; +import { DocumentData } from "../symbols/DocumentData"; +import { HttpClient, Request, Response } from "selenium-webdriver/http"; +import { encodeUriSegment } from "@angular/router/src/url_tree"; + +@Injectable({ + providedIn: "root" +}) +export class DocumentFetchService { + + constructor(private http: HttpClient) {} + + public async fetch(unsafeId: string): Promise { + const encodedId = this.encodeId(unsafeId); + const response: Response = await this.http.send(new Request("GET", "/documents/" + encodedId + ".md")); + if (response.status === 200) { + return { + found: true, + id: encodedId, + content: await response.body + }; + } + return { + found: false, + id: encodedId, + content: await this.fetchErrorContent(404) + }; + } + + public async fetchErrorContent(errorCode: number): Promise { + if (errorCode > 0 && errorCode <= 700) { + const response: Response = await this.http.send(new Request("GET", "/documents/" + errorCode + ".md")); + if (response.status === 200) { + return await response.body; + } + } + return "Error " + errorCode + "."; + } + + private encodeId(id: string): string { + return id.split("/").map(encodeUriSegment).filter((part) => part !== "." && part !== "..").join("/"); + } +} diff --git a/src/app/symbols/DocumentData.ts b/src/app/symbols/DocumentData.ts new file mode 100644 index 0000000..883b7b4 --- /dev/null +++ b/src/app/symbols/DocumentData.ts @@ -0,0 +1,5 @@ +export interface DocumentData { + id: string; + content: string; + found: boolean; +} diff --git a/src/app/symbols/NavigationLink.ts b/src/app/symbols/NavigationLink.ts new file mode 100644 index 0000000..7a1f182 --- /dev/null +++ b/src/app/symbols/NavigationLink.ts @@ -0,0 +1,6 @@ +export interface NavigationLink { + address: string; + text: string; + external?: boolean; + newtab?: boolean; +} diff --git a/src/assets/Muli-600i-latin.woff2 b/src/assets/Muli-600i-latin.woff2 new file mode 100644 index 0000000..7ecfe8b Binary files /dev/null and b/src/assets/Muli-600i-latin.woff2 differ diff --git a/src/assets/Muli-600i-latinext.woff2 b/src/assets/Muli-600i-latinext.woff2 new file mode 100644 index 0000000..2b9d9d5 Binary files /dev/null and b/src/assets/Muli-600i-latinext.woff2 differ diff --git a/src/assets/Muli-600r-latin.woff2 b/src/assets/Muli-600r-latin.woff2 new file mode 100644 index 0000000..797ce47 Binary files /dev/null and b/src/assets/Muli-600r-latin.woff2 differ diff --git a/src/assets/Muli-600r-latinext.woff2 b/src/assets/Muli-600r-latinext.woff2 new file mode 100644 index 0000000..cc2ce3d Binary files /dev/null and b/src/assets/Muli-600r-latinext.woff2 differ diff --git a/src/assets/Muli-800i-latin.woff2 b/src/assets/Muli-800i-latin.woff2 new file mode 100644 index 0000000..d603687 Binary files /dev/null and b/src/assets/Muli-800i-latin.woff2 differ diff --git a/src/assets/Muli-800i-latinext.woff2 b/src/assets/Muli-800i-latinext.woff2 new file mode 100644 index 0000000..dc89b88 Binary files /dev/null and b/src/assets/Muli-800i-latinext.woff2 differ diff --git a/src/assets/Muli-800r-latin.woff2 b/src/assets/Muli-800r-latin.woff2 new file mode 100644 index 0000000..e3269ff Binary files /dev/null and b/src/assets/Muli-800r-latin.woff2 differ diff --git a/src/assets/Muli-800r-latinext.woff2 b/src/assets/Muli-800r-latinext.woff2 new file mode 100644 index 0000000..d2e2a37 Binary files /dev/null and b/src/assets/Muli-800r-latinext.woff2 differ diff --git a/src/index.html b/src/index.html index e8572d3..7516355 100644 --- a/src/index.html +++ b/src/index.html @@ -1,5 +1,5 @@ - + CavalliumWebsite diff --git a/src/main.ts b/src/main.ts index c7b673c..c41b6f5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,8 @@ -import { enableProdMode } from '@angular/core'; -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { enableProdMode } from "@angular/core"; +import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; -import { AppModule } from './app/app.module'; -import { environment } from './environments/environment'; +import { AppModule } from "./app/app.module"; +import { environment } from "./environments/environment"; if (environment.production) { enableProdMode(); diff --git a/src/polyfills.ts b/src/polyfills.ts index 75d6393..2f9b899 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -55,7 +55,7 @@ /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ -import 'zone.js/dist/zone'; // Included with Angular CLI. +import "zone.js/dist/zone"; // Included with Angular CLI. /*************************************************************************************************** diff --git a/src/styles-fonts.scss b/src/styles-fonts.scss new file mode 100644 index 0000000..af11281 --- /dev/null +++ b/src/styles-fonts.scss @@ -0,0 +1,67 @@ +/* latin-ext */ +@font-face { + font-family: 'Muli-custom'; + font-style: italic; + font-weight: 600; + src: local('Muli SemiBold Italic'), local('Muli-SemiBoldItalic'), url(/assets/Muli-600i-latinext.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Muli-custom'; + font-style: italic; + font-weight: 600; + src: local('Muli SemiBold Italic'), local('Muli-SemiBoldItalic'), url(/assets/Muli-600i-latin.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +/* latin-ext */ +@font-face { + font-family: 'Muli-custom'; + font-style: italic; + font-weight: 800; + src: local('Muli ExtraBold Italic'), local('Muli-ExtraBoldItalic'), url(/assets/Muli-800i-latinext.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Muli-custom'; + font-style: italic; + font-weight: 800; + src: local('Muli ExtraBold Italic'), local('Muli-ExtraBoldItalic'), url(/assets/Muli-800i-latin.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +/* latin-ext */ +@font-face { + font-family: 'Muli-custom'; + font-style: normal; + font-weight: 600; + src: local('Muli SemiBold'), local('Muli-SemiBold'), url(/assets/Muli-600r-latinext.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Muli-custom'; + font-style: normal; + font-weight: 600; + src: local('Muli SemiBold'), local('Muli-SemiBold'), url(/assets/Muli-600r-latin.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +/* latin-ext */ +@font-face { + font-family: 'Muli-custom'; + font-style: normal; + font-weight: 800; + src: local('Muli ExtraBold'), local('Muli-ExtraBold'), url(/assets/Muli-800r-latinext.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Muli-custom'; + font-style: normal; + font-weight: 800; + src: local('Muli ExtraBold'), local('Muli-ExtraBold'), url(/assets/Muli-800r-latin.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} \ No newline at end of file diff --git a/src/styles.scss b/src/styles.scss index 90d4ee0..3219489 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -1 +1,9 @@ /* You can add global styles to this file, and also import other style files */ +body { + margin: 0; + font-family: "Muli-custom", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + font-weight: 600; +} +strong, b, h1, h2, h3, h4, h5, h6, th { + font-weight: 800; +} \ No newline at end of file diff --git a/src/test.ts b/src/test.ts index 1631789..1506a2a 100644 --- a/src/test.ts +++ b/src/test.ts @@ -1,11 +1,11 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files -import 'zone.js/dist/zone-testing'; -import { getTestBed } from '@angular/core/testing'; +import "zone.js/dist/zone-testing"; +import { getTestBed } from "@angular/core/testing"; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; +} from "@angular/platform-browser-dynamic/testing"; declare const require: any; @@ -15,6 +15,6 @@ getTestBed().initTestEnvironment( platformBrowserDynamicTesting() ); // Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); +const context = require.context("./", true, /\.spec\.ts$/); // And load the modules. context.keys().map(context); diff --git a/tslint.json b/tslint.json index 868ecba..c8882b7 100644 --- a/tslint.json +++ b/tslint.json @@ -56,10 +56,10 @@ ], "object-literal-sort-keys": false, "ordered-imports": false, - "quotemark": [ - true, - "single" - ], + "quotemark": { + "options": "double", + "severity": "warning" + }, "trailing-comma": false, "no-output-on-prefix": true, "use-input-property-decorator": true, @@ -70,6 +70,10 @@ "use-life-cycle-interface": true, "use-pipe-transform-interface": true, "component-class-suffix": true, - "directive-class-suffix": true + "directive-class-suffix": true, + "indent": { + "options": "tabs", + "severity": "warning" + } } }