From 28f7473969946f6e8fe0d8be0278ce0cee1ab22c Mon Sep 17 00:00:00 2001 From: Zach Hayes Date: Wed, 11 Mar 2026 15:51:58 -0700 Subject: [PATCH 01/11] serve html --- server/server.go | 4 + static/index.html | 417 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 421 insertions(+) create mode 100644 static/index.html diff --git a/server/server.go b/server/server.go index 56eda66e..80e9cd59 100644 --- a/server/server.go +++ b/server/server.go @@ -30,6 +30,10 @@ func New(cfg config.Config, factory repository.Factory) (*Server, error) { r.Use(rwmiddleware.FactoryMiddleware(factory)) + r.Get("/", func(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, "static/index.html") + }) + r.Mount("/api", api.Router()) return &Server{ diff --git a/static/index.html b/static/index.html new file mode 100644 index 00000000..fc2e6700 --- /dev/null +++ b/static/index.html @@ -0,0 +1,417 @@ + + + + + + Reverse Watch + + + + +
+
+
reverse.watch
+

Check if a Steam ID has a history of trade reversals

+
+ +
+
+
+ + +
+

Enter a 64-bit Steam ID to check their reversal history

+
+
+ +
+
+
+
+
+
+
+ Steam ID + +
+
+ Status + +
+ +
+
+ +
+
+ + + + + + From b245a6fb930bb3c31929c5146b952f22cba6b2c8 Mon Sep 17 00:00:00 2001 From: Zach Hayes Date: Wed, 11 Mar 2026 16:12:32 -0700 Subject: [PATCH 02/11] use correct url --- static/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/index.html b/static/index.html index fc2e6700..e80ed2ff 100644 --- a/static/index.html +++ b/static/index.html @@ -335,7 +335,7 @@ searchBtn.innerHTML = ''; try { - const response = await fetch(`http://localhost:3434/api/v1/users/${encodeURIComponent(steamId)}`); + const response = await fetch(`https://reverse.watch/api/v1/users/${encodeURIComponent(steamId)}`); if (!response.ok) { const errorData = await response.json(); @@ -343,7 +343,7 @@ if (errorData.details) { errorStr += ` (${errorData.details})`; } - throw new Error(errorStr || `Request failed with status ${response.status}`); + throw new Error(errorStr); } const data = await response.json(); From a7ef10bbad7461a91f893725cd391185c89e0a7b Mon Sep 17 00:00:00 2001 From: Zach Hayes Date: Wed, 11 Mar 2026 16:12:44 -0700 Subject: [PATCH 03/11] copy static file --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3bbae04f..e430d248 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,9 @@ RUN go build -o reverse-watch main.go FROM gcr.io/distroless/base-debian12 +WORKDIR /app COPY --from=builder /app/reverse-watch /app/reverse-watch +COPY --from=builder /app/static/index.html /app/static/index.html + EXPOSE 80 -CMD ["./app/reverse-watch"] +CMD ["./reverse-watch"] From 1097573dc9912619892c1b05b236ca5e2d915f12 Mon Sep 17 00:00:00 2001 From: Zach Hayes Date: Thu, 12 Mar 2026 09:52:28 -0700 Subject: [PATCH 04/11] add favicon --- static/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/static/index.html b/static/index.html index e80ed2ff..c0884425 100644 --- a/static/index.html +++ b/static/index.html @@ -4,6 +4,7 @@ Reverse Watch + @@ -336,7 +348,7 @@ searchBtn.innerHTML = ''; try { - const response = await fetch(`https://reverse.watch/api/v1/users/${encodeURIComponent(steamId)}`); + const response = await fetch(`http://localhost:3434/api/v1/users/${encodeURIComponent(steamId)}`); if (!response.ok) { const errorData = await response.json(); From 243f3370205712e8a4357029dfc4a8f24856adc6 Mon Sep 17 00:00:00 2001 From: Zach Hayes Date: Thu, 12 Mar 2026 13:28:24 -0700 Subject: [PATCH 07/11] improve mobile layout --- static/index.html | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/static/index.html b/static/index.html index 85c17540..cf3b51eb 100644 --- a/static/index.html +++ b/static/index.html @@ -37,12 +37,17 @@ padding: 40px 20px; .container { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; max-width: 500px; width: 100%; header { text-align: center; margin-bottom: 40px; + padding: 0 10px; .title { font-size: 54px; @@ -51,18 +56,16 @@ letter-spacing: -0.5px; } - @media (max-width: 768px) { - .title { - font-size: 48px; - } - } - .subtitle { color: var(--text-secondary); font-size: 16px; } @media (max-width: 768px) { + .title { + font-size: 42px; + } + .subtitle { font-size: 14px; } @@ -77,8 +80,10 @@ .input-group { display: flex; + flex-wrap: wrap; gap: 12px; margin-bottom: 12px; + justify-content: center; input[type="text"] { flex: 1; @@ -125,9 +130,22 @@ cursor: not-allowed; } } + + @media (max-width: 400px) { + flex-direction: column; + + input[type="text"] { + width: 100%; + } + + button { + width: 100%; + } + } } .hint { + text-align: center; font-size: 0.85rem; color: var(--text-secondary); } From 41c289d975a9b07ecee964d4dfda9d3835c5a33f Mon Sep 17 00:00:00 2001 From: Zach Hayes Date: Thu, 12 Mar 2026 15:37:37 -0700 Subject: [PATCH 08/11] improve layout --- static/index.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/static/index.html b/static/index.html index cf3b51eb..2cc2be72 100644 --- a/static/index.html +++ b/static/index.html @@ -45,6 +45,7 @@ width: 100%; header { + width: 100%; text-align: center; margin-bottom: 40px; padding: 0 10px; @@ -73,6 +74,7 @@ } .search-card { + width: 100%; background: var(--bg-card); border-radius: 16px; padding: 24px; @@ -102,6 +104,8 @@ } &::placeholder { + font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace; + letter-spacing: -0.5px; color: var(--text-secondary); } } @@ -152,6 +156,7 @@ } .result-card { + width: 100%; margin-top: 24px; background: var(--bg-card); border-radius: 16px; @@ -159,7 +164,7 @@ border: 1px solid var(--border); display: none; - .visible { + &.visible { display: block; animation: fadeIn 0.3s ease; } @@ -225,6 +230,8 @@ } .error-message { + width: 100%; + text-align: center; margin-top: 24px; background: rgba(244, 33, 46, 0.1); border: 1px solid rgba(244, 33, 46, 0.3); @@ -232,8 +239,9 @@ padding: 16px; color: var(--danger); display: none; + font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace; - .visible { + &.visible { display: block; animation: fadeIn 0.3s ease; } From e18876f5459206248d55d336f3f1c81a5077a5e0 Mon Sep 17 00:00:00 2001 From: Zach Hayes Date: Fri, 13 Mar 2026 14:34:34 -0700 Subject: [PATCH 09/11] improve design --- static/index.html | 456 +++++++++++++++++++++++++++------------------- 1 file changed, 267 insertions(+), 189 deletions(-) diff --git a/static/index.html b/static/index.html index 2cc2be72..6a234e82 100644 --- a/static/index.html +++ b/static/index.html @@ -3,21 +3,23 @@ - reverse.watch - + + reverse.watch
-
reverse.watch
+

Check if a Steam ID has a history of trade reversals

@@ -318,7 +392,7 @@ autocomplete="off" required > - +

Enter a 64-bit Steam ID to check their reversal history

@@ -391,7 +465,7 @@ showError(error.message); } finally { searchBtn.disabled = false; - searchBtn.textContent = 'Check'; + searchBtn.textContent = 'Check History'; } }); @@ -405,9 +479,12 @@ resultSteamId.textContent = data.steam_id; + resultCard.classList.remove('flagged', 'clear'); + if (data.has_reversed) { + resultCard.classList.add('flagged'); statusIcon.className = 'status-icon flagged'; - statusIcon.innerHTML = `report`; + statusIcon.innerHTML = `priority_high`; resultTitle.className = 'result-title flagged'; resultTitle.textContent = 'Reversal History Found'; @@ -428,8 +505,9 @@ lastReversalRow.style.display = 'none'; } } else { + resultCard.classList.add('clear'); statusIcon.className = 'status-icon clear'; - statusIcon.textContent = '✓'; + statusIcon.innerHTML = `check`; resultTitle.className = 'result-title clear'; resultTitle.textContent = 'No Reversals Found'; From 29a2f9b76af1d983ef0e0093a93f7bebd7743e6c Mon Sep 17 00:00:00 2001 From: Zach Hayes Date: Fri, 13 Mar 2026 14:38:09 -0700 Subject: [PATCH 10/11] use relative url --- static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/index.html b/static/index.html index 6a234e82..5257299b 100644 --- a/static/index.html +++ b/static/index.html @@ -448,7 +448,7 @@ searchBtn.innerHTML = ''; try { - const response = await fetch(`http://localhost:3434/api/v1/users/${encodeURIComponent(steamId)}`); + const response = await fetch(`/api/v1/users/${encodeURIComponent(steamId)}`); if (!response.ok) { const errorData = await response.json(); From 36ba124a04a90551bae56f8e20530a8e361fac87 Mon Sep 17 00:00:00 2001 From: Zach Hayes Date: Mon, 16 Mar 2026 09:55:07 -0700 Subject: [PATCH 11/11] no need to encode uri --- static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/index.html b/static/index.html index 5257299b..95bfedd0 100644 --- a/static/index.html +++ b/static/index.html @@ -448,7 +448,7 @@ searchBtn.innerHTML = ''; try { - const response = await fetch(`/api/v1/users/${encodeURIComponent(steamId)}`); + const response = await fetch(`/api/v1/users/${steamId}`); if (!response.ok) { const errorData = await response.json();