From bde67f5617e1ac1aa738975baf6e468071d0dd43 Mon Sep 17 00:00:00 2001 From: Gisle Aune Date: Sun, 16 Sep 2018 18:34:20 +0200 Subject: [PATCH] ui: Added modal component, added a logging you in/out to try it. --- marko/components/menu/component.js | 16 +++++++ marko/components/menu/index.marko | 11 ++++- marko/components/modal/component.js | 5 ++ marko/components/modal/index.marko | 11 +++++ marko/components/modal/style.less | 47 +++++++++++++++++++ .../story/components/story-menu/index.marko | 6 +-- 6 files changed, 91 insertions(+), 5 deletions(-) create mode 100644 marko/components/menu/component.js create mode 100644 marko/components/modal/component.js create mode 100644 marko/components/modal/index.marko create mode 100644 marko/components/modal/style.less diff --git a/marko/components/menu/component.js b/marko/components/menu/component.js new file mode 100644 index 0000000..5450583 --- /dev/null +++ b/marko/components/menu/component.js @@ -0,0 +1,16 @@ +module.exports = class { + onCreate() { + this.state = { + loggingIn: false, + loggingOut: false, + } + } + + loginClicked() { + this.state.loggingIn = true + } + + logoutClicked() { + this.state.loggingOut = true + } +} \ No newline at end of file diff --git a/marko/components/menu/index.marko b/marko/components/menu/index.marko index 9c85c63..9f543e4 100644 --- a/marko/components/menu/index.marko +++ b/marko/components/menu/index.marko @@ -3,8 +3,15 @@ User - Login - Logout (${input.user.name}) + Login + Logout (${input.user.name}) + + +

You may be redirected to Auth0 if it's been a while.

+
+ +

You can probably log back in without entering your info if you're quick.

+
input.user is missing! diff --git a/marko/components/modal/component.js b/marko/components/modal/component.js new file mode 100644 index 0000000..d74a693 --- /dev/null +++ b/marko/components/modal/component.js @@ -0,0 +1,5 @@ +module.exports = class { + closeModal() { + this.emit("close") + } +} \ No newline at end of file diff --git a/marko/components/modal/index.marko b/marko/components/modal/index.marko new file mode 100644 index 0000000..e04912d --- /dev/null +++ b/marko/components/modal/index.marko @@ -0,0 +1,11 @@ + +
+
+
X
+
+

${input.title}

+ +
+ \ No newline at end of file diff --git a/marko/components/modal/style.less b/marko/components/modal/style.less new file mode 100644 index 0000000..54965f5 --- /dev/null +++ b/marko/components/modal/style.less @@ -0,0 +1,47 @@ +div.overlay { + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + padding-top: 4em; + z-index: 999; + + background-color: rgba(0, 0, 0, 0.75); + + overflow-y: auto; + + h1 { + text-align: center; + } + + div.modal { + width: 60ch; + max-width: 95%; + margin: auto; + } + + div.overlay-options { + width: 60ch; + max-width: 95%; + margin: auto; + text-align: right; + + div { + opacity: 0.75; + user-select: none; + cursor: pointer; + } + div:hover { + opacity: 1; + } + } +} + +div.overlay.notification-overlay { + padding-top: 20%; + + div.modal { + text-align: center; + } +} \ No newline at end of file diff --git a/marko/page/story/components/story-menu/index.marko b/marko/page/story/components/story-menu/index.marko index a949282..28a8f2b 100644 --- a/marko/page/story/components/story-menu/index.marko +++ b/marko/page/story/components/story-menu/index.marko @@ -1,11 +1,11 @@ Story - Stories + Stories Categories - ${category.name} + ${category.name} Tags - ${tag.name} + ${tag.name} Tags \ No newline at end of file