Skip to content

Commit 31757bf

Browse files
Update index.html
Signed-off-by: Abdurhaman Mohammed Ahamed <abdurhamanmohammeda@gmail.com>
1 parent 20d40ee commit 31757bf

File tree

1 file changed

+39
-91
lines changed

1 file changed

+39
-91
lines changed

index.html

Lines changed: 39 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,78 @@
1+
12
<!DOCTYPE html>
23
<html lang="en">
4+
35
<head>
46
<meta charset="UTF-8">
57
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
69
<title>SBM Smart Maintenance AI</title>
10+
11+
<link rel="stylesheet" href="css/style.css">
12+
713
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
8-
<style>
9-
:root { --primary:#FFA500; --bg:#0f1117; --card:#1c1f26; --text:#e6edf3; --accent:#39FF14; }
10-
body { margin:0; background:var(--bg); color:var(--text); font-family:'Roboto',sans-serif; }
11-
header { text-align:center; padding:25px; background:linear-gradient(180deg,#FFA500,#111); border-radius:0 0 20px 20px; }
12-
header h1 { margin:0; font-family:'Orbitron',sans-serif; font-size:20px; color:#000; }
13-
.container { max-width:700px; margin:auto; padding:15px; }
14-
.card { background:var(--card); padding:20px; border-radius:15px; margin-bottom:20px; border:1px solid #30363d; }
15-
h2 { color:var(--primary); font-size:16px; margin-top:0; border-bottom:1px solid #333; padding-bottom:8px; }
16-
input, textarea, button { width:100%; padding:12px; margin:8px 0; border-radius:8px; border:1px solid #444; background:#0d1117; color:white; box-sizing:border-box; }
17-
button { background:var(--primary); color:#000; font-weight:bold; cursor:pointer; border:none; }
18-
.payment-box { background:#111; padding:15px; border-radius:10px; border:1px dashed var(--primary); margin-top:20px; }
19-
.whatsapp-btn { background:#25D366; color:white; padding:10px; text-decoration:none; display:block; text-align:center; border-radius:8px; margin-top:10px; }
20-
#mainApp { display:none; }
21-
#reportList { max-height:300px; overflow-y:auto; }
22-
</style>
14+
2315
</head>
16+
2417
<body>
2518

2619
<header>
2720
<h1>ABDURHAMAN MECHATRONICS</h1>
28-
<p style="margin:5px 0 0;font-size:12px;font-weight:bold;color:#000;">SBM SMART MAINTENANCE AI</p>
21+
<p>SBM SMART MAINTENANCE AI</p>
2922
</header>
3023

3124
<div class="container">
25+
3226
<div id="loginSection" class="card">
33-
<h2>🔐 Admin Access</h2>
34-
<input type="email" id="email" placeholder="Email (admin@example.com)">
27+
28+
<h2>Admin Access</h2>
29+
30+
<input type="email" id="email" placeholder="Email">
31+
3532
<input type="password" id="password" placeholder="Password">
33+
3634
<button onclick="login()">SIGN IN</button>
37-
<p id="authMsg" style="color:red;font-size:12px;text-align:center;"></p>
35+
36+
<p id="authMsg"></p>
37+
3838
</div>
3939

40+
4041
<div id="mainApp">
42+
4143
<div class="card">
42-
<button onclick="logout()" style="width:auto; float:right; background:#444; color:white; padding:5px 10px; font-size:10px;">LOGOUT</button>
43-
<div style="clear:both;"></div>
44-
<h2>📸 AI Machine Scanner</h2>
45-
<input type="file" id="imgFile" accept="image/*">
46-
<button onclick="runVisionAI()" style="background:var(--accent);">RUN AI ANALYSIS</button>
47-
<textarea id="issue" rows="5" placeholder="AI analysis result..."></textarea>
44+
45+
<h2>AI Machine Scanner</h2>
46+
47+
<input type="file" id="imgFile">
48+
49+
<button onclick="runVisionAI()">RUN AI ANALYSIS</button>
50+
51+
<textarea id="issue"></textarea>
52+
4853
<button onclick="saveReport()">SAVE TO CLOUD</button>
54+
4955
</div>
5056

5157
<div class="card">
52-
<h2>📈 Service History</h2>
58+
59+
<h2>Service History</h2>
60+
5361
<div id="reportList"></div>
54-
</div>
5562

56-
<div class="card">
57-
<h2>💳 Subscription & Support</h2>
58-
<div class="payment-box">
59-
<p><strong>Telebirr / e-birr / CBE-birr:</strong> 0988535068</p>
60-
<p><strong>CBE Account:</strong> 1000347503707</p>
61-
<a href="https://wa.me/251904267186" class="whatsapp-btn" target="_blank">🟢 WhatsApp: 0904267186</a>
62-
</div>
6363
</div>
64+
6465
</div>
66+
6567
</div>
6668

6769
<script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-app-compat.js"></script>
6870
<script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-auth-compat.js"></script>
6971
<script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-firestore-compat.js"></script>
7072

71-
<script type="module">
72-
// AI placeholder
73-
window.runVisionAI = async () => {
74-
const file = document.getElementById("imgFile").files[0];
75-
if(!file) return alert("Select image!");
76-
document.getElementById("issue").value = "🔄 Scanning... Please wait.";
77-
// Dummy AI simulation
78-
setTimeout(()=>{ document.getElementById("issue").value = "AI detected issue: Example problem"; }, 1500);
79-
};
80-
</script>
81-
82-
<script>
83-
// Firebase config
84-
const firebaseConfig = {
85-
apiKey: "AIzaSyC1_0Ptpna4V-2cfyJHNwIvWvbA2eGLv18",
86-
authDomain: "sbm-app-ecf59.firebaseapp.com",
87-
projectId: "sbm-app-ecf59",
88-
storageBucket: "sbm-app-ecf59.appspot.com",
89-
messagingSenderId: "666387083873",
90-
appId: "1:666387083873:web:bfd6d5e064ecaad6c73020"
91-
};
92-
firebase.initializeApp(firebaseConfig);
93-
const auth = firebase.auth();
94-
const db = firebase.firestore();
95-
96-
function login(){
97-
const e=document.getElementById("email").value;
98-
const p=document.getElementById("password").value;
99-
auth.signInWithEmailAndPassword(e,p).catch(err=>document.getElementById("authMsg").innerText=err.message);
100-
}
101-
function logout(){ auth.signOut(); }
102-
103-
auth.onAuthStateChanged(user=>{
104-
if(user){
105-
document.getElementById("loginSection").style.display="none";
106-
document.getElementById("mainApp").style.display="block";
107-
} else {
108-
document.getElementById("loginSection").style.display="block";
109-
document.getElementById("mainApp").style.display="none";
110-
}
111-
});
112-
113-
function saveReport(){
114-
const i=document.getElementById("issue").value;
115-
if(!i)return;
116-
db.collection("reports").add({ issue:i, time:firebase.firestore.FieldValue.serverTimestamp() });
117-
alert("Report Saved!");
118-
}
119-
120-
db.collection("reports").orderBy("time","desc").onSnapshot(snap=>{
121-
const list=document.getElementById("reportList");
122-
list.innerHTML="";
123-
snap.forEach(doc=>{
124-
list.innerHTML+=`<div style="border-bottom:1px solid #333;padding:10px;font-size:12px;">${doc.data().issue}</div>`;
125-
});
126-
});
127-
</script>
73+
<script src="js/auth.js"></script>
74+
<script src="js/app.js"></script>
75+
<script src="api/vision-ai.js"></script>
12876

12977
</body>
13078
</html>

0 commit comments

Comments
 (0)