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 {
--background-color: #111;
--main-background-color:
--header-color: #15345b;
--header-text-color: #fff;
--header-height: 150px;
--inset-bg-color: #eee;
--border-radius: .5em;

View File

@ -4,14 +4,18 @@
body {
font-size: 1.1em;
margin: 0 auto;
max-width: 80em;
padding: 1em;
background-color: var(--background-color);
min-width: 30em;
}
main {
background: linear-gradient(180deg, rgba(227,220,190,1) 0%, rgba(255,248,238,1) 100%);
max-width: 80vw;
display: flex;
flex-direction: column;
padding: 1em;
margin: 0 auto;
min-height: calc(100vh - var(--header-height));
}
aside.flash {
@ -38,6 +42,35 @@ h1, h2 {
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 {
ul {
display: flex;

View File

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

View File

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

View File

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

View File

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

View File

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