Skip to content

Commit

Permalink
Summer theme!
Browse files Browse the repository at this point in the history
  • Loading branch information
hartsick committed Apr 19, 2024
1 parent a8d1b0f commit 3f85457
Show file tree
Hide file tree
Showing 27 changed files with 68 additions and 48 deletions.
8 changes: 4 additions & 4 deletions app/assets/stylesheets/application.tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@
}

.link {
@apply underline text-white;
@apply underline;
}

.link:hover {
@apply text-primary-400;
}

.link--dark {
@apply underline text-secondary-900;
@apply underline text-black;
}

.link--dark:hover {
@apply underline text-secondary-700;
@apply underline text-black bg-secondary-200;
}

.link--light {
@apply underline text-white bg-primary-400 px-1;
@apply underline text-black bg-primary-400 px-1;
}

.link--light:hover {
Expand Down
6 changes: 3 additions & 3 deletions app/assets/stylesheets/cursors.css.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
body {
cursor: url(<%= Dir[ './public/cursors/halloween/**/*' ].sample.split('/').last(3).join('/') %>), auto;
cursor: url(<%= Dir[ './public/cursors/summer/**/*' ].sample.split('/').last(3).join('/') %>), auto;
}
a, button {
cursor: url(<%= Dir[ './public/cursors/halloween/**/*' ].sample.split('/').last(3).join('/') %>), pointer;
}
cursor: url(<%= Dir[ './public/cursors/summer/**/*' ].sample.split('/').last(3).join('/') %>), pointer;
}
20 changes: 18 additions & 2 deletions app/models/site_theme.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
class SiteTheme
def self.pick_color(number)
color_wheel = %w[
bg-amber-500
bg-amber-400
bg-amber-100
bg-amber-200
bg-amber-300
bg-amber-200
bg-amber-100
bg-rose-100
bg-rose-200
bg-rose-300
bg-rose-200
bg-rose-100
bg-cyan-100
bg-cyan-200
bg-cyan-300
bg-cyan-200
bg-cyan-100
bg-rose-100
bg-rose-200
bg-rose-300
bg-rose-200
bg-rose-100
]

index = number % color_wheel.length
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/confirmations/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% title("Confirm account") %>

<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-700 text-white">resend confirmation instructions</h1>
<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-300">resend confirmation instructions</h1>

<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/passwords/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% title("Change password") %>

<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-700 text-white">change your password</h1>
<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-300">change your password</h1>

<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }, class: "py-3") do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/passwords/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% title("Forgot password") %>

<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-700 text-white">forgot your password?</h1>
<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-300">forgot your password?</h1>

<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% title("Log in") %>

<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-700 text-white">log in</h1>
<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-300">log in</h1>

<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="field">
Expand Down
12 changes: 6 additions & 6 deletions app/views/devise/shared/_links.html.erb
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<%- if controller_name != 'sessions' %>
<%= link_to "log in", new_session_path(resource_name), class: "link--light" %><br />
<%= link_to "log in", new_session_path(resource_name), class: "link" %><br />
<% end %>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<%= link_to "sign up", new_registration_path(resource_name), class: "link--light" %><br />
<%= link_to "sign up", new_registration_path(resource_name), class: "link" %><br />
<% end %>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
<%= link_to "forgot your password?", new_password_path(resource_name), class: "link--light" %><br />
<%= link_to "forgot your password?", new_password_path(resource_name), class: "link" %><br />
<% end %>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<%= link_to "didn't receive confirmation instructions?", new_confirmation_path(resource_name), class: "link--light" %><br />
<%= link_to "didn't receive confirmation instructions?", new_confirmation_path(resource_name), class: "link" %><br />
<% end %>
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
<%= link_to "didn't receive unlock instructions?", new_unlock_path(resource_name), class: "link--light" %><br />
<%= link_to "didn't receive unlock instructions?", new_unlock_path(resource_name), class: "link" %><br />
<% end %>
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post, class: "link--light" %><br />
<%= link_to "sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post, class: "link" %><br />
<% end %>
<% end %>
2 changes: 1 addition & 1 deletion app/views/devise/unlocks/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% title("Unlock account") %>

<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-700 text-white">resend unlock instructions</h1>
<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-300">resend unlock instructions</h1>

<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
Expand Down
12 changes: 10 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@
</div>
</nav>
<div class="w-full snow">
<p class="px-1 bg-secondary-800 text-white"><%= notice %></p>
<p class="px-1 bg-secondary-900 text-white"><%= alert %></p>
<p class="px-1 bg-secondary-200 text-black"><%= notice %></p>
<p class="px-1 bg-secondary-100 text-black"><%= alert %></p>
</div>
<div class="py-5 px-3">
<%= yield %>
</div>
<div class="text-sm text-white py-1 px-3">
<p>Cursors by:</p>
<ul class="list-disc px-3">
<li class="link"><a target="_blank" href="https://icons8.com/icon/fRieeV3aJTWE/watermelon">Watermelon</a> icon by <a target="_blank" href="https://icons8.com">Icons8</a></li>
<li class="link"><a target="_blank" href="https://icons8.com/icon/80746/tomato">Tomato</a> icon by <a target="_blank" href="https://icons8.com">Icons8</a></li>
<li class="link"><a target="_blank" href="https://icons8.com/icon/17570/beach-ball">Beach Ball</a> icon by <a target="_blank" href="https://icons8.com">Icons8</a></li>
</ul>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion app/views/profile/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% title("Edit profile") %>

<h1 class="text-lg px-1 inline-block bg-secondary-700 text-white">editing <%= @profile.user.username %>'s profile</h1>
<h1 class="text-lg px-1 inline-block bg-secondary-300">editing <%= @profile.user.username %>'s profile</h1>
<div class="py-3">
<%= form_with model: @profile, url: profile_path(@profile.user) do |f| %>
<%= render 'shared/errors', errors: @profile.errors %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/profile/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% title("@#{@profile.user.username}'s Profile") %>
<% if Rails.configuration.x.invitations.enabled && current_user.has_invites_available? %>
<div class="py-1 px-3 mb-3 bg-secondary-800 text-white">
<div class="py-1 px-3 mb-3 bg-secondary-200">
hello, you have an invite available! care to <%= link_to 'invite someone', new_user_invitation_path, class: 'link' %>?
</div>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/topics/_table.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<table class="w-full my-3" id="topics-table">
<thead>
<tr class="py-1 bg-primary-300 border-b-2 border-secondary-900 text-left">
<tr class="py-1 bg-primary-300 border-b-2 border-secondary-100 text-left">
<th class="pl-3 w-1">📜<span class="sr-only">notices</span></th>
<th class="px-3 w-10/12 md:w-7/12 break-all">title</th>
<th class="px-3 hidden md:table-cell w-1/12">author</th>
Expand All @@ -14,7 +14,7 @@
<% views_for_topic = topic_views[topic.id] %>
<% unread_posts = unread_posts?(topic, views_for_topic) %>

<tr class="py-1 border-b-2 border-secondary-900 <%= SiteTheme.pick_color(index) %> <%= 'font-bold' if unread_posts %>">
<tr class="py-1 border-b-2 border-secondary-100 <%= SiteTheme.pick_color(index) %> <%= 'font-bold' if unread_posts %>">
<td class="pl-3 w-1">
<% if unread_mentions?(mentions[topic.id], views_for_topic) %>
👀
Expand Down
12 changes: 6 additions & 6 deletions app/views/topics/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

<div class="flex justify-between">
<%= link_to root_path do %>
<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-700 link">topics</h1>
<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-300 link--dark">topics</h1>
<% end %>
<%= link_to "new topic", new_topic_path, class: "btn inline-block" %>
</div>

<details class="w-full my-3 text-white">
<summary class="py-1 px-1 bg-secondary-800">forum-wide pinned posts</summary>
<details class="w-full my-3">
<summary class="py-1 px-1 bg-secondary-200">forum-wide pinned posts</summary>
<table class="w-full" id="pinned">
<thead>
<tr class="bg-secondary-700 border-b-2 border-secondary-900 text-left">
<tr class="bg-secondary-300 border-b-2 border-secondary-100 text-left">
<th class="px-3 w-10/12 md:w-7/12 break-all">title</th>
<th class="px-3 hidden md:table-cell w-1/12">author</th>
<th class="px-3 hidden md:table-cell w-1/12">#</th>
Expand All @@ -25,7 +25,7 @@
<% views_for_topic = @topic_views[topic.id] %>
<% unread_posts = unread_posts?(topic, views_for_topic) %>

<tr class="py-1 border-b-2 border-secondary-800 bg-secondary-900 <%= 'font-bold' if unread_posts %>">
<tr class="py-1 border-b-2 border-secondary-200 bg-secondary-100 <%= 'font-bold' if unread_posts %>">
<td class="px-3 w-10/12 md:w-6/12 break-all"><%= link_to topic.title, topic_path(topic) %> <span class="sr-only"><%= '(unread)' if unread_posts %></span></td>
<td class="px-3 hidden md:table-cell w-1/12"><%= link_to topic.author.username, profile_path(topic.author) %></td>
<td class="px-3 hidden md:table-cell w-1/12"><%= topic.posts.length %></td>
Expand All @@ -50,5 +50,5 @@
<%= render 'table', topics: @topics, topic_follows: @topic_follows, topic_views: @topic_views, mentions: @mentions %>

<footer>
<%= render 'shared/pagination_controls', link_classes: %w[my-3 link--light] %>
<%= render 'shared/pagination_controls', link_classes: %w[my-3 link] %>
</footer>
4 changes: 2 additions & 2 deletions app/views/topics/mentions.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<% title("Mentions") %>

<div class="flex justify-between">
<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-700 text-white">topics you've been mentioned in</h1>
<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-300">topics you've been mentioned in</h1>
<%= link_to "new topic", new_topic_path, class: "btn inline-block" %>
</div>

<%= render 'table', topics: @topics, topic_follows: @topic_follows, topic_views: @topic_views, mentions: @mentions %>
<%= link_to "back to topics", topics_path, class: "link--light mb-3" %>
<%= link_to "back to topics", topics_path, class: "link mb-3" %>
2 changes: 1 addition & 1 deletion app/views/topics/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% title("New topic") %>

<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-700 text-white">new topic</h1>
<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-300">new topic</h1>
<%= form_with model: @topic, class: "py-2" do |f| %>
<%= render 'shared/errors', errors: @topic.errors if @topic.errors.any? %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/topics/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% title(@topic.title) %>

<div class="pb-2">
<%= link_to '▼ jump to bottom', '#last-post', class: "link--light" %>
<%= link_to '▼ jump to bottom', '#last-post', class: "link link--light" %>
<div class="bg-primary-500">
<div class="bg-primary-400 px-2 py-1 flex justify-between">
<div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/topics/starred.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

<%= render 'table', topics: @topics, topic_follows: @topic_follows, topic_views: @topic_views, mentions: @mentions %>
<%= link_to "back to topics", topics_path, class: "link--light mb-3" %>
<%= link_to "back to topics", topics_path, class: "link mb-3" %>
6 changes: 3 additions & 3 deletions app/views/users/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<% title("Directory") %>

<div class="flex justify-between">
<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-700 text-white">the poster list</h1>
<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-300">the poster list</h1>
</div>

<table class="w-full my-3">
<thead>
<tr class="py-1 bg-primary-300 border-b-2 border-secondary-900 text-left">
<tr class="py-1 bg-primary-300 border-b-2 border-secondary-100 text-left">
<th class="pl-3 w-6/12">username</th>
<th class="px-3 hidden md:table-cell md:w-4/12">invited by</th>
<th class="px-3 w-6/12 md:w-4/12">joined</th>
</tr>
</thead>
<tbody>
<% @users.each_with_index do |user, index| %>
<tr class="py-1 border-b-2 border-secondary-900 <%= SiteTheme.pick_color(index) %>">
<tr class="py-1 border-b-2 border-secondary-100 <%= SiteTheme.pick_color(index) %>">
<td class="px-3 pl-3 w-6/12"><%= link_to user.username, profile_path(user) %></td>
<% if user.invited_by.present? %>
<td class="px-3 hidden md:table-cell md:w-4/12">
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/invitations/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% title("Accept invite") %>

<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-700 text-white">accept invite</h1>
<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-300">accept invite</h1>

<%= form_for(resource, as: resource_name, url: invitation_path(resource_name), html: { method: :put }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/invitations/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% title("Invite") %>

<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-700 text-white">invite new person</h1>
<h1 class="text-lg mb-1 px-1 inline-block bg-secondary-300">invite new person</h1>

<%= form_for(resource, as: resource_name, url: invitation_path(resource_name), html: { method: :post }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
Expand Down
8 changes: 2 additions & 6 deletions config/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ module.exports = {
theme: {
extend: {
colors: {
stone: colors.stone,
yellow: colors.yellow,
amber: colors.amber,
orange: colors.orange,
primary: colors.amber,
secondary: colors.stone,
primary: colors.sky,
secondary: colors.yellow,
},
},
},
Expand Down
Empty file added public/cursors/summer/.keep
Empty file.
Binary file added public/cursors/summer/flower_cursor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/cursors/summer/icons8-beach-ball-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/cursors/summer/icons8-tomato-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/cursors/summer/watermelon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3f85457

Please sign in to comment.