add tailwind css and home page scaffold
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -35,4 +35,6 @@
|
||||
/config/master.key
|
||||
|
||||
/profiler/
|
||||
/flamegraph.svg
|
||||
/flamegraph.svg
|
||||
/app/assets/builds/*
|
||||
!/app/assets/builds/.keep
|
||||
|
||||
2
Gemfile
2
Gemfile
@@ -110,3 +110,5 @@ group :production do
|
||||
gem "rails_semantic_logger"
|
||||
end
|
||||
# gem "pg_party"
|
||||
|
||||
gem "tailwindcss-rails", "~> 2.0"
|
||||
|
||||
@@ -293,6 +293,8 @@ GEM
|
||||
stimulus-rails (1.2.1)
|
||||
railties (>= 6.0.0)
|
||||
table_print (1.5.7)
|
||||
tailwindcss-rails (2.0.26)
|
||||
railties (>= 6.0.0)
|
||||
thor (1.2.1)
|
||||
timeout (0.3.1)
|
||||
turbo-rails (1.3.3)
|
||||
@@ -366,6 +368,7 @@ DEPENDENCIES
|
||||
sqlite3 (~> 1.4)
|
||||
stimulus-rails
|
||||
table_print
|
||||
tailwindcss-rails (~> 2.0)
|
||||
turbo-rails
|
||||
tzinfo-data
|
||||
web-console
|
||||
|
||||
2
Procfile.dev
Normal file
2
Procfile.dev
Normal file
@@ -0,0 +1,2 @@
|
||||
web: bin/rails server -p 3000
|
||||
css: bin/rails tailwindcss:watch
|
||||
0
app/assets/builds/.keep
Normal file
0
app/assets/builds/.keep
Normal file
@@ -2,3 +2,4 @@
|
||||
//= link_directory ../stylesheets .css
|
||||
//= link_tree ../../javascript .js
|
||||
//= link_tree ../../../vendor/javascript .js
|
||||
//= link_tree ../builds
|
||||
|
||||
13
app/assets/stylesheets/application.tailwind.css
Normal file
13
app/assets/stylesheets/application.tailwind.css
Normal file
@@ -0,0 +1,13 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
/*
|
||||
|
||||
@layer components {
|
||||
.btn-primary {
|
||||
@apply py-2 px-4 bg-blue-200;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
6
app/controllers/pages_controller.rb
Normal file
6
app/controllers/pages_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class PagesController < ApplicationController
|
||||
skip_before_action :validate_api_token, only: [:root]
|
||||
|
||||
def root
|
||||
end
|
||||
end
|
||||
@@ -1,6 +1,10 @@
|
||||
class VpnOnlyRouteConstraint
|
||||
def matches?(request)
|
||||
# curtus IP on vpn
|
||||
request.ip == "10.200.0.3" || request.ip == "127.0.0.1"
|
||||
if Rails.env.development?
|
||||
request.ip == "127.0.0.1" || request.ip == "::1"
|
||||
else
|
||||
# curtus IP on vpn
|
||||
request.ip == "10.200.0.3" || request.ip == "127.0.0.1"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,11 +5,14 @@
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
|
||||
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
||||
<%= javascript_importmap_tags %>
|
||||
<%= yield :head %>
|
||||
</head>
|
||||
<body>
|
||||
<%= yield %>
|
||||
<body class="w-full mx-0">
|
||||
<main class="mx-auto w-full">
|
||||
<%= yield %>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
20
app/views/pages/root.html.erb
Normal file
20
app/views/pages/root.html.erb
Normal file
@@ -0,0 +1,20 @@
|
||||
<div class="min-h-full">
|
||||
<header class="bg-white shadow">
|
||||
<div class="mx-auto max-w-5xl py-6 px-6 sm:px-8 flex items-baseline">
|
||||
<h1 class="text-4xl sm:text-5xl font-bold text-gray-900">ReFurrer</h1>
|
||||
<div class="flex-grow"></div>
|
||||
<h2 class="text-1xl sm:text-2xl italic font-bold text-gray-500">
|
||||
Furry Swiss Army Knife</h2>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class="mx-auto max-w-5xl py-6 px-6 sm:px-8">
|
||||
<div class="mx-auto max-w-xl border-gray-800 rounded">
|
||||
<input
|
||||
class="rounded bg-gray-200 text-gray-900 w-full text-xl p-2 placeholder:italic"
|
||||
placeholder="FurAffinity Username"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
8
bin/dev
Executable file
8
bin/dev
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
if ! gem list foreman -i --silent; then
|
||||
echo "Installing foreman..."
|
||||
gem install foreman
|
||||
fi
|
||||
|
||||
exec foreman start -f Procfile.dev "$@"
|
||||
@@ -1,4 +1,6 @@
|
||||
Rails.application.routes.draw do
|
||||
root to: "pages#root"
|
||||
|
||||
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
|
||||
namespace :api do
|
||||
namespace :fa do
|
||||
|
||||
23
config/tailwind.config.js
Normal file
23
config/tailwind.config.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const defaultTheme = require('tailwindcss/defaultTheme')
|
||||
|
||||
module.exports = {
|
||||
content: [
|
||||
'./public/*.html',
|
||||
'./app/helpers/**/*.rb',
|
||||
'./app/javascript/**/*.js',
|
||||
'./app/views/**/*.{erb,haml,html,slim}'
|
||||
],
|
||||
theme: {
|
||||
extend: {
|
||||
fontFamily: {
|
||||
sans: ['Inter var', ...defaultTheme.fontFamily.sans],
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
require('@tailwindcss/forms'),
|
||||
require('@tailwindcss/aspect-ratio'),
|
||||
require('@tailwindcss/typography'),
|
||||
require('@tailwindcss/container-queries'),
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user