Skip to content

Commit 42f3c0c

Browse files
URL Based Logic
1 parent fe32f28 commit 42f3c0c

1 file changed

Lines changed: 114 additions & 1 deletion

File tree

index.html

Lines changed: 114 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,118 @@
11
<!DOCTYPE html>
22
<html>
3+
<head>
4+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
5+
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
6+
<title>Seera Apps</title>
7+
<style>
8+
* { box-sizing: border-box; margin: 0; padding: 0; }
9+
body {
10+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
11+
background: #f0f4f8;
12+
min-height: 100vh;
13+
padding: 40px 24px;
14+
}
15+
.logo { text-align: center; margin-bottom: 40px; }
16+
.logo h1 { font-size: 22px; color: #1a3a5c; font-weight: 700; }
17+
.logo p { color: #888; font-size: 14px; margin-top: 6px; }
18+
.card {
19+
background: white;
20+
border-radius: 14px;
21+
padding: 24px;
22+
box-shadow: 0 1px 6px rgba(0,0,0,0.08);
23+
}
24+
label { font-size: 13px; color: #888; display: block; margin-bottom: 8px; }
25+
input[type=text] {
26+
width: 100%;
27+
padding: 14px;
28+
border: 1px solid #ddd;
29+
border-radius: 10px;
30+
font-size: 15px;
31+
outline: none;
32+
}
33+
input[type=text]:focus { border-color: #1a3a5c; }
34+
.hint { font-size: 12px; color: #aaa; margin-top: 8px; }
35+
.btn {
36+
width: 100%;
37+
margin-top: 16px;
38+
padding: 14px;
39+
background: #1a3a5c;
40+
color: white;
41+
border: none;
42+
border-radius: 10px;
43+
font-size: 16px;
44+
font-weight: 600;
45+
cursor: pointer;
46+
}
47+
.btn:active { opacity: 0.85; }
48+
.error { color: #e53e3e; font-size: 13px; margin-top: 10px; display: none; }
49+
</style>
50+
</head>
51+
<body>
52+
53+
<div class="logo">
54+
<h1>Seera Apps</h1>
55+
<p>Enter your hospital URL to continue</p>
56+
</div>
57+
58+
<div class="card">
59+
<label for="siteUrl">Hospital site URL</label>
60+
<input type="text" id="siteUrl" placeholder="https://kfsh-dammam-asm.seeraarabia.com" />
61+
<p class="hint">Enter the URL with or without /asm_app — we'll handle it</p>
62+
<p class="error" id="errMsg">Please enter a valid URL</p>
63+
<button class="btn" onclick="goToSite()">Open App →</button>
64+
</div>
65+
66+
<script>
67+
function normalizeUrl(raw) {
68+
raw = raw.trim();
69+
if (!raw) return null;
70+
71+
// Add https:// if no protocol given
72+
if (!/^https?:\/\//i.test(raw)) {
73+
raw = 'https://' + raw;
74+
}
75+
76+
try {
77+
const u = new URL(raw);
78+
79+
// Append /asm_app/ if not already in path
80+
if (!u.pathname.includes('/asm_app')) {
81+
u.pathname = '/asm_app/';
82+
}
83+
84+
return u.toString();
85+
} catch(e) {
86+
return null;
87+
}
88+
}
89+
90+
function goToSite() {
91+
const input = document.getElementById('siteUrl').value;
92+
const err = document.getElementById('errMsg');
93+
const url = normalizeUrl(input);
94+
95+
if (!url) {
96+
err.style.display = 'block';
97+
return;
98+
}
99+
100+
err.style.display = 'none';
101+
window.location.href = url;
102+
}
103+
104+
// Allow pressing Enter
105+
document.getElementById('siteUrl').addEventListener('keydown', function(e) {
106+
if (e.key === 'Enter') goToSite();
107+
});
108+
</script>
109+
110+
</body>
111+
</html>
112+
113+
114+
<!-- <!DOCTYPE html>
115+
<html>
3116
<head>
4117
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
5118
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
@@ -96,4 +209,4 @@ <h3>Iman RDH</h3>
96209
</a>
97210
98211
</body>
99-
</html>
212+
</html> -->

0 commit comments

Comments
 (0)