From cb4ac1d30f8d7b148bbfe10ae4a2e0fdd9d3596f Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Sat, 11 Apr 2020 22:25:05 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9A=20Live=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Project.toml | 2 +- assets/editor.html | 134 +++++++++++++++++++++++++++++++---- assets/editor.js | 78 +++++++++++++++++++- assets/light.css | 4 +- assets/welcome.html | 10 +-- src/react/React.jl | 14 +--- src/webserver/Completions.jl | 44 +++++++++++- 7 files changed, 248 insertions(+), 38 deletions(-) diff --git a/Project.toml b/Project.toml index ea39f5415d..8535b39fce 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "Pluto" uuid = "c3e4b0f8-55cb-11ea-2926-15256bba5781" license = "MIT" authors = ["Fons van der Plas ", "Mikołaj Bochenski "] -version = "0.5.20" +version = "0.5.21" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/assets/editor.html b/assets/editor.html index c9cec5c047..a6ad8790ff 100644 --- a/assets/editor.html +++ b/assets/editor.html @@ -86,6 +86,7 @@ main { margin: 0 auto; margin-top: 100px; + margin-bottom: 4rem; min-height: calc(100vh - 100px - 3.5rem - 4rem); max-width: 960px; align-content: center; @@ -93,7 +94,7 @@ /* HEADER */ - header { + body>header { position: absolute; top: 0px; z-index: 5; @@ -107,7 +108,7 @@ } - header h1 { + body>header h1 { color: black; letter-spacing: 2px; } @@ -220,14 +221,14 @@ transition: opacity .15s ease-in-out; } - header:hover #logocontainer .CodeMirror, - header:focus-within #logocontainer .CodeMirror { + body>header:hover #logocontainer .CodeMirror, + body>header:focus-within #logocontainer .CodeMirror { border: 2px solid #818181; border-right: none; } - header:hover #logocontainer button, - header:focus-within #logocontainer button { + body>header:hover #logocontainer button, + body>header:focus-within #logocontainer button { opacity: 1.0; } @@ -402,12 +403,108 @@ content: "no"; } + #helpbox-wrapper { + display: none; + } + + @media screen and (min-width: 1050px){ + + #helpbox-wrapper { + display: block; + position: sticky; + bottom: 0px; + height: 0px; + z-index: 5; + } + + helpbox { + bottom: 0px; + right: 20px; + position: absolute; + display: flex; + flex-direction: column; + width: 300px; + height: 400px; + /* overflow: hidden; */ + + background-color: white; + /* border: 2px solid darkgray; */ + border-right: none; + border-bottom: none; + border-top-left-radius: 9px; + box-shadow: 0 0 11px 0px #00000010; + font-family: "Alegreya Sans", sans-serif; + } + + helpbox>header { + background-color: #eef1f7; + color: hsl(230, 14%, 11%); + padding: 15px; + font-family: "Roboto Mono", monospace; + font-weight: 600; + cursor: pointer; + /* border-top: 4px solid #8a8a8a; */ + } + + helpbox>section { + height: 100%; + overflow: auto; + padding: 10px; + } + + helpbox>section h1, + helpbox>section h2, + helpbox>section h3, + helpbox>section h4, + helpbox>section h5, + helpbox>section h6 { + font-family: inherit; + border-bottom: none; + font-size: 1rem; + } + + helpbox>section h1 { + font-size: 1.3rem; + } + + helpbox.hidden { + height: initial; + } + + helpbox.hidden>section { + display: none; + } + + helpbox>header::before{ + content: "📖 "; + } + + /* helpbox.loading>header::before{ + content: "⌛ "; + } */ + + helpbox.hidden>header::before{ + content: "📚 "; + } + + + } + + @media screen and (min-width: 1050px) and (max-width: 1400px){ + main { + margin-right: 350px; + } + } + + footer { width: 100%; height: 3.5rem; - margin-top: 4rem; font-family: "Roboto Mono"; font-size: .75rem; + background-color: #d7dcd3; + color: #333333; + z-index: 7; } footer form{ @@ -440,7 +537,7 @@ padding: 3px; } - header button, + body>header button, footer button{ background: #896c6c; border-radius: 3px; @@ -469,7 +566,7 @@ font-size: 14px; } - header, + body>header, preamble>button, cell>button, cellinput>button, @@ -492,12 +589,12 @@ } - - - - - - + + + + + + @@ -547,6 +644,13 @@ +
+ + +