diff --git a/app/assets/images/bg-grid.png b/app/assets/images/bg-grid.png new file mode 100644 index 00000000..86742d7d Binary files /dev/null and b/app/assets/images/bg-grid.png differ diff --git a/app/assets/images/logo-squircle.svg b/app/assets/images/logo-squircle.svg new file mode 100644 index 00000000..9a8aa75c --- /dev/null +++ b/app/assets/images/logo-squircle.svg @@ -0,0 +1,160 @@ + diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e947bb37..c5145b17 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,9 +2,6 @@ class ApplicationController < ActionController::Base include Localize, AutoSync, Authentication, Invitable, SelfHostable, StoreLocation include Pagy::Backend - # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. - allow_browser versions: :modern - private def with_sidebar diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 29dba43d..b3981939 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -1,5 +1,6 @@ class PagesController < ApplicationController - layout :with_sidebar + skip_before_action :authenticate_user!, only: %i[early_access] + layout :with_sidebar, except: %i[early_access] include Filterable @@ -37,6 +38,11 @@ class PagesController < ApplicationController def feedback end - def invites + def early_access + redirect_to root_path if self_hosted? + + @invite_codes_count = InviteCode.count + @invite_code = InviteCode.order("RANDOM()").limit(1).first + render layout: false end end diff --git a/app/views/pages/early_access.html.erb b/app/views/pages/early_access.html.erb new file mode 100644 index 00000000..eb77e5c2 --- /dev/null +++ b/app/views/pages/early_access.html.erb @@ -0,0 +1,56 @@ + + +
+There <%= @invite_codes_count == 1 ? "is" : "are" %> <%= @invite_codes_count %> invite <%= "code".pluralize(@invite_codes_count) %> remaining.
+Your invite code is <%= @invite_code.token %>
+<%= link_to "Sign up with this code", new_registration_path(invite: @invite_code.token), class: "block w-full bg-white text-black py-2 px-3 rounded-md no-underline text-sm sm:text-base hover:bg-gray-200 transition duration-150" %>
+You may need to refresh the page to get a new invite code if someone else claimed it before you.
+ ++ <%= link_to early_access_path, class: "w-full block text-center justify-center inline-flex items-center text-white hover:bg-gray-800 p-2 rounded-md text-base transition duration-150", data: { turbo_method: :get } do %> + <%= lucide_icon "refresh-cw", class: "w-4 h-4 sm:w-5 sm:h-5 mr-2 text-gray-400" %> + Refresh page + <% end %> +
+ <% else %> +Sorry, there are no invite codes remaining. Join our <%= link_to "Discord server", "https://link.maybe.co/discord", target: "_blank", class: "text-white hover:text-gray-300" %> to get notified when new invite codes are available.
+<%= link_to "Join Discord server", "https://link.maybe.co/discord", target: "_blank", class: "bg-white text-black px-3 py-2 rounded-md no-underline text-base hover:bg-gray-200 transition duration-150" %>
+ <% end %> +