|
| 1 | + |
1 | 2 | <!DOCTYPE html> |
2 | 3 | <html lang="en"> |
| 4 | + |
3 | 5 | <head> |
4 | 6 | <meta charset="UTF-8"> |
5 | 7 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 8 | + |
6 | 9 | <title>SBM Smart Maintenance AI</title> |
| 10 | + |
| 11 | +<link rel="stylesheet" href="css/style.css"> |
| 12 | + |
7 | 13 | <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 | + |
23 | 15 | </head> |
| 16 | + |
24 | 17 | <body> |
25 | 18 |
|
26 | 19 | <header> |
27 | 20 | <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> |
29 | 22 | </header> |
30 | 23 |
|
31 | 24 | <div class="container"> |
| 25 | + |
32 | 26 | <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 | + |
35 | 32 | <input type="password" id="password" placeholder="Password"> |
| 33 | + |
36 | 34 | <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 | + |
38 | 38 | </div> |
39 | 39 |
|
| 40 | + |
40 | 41 | <div id="mainApp"> |
| 42 | + |
41 | 43 | <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 | + |
48 | 53 | <button onclick="saveReport()">SAVE TO CLOUD</button> |
| 54 | + |
49 | 55 | </div> |
50 | 56 |
|
51 | 57 | <div class="card"> |
52 | | -<h2>📈 Service History</h2> |
| 58 | + |
| 59 | +<h2>Service History</h2> |
| 60 | + |
53 | 61 | <div id="reportList"></div> |
54 | | -</div> |
55 | 62 |
|
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> |
63 | 63 | </div> |
| 64 | + |
64 | 65 | </div> |
| 66 | + |
65 | 67 | </div> |
66 | 68 |
|
67 | 69 | <script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-app-compat.js"></script> |
68 | 70 | <script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-auth-compat.js"></script> |
69 | 71 | <script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-firestore-compat.js"></script> |
70 | 72 |
|
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> |
128 | 76 |
|
129 | 77 | </body> |
130 | 78 | </html> |
0 commit comments