Skip to content

Commit 9ed2151

Browse files
authored
Restyling (#40)
Restyle a bit to unify shades of gray and improve contrast
1 parent dd76462 commit 9ed2151

File tree

10 files changed

+239
-120
lines changed

10 files changed

+239
-120
lines changed

assets/css/app.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,13 @@
22
@import "tailwindcss/components";
33
@import "tailwindcss/utilities";
44

5+
::-webkit-scrollbar {
6+
height: 6px;
7+
width: 6px;
8+
@apply bg-gray-300;
9+
}
10+
11+
::-webkit-scrollbar-thumb {
12+
@apply bg-gray-500;
13+
border-radius: 4px;
14+
}
291 KB
Loading
204 KB
Loading

lib/error_tracker/web/components/core_components.ex

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ defmodule ErrorTracker.Web.CoreComponents do
2020
~H"""
2121
<.link
2222
class={[
23-
"phx-submit-loading:opacity-75 rounded-lg bg-zinc-600 hover:bg-zinc-400 py-[11.5px] px-3",
24-
"text-sm font-semibold leading-6 text-white active:text-white/80",
23+
"phx-submit-loading:opacity-75 py-[11.5px]",
24+
"text-sm font-semibold text-sky-500 hover:text-white/80",
2525
@class
2626
]}
2727
{@rest}
@@ -36,8 +36,8 @@ defmodule ErrorTracker.Web.CoreComponents do
3636
<button
3737
type={@type}
3838
class={[
39-
"phx-submit-loading:opacity-75 rounded-lg bg-zinc-600 hover:bg-zinc-400 py-2 px-3",
40-
"text-sm font-semibold leading-6 text-white active:text-white/80",
39+
"phx-submit-loading:opacity-75 rounded-lg bg-sky-500 hover:bg-sky-700 py-2 px-4",
40+
"text-sm text-white active:text-white/80",
4141
@class
4242
]}
4343
{@rest}
@@ -65,8 +65,8 @@ defmodule ErrorTracker.Web.CoreComponents do
6565
case assigns.color do
6666
:blue -> "bg-blue-900 text-blue-300"
6767
:gray -> "bg-gray-700 text-gray-300"
68-
:red -> "bg-red-900 text-red-300"
69-
:green -> "bg-green-900 text-green-300"
68+
:red -> "bg-red-400/10 text-red-300 ring-red-400/20"
69+
:green -> "bg-emerald-400/10 text-emerald-300 ring-emerald-400/20"
7070
:yellow -> "bg-yellow-900 text-yellow-300"
7171
:indigo -> "bg-indigo-900 text-indigo-300"
7272
:purple -> "bg-purple-900 text-purple-300"
@@ -76,7 +76,10 @@ defmodule ErrorTracker.Web.CoreComponents do
7676
assigns = Map.put(assigns, :color_class, color_class)
7777

7878
~H"""
79-
<span class={["text-sm font-medium me-2 px-2.5 py-1.5 rounded", @color_class]} {@rest}>
79+
<span
80+
class={["text-sm font-medium me-2 py-1 px-2 rounded-lg ring-1 ring-inset", @color_class]}
81+
{@rest}
82+
>
8083
<%= render_slot(@inner_block) %>
8184
</span>
8285
"""
@@ -92,14 +95,14 @@ defmodule ErrorTracker.Web.CoreComponents do
9295
<div class="mt-10 w-full flex">
9396
<button
9497
:if={@page > 1}
95-
class="flex items-center justify-center px-4 h-10 text-base font-medium text-gray-400 bg-gray-800 border border-gray-700 rounded-lg hover:bg-gray-700 hover:text-white"
98+
class="flex items-center justify-center px-4 h-10 text-base font-medium text-gray-400 bg-gray-900 border border-gray-400 rounded-lg hover:bg-gray-800 hover:text-white"
9699
phx-click={@event_previous}
97100
>
98101
Previous page
99102
</button>
100103
<button
101104
:if={@page < @total_pages}
102-
class="flex items-center justify-center px-4 h-10 text-base font-medium text-gray-400 bg-gray-800 border border-gray-700 rounded-lg hover:bg-gray-700 hover:text-white"
105+
class="flex items-center justify-center px-4 h-10 text-base font-medium text-gray-400 bg-gray-900 border border-gray-400 rounded-lg hover:bg-gray-800 hover:text-white"
103106
phx-click={@event_next}
104107
>
105108
Next page
@@ -117,7 +120,10 @@ defmodule ErrorTracker.Web.CoreComponents do
117120
def section(assigns) do
118121
~H"""
119122
<div>
120-
<h2 :if={assigns[:title]} class={["text-sm font-bold mb-2 uppercase", @title_class]}>
123+
<h2
124+
:if={assigns[:title]}
125+
class={["text-sm font-semibold mb-2 uppercase text-gray-400", @title_class]}
126+
>
121127
<%= @title %>
122128
</h2>
123129
<%= render_slot(@inner_block) %>

lib/error_tracker/web/components/layouts/navbar.ex

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule ErrorTracker.Web.Layouts.Navbar do
44

55
def render(assigns) do
66
~H"""
7-
<nav class="border-gray-200 bg-gray-800" phx-click-away={JS.hide(to: "#navbar-main")}>
7+
<nav class="border-gray-400 bg-gray-900">
88
<div class="container flex flex-wrap items-center justify-between mx-auto p-4">
99
<.link
1010
href={dashboard_path(@socket)}
@@ -14,7 +14,7 @@ defmodule ErrorTracker.Web.Layouts.Navbar do
1414
</.link>
1515
<button
1616
type="button"
17-
class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm rounded -lg md:hidden focus:outline-none focus:ring-2 text-gray-400 hover:bg-gray-600 focus:ring-gray-500"
17+
class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm rounded -lg md:hidden focus:outline-none focus:ring-2 text-gray-400 hover:bg-gray-700 focus:ring-gray-500"
1818
aria-controls="navbar-main"
1919
aria-expanded="false"
2020
phx-click={JS.toggle(to: "#navbar-main")}
@@ -37,8 +37,24 @@ defmodule ErrorTracker.Web.Layouts.Navbar do
3737
</svg>
3838
</button>
3939
<div class="hidden w-full md:block md:w-auto" id="navbar-main">
40-
<ul class="font-medium flex flex-col p-4 md:p-0 mt-4 border border-gray-600 rounded-lg bg-gray-700 md:flex-row md:space-x-8 rtl:space-x-reverse md:mt-0 md:border-0 md:bg-gray-800">
41-
<.navbar_item to="https://github.com" target="_blank">GitHub</.navbar_item>
40+
<ul class="font-medium flex flex-col p-4 md:p-0 mt-4 border border-gray-400 bg-gray-900 rounded-lg md:flex-row md:space-x-8 rtl:space-x-reverse md:mt-0 md:border-0 md:bg-gray-800">
41+
<.navbar_item to="https://github.com" target="_blank">
42+
<svg
43+
width="18"
44+
height="18"
45+
aria-hidden="true"
46+
viewBox="0 0 24 24"
47+
version="1.1"
48+
class="inline-block mr-1 align-text-top"
49+
>
50+
<path
51+
fill="currentColor"
52+
d="M12.5.75C6.146.75 1 5.896 1 12.25c0 5.089 3.292 9.387 7.863 10.91.575.101.79-.244.79-.546 0-.273-.014-1.178-.014-2.142-2.889.532-3.636-.704-3.866-1.35-.13-.331-.69-1.352-1.18-1.625-.402-.216-.977-.748-.014-.762.906-.014 1.553.834 1.769 1.179 1.035 1.74 2.688 1.25 3.349.948.1-.747.402-1.25.733-1.538-2.559-.287-5.232-1.279-5.232-5.678 0-1.25.445-2.285 1.178-3.09-.115-.288-.517-1.467.115-3.048 0 0 .963-.302 3.163 1.179.92-.259 1.897-.388 2.875-.388.977 0 1.955.13 2.875.388 2.2-1.495 3.162-1.179 3.162-1.179.633 1.581.23 2.76.115 3.048.733.805 1.179 1.825 1.179 3.09 0 4.413-2.688 5.39-5.247 5.678.417.36.776 1.05.776 2.128 0 1.538-.014 2.774-.014 3.162 0 .302.216.662.79.547C20.709 21.637 24 17.324 24 12.25 24 5.896 18.854.75 12.5.75Z"
53+
>
54+
</path>
55+
</svg>
56+
GitHub
57+
</.navbar_item>
4258
</ul>
4359
</div>
4460
</div>
@@ -56,7 +72,7 @@ defmodule ErrorTracker.Web.Layouts.Navbar do
5672
<li>
5773
<a
5874
href={@to}
59-
class="block py-2 px-3 text-gray-900 rounded text-white hover:text-white hover:bg-gray-700 md:hover:bg-transparent md:border-0 md:hover:text-blue-500 md:p-0"
75+
class="whitespace-nowrap flex-0 block py-2 px-3 rounded-lg text-white hover:text-white hover:bg-gray-700 md:hover:bg-transparent md:border-0 md:hover:text-sky-500"
6076
{@rest}
6177
>
6278
<%= render_slot(@inner_block) %>

lib/error_tracker/web/components/layouts/root.html.heex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</script>
1919
</head>
2020

21-
<body class="bg-gray-700 text-white">
21+
<body class="bg-gray-800 text-white">
2222
<%= @inner_content %>
2323
</body>
2424
</html>

lib/error_tracker/web/live/dashboard.html.heex

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,29 @@
99
value={@search_form[:reason].value}
1010
type="text"
1111
placeholder="Error"
12+
class="border text-sm rounded-lg block p-2.5 bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-blue-500 focus:border-blue-500"
1213
phx-debounce
1314
/>
1415
<input
1516
name={@search_form[:source_line].name}
1617
value={@search_form[:source_line].value}
1718
type="text"
1819
placeholder="Source line"
20+
class="border text-sm rounded-lg block p-2.5 bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-blue-500 focus:border-blue-500"
1921
phx-debounce
2022
/>
2123
<input
2224
name={@search_form[:source_function].name}
2325
value={@search_form[:source_function].value}
2426
type="text"
2527
placeholder="Source function"
28+
class="border text-sm rounded-lg block p-2.5 bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-blue-500 focus:border-blue-500"
2629
phx-debounce
2730
/>
28-
<select name={@search_form[:status].name}>
31+
<select
32+
name={@search_form[:status].name}
33+
class="border text-sm rounded-lg block p-2.5 bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-blue-500 focus:border-blue-500"
34+
>
2935
<option value="" selected={@search_form[:status].value == ""}>All</option>
3036
<option value="unresolved" selected={@search_form[:status].value == "unresolved"}>
3137
Unresolved
@@ -36,9 +42,9 @@
3642
</select>
3743
</.form>
3844

39-
<div class="relative overflow-x-auto shadow-md sm:rounded-lg">
40-
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 table-fixed">
41-
<thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-600 dark:text-gray-400">
45+
<div class="relative overflow-x-auto shadow-md sm:rounded-lg ring-1 ring-gray-900">
46+
<table class="w-full text-sm text-left rtl:text-right text-gray-400 table-fixed">
47+
<thead class="text-xs uppercase bg-gray-900">
4248
<tr>
4349
<th scope="col" class="px-4 pr-2 py-3 w-128">Error</th>
4450
<th scope="col" class="px-4 py-3 w-72">Occurrences</th>
@@ -52,20 +58,23 @@
5258
No errors to show 🎉
5359
</td>
5460
</tr>
55-
<tr :for={error <- @errors} class="border-b bg-gray-800 border-gray-700">
56-
<th
57-
scope="row"
58-
class="px-4 py-4 font-medium text-white whitespace-nowrap text-ellipsis overflow-hidden"
59-
>
60-
<.link navigate={error_path(@socket, error)}>
61-
(<%= sanitize_module(error.kind) %>) <%= error.reason %>
61+
<tr
62+
:for={error <- @errors}
63+
class="border-b bg-gray-400/10 border-y border-gray-900 hover:bg-gray-800/60 last-of-type:border-b-0"
64+
>
65+
<td scope="row" class="px-4 py-4 font-medium text-white relative">
66+
<.link navigate={error_path(@socket, error)} class="absolute inset-1">
67+
<span class="sr-only">(<%= sanitize_module(error.kind) %>) <%= error.reason %></span>
6268
</.link>
69+
<p class="whitespace-nowrap text-ellipsis w-full overflow-hidden">
70+
(<%= sanitize_module(error.kind) %>) <%= error.reason %>
71+
</p>
6372
<p class="font-normal text-gray-400">
6473
<%= sanitize_module(error.source_function) %>
6574
<br />
6675
<%= error.source_line %>
6776
</p>
68-
</th>
77+
</td>
6978
<td class="px-4 py-4">
7079
<p>Last: <%= format_datetime(error.last_occurrence_at) %></p>
7180
<p>Total: <%= @occurrences[error.id] %></p>

lib/error_tracker/web/live/show.html.heex

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
<div class="my-6">
2-
<.button type="link" href={dashboard_path(@socket)}>Back to the dashboard</.button>
2+
<.button type="link" href={dashboard_path(@socket)}>« Back to the dashboard</.button>
33
</div>
44

55
<div id="header">
6-
<p class="text-sm uppercase font-semibold text-gray-300">
6+
<p class="text-sm uppercase font-semibold text-gray-400">
77
Error #<%= @error.id %> @ <%= format_datetime(@occurrence.inserted_at) %>
88
</p>
9-
<h1 class="my-1 text-2xl font-bold whitespace-nowrap text-ellipsis overflow-hidden">
9+
<h1 class="my-1 text-2xl w-full font-semibold whitespace-nowrap text-ellipsis overflow-hidden">
1010
(<%= sanitize_module(@error.kind) %>) <%= @error.reason
1111
|> String.replace("\n", " ")
1212
|> String.trim() %>
1313
</h1>
1414
</div>
1515

1616
<div class="grid grid-cols-1 md:grid-cols-4 md:space-x-3 mt-6 gap-2">
17-
<div class="px-3 md:col-span-3 md:border-r-2 md:border-gray-500 space-y-8">
17+
<div class="md:col-span-3 md:border-r md:border-gray-600 space-y-8 pr-5">
1818
<.section title="Full message">
19-
<pre class="overflow-auto p-4 bg-gray-600"><%= @occurrence.reason %></pre>
19+
<pre class="overflow-auto p-4 rounded-lg bg-gray-300/10 border border-gray-900"><%= @occurrence.reason %></pre>
2020
</.section>
2121

2222
<.section title="Source">
23-
<pre class="overflow-auto text-sm p-4 bg-gray-600">
23+
<pre class="overflow-auto text-sm p-4 rounded-lg bg-gray-300/10 border border-gray-900">
2424
<%= sanitize_module(@error.source_function) %>
2525
<%= @error.source_line %></pre>
2626
</.section>
2727

2828
<.section title="Stacktrace">
29-
<div class="p-4 bg-gray-600">
29+
<div class="p-4 bg-gray-300/10 border border-gray-900 rounded-lg">
3030
<div class="w-full mb-4">
3131
<label class="flex justify-end">
3232
<input
3333
type="checkbox"
3434
id="show-app-frames"
35-
class="ml-2 mr-2 mb-1 mt-1 inline-block"
35+
class="ml-2 mr-2 mb-1 mt-1 inline-block text-sky-600 rounded focus:ring-sky-600 ring-offset-gray-800 focus:ring-2 bg-gray-700 border-gray-600"
3636
phx-click={JS.toggle(to: "#stacktrace tr:not([data-app=#{@app}])")}
3737
/>
3838
<span class="text-md inline-block">
@@ -58,14 +58,17 @@
5858
</.section>
5959

6060
<.section title="Context">
61-
<pre class="overflow-auto text-sm p-4 bg-gray-600"><%= Jason.encode!(@occurrence.context, pretty: true) %></pre>
61+
<pre class="overflow-auto text-sm p-4 rounded-lg bg-gray-300/10 border border-gray-900"><%= Jason.encode!(@occurrence.context, pretty: true) %></pre>
6262
</.section>
6363
</div>
6464

6565
<div class="px-3 md:pl-0 space-y-8">
6666
<.section title={"Occurrence (#{@total_occurrences} total)"}>
6767
<form phx-change="occurrence_navigation">
68-
<select name="occurrence_id" class="text-black w-full">
68+
<select
69+
name="occurrence_id"
70+
class="w-full border text-sm rounded-lg block p-2.5 bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-blue-500 focus:border-blue-500"
71+
>
6972
<option
7073
:for={occurrence <- @occurrences}
7174
value={occurrence.id}

mix.exs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ defmodule ErrorTracker.MixProject do
4545
links: %{
4646
"GitHub" => "https://github.com/elixir-error-tracker/error-tracker"
4747
},
48-
maintainers: ["Óscar de Arriba González", "Cristian Álvarez Belaustegui"],
48+
maintainers: [
49+
"Óscar de Arriba González",
50+
"Cristian Álvarez Belaustegui",
51+
"Víctor Ortiz Heredia"
52+
],
4953
files: ~w(lib priv/static LICENSE mix.exs README.md .formatter.exs)
5054
]
5155
end
@@ -100,7 +104,7 @@ defmodule ErrorTracker.MixProject do
100104
dev: "run --no-halt dev.exs",
101105
"assets.install": ["bun.install", "cmd _build/bun install --cwd assets/"],
102106
"assets.watch": ["tailwind default --watch"],
103-
"assets.build": ["bun default --minify", "tailwind default --minify"]
107+
"assets.build": ["bun default", "tailwind default"]
104108
]
105109
end
106110
end

0 commit comments

Comments
 (0)