From 72db3a16521408509f4a0f61ef110851a252d2cc Mon Sep 17 00:00:00 2001 From: Filip ZybaƂa Date: Mon, 6 Apr 2020 14:24:07 +0200 Subject: Change PlatformHintedContent rendering, js and css to match Figma style --- .../out/html/root//f.html | 4 +- .../out/html/root//index.html | 4 +- .../suspendFunction/out/html/root/index.html | 1 + .../out/html/scripts/navigationLoader.js | 4 +- .../out/html/scripts/platformContentHandler.js | 29 +++++++++++++ .../suspendFunction/out/html/styles/style.css | 50 ++++++++++++++++++++++ 6 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 plugins/base/src/test/resources/expect/suspendFunction/out/html/scripts/platformContentHandler.js (limited to 'plugins/base/src/test/resources/expect/suspendFunction') diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root//f.html b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root//f.html index dafca58f..9de96412 100644 --- a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root//f.html +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root//f.html @@ -4,6 +4,7 @@ f + @@ -20,7 +21,8 @@

f

-
final fun f()
+
final fun f()
+ diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root//index.html b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root//index.html index 59b7070b..1ebe6dce 100644 --- a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root//index.html +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root//index.html @@ -4,6 +4,7 @@ <jvm root> + @@ -27,7 +28,8 @@ f -
final fun f()
+ +
final fun f()
diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html index f8c89bbf..a3211166 100644 --- a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html @@ -4,6 +4,7 @@ root + diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/scripts/navigationLoader.js b/plugins/base/src/test/resources/expect/suspendFunction/out/html/scripts/navigationLoader.js index 5fe52ade..ecbabb4c 100644 --- a/plugins/base/src/test/resources/expect/suspendFunction/out/html/scripts/navigationLoader.js +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/scripts/navigationLoader.js @@ -1,4 +1,4 @@ -onload = () => { +window.addEventListener('load', () => { fetch(pathToRoot + "navigation.html") .then(response => response.text()) .then(data => { @@ -15,7 +15,7 @@ onload = () => { }).then(() => { revealNavigationForCurrentPage() }) -}; +}) revealNavigationForCurrentPage = () => { let pageId = document.getElementById("content").attributes["pageIds"].value.toString(); diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/scripts/platformContentHandler.js b/plugins/base/src/test/resources/expect/suspendFunction/out/html/scripts/platformContentHandler.js new file mode 100644 index 00000000..b4a9e7c9 --- /dev/null +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/scripts/platformContentHandler.js @@ -0,0 +1,29 @@ +window.addEventListener('load', () => { + document.querySelectorAll("div[data-platform-hinted]") + .forEach(elem => elem.addEventListener('click', (event) => togglePlatformDependent(event,elem))) + } +) + +function togglePlatformDependent(e, container) { + let target = e.target + if (target.tagName != 'BUTTON') return; + let index = target.getAttribute('data-toggle') + + for(let child of container.children){ + if(child.hasAttribute('data-toggle-list')){ + for(let bm of child.children){ + if(bm == target){ + bm.setAttribute('data-active',"") + } else if(bm != target) { + bm.removeAttribute('data-active') + } + } + } + else if(child.getAttribute('data-togglable') == index) { + child.setAttribute('data-active',"") + } + else { + child.removeAttribute('data-active') + } + } +} diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/styles/style.css b/plugins/base/src/test/resources/expect/suspendFunction/out/html/styles/style.css index 5c347128..720998ad 100644 --- a/plugins/base/src/test/resources/expect/suspendFunction/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/styles/style.css @@ -487,6 +487,56 @@ td.content { color: #5B5DEF; } +.platform-hinted { + display: block; +} + +.platform-hinted > .platform-bookmarks-row { + display: flex; + flex-direction: row; + padding: 0px; +} + +.platform-hinted > .platform-bookmarks-row > .platform-bookmark { + min-width: 64px; + height: 36px; + border: 2px solid white; + background: white; + outline: none; + flex: none; + order: 5; + align-self: flex-start; + margin: 0; +} + +.platform-hinted > .platform-bookmarks-row > .platform-bookmark:nth-child(1):hover { + border-top: 2px solid gray; +} + +.platform-hinted > .platform-bookmarks-row > .platform-bookmark:nth-child(2):hover { + border-top: 2px solid orange; +} + +.platform-hinted > .platform-bookmarks-row > .platform-bookmark:nth-child(3):hover { + border-top: 2px solid crimson; +} + +.platform-hinted > .platform-bookmarks-row > .platform-bookmark:nth-child(4):hover { + border-top: 2px solid blue; +} + +.platform-hinted > .platform-bookmarks-row > .platform-bookmark[data-active=''] { + border: 2px solid #F4F4F4; + border-top: 2px solid #4DBB5F; + + background: #F4F4F4; +} + +.platform-hinted > .content:not([data-active]) { + display: none +} + + @media print, screen and (max-width: 960px) { div.wrapper { -- cgit