]> gitweb.hhaalo.de Git - speisekarten-editor.git/commitdiff
add: export style for title
authorBastian Dehn <hhaalo@arcor.de>
Fri, 10 Jun 2022 19:50:05 +0000 (21:50 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 10 Jun 2022 19:50:05 +0000 (21:50 +0200)
src/app/html-export.service.ts

index ea821ab256bc40b8d554d4f54515a7de57aa5a0b..30dde62523bd7de04c733a648170bbe26abbf9c0 100644 (file)
@@ -22,6 +22,9 @@ export class HtmlExportService
                        html += '<meta charset="utf-8">';
                        html += '<meta name="viewport" content="width-device-width, initial-scale=1.0">';
                        html += '<title>Speisekarte</title>';
+                       html += '<style type="text/css" media="screen">';
+                       html += this.createHtmlStyle();
+                       html += '</style>';
                        html += '</head>';
                        html += '<body>';
                        html += this.createHtmlTitles(foodcard.Titles);
@@ -34,6 +37,23 @@ export class HtmlExportService
                return observ;
        }
 
+       private createHtmlStyle(): string
+       {
+               let stylestring = ""
+               stylestring += '@import url("https://fonts.googleapis.com/css?family=Tangerine");';
+               stylestring += '@font-face { font-family: "Tangerine"; }';
+               stylestring += 'h1 { font-family: "Tangerine", serif;';
+               stylestring += 'text-align: center; font-size: 2.5em;';
+               stylestring += 'margin: 1em 0; }';
+               stylestring += 'body { max-width: 60em; margin: 0 auto; }';
+
+               stylestring += '@media only screen and (min-width: 46.875em) {';
+               stylestring += 'h1 { text-align: left; }';
+               stylestring += '}';
+
+               return stylestring;
+       }
+
        private createHtmlTitles(titles: ITitle[]): string
        {
                let titlestring = "";