Skip to content

Commit

Permalink
Iterate on the design
Browse files Browse the repository at this point in the history
Less box-shadow
  • Loading branch information
maghoff committed Jul 16, 2018
1 parent d5bb94d commit e26e60c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 18 deletions.
4 changes: 2 additions & 2 deletions assets/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ function openEditor() {
const editor = container.querySelector(".editor");
const textarea = editor.querySelector('textarea[name="body"]');
const shadow = editor.querySelector('textarea.shadow-control');
const form = editor.querySelector("form");
const cancel = editor.querySelector('.cancel');
const form = document.getElementById('article-editor');
const cancel = form.querySelector('.cancel');

const footer = document.querySelector("footer");
const lastUpdated = footer.querySelector(".last-updated");
Expand Down
38 changes: 27 additions & 11 deletions assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,11 @@ article>hr {

/* Hack to force containing the children instead of collapsing marigins */
border: 1px solid var(--theme-main);

box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.search-container {
background: var(--theme-main);
color: var(--theme-text);
z-index: 1;
}

header, article>*, .search {
Expand Down Expand Up @@ -209,8 +206,6 @@ footer {
"Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans",
"Droid Sans", "Helvetica Neue", sans-serif;

box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

footer a {
Expand Down Expand Up @@ -306,19 +301,41 @@ h1>input {
bottom: 0;
left: 0;

box-shadow: 0px 5px 20px rgba(0,0,0, 0.2);

background: var(--theme-main);
color: var(--theme-text);
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) {
.editor-controls {
position: fixed;
left: auto;
right: 20px;
bottom: 20px;
left: calc(50vw + 320px);
width: 120px;
top: calc(50vh - 40px);
height: 80px;

transform: translate(20px, 0);
opacity: 0;

transition: transform 100ms, opacity 100ms;
transition-timing-function: linear;
}

box-shadow: 2px 2px 8px rgba(0,0,0, 0.25);
.edit .editor-controls {
transform: translate(0, 0);
transition-timing-function: cubic-bezier(.17,.84,.44,1);
opacity: 1;
}
}

Expand Down Expand Up @@ -484,7 +501,7 @@ input[type="search"] {

text-align: center;
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 {
Expand Down Expand Up @@ -542,7 +559,6 @@ input[type="search"] {

/* Disable hack to force containing the children instead of collapsing marigins */
border: none;
box-shadow: none;
}

h1, h2, h3, h4, h5, h6 {
Expand Down
11 changes: 6 additions & 5 deletions templates/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
{{>article_contents.html}}
</div>

<div class="editor">
<form action="" method="POST">
<form id="article-editor" action="" method="POST">

<div class="hero" style="z-index: -1">
<div class="editor">
<div class="hero">
<header>
<h1><input autocomplete=off type=text name=title value="{{title}}" placeholder="Title" required></h1>
</header>
Expand All @@ -22,15 +22,16 @@ <h1><input autocomplete=off type=text name=title value="{{title}}" placeholder="
</p>
</article>

</div>

<div class="editor-controls">
{{#cancel_url}}
<a class="cancel" href="{{.}}">Cancel</a>
{{/cancel_url}}
<button type=submit>Save</button>
</div>

</form>
</div>

</div>

<footer>
Expand Down

0 comments on commit e26e60c

Please sign in to comment.