From 27bab3ccc8cb4cbdb59ed59904cfc33ffc1c0f23 Mon Sep 17 00:00:00 2001 From: codecalm Date: Fri, 28 Feb 2020 11:47:08 +0100 Subject: simple icon manager --- _icons/arrow-down.svg | 7 ++ _icons/arrow-left.svg | 5 +- _icons/arrow-right.svg | 5 +- _icons/arrow-up.svg | 7 ++ _includes/icon.html | 2 +- assets/bg.svg | 34 ++++++--- assets/style.scss | 188 ++++++++++++++++++++++++++++++++++++++++++++++++- index.html | 60 ++++++++++++++-- 8 files changed, 285 insertions(+), 23 deletions(-) create mode 100644 _icons/arrow-down.svg create mode 100644 _icons/arrow-up.svg diff --git a/_icons/arrow-down.svg b/_icons/arrow-down.svg new file mode 100644 index 00000000..a202dfff --- /dev/null +++ b/_icons/arrow-down.svg @@ -0,0 +1,7 @@ +--- +--- + + + + + diff --git a/_icons/arrow-left.svg b/_icons/arrow-left.svg index 59e7ba17..3d833119 100644 --- a/_icons/arrow-left.svg +++ b/_icons/arrow-left.svg @@ -1,6 +1,7 @@ --- --- - - + + + diff --git a/_icons/arrow-right.svg b/_icons/arrow-right.svg index 59e7ba17..5869438e 100644 --- a/_icons/arrow-right.svg +++ b/_icons/arrow-right.svg @@ -1,6 +1,7 @@ --- --- - - + + + diff --git a/_icons/arrow-up.svg b/_icons/arrow-up.svg new file mode 100644 index 00000000..980a5064 --- /dev/null +++ b/_icons/arrow-up.svg @@ -0,0 +1,7 @@ +--- +--- + + + + + diff --git a/_includes/icon.html b/_includes/icon.html index fe6b02e4..d61658ed 100644 --- a/_includes/icon.html +++ b/_includes/icon.html @@ -1,6 +1,6 @@ {% assign name = include.name %} {% assign icon = site.icons | where: "slug", name | first %} -{% assign content = icon.content | replace: ' - - - - - - - + + + + + + + + + + + + + - + {% for i in (1..24) %} - - + + {{ i }} + {{ i }} + + + + + + {% endfor %} diff --git a/assets/style.scss b/assets/style.scss index 61fed5fe..5c331aa1 100644 --- a/assets/style.scss +++ b/assets/style.scss @@ -1,5 +1,16 @@ --- --- + +$breakpoint: (min-width: 50rem); +$primary: #206bc4; +$border: #eeeeee; +$muted: #aaaaaa; +$btn-form-height: 2rem; + +* { + box-sizing: border-box; +} + html { font-size: 16px; font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji; @@ -7,21 +18,54 @@ html { body { background: #fafbfc; - font-size: 1rem; + font-size: .9375rem; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } +a { + color: $primary; + text-decoration: none; + + &:hover { + text-decoration: underline; + } +} + .container { - max-width: 50rem; + max-width: 60rem; margin: 0 auto; padding: 1rem } +.row { + display: flex; + flex-direction: column; + + @media #{$breakpoint} { + flex-direction: row; + } +} + +.col { + flex: 1; +} + +.col-aside { + width: 15rem; + margin-top: 2rem; + + @media #{$breakpoint} { + margin-top: 0; + margin-left: 2rem; + flex-direction: row; + } +} + .box { padding: 2rem; background: #ffff; - box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 1px 1px rgba(0,0,0,.1); + box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 1px 1px rgba(0, 0, 0, .1); } .icon-preview-wrap { @@ -73,3 +117,141 @@ body { } } +.mb { + margin-bottom: 2rem; +} + + +/* +Components + */ +.btn { + display: inline-flex; + color: #ffffff; + background: $primary; + border: 0; + border-radius: 3px; + font-size: inherit; + line-height: 1; + justify-content: center; + align-items: center; + min-height: $btn-form-height; + min-width: $btn-form-height; + padding: 0 .75rem; + + + .icon { + width: 1rem; + height: 1rem; + stroke-width: 2; + margin: 0 .5rem 0 -.25rem; + } +} + +.btn-icon { + padding: 0; + justify-content: center; + + .icon { + margin: 0; + } +} + +.btn-link { + background: transparent; + color: $primary; +} + +.input { + border: 1px solid $border; + border-radius: 3px; + height: $btn-form-height; + display: block; + font-size: inherit; + font-family: inherit; + padding: 0 .5rem; + width: 100%; + + &:focus { + outline: 0; + box-shadow: 0 0 0 3px rgba($primary, .1); + border-color: rgba($primary, .4); + } +} + +.icon { + width: 1em; + height: 1em; + vertical-align: -.15em; +} + +.input-icon { + position: relative; + + .input { + padding-right: 2rem; + } + + .icon { + color: $muted; + width: 1.25rem; + height: 1.25rem; + stroke-width: 1.5; + position: absolute; + top: ($btn-form-height - 1.25rem) / 2; + right: ($btn-form-height - 1.25rem) / 2; + } + + &.icon-left { + .icon { + left: ($btn-form-height - 1.25rem) / 2; + right: auto; + } + + .input { + padding-left: 2rem; + padding-right: 0; + } + } +} + +.avatar { + background: rgba($muted, .1); + color: $muted; + display: inline-flex; + width: 2.5rem; + height: 2.5rem; + align-items: center; + justify-content: center; + border-radius: 50%; + vertical-align: bottom; + + .icon { + height: 50%; + width: 50%; + } +} + +.avatar-sm { + width: 1.5rem; + height: 1.5rem; +} + +.tabs { + display: flex; + + .tab { + flex: 1; + text-align: center; + border-bottom: 1px solid $border; + padding: .25rem 0; + color: inherit; + text-decoration: none; + cursor: pointer; + + &.active { + color: $primary; + border-bottom-color: $primary; + } + } +} diff --git a/index.html b/index.html index 45cbb941..0ae728e5 100644 --- a/index.html +++ b/index.html @@ -14,14 +14,66 @@
-
-
- {% include icon.html name="arrow-left" %} + + {% assign last-icon = site.icons | sort: date | reverse | first %} + {% capture last-icon %} + {% include icon.html name=last-icon.slug %} + {% endcapture %} + +
+
+ +
+
+ {{ last-icon }} +
+
+
+
+ +
+ + + +
+ +
+ + {{ last-icon }} +
+ +
+ {{ last-icon }} + +
+ +
+
{{ last-icon }}
+
{{ last-icon }}
+
+ + + +
+ +
{% for icon in site.icons %} -
+
{% assign name = icon.slug %} {% include icon.html name=name %}
-- cgit v1.2.1