From 9a0fdc202a75c0b962fbd1a306e919e34302bab5 Mon Sep 17 00:00:00 2001 From: Christian Kremitzl Date: Thu, 25 Apr 2019 22:48:53 +0200 Subject: [PATCH] Start on dynamic square layout --- css/theme/latex.css | 70 ++++++++++++++++++++++++--- css/theme/source/latex.scss | 96 ++++++++++++++++++++++++++++++++++--- sections/german/04/04.md | 9 ++-- 3 files changed, 157 insertions(+), 18 deletions(-) diff --git a/css/theme/latex.css b/css/theme/latex.css index 7b1098e..6d2048f 100644 --- a/css/theme/latex.css +++ b/css/theme/latex.css @@ -1,4 +1,67 @@ +/* basic layout */ @import url("https://free.bboxtype.com/embedfonts/?family=FiraSans:300,600"); +body { + background: red; + font-size: 1vw; + /* transition: background 1s ease; */ } + body .layout-content-and-preview { + display: grid; + grid-template-rows: 100vw auto; + grid-template-columns: auto; + grid-template-areas: "content" "preview"; + min-height: 100vh; + max-height: 100vh; + min-width: 100vw; + max-width: 100vw; + overflow: auto; } + body .layout-content-and-preview .layout-content { + background: white; + grid-area: content; } + body .layout-content-and-preview .layout-preview { + grid-area: preview; + display: flex; + align-items: center; + justify-content: center; + /* padding: 4vw; */ } + body .layout-content-and-preview .layout-preview img { + opacity: .5; + width: auto; + height: auto; + max-width: 100%; + max-height: 100%; + box-shadow: 0.2em 0.2em 0.5em 0 rgba(0, 0, 0, 0.3); } + +/* +@media screen and (min-aspect-ratio: 1/2) { + $base-unit: 0.5vh; + body { + background: orange; + .layout-content-and-preview { + grid-template-rows: 50vh auto; + grid-template-columns: auto 50vh auto; + grid-template-areas: + " . content . " + "preview preview preview"; + } + } +} +*/ +@media screen and (min-aspect-ratio: 1 / 1) { + body { + background: yellow; } + body .layout-content-and-preview { + grid-template-rows: auto 50vw auto; + grid-template-columns: 50vw auto; + grid-template-areas: " . preview" "content preview" " . preview"; } } + +@media screen and (min-aspect-ratio: 2 / 1) { + body { + background: lime; } + body .layout-content-and-preview { + grid-template-rows: 100vh; + grid-template-columns: 100vh auto; + grid-template-areas: "content preview"; } } + @font-face { font-family: 'Fira Code'; src: url("../../lib/font/fira-code/FiraCode-Regular.otf"); @@ -12,12 +75,7 @@ body { font-family: 'Fira Sans'; margin: 0; - line-height: 1.2em; - font-size: 1.7vw; } - -@media screen and (screen-orientation: landscape) { - body { - font-size: 3.5vh; } } + line-height: 1.2em; } section { min-height: 100vh; diff --git a/css/theme/source/latex.scss b/css/theme/source/latex.scss index f06121a..e303d32 100644 --- a/css/theme/source/latex.scss +++ b/css/theme/source/latex.scss @@ -1,7 +1,89 @@ -// @import "../template/mixins"; -// @import "../template/settings"; -// $heading2Size: 101px; -// @import "../template/theme"; +/* basic layout */ + +$base-unit: 1vw; +body { + background: red; + font-size: $base-unit; + + + /* transition: background 1s ease; */ + .layout-content-and-preview { + display: grid; + grid-template-rows: 100vw auto; + grid-template-columns: auto; + grid-template-areas: + "content" + "preview"; + min-height: 100vh; + max-height: 100vh; + min-width: 100vw; + max-width: 100vw; + overflow: auto; + .layout-content { + background: white; + grid-area: content; + } + .layout-preview { + grid-area: preview; + display: flex; + align-items: center; + justify-content: center; + /* padding: 4vw; */ + img { + opacity: .5; + width: auto; + height: auto; + max-width: 100%; + max-height: 100%; + box-shadow: .2em .2em .5em 0 rgba(0, 0, 0, .3); + } + } + } +} +/* +@media screen and (min-aspect-ratio: 1/2) { + $base-unit: 0.5vh; + body { + background: orange; + .layout-content-and-preview { + grid-template-rows: 50vh auto; + grid-template-columns: auto 50vh auto; + grid-template-areas: + " . content . " + "preview preview preview"; + } + } +} +*/ +@media screen and (min-aspect-ratio: 1/1) { + $base-unit: 0.5vw; + body { + background: yellow; + .layout-content-and-preview { + grid-template-rows: auto 50vw auto; + grid-template-columns: 50vw auto; + grid-template-areas: + " . preview" + "content preview" + " . preview"; + } + } +} +@media screen and (min-aspect-ratio: 2/1) { + $base-unit: 1vh; + body { + background: lime; + .layout-content-and-preview { + grid-template-rows: 100vh; + grid-template-columns: 100vh auto; + grid-template-areas: + "content preview"; + } + } +} + + + @import url('https://free.bboxtype.com/embedfonts/?family=FiraSans:300,600'); @font-face { @@ -20,12 +102,12 @@ body { font-family: 'Fira Sans'; margin: 0; line-height: 1.2em; - font-size: 1.7vw; + // font-size: 1.7vw; } @media screen and (screen-orientation: landscape) { body { - font-size: 3.5vh; + // font-size: 3.5vh; } } @@ -136,4 +218,4 @@ section { } } -h1 { font-size: 300%; } \ No newline at end of file +h1 { font-size: 300%; } diff --git a/sections/german/04/04.md b/sections/german/04/04.md index cf7608a..2f9991e 100644 --- a/sections/german/04/04.md +++ b/sections/german/04/04.md @@ -12,12 +12,11 @@ Ein größeres LaTeX-Projekt anlegen und dabei ... --- -
+
+ +

Hauptdatei 👑

- -
-
  • enthält Grundgerüst, Titelei, etc.
  • bindet einzelne Kapitel ein mit @@ -42,7 +41,7 @@ Ein größeres LaTeX-Projekt anlegen und dabei ...
-
+
![](sections/german/04/projekt_dokument.png)