diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 082531a..215af92 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,23 +1,87 @@ import { NgModule } from "@angular/core"; -import { Routes, RouterModule } from "@angular/router"; +import { Routes, RouterModule, UrlSegment, UrlMatchResult } from "@angular/router"; import { ArticleComponent } from "./article/article.component"; import { RouterEmptyComponent } from "./gui/router-empty/router-empty.component"; +import { NavigationLink } from "./symbols/NavigationLink"; const routes: Routes = [ { path: "", - component: ArticleComponent + component: ArticleComponent, + data: { + resolveUrlPaths: false + }, }, { - path: "page", + matcher: pageMatcher, component: RouterEmptyComponent, children: [{ path: "**", + data: { + resolveUrlPaths: false + }, component: ArticleComponent }] + }, + { + matcher: fwlinkMatcher, + component: RouterEmptyComponent, + children: [{ + path: "**", + data: { + resolveUrlPaths: true + }, + component: ArticleComponent + }] + }, + { + path: "**", + data: { + notFound: true + }, + component: ArticleComponent } ]; +export const navigationLinks: NavigationLink[] = [ + { + text: "WarpPI", + address: "/page/WarpPI" + }, + { + text: "Midi23D", + address: "/page/software/Midi23D" + }, + { + text: "Contacts", + address: "/page/contacts" + }, + { + text: "Github ↗", + address: "https://github.com/Cavallium", + external: true, + newtab: true + }, +]; + +export function pageMatcher(url: UrlSegment[]): UrlMatchResult { + if (url.length > 1) { + if (url[0].path === "page") { + return { consumed: [url[0]] }; + } + } + return null; +} + +export function fwlinkMatcher(url: UrlSegment[]): UrlMatchResult { + if (url.length === 1) { + if (url[0].path === "fwlink.php") { + return { consumed: url }; + } + } + return null; +} + @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] diff --git a/src/app/app.module.ts b/src/app/app.module.ts index d0f9baf..1451e6e 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -10,9 +10,10 @@ import { ArticleComponent } from "./article/article.component"; import { RouterEmptyComponent } from "./gui/router-empty/router-empty.component"; import {HttpClientModule} from "@angular/common/http"; import { MarkdownModule, MarkedOptions, MarkedRenderer, MarkdownComponent } from "ngx-markdown"; -import { BigLogoComponent } from './gui/big-logo/big-logo.component'; -import { ServiceWorkerModule } from '@angular/service-worker'; -import { environment } from '../environments/environment'; +import { BigLogoComponent } from "./gui/big-logo/big-logo.component"; +import { ServiceWorkerModule } from "@angular/service-worker"; +import { environment } from "../environments/environment"; +import { isString } from "util"; @NgModule({ declarations: [ @@ -48,7 +49,19 @@ export function markedOptionsFactory(): MarkedOptions { return "

" + text + "

"; }; renderer.link = (href: string, title: string, text: string) => { - return "" + text + ""; + let result = ""; + return result; + }; + + renderer.image = (href: string, title: string, text: string) => { + return "\"""; }; return { diff --git a/src/app/article/article.component.ts b/src/app/article/article.component.ts index b4cd586..baa5116 100644 --- a/src/app/article/article.component.ts +++ b/src/app/article/article.component.ts @@ -1,10 +1,13 @@ -import { Component, OnInit, OnDestroy } from "@angular/core"; -import { ActivatedRoute, UrlSegment } from "@angular/router"; +import { Component, OnInit, OnDestroy, HostListener } from "@angular/core"; +import { ActivatedRoute, UrlSegment, Params, Router } from "@angular/router"; import { map } from "rxjs/operators"; import { DocumentFetchService } from "../services/document-fetch.service"; import { DocumentData } from "../symbols/DocumentData"; import { MarkdownService } from "ngx-markdown"; import { CurrentDocumentService } from "../services/current-document.service"; +import { combineLatest } from "rxjs"; +import { fwlinkMapper } from "../fwlink-mapper"; +import { isObject, isString } from "util"; @Component({ selector: "app-article", @@ -19,17 +22,53 @@ export class ArticleComponent implements OnInit, OnDestroy { private activatedRoute: ActivatedRoute, private documentFetcher: DocumentFetchService, private markdownService: MarkdownService, - private currentDocumentService: CurrentDocumentService - ) { } + private currentDocumentService: CurrentDocumentService, + private router: Router + ) { } ngOnInit() { - this.activatedRoute.url - .pipe(map((urlSegments: UrlSegment[]) => urlSegments.map(urlSegment => urlSegment.path).join("/"))) - .subscribe(async (url: string) => { - const docData: DocumentData = await this.documentFetcher.fetch(url); - this.documentData = docData; - this.currentDocumentService.setCurrentDocument(docData); - }); + const urlEvent = this.activatedRoute.url + .pipe(map((urlSegments: UrlSegment[]) => urlSegments.map(urlSegment => urlSegment.path).join("/"))); + + const dataEvent = this.activatedRoute.data + .pipe(map(data => { + return { + resolveUrlPaths: data.resolveUrlPaths === true, + notFound: data.notFound === true + }; + })); + + const queryEvent = this.activatedRoute.queryParams + .pipe(map((params: Params) => isString(params.page) ? params.page : params.p)); + + combineLatest(urlEvent, dataEvent, queryEvent) + .pipe(map((combined) => { + return { + url: combined[0], + queryPage: combined[2], + resolveUrlPaths: combined[1].resolveUrlPaths, + notFound: combined[1].notFound, + }; + })) + .subscribe(async (data) => { + let resolvedUrl: string; + if (!data.notFound) { + if (data.resolveUrlPaths) { + resolvedUrl = fwlinkMapper(data.queryPage); + } else { + if ((isString(data.url) && data.url.length === 0 || !isString(data.url)) && isString(data.queryPage) && data.queryPage.length > 0) { + resolvedUrl = data.queryPage; + } else { + resolvedUrl = data.url; + } + } + } else { + resolvedUrl = "404"; + } + const docData: DocumentData = await this.documentFetcher.fetch(resolvedUrl); + this.documentData = docData; + this.currentDocumentService.setCurrentDocument(docData); + }); } @@ -37,4 +76,15 @@ export class ArticleComponent implements OnInit, OnDestroy { this.currentDocumentService.setCurrentDocument(null); } + @HostListener("click", ["$event"]) + public onClick(e: Event) { + if (isObject(e.target)) { + const target = e.target as HTMLLinkElement; + if (isString(target.dataset.routerlink)) { + e.preventDefault(); + this.router.navigateByUrl(target.dataset.routerlink); + } + } + } + } diff --git a/src/app/fwlink-mapper.ts b/src/app/fwlink-mapper.ts new file mode 100644 index 0000000..7e75eee --- /dev/null +++ b/src/app/fwlink-mapper.ts @@ -0,0 +1,35 @@ +import { isString } from "util"; + +const redirects = { + home: "index", + homepage: "index", + "home page": "index", + license: "license", + software: "software", + "segnalazione app": "contacts", + "Gatecraft Apps": "discontinued/warpgate-apps", + "WarpGate Apps": "discontinued/warpgate-apps", + "WarpGate Store": "discontinued/warpgate-apps", + ServerStore: "discontinued/warpgate-apps", + feedback: "contacts", + login: "discontinued/gatecraft-accounts", + account: "discontinued/gatecraft-accounts", + modpack: "discontinued/gatepack", + gatepack: "discontinued/gatepack", + G2CardboardFix: "android/g2cardboard", + warppi: "WarpPI", + midi23D: "software/Midi23D", + mid23D: "software/Midi23D", + "elettronica/WarpPi": "WarpPI", + "elettronica/midi23D": "software/Midi23D", + "modpack/guida": "discontinued/gatepack", + "modpack/base/mondi": "discontinued/gatepack", +}; + +export function fwlinkMapper(url: string): string { + if (isString(redirects[url])) { + return redirects[url]; + } else { + return url; + } +} diff --git a/src/app/gui/big-logo/big-logo.component.scss b/src/app/gui/big-logo/big-logo.component.scss index 5ade9cb..13dde7e 100644 --- a/src/app/gui/big-logo/big-logo.component.scss +++ b/src/app/gui/big-logo/big-logo.component.scss @@ -1,7 +1,7 @@ @import "../../../styles-variables.scss"; :host { display: block; - background-color: $color-main; + background: linear-gradient(0deg, $color-main, $color-main-darker); color: white; text-align: center; position: relative; diff --git a/src/app/gui/navbar/navbar.component.ts b/src/app/gui/navbar/navbar.component.ts index 2057291..66f71eb 100644 --- a/src/app/gui/navbar/navbar.component.ts +++ b/src/app/gui/navbar/navbar.component.ts @@ -3,6 +3,7 @@ import { NavigationLink } from "src/app/symbols/NavigationLink"; import { ActivatedRoute, UrlSegment } from "@angular/router"; import { map } from "rxjs/operators"; import { CurrentDocumentService } from "src/app/services/current-document.service"; +import { navigationLinks } from "src/app/app-routing.module"; @Component({ selector: "app-navbar", @@ -11,23 +12,7 @@ import { CurrentDocumentService } from "src/app/services/current-document.servic }) export class NavbarComponent implements OnInit, AfterViewInit { - public navigationLinks: NavigationLink[] = [ - { - text: "Midi23D", - address: "/page/Midi23D" - }, - { - text: "WarpPI Calculator", - address: "/page/WarpPI", - newtab: false - }, - { - text: "Github", - address: "https://github.com/Cavallium/WarpPI", - external: true, - newtab: true - }, - ]; + public navigationLinks: NavigationLink[] = navigationLinks; stickedOnTop = false; overflowLogo = false; overflowMax = false; diff --git a/src/app/services/document-fetch.service.ts b/src/app/services/document-fetch.service.ts index 59dd570..52f5c3c 100644 --- a/src/app/services/document-fetch.service.ts +++ b/src/app/services/document-fetch.service.ts @@ -2,6 +2,7 @@ import { Injectable } from "@angular/core"; import { DocumentData } from "../symbols/DocumentData"; import { HttpClient } from "@angular/common/http"; import { take } from "rxjs/operators"; +import { fwlinkMapper } from "../fwlink-mapper"; @Injectable({ providedIn: "root" @@ -22,11 +23,12 @@ export class DocumentFetchService { public async fetch(unsafeId: string): Promise { const encodedId = this.encodeId(unsafeId); + try { - return await this.fetchWithLanguage(encodedId, this.language); + return await this.fetchInternal(encodedId); } catch (e) { try { - return await this.fetchWithLanguage(encodedId, "en"); + return await this.fetchInternal(this.encodeId(fwlinkMapper(encodedId))); } catch (e) { return { found: false, @@ -37,8 +39,15 @@ export class DocumentFetchService { } } - private async fetchWithLanguage(unsafeId: string, language: string): Promise { - const encodedId = this.encodeId(unsafeId); + private async fetchInternal(encodedId: string): Promise { + try { + return await this.fetchWithLanguage(encodedId, this.language); + } catch (e) { + return await this.fetchWithLanguage(encodedId, "en"); + } + } + + private async fetchWithLanguage(encodedId: string, language: string): Promise { const response: string = await this.http.get("/documents/" + encodedId + "." + language + ".md", { responseType: "text" }) .pipe(take(1)).toPromise(); return { @@ -61,7 +70,7 @@ export class DocumentFetchService { } private encodeId(id: string): string { - const encoded = id.split("/").map(encodeURIComponent).filter((part) => part.length > 0 && !/[^a-zA-Z0-9_-àùéèì]/.test(part)).join("/"); + const encoded = id.split("/").map(encodeURIComponent).filter((part) => part.length > 0 && !/[^a-zA-Z0-9_\-àùéèì]/.test(part)).join("/"); if (encoded.length > 0) { return encoded; } else { diff --git a/src/assets/midi23d/delta.svg b/src/assets/midi23d/delta.svg new file mode 100644 index 0000000..835f270 --- /dev/null +++ b/src/assets/midi23d/delta.svg @@ -0,0 +1,463 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Known values:time = note timesx = motor X speed (note)Unknown values:stot = total speed∆px = motor X position + + diff --git a/src/assets/midi23d/midi-gui.png b/src/assets/midi23d/midi-gui.png new file mode 100644 index 0000000..52c6104 Binary files /dev/null and b/src/assets/midi23d/midi-gui.png differ diff --git a/src/documents/WarpPI.en.md b/src/documents/WarpPI.en.md new file mode 100644 index 0000000..7affc0b --- /dev/null +++ b/src/documents/WarpPI.en.md @@ -0,0 +1,3 @@ +# WarpPI Calculator + +https://github.com/Cavallium/WarpPI diff --git a/src/documents/WarpPi.it.md b/src/documents/WarpPi.it.md new file mode 100644 index 0000000..a44310a --- /dev/null +++ b/src/documents/WarpPi.it.md @@ -0,0 +1,3 @@ +# Calcolatrice WarpPI + +https://github.com/Cavallium/WarpPI diff --git a/src/documents/contacts.en.md b/src/documents/contacts.en.md new file mode 100644 index 0000000..5ef36a8 --- /dev/null +++ b/src/documents/contacts.en.md @@ -0,0 +1,15 @@ +# Contacts + +## Andrea Cavalli (Cavallium) + +Enthusiast programmer. + +[**My LinkedIn account**](https://www.linkedin.com/in/cavallium/?trk=profile-badge) + +**e-mail**: nospam@warp.ovh + +**Location**: Milan, Italy + +**Telegram**: @Cavaiiium + +**Twitter**: [@Cavallium](https://twitter.com/Cavallium) \ No newline at end of file diff --git a/src/documents/contacts.it.md b/src/documents/contacts.it.md new file mode 100644 index 0000000..c68d304 --- /dev/null +++ b/src/documents/contacts.it.md @@ -0,0 +1,15 @@ +# Contatti + +## Andrea Cavalli (Cavallium) + +Programmatore e Web developer per passione + +[**Il mio account LinkedIn**](https://www.linkedin.com/in/cavallium/?trk=profile-badge) + +**e-mail**: nospam@warp.ovh + +**Posizione**: Milano, Italia + +**Telegram**: @Cavaiiium + +**Twitter**: [@Cavallium](https://twitter.com/Cavallium) \ No newline at end of file diff --git a/src/documents/discontinued/gatecraft-accounts.en.md b/src/documents/discontinued/gatecraft-accounts.en.md new file mode 100644 index 0000000..ad5d4cd --- /dev/null +++ b/src/documents/discontinued/gatecraft-accounts.en.md @@ -0,0 +1,5 @@ +# Gatecraft account + +## This service is no longer available + +For more information contact me: *nospam@warp.ovh* diff --git a/src/documents/discontinued/gatepack.en.md b/src/documents/discontinued/gatepack.en.md new file mode 100644 index 0000000..699d6ff --- /dev/null +++ b/src/documents/discontinued/gatepack.en.md @@ -0,0 +1,5 @@ +# GatePack + +## This service is no longer available + +For more information contact me: *nospam@warp.ovh* diff --git a/src/documents/discontinued/gatepack.it.md b/src/documents/discontinued/gatepack.it.md new file mode 100644 index 0000000..f1cbee1 --- /dev/null +++ b/src/documents/discontinued/gatepack.it.md @@ -0,0 +1,5 @@ +# GatePack + +## Questo servizio non è più disponibile + +Per maggiori informazioni contatta: *nospam@warp.ovh* diff --git a/src/documents/discontinued/warpgate-apps.en.md b/src/documents/discontinued/warpgate-apps.en.md new file mode 100644 index 0000000..32e4b2e --- /dev/null +++ b/src/documents/discontinued/warpgate-apps.en.md @@ -0,0 +1,5 @@ +# WarpGate Apps + +## This service is no longer available + +For more information contact me: *nospam@warp.ovh* diff --git a/src/documents/discontinued/warpgate-apps.it.md b/src/documents/discontinued/warpgate-apps.it.md new file mode 100644 index 0000000..e122944 --- /dev/null +++ b/src/documents/discontinued/warpgate-apps.it.md @@ -0,0 +1,5 @@ +# WarpGate Apps + +## Questo servizio non è più disponibile + +Per maggiori informazioni contatta: *nospam@warp.ovh* diff --git a/src/documents/index.en.md b/src/documents/index.en.md index 9b633dc..2c11d7e 100644 --- a/src/documents/index.en.md +++ b/src/documents/index.en.md @@ -2,19 +2,22 @@ **Cavallium.it** è il mio sito personale, in cui pubblico varie pagine riguardanti le mie creazioni nell'ambito informatico. -Dato che mi piace creare siti web, Cavallium.it è stato fatto interamente da me nel 2019 utilizzando Angular 9. +Attualmente sviluppo sia in ambito desktop che web. -Oltre alle pagine web mi piace creare applicazioni, sia web che desktop. Nel 2016 ho iniziato ad avvicinarmi anche all'elettronica, iniziando a progettare la calcolatrice WarpPI. -Negli ultimi tre anni mi sono focalizzato sullo sviluppo di **applicazioni web** e **progressive web apps** usando il framework **Angular** insieme a **RxJs** e **Firebase**, oltre a sviluppare software in **Java**. La maggior parte delle web app che ho sviluppato non possono essere mostrate pubblicamente qui, nonostante ciò le altre web app che ho sviluppato sono: +Negli ultimi tre anni mi sono focalizzato sullo sviluppo di **applicazioni web** e **progressive web apps** usando il framework **Angular** insieme a **RxJs** e **Firebase**, oltre a sviluppare software desktop in **Java**.\ +La maggior parte delle web app che ho sviluppato sono commissioni per privati, pertanto non possono essere mostrate pubblicamente qui, mentre i siti pubblici che ho creato sono i seguenti: + +* [Cavallium.it](https://cavallium.it) * [ExtraDrone.it](https://extradrone.it) -Il menù sottostante contiene solo i miei ultimi progetti più rilevanti (altrimenti avrei dovuto fare una lista infinitamente lunga piena di stupide prove e progetti sperimentali). +Il menù sottostante contiene i miei progetti più rilevanti. Dacci un'occhiata 😉 * [WarpPi Calculator](/page/WarpPI) -* [Midi23D](/page/Midi23D) -* [OpenRC Formula 1 Car](https://www.youtube.com/watch?v=EF921CLhXQg&vl=it&ab_channel=AndreaCavalli) +* [Midi23D](/page/software/Midi23D) -Oltre a questo sito possiedo un [server locale al seguente indirizzo](https://rk3328.cc) \ No newline at end of file +Possiedo anche un piccolo [server locale](https://local.cavallium.it) in cui pubblico alcuni esperimenti. + +[License](/page/license) diff --git a/src/documents/index.it.md b/src/documents/index.it.md index 9b633dc..28831a4 100644 --- a/src/documents/index.it.md +++ b/src/documents/index.it.md @@ -2,19 +2,22 @@ **Cavallium.it** è il mio sito personale, in cui pubblico varie pagine riguardanti le mie creazioni nell'ambito informatico. -Dato che mi piace creare siti web, Cavallium.it è stato fatto interamente da me nel 2019 utilizzando Angular 9. +Attualmente sviluppo sia in ambito desktop che web. -Oltre alle pagine web mi piace creare applicazioni, sia web che desktop. Nel 2016 ho iniziato ad avvicinarmi anche all'elettronica, iniziando a progettare la calcolatrice WarpPI. -Negli ultimi tre anni mi sono focalizzato sullo sviluppo di **applicazioni web** e **progressive web apps** usando il framework **Angular** insieme a **RxJs** e **Firebase**, oltre a sviluppare software in **Java**. La maggior parte delle web app che ho sviluppato non possono essere mostrate pubblicamente qui, nonostante ciò le altre web app che ho sviluppato sono: +Negli ultimi tre anni mi sono focalizzato sullo sviluppo di **applicazioni web** e **progressive web apps** usando il framework **Angular** insieme a **RxJs** e **Firebase**, oltre a sviluppare software desktop in **Java**.\ +La maggior parte delle web app che ho sviluppato sono commissioni per privati, pertanto non possono essere mostrate pubblicamente qui, mentre i siti pubblici che ho creato sono i seguenti: + +* [Cavallium.it](https://cavallium.it) * [ExtraDrone.it](https://extradrone.it) -Il menù sottostante contiene solo i miei ultimi progetti più rilevanti (altrimenti avrei dovuto fare una lista infinitamente lunga piena di stupide prove e progetti sperimentali). +Il menù sottostante contiene i miei progetti più rilevanti. Dacci un'occhiata 😉 * [WarpPi Calculator](/page/WarpPI) -* [Midi23D](/page/Midi23D) -* [OpenRC Formula 1 Car](https://www.youtube.com/watch?v=EF921CLhXQg&vl=it&ab_channel=AndreaCavalli) +* [Midi23D](/page/software/Midi23D) -Oltre a questo sito possiedo un [server locale al seguente indirizzo](https://rk3328.cc) \ No newline at end of file +Possiedo anche un piccolo [server locale](https://local.cavallium.it) in cui pubblico alcuni esperimenti. + +[Licenza](/page/license) \ No newline at end of file diff --git a/src/documents/license.en.md b/src/documents/license.en.md new file mode 100644 index 0000000..816c9fb --- /dev/null +++ b/src/documents/license.en.md @@ -0,0 +1,392 @@ +# License + +## Attribution-NoDerivatives 4.0 International + +``` +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + + +======================================================================= + +Creative Commons Attribution-NoDerivatives 4.0 International Public +License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution-NoDerivatives 4.0 International Public License ("Public +License"). To the extent this Public License may be interpreted as a +contract, You are granted the Licensed Rights in consideration of Your +acceptance of these terms and conditions, and the Licensor grants You +such rights in consideration of benefits the Licensor receives from +making the Licensed Material available under these terms and +conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + c. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + d. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + e. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + f. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + g. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + h. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + i. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + j. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce and reproduce, but not Share, Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material, You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + For the avoidance of doubt, You do not have permission under + this Public License to Share Adapted Material. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database, provided You do not Share + Adapted Material; + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. +``` diff --git a/src/documents/software.en.md b/src/documents/software.en.md new file mode 100644 index 0000000..d9f058c --- /dev/null +++ b/src/documents/software.en.md @@ -0,0 +1,6 @@ +# Software + +Here's my software: + +* [WarpPI Calculator](/page/WarpPI), an experimental calculator +* [Midi23D](/page/software/Midi23D), a tool to convert .midi files into playable GCODE files for cartesian printers diff --git a/src/documents/software.it.md b/src/documents/software.it.md new file mode 100644 index 0000000..d00c88d --- /dev/null +++ b/src/documents/software.it.md @@ -0,0 +1,6 @@ +# Software + +I miei software: + +* [Calcolatrice WarpPI](/page/WarpPI), una calcolatrice Algebrica sperimentale +* [Midi23D](/page/software/Midi23D), un programma per convertire i file .midi in codice GCODE adatto a quasi tutte le stampanti 3D cartesiane diff --git a/src/documents/software/midi23d.en.md b/src/documents/software/midi23d.en.md index 82a2752..1ddca06 100644 --- a/src/documents/software/midi23d.en.md +++ b/src/documents/software/midi23d.en.md @@ -1,3 +1,55 @@ # Midi23D -This is a test page \ No newline at end of file +## Summary + +**Midi23D** is a tool made in Java that converts every note of a .midi music into GCODE instructions to send directly to a 3D printer. + +![gui](/assets/midi23d/midi-gui.png) + +## How it works + +Every 3D printer has 3 or more particular motors, called **stepper motors**. Despite of the regular DC motors their angular speed and rotation be controlled very precisely. + +Sending an impulse to that motors, in addition to result in a rotation, it will produce a sound, that it can be modulated by changing it. + +With the GCODE you can tell to the 3D printer extruder to go in a position with a determined speed. + +Setting the right speed for each motor by sending to the printer only the position and the total speed seems difficult, but it's quite easy. +You must use this formula: + +![explanation](/assets/midi23d/delta.svg) + +In this way you can control simultaneously one note for each motor. + +## Usage + +First of all, download **_Midi23D.jar_** + +[Midi23D.jar](http://gdb.altervista.org/downloads/Midi23D.jar) + +Run the program by clicking on it if you have a GUI, or by executing it into your terminal: +`java -jar Midi23D.jar ` +_(Motor-test is a boolean (true/false) parameter that if it's true it plays the same notes on all the motors. It helps when you try to accord each motor speed)._ + +Insert the parameters that asks to you. + +Drag and drop the generated file into Repetier Host or your program that controls your printer. + +Enjoy + +## Samples + +* [Pokémon center.mid](http://gdb.altervista.org/downloads/midi/pokemon_center.mid) +* [Pokémon Red route 1.mid](http://gdb.altervista.org/downloads/midi/route_1.mid) +* [Pokémon Red route 24.mid](http://gdb.altervista.org/downloads/midi/route_24.mid) +* [Harry Potter theme.mid](http://gdb.altervista.org/downloads/midi/HarryPotter.mid) +* [Super Mario Bros theme.mid](http://gdb.altervista.org/downloads/midi/super_mario_bros.mid) +* [Castlevania Legends Boss.mid](http://gdb.altervista.org/downloads/midi/CVL_Boss.mid) +* [Harry Potter for gameboy Main menu.mid](http://gdb.altervista.org/downloads/midi/Harry_Potter_game_main_menu.mid) +* [Wild Pokémon encounter.mid](http://gdb.altervista.org/downloads/midi/wild_pokemon_battle.mid) + +## Videos + +
+ +
\ No newline at end of file diff --git a/src/index.html b/src/index.html index b0a596f..844d5e9 100644 --- a/src/index.html +++ b/src/index.html @@ -7,7 +7,7 @@ - + diff --git a/src/manifest.json b/src/manifest.json index 8f63eeb..a1396b9 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "name": "Cavallium.it", "short_name": "Cavallium.it", - "theme_color": "#1976d2", + "theme_color": "#2c41b9", "background_color": "#ffffff", "display": "minimal-ui", "scope": "/", diff --git a/src/styles-variables.scss b/src/styles-variables.scss index 0fc5ee0..17d9012 100644 --- a/src/styles-variables.scss +++ b/src/styles-variables.scss @@ -1,2 +1,3 @@ -$color-main: #3F51B5; +$color-main: #2c41b9; +$color-main-darker: #122792; $mobile-mode-size: 425px; \ No newline at end of file diff --git a/src/styles.scss b/src/styles.scss index c6cdaeb..4e4fe7c 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -20,10 +20,13 @@ strong, b, h1, h2, h3, h4, h5, h6, th { .document-style-warning{ color: red; } - -@media only screen, (any-pointer: fine) { - .article-link { - min-height: 48px; - display: inline-block; - } +.article-image { + max-width: 100%; } + +@media only screen and (any-pointer: coarse) { + .article-link { + line-height: 48px; + display: inline-block; + } +} \ No newline at end of file