First pass styling improvements

This commit is contained in:
Trevor Vallender 2024-05-30 17:08:51 +01:00
parent ac0f759a4a
commit f17b5046c4
7 changed files with 53 additions and 9 deletions

View File

@ -1,4 +1,10 @@
:root { :root {
--background-color: #111;
--main-background-color:
--header-color: #15345b;
--header-text-color: #fff;
--header-height: 150px;
--inset-bg-color: #eee; --inset-bg-color: #eee;
--border-radius: .5em; --border-radius: .5em;

View File

@ -4,14 +4,18 @@
body { body {
font-size: 1.1em; font-size: 1.1em;
margin: 0 auto; background-color: var(--background-color);
max-width: 80em; min-width: 30em;
padding: 1em;
} }
main { main {
background: linear-gradient(180deg, rgba(227,220,190,1) 0%, rgba(255,248,238,1) 100%);
max-width: 80vw;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 1em;
margin: 0 auto;
min-height: calc(100vh - var(--header-height));
} }
aside.flash { aside.flash {
@ -38,6 +42,35 @@ h1, h2 {
text-align: center; text-align: center;
} }
header {
background: linear-gradient(180deg, rgba(34,45,113,1) 0%, rgba(22,90,157,1) 100%);
position: relative;
padding: 0 50px;
margin-right: 2em;
height: var(--header-height);
}
/* Angled banner end */
header:before {
content: "";
width: 0;
height: 0;
border-top: calc(var(--header-height) / 2) solid transparent;
border-bottom: calc(var(--header-height) / 2) solid transparent;
border-right: calc(var(--header-height) / 2) solid var(--background-color);
position: absolute;
right:0;
}
header h1 {
padding: .5em 0;
}
header h1 a:link, header h1 a:visited {
color: var(--header-text-color);
text-decoration: none;
}
header nav { header nav {
ul { ul {
display: flex; display: flex;

View File

@ -4,7 +4,7 @@ class TablesController < ApplicationController
before_action :set_table, only: [ :show, :edit, :update, :destroy ] before_action :set_table, only: [ :show, :edit, :update, :destroy ]
def index def index
@owned_tables = Current.user.owned_tables @tables = Current.user.tables
end end
def show def show

View File

@ -31,8 +31,8 @@
</ul> </ul>
</nav> </nav>
</header> </header>
<%= render partial: "shared/flash_messages" %>
<main> <main>
<%= render partial: "shared/flash_messages" %>
<%= yield(:submenu) if content_for?(:submenu) %> <%= yield(:submenu) if content_for?(:submenu) %>
<%= yield %> <%= yield %>
</main> </main>

View File

@ -2,4 +2,7 @@
<div id="<%= dom_id(table) %>" class="table"> <div id="<%= dom_id(table) %>" class="table">
<h4><%= link_to table.name, table %></h4> <h4><%= link_to table.name, table %></h4>
<% if table.owner == Current.user %>
OWNER
<% end %>
</div> </div>

View File

@ -1,10 +1,11 @@
<% content_for :title, t(".tables") %> <% content_for :title, t(".tables") %>
<h2><%= t(".tables") %></h2>
<%= link_to t(".new_table"), new_table_path %> <%= link_to t(".new_table"), new_table_path %>
<h2>Tables you own</h2> <% if @tables.any? %>
<% if @owned_tables.any? %> <%= render @tables %>
<%= render @owned_tables %>
<% else %> <% else %>
<p>You do not own any tables.</p> <p><%= t(".no_tables") %></p>
<% end %> <% end %>

View File

@ -99,6 +99,7 @@ en:
index: index:
new_table: Create a table new_table: Create a table
tables: Tables tables: Tables
no_tables: You are currently not at any tables. Why not create one?
show: show:
edit_table: Edit table edit_table: Edit table
game_system: Game system game_system: Game system