Skip to content

Commit 55c5f2a

Browse files
committed
feature/Add unauthenticated root
1 parent 21d02f9 commit 55c5f2a

File tree

6 files changed

+205
-3
lines changed

6 files changed

+205
-3
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Unauthenticated::HomeController < ApplicationController
2+
layout 'unauthenticated'
3+
4+
def index
5+
6+
end
7+
end

app/javascript/stylesheets/application.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
.CodeMirror {
77
/* Set height, width, borders, and global font properties here */
8-
@apply font-mono p-2 rounded-sm border text-sm;
8+
@apply font-mono p-2 rounded-md border text-sm;
99
height: auto;
1010
color: black;
1111
direction: ltr;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Snippet Safe</title>
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
7+
<%= csrf_meta_tags %>
8+
<%= csp_meta_tag %>
9+
10+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
11+
<%= javascript_pack_tag 'snippet_app' %>
12+
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
13+
<%= stylesheet_pack_tag "application", "data-turbo-track": "reload" %>
14+
</head>
15+
16+
<body>
17+
<%= yield %>
18+
</body>
19+
</html>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<svg class="w-<%= width %> h-<%= height %> <%= color %>" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid meet" viewBox="158.99999999999997 79 84.00000000000003 104" width="100" height="100">
2+
<defs>
3+
<path d="M160 80L220 80L220 100L160 100L160 80Z" id="a7dSAlYCNy"></path>
4+
<path d="M181.08 120L240 120L240 140L181.08 140L181.08 120Z" id="hASAxdwr9"></path>
5+
<path d="M160 160L220 160L220 180L160 180L160 160Z" id="d4KpUcG1Lz"></path>
6+
</defs>
7+
<g>
8+
<g>
9+
<use xlink:href="#a7dSAlYCNy" opacity="1" fill="currentColor" fill-opacity="1"></use>
10+
</g>
11+
<g>
12+
<use xlink:href="#hASAxdwr9" opacity="1" fill="currentColor" fill-opacity="1"></use>
13+
</g>
14+
<g>
15+
<use xlink:href="#d4KpUcG1Lz" opacity="1" fill="currentColor" fill-opacity="1"></use>
16+
</g>
17+
</g>
18+
</svg>
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
<!-- This example requires Tailwind CSS v2.0+ -->
2+
<div class="bg-gray-50">
3+
<div class="relative overflow-hidden">
4+
<div class="absolute inset-y-0 h-full w-full" aria-hidden="true">
5+
<div class="relative h-full">
6+
<svg class="absolute right-full transform translate-y-1/3 translate-x-1/4 md:translate-y-1/2 sm:translate-x-1/2 lg:translate-x-full" width="404" height="784" fill="none" viewBox="0 0 404 784">
7+
<defs>
8+
<pattern id="e229dbec-10e9-49ee-8ec3-0286ca089edf" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
9+
<rect x="0" y="0" width="4" height="4" class="text-gray-200" fill="currentColor" />
10+
</pattern>
11+
</defs>
12+
<rect width="404" height="784" fill="url(#e229dbec-10e9-49ee-8ec3-0286ca089edf)" />
13+
</svg>
14+
<svg class="absolute left-full transform -translate-y-3/4 -translate-x-1/4 sm:-translate-x-1/2 md:-translate-y-1/2 lg:-translate-x-3/4" width="404" height="784" fill="none" viewBox="0 0 404 784">
15+
<defs>
16+
<pattern id="d2a68204-c383-44b1-b99f-42ccff4e5365" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
17+
<rect x="0" y="0" width="4" height="4" class="text-gray-200" fill="currentColor" />
18+
</pattern>
19+
</defs>
20+
<rect width="404" height="784" fill="url(#d2a68204-c383-44b1-b99f-42ccff4e5365)" />
21+
</svg>
22+
</div>
23+
</div>
24+
25+
<div class="relative pt-6 pb-16 sm:pb-24">
26+
<div class="max-w-7xl mx-auto px-4 sm:px-6">
27+
<nav class="relative flex items-center justify-between sm:h-10 md:justify-center" aria-label="Global">
28+
<div class="flex items-center flex-1 md:absolute md:inset-y-0 md:left-0">
29+
<div class="flex items-center justify-between w-full md:w-auto">
30+
<a href="#">
31+
<span class="sr-only">Workflow</span>
32+
<img class="h-8 w-auto sm:h-10" src="https://tailwindui.com/img/logos/workflow-mark-indigo-600.svg" alt="">
33+
</a>
34+
<div class="-mr-2 flex items-center md:hidden">
35+
<button type="button" class="bg-gray-50 rounded-md p-2 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500" aria-expanded="false">
36+
<span class="sr-only">Open main menu</span>
37+
<!-- Heroicon name: outline/menu -->
38+
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
39+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
40+
</svg>
41+
</button>
42+
</div>
43+
</div>
44+
</div>
45+
<div class="hidden md:flex md:space-x-10">
46+
<a href="#" class="font-medium text-gray-500 hover:text-gray-900">Product</a>
47+
48+
<a href="#" class="font-medium text-gray-500 hover:text-gray-900">Features</a>
49+
50+
<a href="#" class="font-medium text-gray-500 hover:text-gray-900">Marketplace</a>
51+
52+
<a href="#" class="font-medium text-gray-500 hover:text-gray-900">Company</a>
53+
</div>
54+
<div class="hidden md:absolute md:flex md:items-center md:justify-end md:inset-y-0 md:right-0">
55+
<span class="inline-flex rounded-md shadow">
56+
<a href="#" class="inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md text-indigo-600 bg-white hover:text-indigo-500">
57+
Log in
58+
</a>
59+
</span>
60+
</div>
61+
</nav>
62+
</div>
63+
64+
<!--
65+
Mobile menu, show/hide based on menu open state.
66+
67+
Entering: "duration-150 ease-out"
68+
From: "opacity-0 scale-95"
69+
To: "opacity-100 scale-100"
70+
Leaving: "duration-100 ease-in"
71+
From: "opacity-100 scale-100"
72+
To: "opacity-0 scale-95"
73+
-->
74+
<div class="absolute top-0 inset-x-0 p-2 transition transform origin-top-right md:hidden">
75+
<div class="rounded-lg shadow-md bg-white ring-1 ring-black ring-opacity-5 overflow-hidden">
76+
<div class="px-5 pt-4 flex items-center justify-between">
77+
<div>
78+
<img class="h-8 w-auto" src="https://tailwindui.com/img/logos/workflow-mark-indigo-600.svg" alt="">
79+
</div>
80+
<div class="-mr-2">
81+
<button type="button" class="bg-white rounded-md p-2 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500">
82+
<span class="sr-only">Close main menu</span>
83+
<!-- Heroicon name: outline/x -->
84+
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
85+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
86+
</svg>
87+
</button>
88+
</div>
89+
</div>
90+
<div class="px-2 pt-2 pb-3 space-y-1">
91+
<a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50">Product</a>
92+
93+
<a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50">Features</a>
94+
95+
<a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50">Marketplace</a>
96+
97+
<a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50">Company</a>
98+
</div>
99+
<a href="#" class="block w-full px-5 py-3 text-center font-medium text-indigo-600 bg-gray-50 hover:bg-gray-100 hover:text-indigo-700">
100+
Log in
101+
</a>
102+
</div>
103+
</div>
104+
105+
<div class="mt-16 mx-auto max-w-7xl px-4 sm:mt-24 sm:px-6">
106+
<div class="text-center">
107+
<h1 class="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl">
108+
<span class="block">Find out what</span>
109+
<span class="block text-cyan">everyone is building</span>
110+
</h1>
111+
<p class="mt-3 max-w-md mx-auto text-base text-gray-500 sm:text-lg md:mt-5 md:text-xl md:max-w-3xl">
112+
Anim aute id magna aliqua ad ad non deserunt sunt. Qui irure qui lorem cupidatat commodo. Elit sunt amet fugiat veniam occaecat fugiat aliqua.
113+
</p>
114+
</div>
115+
</div>
116+
</div>
117+
<div class="relative">
118+
<div class="absolute inset-0 flex flex-col" aria-hidden="true">
119+
<div class="flex-1"></div>
120+
<div class="flex-1 w-full bg-gray-800"></div>
121+
</div>
122+
<div class="max-w-7xl mx-auto px-4 sm:px-6">
123+
<img class="relative rounded-lg shadow-lg" src="https://tailwindui.com/img/component-images/top-nav-with-multi-column-layout-screenshot.jpg" alt="App screenshot">
124+
</div>
125+
</div>
126+
</div>
127+
<div class="bg-gray-800">
128+
<div class="max-w-7xl mx-auto py-16 px-4 sm:py-24 sm:px-6 lg:px-8">
129+
<h2 class="text-center text-gray-400 text-sm font-semibold uppercase tracking-wide">Trusted by over 26,000 forward-thinking companies</h2>
130+
<div class="mt-8 grid grid-cols-2 gap-8 md:grid-cols-6 lg:grid-cols-5">
131+
<div class="col-span-1 flex justify-center md:col-span-2 lg:col-span-1">
132+
<img class="h-12" src="https://tailwindui.com/img/logos/tuple-logo-gray-400.svg" alt="Tuple">
133+
</div>
134+
<div class="col-span-1 flex justify-center md:col-span-2 lg:col-span-1">
135+
<img class="h-12" src="https://tailwindui.com/img/logos/mirage-logo-gray-400.svg" alt="Mirage">
136+
</div>
137+
<div class="col-span-1 flex justify-center md:col-span-2 lg:col-span-1">
138+
<img class="h-12" src="https://tailwindui.com/img/logos/statickit-logo-gray-400.svg" alt="StaticKit">
139+
</div>
140+
<div class="col-span-1 flex justify-center md:col-span-3 lg:col-span-1">
141+
<img class="h-12" src="https://tailwindui.com/img/logos/transistor-logo-gray-400.svg" alt="Transistor">
142+
</div>
143+
<div class="col-span-2 flex justify-center md:col-span-3 lg:col-span-1">
144+
<img class="h-12" src="https://tailwindui.com/img/logos/workcation-logo-gray-400.svg" alt="Workcation">
145+
</div>
146+
</div>
147+
</div>
148+
</div>
149+
</div>

config/routes.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,17 @@
1515
confirmations: 'confirmations',
1616
omniauth_callbacks: 'omniauth_callbacks'
1717
}
18-
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
19-
root to: 'home#index'
18+
19+
devise_scope :user do
20+
authenticated do
21+
root 'home#index', as: :authenticated_root
22+
end
23+
24+
unauthenticated do
25+
root 'unauthenticated/home#index', as: :unauthenticated_root
26+
end
27+
end
28+
2029
get '/connect', to: 'home#connect'
2130

2231
namespace :modals do

0 commit comments

Comments
 (0)