Add a new color palette and rework all site colors (both light mode and dark mode) to
use the new palette.
This ensures that colors are used consistently, from a carefully designed color palette,
instead of being chosen at random.
Before, colors in light mode were chosen on an ad-hoc basis, which resulted in a lot of
random colors and inconsistent design.
The new palette has 7 hues: red, orange, yellow, green, blue, azure (a lighter blue), and
purple. There's also a greyscale. Each hue has 10 shades of brightness, which (including
grey) gives us 80 total colors.
Colors are named like this:
var(--red-0); /* very light red */
var(--red-2); /* light red */
var(--red-5); /* medium red */
var(--red-7); /* dark red */
var(--red-9); /* very dark red */
var(--green-7); /* dark green */
var(--blue-5); /* medium blue */
var(--purple-3); /* light purple */
/* etc */
The color palette is designed to meet the following criteria:
* To have close equivalents to the main colors used in the old color scheme,
especially tag colors, so that changes to major colors are minimized.
* To produce a set of colors that can be used as as main text colors, as background
colors, and as accent colors, both in light mode and dark mode.
* To ensure that colors at the same brightness level have the same perceived brightness.
Green-4, blue-4, red-4, purple-4, etc should all have the same brightness and contrast
ratios. This way colors look balanced. This is actually a difficult problem, because human
color perception is non-linear, so you can't just scale brightness values linearly.
There's a color palette test page at https://danbooru.donmai/static/colors
Notable changes to colors in light mode:
* Username colors are the same as tag colors.
* Copyright tags are a deeper purple.
* Builders are a deeper purple (fixes #4626).
* Moderators are green.
* Gold users are orange.
* Parent borders are a darker green.
* Child borders are a darker orange.
* Unsaved notes have a thicker red border.
* Selected notes have a thicker blue (not green) border.
65 lines
1.4 KiB
Ruby
65 lines
1.4 KiB
Ruby
class StaticController < ApplicationController
|
|
respond_to :html, :json, :xml
|
|
|
|
def privacy_policy
|
|
end
|
|
|
|
def terms_of_service
|
|
end
|
|
|
|
def not_found
|
|
@pool = Pool.find(Danbooru.config.page_not_found_pool_id) if Danbooru.config.page_not_found_pool_id.present?
|
|
@post = @pool.posts.sample if @pool.present?
|
|
@artist = @post.tags.select(&:artist?).first if @post.present?
|
|
|
|
render_error_page(404, nil, template: "static/not_found", message: "Page not found")
|
|
end
|
|
|
|
def error
|
|
end
|
|
|
|
def dtext_help
|
|
redirect_to wiki_page_path("help:dtext") unless request.format.js?
|
|
end
|
|
|
|
def colors
|
|
end
|
|
|
|
def opensearch
|
|
end
|
|
|
|
def site_map
|
|
end
|
|
|
|
def sitemap_index
|
|
@sitemap = params[:sitemap]
|
|
@limit = params.fetch(:limit, 10000).to_i
|
|
|
|
case @sitemap
|
|
when "artists"
|
|
@relation = Artist.undeleted
|
|
@search = { is_deleted: "false" }
|
|
when "forum_topics"
|
|
@relation = ForumTopic.undeleted
|
|
@search = { is_deleted: "false" }
|
|
when "pools"
|
|
@relation = Pool.undeleted
|
|
@search = { is_deleted: "false" }
|
|
when "posts"
|
|
@relation = Post.order(id: :asc)
|
|
@search = {}
|
|
when "tags"
|
|
@relation = Tag.nonempty
|
|
@search = {}
|
|
when "users"
|
|
@relation = User.all
|
|
@search = {}
|
|
when "wiki_pages"
|
|
@relation = WikiPage.undeleted
|
|
@search = { is_deleted: "false" }
|
|
else
|
|
raise NotImplementedError
|
|
end
|
|
end
|
|
end
|