From e57d0f833529d054ec417dc47a16d29dcaf4a12e Mon Sep 17 00:00:00 2001 From: Kombie Date: Fri, 26 Apr 2019 13:48:37 +0100 Subject: [PATCH] [feature] display date in words or numbers and control month date order --- css/button.css | 31 -- css/clock.css | 9 +- css/date.css | 7 +- css/form.css | 126 +++++- css/header.css | 2 + css/menu.css | 94 ++++- css/transitional.css | 28 ++ css/typography.css | 2 +- index.html | 892 +++++++++++++++++++++++++++---------------- js/clock.js | 81 ++-- js/control.js | 649 ++++++++++++++++++++++++++++--- js/date.js | 164 ++++++-- js/greeting.js | 18 +- js/helper.js | 132 ++++++- js/init.js | 7 +- js/state.js | 66 +++- js/transitional.js | 84 ++++ js/update.js | 63 +++ js/version.js | 2 +- 19 files changed, 1906 insertions(+), 551 deletions(-) create mode 100644 css/transitional.css create mode 100644 js/transitional.js diff --git a/css/button.css b/css/button.css index 0004ec82..5080bb24 100755 --- a/css/button.css +++ b/css/button.css @@ -96,37 +96,6 @@ button [class*=" icon-"], width: 100%; } -.button-group { - margin: 0 0 1em 0; - display: inline-flex; - justify-content: center; - align-items: stretch; -} - -.button-group button, -.button-group .button { - margin: 0; - border-radius: 0; -} - -.button-group>button:first-child, -.button-group>.button:first-child { - border-radius: var(--radius) 0 0 var(--radius); -} - -.button-group>button:last-child, -.button-group>.button:last-child { - border-radius: 0 var(--radius) var(--radius) 0; -} - -.button-group.nested-button *:first-child .button { - border-radius: var(--radius) 0 0 var(--radius); -} - -.button-group.nested-button *:last-child .button { - border-radius: 0 var(--radius) var(--radius) 0; -} - button [class^="button-"], button [class*=" button-"], .button [class^="button-"], diff --git a/css/clock.css b/css/clock.css index ca47b522..2bdb85e0 100755 --- a/css/clock.css +++ b/css/clock.css @@ -9,8 +9,8 @@ min-height: 2.5em; display: flex; flex-direction: row; - justify-content: center; - flex-wrap: nowrap; + justify-content: flex-start; + flex-wrap: wrap; } .clock-separator, @@ -22,11 +22,12 @@ display: flex; justify-content: center; align-items: center; + white-space: nowrap; } .clock-separator { justify-content: center; - min-width: 0.5em; + /* min-width: 0.5em; */ color: rgb(var(--accent)); } @@ -55,5 +56,5 @@ .clock-minutes, .clock-seconds, .clock-meridiem { - color: rgb(var(--gray-19)); + color: rgb(var(--gray-16)); } diff --git a/css/date.css b/css/date.css index 3807cf03..608231cc 100755 --- a/css/date.css +++ b/css/date.css @@ -10,7 +10,7 @@ display: flex; flex-direction: row; justify-content: flex-start; - flex-wrap: nowrap; + flex-wrap: wrap; } .date-separator, @@ -22,11 +22,12 @@ display: flex; justify-content: flex-start; align-items: center; + white-space: nowrap; } .date-separator { justify-content: center; - min-width: 0.5em; + /* min-width: 0.5em; */ color: rgb(var(--accent)); } @@ -54,5 +55,5 @@ .date-date, .date-month, .date-year { - color: rgb(var(--gray-19)); + color: rgb(var(--gray-16)); } diff --git a/css/form.css b/css/form.css index 49b98f04..2c8c898e 100755 --- a/css/form.css +++ b/css/form.css @@ -22,6 +22,16 @@ input[type="text"] { -moz-appearance: textfield; } +input[type="number"] { + text-align: center; +} + +input[type=number]::-webkit-inner-spin-button, +input[type=number]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} + input[type="email"]:hover, input[type="number"]:hover, input[type="password"]:hover, @@ -84,7 +94,8 @@ input[type="number"][disabled]~.input-helper, input[type="password"][disabled]~.input-helper, input[type="search"][disabled]~.input-helper, input[type="tel"][disabled]~.input-helper, -input[type="text"][disabled]~.input-helper { +input[type="text"][disabled]~.input-helper, +input[type="range"][disabled]~.input-helper { color: rgb(var(--form-input-text-disabled-helper-text)); } @@ -197,22 +208,13 @@ input[type="color"]+.input-label-button:before { position: relative; } -.form-indent-1, -.form-indent-1, -.form-indent-1 { +.form-indent { margin-left: 2.25em; } -.form-indent-2, -.form-indent-2, -.form-indent-2 { - margin-left: 4.5em; -} - -.form-indent-3, -.form-indent-3, -.form-indent-3 { - margin-left: 6.75em; +.form-inline { + display: inline-block; + margin-right: 1.5em; } input[type="checkbox"], @@ -460,7 +462,7 @@ input[type="range"]::-webkit-slider-thumb { width: 1em; cursor: pointer; box-sizing: border-box; - z-index: 2; + /* z-index: 2; */ transform: scale(1); transition: all var(--animation-speed-fast) ease-in-out; -webkit-appearance: none; @@ -524,7 +526,7 @@ input[type="range"]::-moz-range-thumb { width: 1em; cursor: pointer; box-sizing: border-box; - z-index: 2; + /* z-index: 2; */ transform: scale(1); transition: all var(--animation-speed-fast) ease-in-out; -webkit-appearance: none; @@ -574,3 +576,95 @@ input[type="range"][disabled]:focus::-moz-range-thumb { input[type="range"][disabled]::-moz-range-progress { background-color: rgb(var(--gray-08)); } + +.form-group { + margin: 0 0 1em 0; + display: inline-flex; + justify-content: center; + align-items: stretch; + width: 100%; +} + +.form-group button, +.form-group .button, +.form-group>input[type="email"], +.form-group>input[type="number"], +.form-group>input[type="password"], +.form-group>input[type="search"], +.form-group>input[type="tel"], +.form-group>input[type="text"] { + margin: 0; + border-radius: 0; +} + +.form-group>input[type="email"], +.form-group>input[type="number"], +.form-group>input[type="password"], +.form-group>input[type="search"], +.form-group>input[type="tel"], +.form-group>input[type="text"] { + padding: 0 0.5em; +} + +.form-group>input[type="email"], +.form-group>input[type="number"], +.form-group>input[type="password"], +.form-group>input[type="search"], +.form-group>input[type="tel"], +.form-group>input[type="text"] { + z-index: 1; +} + +.form-group>input[type="email"]:hover, +.form-group>input[type="number"]:hover, +.form-group>input[type="password"]:hover, +.form-group>input[type="search"]:hover, +.form-group>input[type="tel"]:hover, +.form-group>input[type="text"]:hover { + z-index: 2; +} + +.form-group>input[type="email"]:active, +.form-group>input[type="email"]:focus, +.form-group>input[type="number"]:active, +.form-group>input[type="number"]:focus, +.form-group>input[type="password"]:active, +.form-group>input[type="password"]:focus, +.form-group>input[type="search"]:active, +.form-group>input[type="search"]:focus, +.form-group>input[type="tel"]:active, +.form-group>input[type="tel"]:focus, +.form-group>input[type="text"]:active, +.form-group>input[type="text"]:focus { + z-index: 3; +} + +.form-group>button:first-child, +.form-group>.button:first-child, +.form-group>input[type="email"]:first-child, +.form-group>input[type="number"]:first-child, +.form-group>input[type="password"]:first-child, +.form-group>input[type="search"]:first-child, +.form-group>input[type="tel"]:first-child, +.form-group>input[type="text"]:first-child { + border-radius: var(--radius) 0 0 var(--radius); +} + +.form-group>button:last-child, +.form-group>.button:last-child, +.form-group>input[type="email"]:last-child, +.form-group>input[type="number"]:last-child, +.form-group>input[type="password"]:last-child, +.form-group>input[type="search"]:last-child, +.form-group>input[type="tel"]:last-child, +.form-group>input[type="text"]:last-child { + border-radius: 0 var(--radius) var(--radius) 0; +} + +.form-group.nested-button *:first-child .button { + border-radius: var(--radius) 0 0 var(--radius); +} + +.form-group.nested-button *:last-child .button { + border-radius: 0 var(--radius) var(--radius) 0; +} diff --git a/css/header.css b/css/header.css index fda0caa0..a951cf60 100755 --- a/css/header.css +++ b/css/header.css @@ -124,6 +124,7 @@ .header-edit-add, .header-accent, .header-greeting, +.header-transitional, .header-menu { display: none; } @@ -134,6 +135,7 @@ .is-header-edit-add .header-edit-add, .is-header-accent .header-accent, .is-header-greeting .header-greeting, +.is-header-transitional .header-transitional, .is-menu .header-menu { display: flex; } diff --git a/css/menu.css b/css/menu.css index 147a4b5c..57412346 100755 --- a/css/menu.css +++ b/css/menu.css @@ -51,24 +51,22 @@ } .menu-content { - padding: 2em 2em 20vh 2em; + padding-bottom: 40vh; } .menu-content-area { display: grid; grid-template-columns: 1fr; - grid-gap: 2em; } .menu-item { - padding-bottom: 2em; - border-bottom: var(--line-width) solid rgb(var(--gray-04)); + padding: 2em; + position: relative; + z-index: 1; } -.menu-item:last-child, -.menu-item:nth-last-child(2):nth-child(odd) { - padding-bottom: 0; - border-bottom: 0; +.menu-item:not(:last-child) { + border-bottom: var(--line-width) solid rgb(var(--gray-02)); } .menu-close { @@ -86,7 +84,7 @@ padding-bottom: 1em; border-radius: 0; flex-grow: 1; - flex-basis: 50%; + flex-basis: 33%; } .menu-nav-button:first-child { @@ -101,8 +99,14 @@ } @media (min-width: 550px) { + .menu-nav-button { + flex-basis: 0; + } +} + +@media (min-width: 700px) { .menu { - width: 80vw; + width: 90vw; height: 100%; overflow-y: inherit; max-height: inherit; @@ -125,21 +129,83 @@ .menu-content-area { grid-template-columns: repeat(2, 1fr); + grid-gap: 4em; + padding: 2em; } - .menu-nav-button { - flex-basis: 0; + .menu-item:not(:last-child) { + border-bottom: 0; + } + + .menu-item:nth-child(odd):after { + content: ""; + width: 0; + height: 100%; + position: absolute; + top: 0; + right: calc(-2em - calc(var(--line-width) / 2)); + border-radius: 1em; + border-right: var(--line-width) solid rgb(var(--gray-03)); + } + + .menu-item:not(:nth-last-child(2)):not(:last-child):before { + content: ""; + width: 100%; + height: 0; + position: absolute; + left: 0; + bottom: calc(-2em - calc(var(--line-width) / 2)); + border-radius: 1em; + border-bottom: var(--line-width) solid rgb(var(--gray-03)); + } + + .menu-item { + padding: 1em 0; } } @media (min-width: 900px) { .menu { - width: 70vw; + width: 80vw; } } @media (min-width: 1600px) { .menu { - width: 50vw; + width: 70vw; + } + + .menu-content-area { + grid-template-columns: repeat(3, 1fr); + } + + .menu-item:nth-child(odd):after { + content: none; + } + + .menu-item:not(:nth-child(3n+3)):after { + content: ""; + width: 0; + height: 100%; + position: absolute; + top: 0; + right: calc(-2em - calc(var(--line-width) / 2)); + border-radius: 1em; + border-right: var(--line-width) solid rgb(var(--gray-03)); + } + + .menu-item:not(:nth-last-child(2)):not(:last-child):before { + content: none; + } + + .menu-item:not(:nth-last-child(1)):not(:nth-last-child(2)):not(:nth-last-child(3)):before { + content: ""; + width: 100%; + height: 0; + position: absolute; + left: 0; + bottom: calc(-2em - calc(var(--line-width) / 2)); + border-radius: 1em; + border-bottom: var(--line-width) solid rgb(var(--gray-03)); } } diff --git a/css/transitional.css b/css/transitional.css new file mode 100644 index 00000000..f47e1b13 --- /dev/null +++ b/css/transitional.css @@ -0,0 +1,28 @@ +.transitional { + margin: 0; + padding: 0; + border-radius: var(--radius); + font-size: 1em; + font-family: var(--font-fjalla); + color: rgb(var(--gray-14)); + width: 100%; + min-height: 2.5em; + display: flex; + flex-direction: row; + justify-content: center; + flex-wrap: nowrap; +} + +.transitional-item { + font-size: 1.5em; + max-width: 100%; + display: flex; + justify-content: center; + align-items: center; +} + +.transitional-item-text { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} diff --git a/css/typography.css b/css/typography.css index 6e8d55bc..0ba6ab0b 100755 --- a/css/typography.css +++ b/css/typography.css @@ -52,7 +52,7 @@ p { hr { border: 0; - border-top: 1px solid rgb(var(--gray-04)); + border-top: 1px solid rgb(var(--gray-02)); border-radius: var(--radius); margin: 1em 0; clear: both; diff --git a/index.html b/index.html index ffa8f79b..4451aef1 100644 --- a/index.html +++ b/index.html @@ -26,6 +26,7 @@ + @@ -46,6 +47,9 @@

+
+

+

@@ -62,7 +66,7 @@
-
+