Skip to content

Commit 8d63b48

Browse files
Merge pull request #42 from recursivezero/feature/RTY-260041
Mobile Responsiveness improvement
2 parents 2977783 + 496bc63 commit 8d63b48

File tree

5 files changed

+98
-10
lines changed

5 files changed

+98
-10
lines changed

app/routes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,14 @@ async def create_short_url(
112112

113113
if not original_url or not is_valid_url(original_url): # validate the URL
114114
session["error"] = "Please enter a valid URL."
115+
session["original_url"] = original_url # preserve user input
115116
return RedirectResponse("/", status_code=status.HTTP_303_SEE_OTHER)
116117

117118
if not authorize_url(
118119
original_url
119120
): # authorize the URL based on whitelist/blacklist
120121
session["error"] = "This domain is not allowed."
122+
session["original_url"] = original_url # preserve user input
121123
return RedirectResponse("/", status_code=status.HTTP_303_SEE_OTHER)
122124

123125
short_code: Optional[str] = get_short_from_cache(original_url)

app/static/css/tiny.css

Lines changed: 86 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
*,
2+
*::before,
3+
*::after {
4+
box-sizing: border-box;
5+
}
6+
17
:root {
28
--bg: #0a0a0c;
39
--glass: rgba(255, 255, 255, 0.03);
@@ -14,6 +20,7 @@ body {
1420
margin: 0;
1521
overflow-x: hidden;
1622
background-image: radial-gradient(circle at 50% -20%, #1e1e2e 0%, transparent 50%);
23+
1724
}
1825

1926

@@ -30,12 +37,13 @@ body.light-theme {
3037
}
3138

3239
.main-layout {
33-
max-width: 940px;
40+
max-width: 870px;
3441
margin: 0 auto;
3542
padding: 6rem 1rem 4rem;
3643
display: flex;
3744
flex-direction: column;
3845
gap: 2rem;
46+
flex: 1;
3947
}
4048

4149
.page {
@@ -53,7 +61,6 @@ body.light-theme {
5361
justify-content: space-between;
5462
padding: 0 10px;
5563
box-sizing: border-box;
56-
5764
background: var(--glass);
5865
border-bottom: 1px solid var(--glass-border);
5966
z-index: 1000;
@@ -93,7 +100,9 @@ body.light-theme .app-header {
93100
.header-nav {
94101
display: flex;
95102
gap: 26px;
96-
margin: 0 auto;
103+
flex-wrap: wrap;
104+
white-space: nowrap;
105+
flex-shrink: 1;
97106
}
98107

99108
.nav-link,
@@ -166,10 +175,56 @@ body.dark-theme .app-header {
166175
color: var(--accent);
167176
}
168177

178+
/* hamburger hidden on desktop */
179+
180+
.hamburger {
181+
display: none;
182+
font-size: 22px;
183+
background: transparent;
184+
border: none;
185+
color: var(--text-primary);
186+
cursor: pointer;
187+
}
188+
189+
169190
@media (max-width: 600px) {
170-
.logo {
171-
font-size: 1.2rem;
191+
.app-logo {
192+
transform: scale(0.9);
172193
}
194+
195+
.app-name {
196+
font-size: 1.1rem;
197+
}
198+
199+
200+
}
201+
202+
203+
@media (max-width: 700px) {
204+
205+
.hamburger {
206+
display: block;
207+
}
208+
209+
.header-nav {
210+
display: none;
211+
position: fixed;
212+
top: 55px;
213+
left: 0;
214+
right: 0;
215+
width: 100%;
216+
flex-direction: column;
217+
background: var(--bg);
218+
padding: 20px;
219+
display: none;
220+
gap: 16px;
221+
border-bottom: 1px solid var(--glass-border);
222+
}
223+
224+
.header-nav.open {
225+
display: flex;
226+
}
227+
173228
}
174229

175230
/* Hero input */
@@ -266,6 +321,10 @@ body.dark-theme .app-header {
266321
gap: 1.5rem;
267322
}
268323

324+
.short-url {
325+
max-width: 100%;
326+
}
327+
269328
.qr-image {
270329
width: 80px;
271330
height: 80px;
@@ -286,6 +345,8 @@ body.dark-theme .app-header {
286345
font-weight: 700;
287346
color: var(--text-primary);
288347
text-decoration: none;
348+
word-break: break-all;
349+
overflow-wrap: anywhere;
289350
}
290351

291352
.result-actions {
@@ -380,6 +441,23 @@ body.dark-theme .app-header {
380441
font-weight: 700;
381442
}
382443

444+
@media (max-width: 768px) {
445+
446+
.input-wrapper {
447+
flex-direction: column;
448+
}
449+
450+
.btn-primary {
451+
width: 100%;
452+
}
453+
454+
.scroll-container {
455+
padding-left: 12px;
456+
padding-right: 12px;
457+
}
458+
459+
}
460+
383461
/* ===============================
384462
MODERN GLASS RECENT TABLE
385463
================================= */
@@ -394,6 +472,7 @@ body.dark-theme .app-header {
394472
.recent-table-wrapper {
395473
width: 100%;
396474
overflow-x: auto;
475+
-webkit-overflow-scrolling: touch;
397476
}
398477

399478
/* ===============================
@@ -406,7 +485,7 @@ body.dark-theme .app-header {
406485
border-radius: 12px;
407486
overflow: hidden;
408487
table-layout: fixed;
409-
min-width: 800px;
488+
min-width: 720px;
410489
}
411490

412491
.recent-table thead {
@@ -583,7 +662,7 @@ footer.big-footer {
583662
background: var(--bg);
584663
border-top: 1px solid var(--glass-border);
585664
padding: 4rem 1rem 2rem;
586-
margin-top: 4rem;
665+
margin-top: auto;
587666
}
588667

589668
.footer-grid {

app/templates/footer.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ <h3>🔗 RZRO.link</h3>
77
<div class="footer-col">
88
<h4>Product</h4>
99
<ul>
10-
<li><a href="cache/list">CACHE URLs</a></li>
1110
<li><a href="#">API Documentation</a></li>
1211
<li><a href="#">Custom Branded Links</a></li>
1312
<li><a href="#">QR Code Engine</a></li>
@@ -16,7 +15,6 @@ <h4>Product</h4>
1615
<div class="footer-col">
1716
<h4>Support</h4>
1817
<ul>
19-
<li><a href="/docs"> UI docs</a></li>
2018
<li><a href="#">Help Center</a></li>
2119
<li><a href="#">System Status</a></li>
2220
<li><a href="#">Contact Us</a></li>

app/templates/header.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
</nav>
1313
<div class="header-right">
1414
<button class="theme-toggle" onclick="toggleTheme()">🌓</button>
15+
<button class="hamburger"></button>
1516
</div>
1617
</header>
1718
<script>
@@ -25,4 +26,12 @@
2526
link.classList.remove("active");
2627
}
2728
});
29+
30+
const hamburger = document.querySelector(".hamburger");
31+
const nav = document.querySelector(".header-nav");
32+
33+
hamburger.addEventListener("click", () => {
34+
nav.classList.toggle("open");
35+
});
36+
2837
</script>

app/templates/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77

8-
<title>{% block title %}tiny URL{% endblock %}</title>
8+
<title>{% block title %}rzro.link{% endblock %}</title>
99
<!-- OpenGraph Meta Tags -->
1010
<meta property="og:title" content="rzro.link | Smart URL Shortener">
1111
<meta property="og:description"

0 commit comments

Comments
 (0)