Spaces:
Running
Running
Upload index.html.html
Browse files- index.html.html +145 -0
index.html.html
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<title>Bharat AI</title>
|
6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
+
<style>
|
8 |
+
body {
|
9 |
+
margin: 0;
|
10 |
+
background: #121212;
|
11 |
+
font-family: 'Segoe UI', sans-serif;
|
12 |
+
color: #fff;
|
13 |
+
display: flex;
|
14 |
+
flex-direction: column;
|
15 |
+
align-items: center;
|
16 |
+
padding-top: 20px;
|
17 |
+
}
|
18 |
+
img.logo {
|
19 |
+
max-width: 180px;
|
20 |
+
border-radius: 12px;
|
21 |
+
margin-bottom: 20px;
|
22 |
+
}
|
23 |
+
h1 {
|
24 |
+
color: #00ffc8;
|
25 |
+
}
|
26 |
+
.chatbox {
|
27 |
+
width: 90%;
|
28 |
+
max-width: 700px;
|
29 |
+
background: #1e1e1e;
|
30 |
+
border-radius: 10px;
|
31 |
+
padding: 15px;
|
32 |
+
margin-bottom: 20px;
|
33 |
+
overflow-y: auto;
|
34 |
+
height: 400px;
|
35 |
+
box-shadow: 0 0 10px rgba(0, 255, 200, 0.4);
|
36 |
+
}
|
37 |
+
.input-area, .upload-area {
|
38 |
+
display: flex;
|
39 |
+
width: 90%;
|
40 |
+
max-width: 700px;
|
41 |
+
margin-bottom: 10px;
|
42 |
+
}
|
43 |
+
input[type="text"], input[type="file"], input[type="password"], input[type="email"] {
|
44 |
+
flex: 1;
|
45 |
+
padding: 10px;
|
46 |
+
border: none;
|
47 |
+
border-radius: 8px;
|
48 |
+
font-size: 16px;
|
49 |
+
margin-right: 10px;
|
50 |
+
}
|
51 |
+
button {
|
52 |
+
background: #00ffc8;
|
53 |
+
border: none;
|
54 |
+
padding: 10px 15px;
|
55 |
+
cursor: pointer;
|
56 |
+
border-radius: 8px;
|
57 |
+
font-size: 16px;
|
58 |
+
}
|
59 |
+
#authSection, #mainApp { display: none; }
|
60 |
+
</style>
|
61 |
+
</head>
|
62 |
+
<body>
|
63 |
+
<img src="logo.jpg" alt="Bharat AI Logo" class="logo">
|
64 |
+
<h1>BHARAT AI</h1>
|
65 |
+
|
66 |
+
<div id="authSection">
|
67 |
+
<input type="email" id="email" placeholder="Enter email">
|
68 |
+
<input type="password" id="password" placeholder="Create a password">
|
69 |
+
<button onclick="registerUser()">Register & Login</button>
|
70 |
+
</div>
|
71 |
+
|
72 |
+
<div id="mainApp">
|
73 |
+
<div class="chatbox" id="chatbox"></div>
|
74 |
+
<div class="input-area">
|
75 |
+
<input type="text" id="userInput" placeholder="Ask something..." />
|
76 |
+
<button onclick="sendMessage()">Send</button>
|
77 |
+
</div>
|
78 |
+
<div class="upload-area">
|
79 |
+
<input type="file" id="mediaInput" />
|
80 |
+
<button onclick="uploadMedia()">Upload</button>
|
81 |
+
</div>
|
82 |
+
<div class="input-area">
|
83 |
+
<button onclick="generateImage()">🖼 Generate Image</button>
|
84 |
+
<button onclick="generateVideo()">🎥 Generate Video</button>
|
85 |
+
</div>
|
86 |
+
</div>
|
87 |
+
|
88 |
+
<script>
|
89 |
+
window.onload = () => {
|
90 |
+
document.getElementById('authSection').style.display = 'block';
|
91 |
+
};
|
92 |
+
|
93 |
+
function registerUser() {
|
94 |
+
const email = document.getElementById('email').value;
|
95 |
+
const pass = document.getElementById('password').value;
|
96 |
+
if (email && pass) {
|
97 |
+
localStorage.setItem('user', JSON.stringify({ email, pass }));
|
98 |
+
document.getElementById('authSection').style.display = 'none';
|
99 |
+
document.getElementById('mainApp').style.display = 'block';
|
100 |
+
} else {
|
101 |
+
alert("Enter both email and password.");
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
async function sendMessage() {
|
106 |
+
const input = document.getElementById('userInput');
|
107 |
+
const chatbox = document.getElementById('chatbox');
|
108 |
+
const userMessage = input.value.trim();
|
109 |
+
if (!userMessage) return;
|
110 |
+
chatbox.innerHTML += `<div><strong>You:</strong> ${userMessage}</div>`;
|
111 |
+
input.value = "";
|
112 |
+
|
113 |
+
const response = await fetch("https://api-inference.huggingface.co/models/microsoft/Phi-3-mini-4k-instruct", {
|
114 |
+
method: "POST",
|
115 |
+
headers: {
|
116 |
+
"Content-Type": "application/json",
|
117 |
+
"Authorization": "Bearer hf_HF_TOKEN_HERE"
|
118 |
+
},
|
119 |
+
body: JSON.stringify({
|
120 |
+
inputs: userMessage
|
121 |
+
})
|
122 |
+
});
|
123 |
+
|
124 |
+
const data = await response.json();
|
125 |
+
const reply = data?.[0]?.generated_text || "Sorry, no response.";
|
126 |
+
chatbox.innerHTML += `<div><strong>Bharat AI:</strong> ${reply}</div>`;
|
127 |
+
chatbox.scrollTop = chatbox.scrollHeight;
|
128 |
+
}
|
129 |
+
|
130 |
+
function uploadMedia() {
|
131 |
+
const file = document.getElementById('mediaInput').files[0];
|
132 |
+
if (!file) return alert("Select a file first.");
|
133 |
+
alert(`Media '${file.name}' uploaded successfully.`); // Simulated
|
134 |
+
}
|
135 |
+
|
136 |
+
function generateImage() {
|
137 |
+
alert("Image generation will be added soon. This is a placeholder.");
|
138 |
+
}
|
139 |
+
|
140 |
+
function generateVideo() {
|
141 |
+
alert("Video generation requires advanced setup. Coming soon!");
|
142 |
+
}
|
143 |
+
</script>
|
144 |
+
</body>
|
145 |
+
</html>
|