Iterate on the design

Less box-shadow
This commit is contained in:
Magnus Hoff 2018-07-16 22:11:53 +02:00
parent d5bb94dfb6
commit e26e60ce2c
3 changed files with 35 additions and 18 deletions

View file

@ -63,8 +63,8 @@ function openEditor() {
const editor = container.querySelector(".editor"); const editor = container.querySelector(".editor");
const textarea = editor.querySelector('textarea[name="body"]'); const textarea = editor.querySelector('textarea[name="body"]');
const shadow = editor.querySelector('textarea.shadow-control'); const shadow = editor.querySelector('textarea.shadow-control');
const form = editor.querySelector("form"); const form = document.getElementById('article-editor');
const cancel = editor.querySelector('.cancel'); const cancel = form.querySelector('.cancel');
const footer = document.querySelector("footer"); const footer = document.querySelector("footer");
const lastUpdated = footer.querySelector(".last-updated"); const lastUpdated = footer.querySelector(".last-updated");

View file

@ -78,14 +78,11 @@ article>hr {
/* Hack to force containing the children instead of collapsing marigins */ /* Hack to force containing the children instead of collapsing marigins */
border: 1px solid var(--theme-main); border: 1px solid var(--theme-main);
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
} }
.search-container { .search-container {
background: var(--theme-main); background: var(--theme-main);
color: var(--theme-text); color: var(--theme-text);
z-index: 1;
} }
header, article>*, .search { header, article>*, .search {
@ -209,8 +206,6 @@ footer {
"Segoe UI", "Roboto", "Oxygen", "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Ubuntu", "Cantarell", "Fira Sans",
"Droid Sans", "Helvetica Neue", sans-serif; "Droid Sans", "Helvetica Neue", sans-serif;
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
} }
footer a { footer a {
@ -306,19 +301,41 @@ h1>input {
bottom: 0; bottom: 0;
left: 0; left: 0;
box-shadow: 0px 5px 20px rgba(0,0,0, 0.2);
background: var(--theme-main); background: var(--theme-main);
color: var(--theme-text); color: var(--theme-text);
padding: 10px 20px; padding: 10px 20px;
transform: translate(0, 65px);
transition: transform 100ms;
transition-timing-function: linear;
}
.edit .editor-controls {
transform: translate(0, 0);
transition-timing-function: cubic-bezier(.17,.84,.44,1);
} }
@media (min-width: 630px) { @media (min-width: 630px) {
.editor-controls { .editor-controls {
position: fixed; position: fixed;
left: auto; left: calc(50vw + 320px);
right: 20px; width: 120px;
bottom: 20px; top: calc(50vh - 40px);
height: 80px;
box-shadow: 2px 2px 8px rgba(0,0,0, 0.25); transform: translate(20px, 0);
opacity: 0;
transition: transform 100ms, opacity 100ms;
transition-timing-function: linear;
}
.edit .editor-controls {
transform: translate(0, 0);
transition-timing-function: cubic-bezier(.17,.84,.44,1);
opacity: 1;
} }
} }
@ -484,7 +501,7 @@ input[type="search"] {
text-align: center; text-align: center;
background: #eee; background: #eee;
box-shadow: 2px 2px 8px rgba(0,0,0, 0.25); box-shadow: 0px 5px 20px rgba(0,0,0, 0.2);
} }
.popup>.message { .popup>.message {
@ -542,7 +559,6 @@ input[type="search"] {
/* Disable hack to force containing the children instead of collapsing marigins */ /* Disable hack to force containing the children instead of collapsing marigins */
border: none; border: none;
box-shadow: none;
} }
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {

View file

@ -5,10 +5,10 @@
{{>article_contents.html}} {{>article_contents.html}}
</div> </div>
<div class="editor"> <form id="article-editor" action="" method="POST">
<form action="" method="POST">
<div class="hero" style="z-index: -1"> <div class="editor">
<div class="hero">
<header> <header>
<h1><input autocomplete=off type=text name=title value="{{title}}" placeholder="Title" required></h1> <h1><input autocomplete=off type=text name=title value="{{title}}" placeholder="Title" required></h1>
</header> </header>
@ -22,15 +22,16 @@
</p> </p>
</article> </article>
</div>
<div class="editor-controls"> <div class="editor-controls">
{{#cancel_url}} {{#cancel_url}}
<a class="cancel" href="{{.}}">Cancel</a> <a class="cancel" href="{{.}}">Cancel</a>
{{/cancel_url}} {{/cancel_url}}
<button type=submit>Save</button> <button type=submit>Save</button>
</div> </div>
</form> </form>
</div>
</div> </div>
<footer> <footer>