From 489be7f21ce0c510f7bbdd1491ece9fb6b5fe9a2 Mon Sep 17 00:00:00 2001 From: Damillora Date: Fri, 13 Nov 2020 16:09:42 +0700 Subject: [PATCH] Add templates to prepare for full membership --- assets/css/styles.css | 25 ++++++++++++++-- assets/js/subscription.js | 50 -------------------------------- members/account.hbs | 50 ++++++++++++++++++++++++++++++++ members/signin.hbs | 56 +++++++++++++++++++++++++++++++++++ members/signup.hbs | 58 +++++++++++++++++++++++++++++++++++++ package.json | 2 +- partials/site-header.hbs | 61 ++++++++++----------------------------- 7 files changed, 203 insertions(+), 99 deletions(-) delete mode 100644 assets/js/subscription.js create mode 100644 members/account.hbs create mode 100644 members/signin.hbs create mode 100644 members/signup.hbs diff --git a/assets/css/styles.css b/assets/css/styles.css index 666d6ea..c95c6f5 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -41,7 +41,7 @@ header { } .index-header { min-height: 200px; - height: 50vh; + height: 70vh; } @screen md { .index-header { @@ -49,6 +49,9 @@ header { height: 70vh; } } +.index-header.large { + height: 90vh; +} .no-image { @apply bg-yuika-blue-500 } @@ -254,6 +257,10 @@ footer { .nav li { @apply w-full flex flex-row justify-start items-center my-0 text-white text-base h-12 transition duration-300 ease-in-out; } +.nav li.separator { + height: 0; + @apply border border-white; +} .nav li a { @apply align-middle w-full h-full flex items-center justify-start px-4 py-2; } @@ -370,7 +377,21 @@ footer { @apply grid grid-cols-1 row-gap-4 my-8; } -/* 7. Default transitions */ +/* 7. Subscribe form */ +#subscribe-form .message-success { + @apply hidden; +} +#subscribe-form.success .message-success { + @apply block; +} +#subscribe-form .message-error { + @apply hidden; +} +#subscribe-form.error .message-error { + @apply block; +} + +/* 8. Default transitions */ @tailwind components; @tailwind utilities; diff --git a/assets/js/subscription.js b/assets/js/subscription.js deleted file mode 100644 index 3e1d426..0000000 --- a/assets/js/subscription.js +++ /dev/null @@ -1,50 +0,0 @@ - -// Parse the URL parameter -function getParameterByName(name, url) { - if (!url) url = window.location.href; - name = name.replace(/[\[\]]/g, "\\$&"); - var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), - results = regex.exec(url); - if (!results) return null; - if (!results[2]) return ''; - return decodeURIComponent(results[2].replace(/\+/g, " ")); -} - -$("#subscribe-button").click(function(){ - $("#subscribe-dialog").show(); - $("#subscribe-form").show(); - $("#subscribe-success").hide(); - $("#subscribe-confirmation").hide(); - $("#subscribe-failure").hide(); -}) - -$("#subscribe-back").click(function(){ - $("#subscribe-dialog").hide(); -}) - -$("#subscribe-submit").click(function() { - $("#subscribe-form").hide(); - $("#subscribe-success").hide(); - $("#subscribe-confirmation").show(); - $("#subscribe-failure").hide(); - -}) -$(document).ready(function () { - var action = getParameterByName('action'); - var success = getParameterByName('success'); - - if (action == 'subscribe' && (success === null || success === 'true')) { - $("#subscribe-dialog").show(); - $("#subscribe-form").hide(); - $("#subscribe-success").show(); - $("#subscribe-confirmation").hide(); - $("#subscribe-failure").hide(); - } - if (action == 'subscribe' && success === 'false') { - $("#subscribe-dialog").show(); - $("#subscribe-form").hide(); - $("#subscribe-success").hide(); - $("#subscribe-confirmation").hide(); - $("#subscribe-failure").show(); - } -}); \ No newline at end of file diff --git a/members/account.hbs b/members/account.hbs new file mode 100644 index 0000000..5d91b45 --- /dev/null +++ b/members/account.hbs @@ -0,0 +1,50 @@ +{{!< ../default}} + + +{{#unless @member}} + +{{/unless}} +
+ {{> header-background background=@site.cover_image}} {{!--Special header-image.hbs partial to generate the background image--}} +
+
+
+
+
+
+
+ {{#if @member}} +
+ {{#if @member.avatar_image}} + {{@member.email}} + {{/if}} +

{{@member.email}}

+
+ {{/if}} +
+
+
+
+ + +
+
+
+ {{#if @member.paid}} + {{else if @member}} +

You are subscribed to updates

+

You are currently subscribed to updates from {{@site.title}}.

+ {{else}} + {{/if}} +
+
+{{#contentFor "scripts"}} + +{{/contentFor}} diff --git a/members/signin.hbs b/members/signin.hbs new file mode 100644 index 0000000..b2be181 --- /dev/null +++ b/members/signin.hbs @@ -0,0 +1,56 @@ +{{!< ../default}} + + +{{#if @member}} + +{{/if}} +
+ {{> header-background background=@site.cover_image}} {{!--Special header-image.hbs partial to generate the background image--}} +
+
+
+
+
+
+
+

Welcome back!

+

Sign into your account again for full access

+
+
+ + +
+ +
+

Please check your email inbox to complete sign in.

+
+
+

Please enter a valid email address!

+
+
+
+
+
+
+ + +
+
+
+ {{#post}} + {{content}} + {{/post}} +
+
+{{#contentFor "scripts"}} + +{{/contentFor}} diff --git a/members/signup.hbs b/members/signup.hbs new file mode 100644 index 0000000..542f616 --- /dev/null +++ b/members/signup.hbs @@ -0,0 +1,58 @@ +{{!< ../default}} + + +{{#if @member}} + +{{/if}} +
+ {{> header-background background=@site.cover_image}} {{!--Special header-image.hbs partial to generate the background image--}} +
+
+
+
+
+
+
+ {{#unless @member}} +

Subscribe to {{@site.title}}

+

Get the latest posts delivered straight to your inbox

+
+
+ + +
+ +
+

Please check your email inbox to confirm your subscription!

+
+
+

Please enter a valid email address!

+
+
+ {{/unless}} +
+
+
+
+ + +
+
+
+ {{#post}} + {{content}} + {{/post}} +
+
+{{#contentFor "scripts"}} + +{{/contentFor}} diff --git a/package.json b/package.json index 010910d..48e46fb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "yuika", "description": "nanao.moe's blog theme", - "version": "2.4.1", + "version": "2.5.0", "engines": { "ghost-api": "v3" }, diff --git a/partials/site-header.hbs b/partials/site-header.hbs index b3cc79b..8cfe7d5 100644 --- a/partials/site-header.hbs +++ b/partials/site-header.hbs @@ -17,57 +17,26 @@ - - -{{#if @labs.members}} -{{!-- Subscription dialog --}} - -{{/if}} \ No newline at end of file + \ No newline at end of file