From f180fee276fa51bad6233d74d21d949244dde9b1 Mon Sep 17 00:00:00 2001 From: zombieFox Date: Mon, 25 Nov 2019 00:34:26 +0000 Subject: [PATCH] [feature] add link direction controls and improve order controls --- src/css/link.css | 123 ++++++++++++++++++++++++++-------------------- src/index.html | 26 +++++++--- src/js/control.js | 57 ++++++++++++++------- src/js/link.js | 11 ++--- src/js/state.js | 3 +- src/js/update.js | 18 +++++-- 6 files changed, 148 insertions(+), 90 deletions(-) diff --git a/src/css/link.css b/src/css/link.css index f7126073..83c28763 100755 --- a/src/css/link.css +++ b/src/css/link.css @@ -281,104 +281,128 @@ font-size: 0.6em; } -.is-link-style-block .link-display { - flex-direction: column; -} - -.is-link-style-list .link-display { +.is-link-item-display-direction-horizontal.is-link-item-display-order-letconname .link-display { flex-direction: row; } -.is-link-style-block.is-link-display-alignment-topleft .link-display { +.is-link-item-display-direction-horizontal.is-link-item-display-order-nameletcon .link-display { + flex-direction: row-reverse; +} + +.is-link-item-display-direction-vertical.is-link-item-display-order-letconname .link-display { + flex-direction: column; +} + +.is-link-item-display-direction-vertical.is-link-item-display-order-nameletcon .link-display { + flex-direction: column-reverse; +} + +.is-link-item-display-direction-horizontal.is-link-item-display-order-letconname .link-display>*:not(:only-child):first-child { + margin-right: 0.5em; +} + +.is-link-item-display-direction-horizontal.is-link-item-display-order-nameletcon .link-display>*:not(:only-child):last-child { + margin-right: 0.5em; +} + +.is-link-item-display-direction-vertical.is-link-item-display-order-letconname .link-display>*:not(:only-child):first-child { + margin-bottom: 0.5em; +} + +.is-link-item-display-direction-vertical.is-link-item-display-order-nameletcon .link-display>*:not(:only-child):last-child { + margin-bottom: 0.5em; +} + +.is-link-item-display-direction-vertical.is-link-display-alignment-topleft .link-display { justify-content: flex-start; align-items: flex-start; } -.is-link-style-block.is-link-display-alignment-topcenter .link-display { +.is-link-item-display-direction-vertical.is-link-display-alignment-topcenter .link-display { justify-content: flex-start; align-items: center; } -.is-link-style-block.is-link-display-alignment-topright .link-display { +.is-link-item-display-direction-vertical.is-link-display-alignment-topright .link-display { justify-content: flex-start; align-items: flex-end; } -.is-link-style-block.is-link-display-alignment-centerleft .link-display { +.is-link-item-display-direction-vertical.is-link-display-alignment-centerleft .link-display { justify-content: center; align-items: flex-start; } -.is-link-style-block.is-link-display-alignment-centercenter .link-display { +.is-link-item-display-direction-vertical.is-link-display-alignment-centercenter .link-display { justify-content: center; align-items: center; } -.is-link-style-block.is-link-display-alignment-centerright .link-display { +.is-link-item-display-direction-vertical.is-link-display-alignment-centerright .link-display { justify-content: center; align-items: flex-end; } -.is-link-style-block.is-link-display-alignment-bottomleft .link-display { +.is-link-item-display-direction-vertical.is-link-display-alignment-bottomleft .link-display { justify-content: flex-end; align-items: flex-start; } -.is-link-style-block.is-link-display-alignment-bottomcenter .link-display { +.is-link-item-display-direction-vertical.is-link-display-alignment-bottomcenter .link-display { justify-content: flex-end; align-items: center; } -.is-link-style-block.is-link-display-alignment-bottomright .link-display { +.is-link-item-display-direction-vertical.is-link-display-alignment-bottomright .link-display { justify-content: flex-end; align-items: flex-end; } -.is-link-style-list.is-link-display-alignment-topleft .link-display { +.is-link-item-display-direction-horizontal.is-link-display-alignment-topleft .link-display { + justify-content: flex-end; + align-items: flex-start; +} + +.is-link-item-display-direction-horizontal.is-link-display-alignment-topcenter .link-display { + justify-content: center; + align-items: flex-start; +} + +.is-link-item-display-direction-horizontal.is-link-display-alignment-topright .link-display { justify-content: flex-start; align-items: flex-start; } -.is-link-style-list.is-link-display-alignment-topcenter .link-display { - justify-content: center; - align-items: flex-start; -} - -.is-link-style-list.is-link-display-alignment-topright .link-display { +.is-link-item-display-direction-horizontal.is-link-display-alignment-centerleft .link-display { justify-content: flex-end; - align-items: flex-start; + align-items: center; } -.is-link-style-list.is-link-display-alignment-centerleft .link-display { +.is-link-item-display-direction-horizontal.is-link-display-alignment-centercenter .link-display { + justify-content: center; + align-items: center; +} + +.is-link-item-display-direction-horizontal.is-link-display-alignment-centerright .link-display { justify-content: flex-start; align-items: center; } -.is-link-style-list.is-link-display-alignment-centercenter .link-display { - justify-content: center; - align-items: center; -} - -.is-link-style-list.is-link-display-alignment-centerright .link-display { +.is-link-item-display-direction-horizontal.is-link-display-alignment-bottomleft .link-display { justify-content: flex-end; - align-items: center; + align-items: flex-end; } -.is-link-style-list.is-link-display-alignment-bottomleft .link-display { +.is-link-item-display-direction-horizontal.is-link-display-alignment-bottomcenter .link-display { + justify-content: center; + align-items: flex-end; +} + +.is-link-item-display-direction-horizontal.is-link-display-alignment-bottomright .link-display { justify-content: flex-start; align-items: flex-end; } -.is-link-style-list.is-link-display-alignment-bottomcenter .link-display { - justify-content: center; - align-items: flex-end; -} - -.is-link-style-list.is-link-display-alignment-bottomright .link-display { - justify-content: flex-end; - align-items: flex-end; -} - .link-display-letter, .link-display-icon { margin: 0; @@ -417,14 +441,6 @@ font-size: var(--link-item-display-icon-size); } -.is-link-style-block.is-link-item-display-name-show.is-link-item-display-letcon-show .link-display>*:not(:only-child):not(:last-child) { - margin-bottom: 0.5em; -} - -.is-link-style-list.is-link-item-display-name-show.is-link-item-display-letcon-show .link-display>*:not(:only-child):not(:last-child) { - margin-right: 0.5em -} - .link-item:hover .link-display-letter, .link-item:focus .link-display-letter, .link-item:hover .link-display-icon, @@ -443,10 +459,15 @@ font-size: var(--link-item-display-name-size); font-family: var(--font-regular); color: rgb(var(--theme-gray-12)); + flex-basis: 1%; display: none; transition: color var(--layout-timing-extra-fast); } +.is-link-item-display-name-show .link-display-name { + display: block; +} + .link-display-name, .link-display-name:not(:last-child) { margin-bottom: 0; @@ -470,10 +491,6 @@ text-align: right; } -.is-link-item-display-name-show .link-display-name { - display: block; -} - .link-item:hover .link-display-name, .link-item:focus .link-display-name { color: rgb(var(--theme-style-text)); diff --git a/src/index.html b/src/index.html index 9c59021e..33f97674 100644 --- a/src/index.html +++ b/src/index.html @@ -1008,14 +1008,24 @@
- - + +
- - + +
- + +
+
+ + +
+
+ + +
+
@@ -1064,12 +1074,12 @@
- +
- + - +