colorful css

This commit is contained in:
bronku 2025-04-05 19:08:32 +02:00
parent 1d05c217b9
commit 75c2be36dd
3 changed files with 280 additions and 117 deletions

View file

@ -1,149 +1,311 @@
:root { :root {
--base-color: #ffffff; --primary-color: #ff6b6b;
--base-font-color: #333333; --primary-light: #ffeded;
--base-font-size: 16 px; --primary-dark: #e64c4c;
--border-color: #d7dde4; --text-color: #333333;
--body-color: #f8f9fa; --text-light: #666666;
--hover-color: #eaeaea; --background-color: #f8f9fa;
--transition-duration: 0.15 s; --white: #ffffff;
--base-color-alt3: #e4e9ec; --border-color: #e4e9ec;
--hover-color: #f5f5f5;
--shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
--font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
--transition: 0.2s ease;
--radius: 6px;
} }
* { * {
box-sizing: border-box; box-sizing: border-box;
margin: 0;
padding: 0;
} }
body { body {
margin: 0; font-family: var(--font-main);
padding: 0; color: var(--text-color);
font-family: sans-serif; background-color: var(--background-color);
font-size: var(--base-font-size); display: flex;
line-height: 1.5; min-height: 100vh;
color: var(--base-font-color); width: 100%;
display: flex; line-height: 1.6;
height: 100vh;
width: 100%;
background-color: var(--body-color);
} }
/* Sidebar */
aside { aside {
min-width: 5rem; min-width: 4.5rem;
max-width: 5rem; max-width: 4.5rem;
padding: 1rem 0; background-color: var(--primary-color);
height: 100vh; height: 100vh;
display: flex; position: fixed;
flex-direction: column; left: 0;
border-right: 1px solid var(--border-color); top: 0;
background-color: var(--base-color); border-right: 1px solid var(--border-color);
align-items: center; box-shadow: var(--shadow);
justify-content: space-between; z-index: 10;
overflow: auto;
} }
nav { nav {
flex-shrink: 0; display: flex;
display: flex; flex-direction: column;
row-gap: 1rem; align-items: center;
flex-direction: column; padding-top: 2rem;
align-items: center; gap: 1.5rem;
overflow: auto; height: 100%;
} }
nav>a {
color: var(--white);
text-decoration: none;
font-size: 1.5rem;
width: 3rem;
height: 3rem;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
transition: background-color var(--transition);
position: relative;
}
nav>a:hover {
background-color: var(--primary-dark);
}
nav>a:last-child {
margin-top: auto;
margin-bottom: 2rem;
}
nav>a>i {
text-decoration: none;
color: var(--white);
}
/* Tooltip for sidebar icons */
nav>a::after {
content: attr(data-title);
position: absolute;
left: 120%;
top: 50%;
transform: translateY(-50%);
background-color: var(--text-color);
color: var(--white);
padding: 0.3rem 0.8rem;
border-radius: var(--radius);
font-size: 0.8rem;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: opacity var(--transition);
z-index: 1;
}
nav>a:hover::after {
opacity: 1;
}
/* Main content area */
.app-body { .app-body {
height: 100vh; flex: 1;
flex-grow: 1; margin-left: 4.5rem;
display: flex; padding: 0;
flex-direction: column; display: flex;
overflow: auto; flex-direction: column;
} min-height: 100vh;
overflow-x: hidden;
.app-body>* {
width: 100%;
padding: 0 1rem;
} }
header { header {
max-height: 5rem; background-color: var(--white);
min-height: 5rem; border-bottom: 1px solid var(--border-color);
display: flex; padding: 1rem 2rem;
justify-content: space-between; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
h1 {
font-size: 1.8rem;
font-weight: 600;
color: var(--primary-color);
} }
main { main {
padding: 0 0; flex: 1;
flex-grow: 1; padding: 2rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: relative; gap: 1.5rem;
overflow: auto;
} }
/* Search form */
.search-container { .search-container {
display: flex; background-color: var(--white);
flex-direction: row; border-radius: var(--radius);
padding: 1.25rem;
display: flex;
flex-wrap: wrap;
gap: 1rem;
align-items: center;
box-shadow: var(--shadow);
} }
.search-container>*:first-child { .search-box {
flex-grow: 1; flex: 1;
min-width: 250px;
position: relative;
} }
.search-container>* { .search-box input {
flex-grow: 0; width: 100%;
padding: 0.75rem 1rem 0.75rem 2.5rem;
border: 1px solid var(--border-color);
border-radius: var(--radius);
font-size: 1rem;
transition: border-color var(--transition);
} }
.search-box::before {
content: "🔍";
position: absolute;
left: 1rem;
top: 50%;
transform: translateY(-50%);
color: var(--text-light);
}
.search-container label:not(.search-box) {
display: flex;
flex-direction: column;
gap: 0.5rem;
font-size: 0.9rem;
color: var(--text-light);
}
.search-container input[type="date"] {
padding: 0.75rem;
border: 1px solid var(--border-color);
border-radius: var(--radius);
min-width: 160px;
}
input:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}
/* Table styling */
#results-table {
background-color: var(--white);
border-radius: var(--radius);
box-shadow: var(--shadow);
overflow: hidden;
margin-top: 1rem;
}
table { table {
cursor: pointer; width: 100%;
user-select: none; border-collapse: separate;
border-collapse: collapse; border-spacing: 0;
overflow: auto; font-size: 0.95rem;
table-layout: fixed; }
thead {
/* background-color: var(--primary-light); */
border-bottom: 1px black;
}
tbody {
color: var(--text-light);
}
thead th {
font-weight: 500;
}
th {
font-weight: 200;
text-align: left;
padding: 1rem;
/* color: var(--primary-dark); */
}
td {
padding: 1rem;
border-top: 1px solid var(--border-color);
}
th:first-child,
td:first-child {
padding-left: 1.5rem;
}
th:last-child,
td:last-child {
padding-right: 1.5rem;
}
tr.clickable {
cursor: pointer;
transition: background-color var(--transition);
}
tr.clickable:hover {
background-color: var(--hover-color);
}
tr.active {
background-color: var(--primary-light);
}
/* Order details */
.details-content {
background-color: var(--hover-color);
padding: 0 !important;
}
.details-content table {
margin: 0;
box-shadow: none;
}
.details-content th {
background-color: transparent;
font-weight: normal;
}
/* Links */
a {
text-decoration: none;
color: var(--text-light);
}
/* Responsive adjustments */
@media (max-width: 768px) {
.search-container {
flex-direction: column;
align-items: stretch;
}
.search-container>* {
width: 100%; width: 100%;
} }
table>thead { aside {
height: 4rem; min-width: 3.5rem;
} max-width: 3.5rem;
}
table>tbody { .app-body {
overflow: auto margin-left: 3.5rem;
} }
table>*>tr { nav a {
width: 100%; width: 2.5rem;
} height: 2.5rem;
font-size: 1.2rem;
table>thead>tr>th { }
text-align: left;
font-weight: 300;
}
table>thead>tr {
border-bottom: 1px solid var(--border-color);
box-shadow: 0px 0px 10px 2px rgba(0, 0, 0, 0.1);
}
table>*>tr>* {
padding: 1rem 1rem;
border-bottom: 1px solid var(--border-color);
}
table>*>tr>*:first-child {
padding-left: 2rem;
}
table>*>tr>*:last-child {
padding-right: 2rem;
}
table>tbody>tr:hover {
background-color: var(--hover-color);
box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.1) inset;
transition: var(--transition-duration);
}
table>tbody>tr>td {
font-weight: 200;
} }

View file

@ -7,6 +7,7 @@
<title>{{template "title" .}}</title> <title>{{template "title" .}}</title>
<script src="/static/htmx2.04.js" defer></script> <script src="/static/htmx2.04.js" defer></script>
<link rel="stylesheet" href="/static/style.css"> <link rel="stylesheet" href="/static/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head> </head>
<body> <body>

View file

@ -1,7 +1,7 @@
{{define "nav"}} {{define "nav"}}
<a href="/orders">All orders</a> <a href="/orders" data-title="Zamówienia"><i class="fas fa-list-ul"></i></a>
<a href="/order">New order</a> <a href="/order" data-title="Nowe zamówienie"><i class="fas fa-plus-circle"></i></a>
<a href="/cakes">All Cakes</a> <a href="/cakes" data-title="Wszystkie ciasta"><i class="fas fa-birthday-cake"></i></a>
<a href="/cake">New Cake</a> <a href="/cake" data-title="Nowe ciasto"><i class="fas fa-plus"></i></a>
<a href="/logout">Logout</a> <a href="/logout" data-title="Wyloguj"><i class="fas fa-sign-out-alt"></i></a>
{{end}} {{end}}