תסדר את האתר שיראה יפה אבל יעבוד אותו דבר רק מסודק יותר ובצבעים בהירים
Browse files- components/footer.js +9 -10
- components/navbar.js +12 -12
- index.html +571 -1
- style.css +22 -17
components/footer.js
CHANGED
|
@@ -4,14 +4,14 @@ class CustomFooter extends HTMLElement {
|
|
| 4 |
this.shadowRoot.innerHTML = `
|
| 5 |
<style>
|
| 6 |
footer {
|
| 7 |
-
background:
|
| 8 |
-
color:
|
| 9 |
text-align: center;
|
| 10 |
padding: 2rem;
|
| 11 |
-
margin-top:
|
|
|
|
| 12 |
}
|
| 13 |
-
|
| 14 |
-
.footer-content {
|
| 15 |
max-width: 1200px;
|
| 16 |
margin: 0 auto;
|
| 17 |
}
|
|
@@ -22,17 +22,16 @@ class CustomFooter extends HTMLElement {
|
|
| 22 |
gap: 20px;
|
| 23 |
margin-bottom: 20px;
|
| 24 |
}
|
| 25 |
-
|
| 26 |
.footer-links a {
|
| 27 |
-
color:
|
| 28 |
text-decoration: none;
|
|
|
|
| 29 |
}
|
| 30 |
|
| 31 |
.footer-links a:hover {
|
| 32 |
-
|
| 33 |
}
|
| 34 |
-
|
| 35 |
-
.copyright {
|
| 36 |
margin-top: 20px;
|
| 37 |
font-size: 0.9rem;
|
| 38 |
opacity: 0.8;
|
|
|
|
| 4 |
this.shadowRoot.innerHTML = `
|
| 5 |
<style>
|
| 6 |
footer {
|
| 7 |
+
background: white;
|
| 8 |
+
color: var(--text-primary);
|
| 9 |
text-align: center;
|
| 10 |
padding: 2rem;
|
| 11 |
+
margin-top: 4rem;
|
| 12 |
+
border-top: 1px solid var(--border);
|
| 13 |
}
|
| 14 |
+
.footer-content {
|
|
|
|
| 15 |
max-width: 1200px;
|
| 16 |
margin: 0 auto;
|
| 17 |
}
|
|
|
|
| 22 |
gap: 20px;
|
| 23 |
margin-bottom: 20px;
|
| 24 |
}
|
|
|
|
| 25 |
.footer-links a {
|
| 26 |
+
color: var(--text-primary);
|
| 27 |
text-decoration: none;
|
| 28 |
+
transition: color 0.2s;
|
| 29 |
}
|
| 30 |
|
| 31 |
.footer-links a:hover {
|
| 32 |
+
color: var(--primary);
|
| 33 |
}
|
| 34 |
+
.copyright {
|
|
|
|
| 35 |
margin-top: 20px;
|
| 36 |
font-size: 0.9rem;
|
| 37 |
opacity: 0.8;
|
components/navbar.js
CHANGED
|
@@ -4,19 +4,19 @@ class CustomNavbar extends HTMLElement {
|
|
| 4 |
this.shadowRoot.innerHTML = `
|
| 5 |
<style>
|
| 6 |
nav {
|
| 7 |
-
background:
|
| 8 |
-
color:
|
| 9 |
padding: 1rem 2rem;
|
| 10 |
display: flex;
|
| 11 |
justify-content: space-between;
|
| 12 |
align-items: center;
|
| 13 |
-
box-shadow: 0
|
| 14 |
position: sticky;
|
| 15 |
top: 0;
|
| 16 |
z-index: 1000;
|
|
|
|
| 17 |
}
|
| 18 |
-
|
| 19 |
-
.logo {
|
| 20 |
display: flex;
|
| 21 |
align-items: center;
|
| 22 |
font-weight: bold;
|
|
@@ -32,24 +32,24 @@ class CustomNavbar extends HTMLElement {
|
|
| 32 |
display: flex;
|
| 33 |
gap: 20px;
|
| 34 |
}
|
| 35 |
-
|
| 36 |
.nav-links a {
|
| 37 |
-
color:
|
| 38 |
text-decoration: none;
|
| 39 |
padding: 0.5rem 1rem;
|
| 40 |
border-radius: 8px;
|
| 41 |
-
transition:
|
|
|
|
| 42 |
}
|
| 43 |
|
| 44 |
.nav-links a:hover {
|
| 45 |
-
|
| 46 |
}
|
| 47 |
|
| 48 |
.nav-links a.active {
|
| 49 |
-
|
|
|
|
| 50 |
}
|
| 51 |
-
|
| 52 |
-
@media (max-width: 768px) {
|
| 53 |
nav {
|
| 54 |
flex-direction: column;
|
| 55 |
padding: 1rem;
|
|
|
|
| 4 |
this.shadowRoot.innerHTML = `
|
| 5 |
<style>
|
| 6 |
nav {
|
| 7 |
+
background: white;
|
| 8 |
+
color: var(--text-primary);
|
| 9 |
padding: 1rem 2rem;
|
| 10 |
display: flex;
|
| 11 |
justify-content: space-between;
|
| 12 |
align-items: center;
|
| 13 |
+
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
| 14 |
position: sticky;
|
| 15 |
top: 0;
|
| 16 |
z-index: 1000;
|
| 17 |
+
border-bottom: 1px solid var(--border);
|
| 18 |
}
|
| 19 |
+
.logo {
|
|
|
|
| 20 |
display: flex;
|
| 21 |
align-items: center;
|
| 22 |
font-weight: bold;
|
|
|
|
| 32 |
display: flex;
|
| 33 |
gap: 20px;
|
| 34 |
}
|
|
|
|
| 35 |
.nav-links a {
|
| 36 |
+
color: var(--text-primary);
|
| 37 |
text-decoration: none;
|
| 38 |
padding: 0.5rem 1rem;
|
| 39 |
border-radius: 8px;
|
| 40 |
+
transition: all 0.2s;
|
| 41 |
+
font-weight: 500;
|
| 42 |
}
|
| 43 |
|
| 44 |
.nav-links a:hover {
|
| 45 |
+
color: var(--primary);
|
| 46 |
}
|
| 47 |
|
| 48 |
.nav-links a.active {
|
| 49 |
+
color: var(--primary);
|
| 50 |
+
background: rgba(79, 70, 229, 0.1);
|
| 51 |
}
|
| 52 |
+
@media (max-width: 768px) {
|
|
|
|
| 53 |
nav {
|
| 54 |
flex-direction: column;
|
| 55 |
padding: 1rem;
|
index.html
CHANGED
|
@@ -97,4 +97,574 @@
|
|
| 97 |
<script src="components/footer.js"></script>
|
| 98 |
<script src="script.js"></script>
|
| 99 |
</body>
|
| 100 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
<script src="components/footer.js"></script>
|
| 98 |
<script src="script.js"></script>
|
| 99 |
</body>
|
| 100 |
+
</html>
|
| 101 |
+
/* DeepStudy Pro MAX — Luxe UI
|
| 102 |
+
* Same powerhouse features, premium UI polish for DeepSite.
|
| 103 |
+
* Env: OPENAI_API_KEY, OPENAI_MODEL, JWT_SECRET, SMTP_*, APP_BASE_URL
|
| 104 |
+
*/
|
| 105 |
+
require('dotenv').config();
|
| 106 |
+
const path=require('path'),fs=require('fs'),os=require('os');
|
| 107 |
+
const express=require('express'),cors=require('cors'),bodyParser=require('body-parser');
|
| 108 |
+
const multer=require('multer'),pdfParse=require('pdf-parse'),mammoth=require('mammoth');
|
| 109 |
+
const {v4:uuidv4}=require('uuid'); const helmet=require('helmet'); const rateLimit=require('express-rate-limit');
|
| 110 |
+
const cookieParser=require('cookie-parser'); const nodemailer=require('nodemailer');
|
| 111 |
+
const bcrypt=require('bcryptjs'); const jwt=require('jsonwebtoken'); const OpenAI=require('openai');
|
| 112 |
+
|
| 113 |
+
const app=express();
|
| 114 |
+
app.use(helmet({contentSecurityPolicy:false}));
|
| 115 |
+
app.use(cors({origin:true,credentials:true}));
|
| 116 |
+
app.use(cookieParser());
|
| 117 |
+
app.use(bodyParser.json({limit:'16mb'}));
|
| 118 |
+
app.use(rateLimit({windowMs:60_000,max:180}));
|
| 119 |
+
|
| 120 |
+
const PORT=process.env.PORT||3000;
|
| 121 |
+
const APP_BASE_URL=process.env.APP_BASE_URL||`http://localhost:${PORT}`;
|
| 122 |
+
const JWT_SECRET=process.env.JWT_SECRET||'dev_change_me';
|
| 123 |
+
|
| 124 |
+
const DATA_DIR=path.join(process.cwd(),'data');
|
| 125 |
+
const USERS_PATH=path.join(DATA_DIR,'users.json');
|
| 126 |
+
const PACKS_PATH=path.join(DATA_DIR,'packs.json');
|
| 127 |
+
if(!fs.existsSync(DATA_DIR)) fs.mkdirSync(DATA_DIR);
|
| 128 |
+
if(!fs.existsSync(USERS_PATH)) fs.writeFileSync(USERS_PATH,JSON.stringify([]));
|
| 129 |
+
if(!fs.existsSync(PACKS_PATH)) fs.writeFileSync(PACKS_PATH,JSON.stringify([]));
|
| 130 |
+
const readJSON=p=>{try{return JSON.parse(fs.readFileSync(p,'utf8'));}catch{return[];}};
|
| 131 |
+
const writeJSON=(p,v)=>fs.writeFileSync(p,JSON.stringify(v,null,2));
|
| 132 |
+
const readUsers=()=>readJSON(USERS_PATH), writeUsers=a=>writeJSON(USERS_PATH,a);
|
| 133 |
+
const readPacks=()=>readJSON(PACKS_PATH), writePacks=a=>writeJSON(PACKS_PATH,a);
|
| 134 |
+
|
| 135 |
+
let transporter=null;
|
| 136 |
+
if(process.env.SMTP_HOST){
|
| 137 |
+
transporter=nodemailer.createTransport({host:process.env.SMTP_HOST,port:Number(process.env.SMTP_PORT||587),secure:false,auth:{user:process.env.SMTP_USER,pass:process.env.SMTP_PASS}});
|
| 138 |
+
}
|
| 139 |
+
const openaiConfigured=!!process.env.OPENAI_API_KEY;
|
| 140 |
+
const openaiClient=openaiConfigured? new OpenAI.OpenAI({apiKey:process.env.OPENAI_API_KEY}):null;
|
| 141 |
+
const MODEL=process.env.OPENAI_MODEL||'gpt-4o-mini';
|
| 142 |
+
|
| 143 |
+
const sanitize=s=>(s||'').toString().replace(/\u0000/g,'').trim();
|
| 144 |
+
const safeParseJSON=s=>{try{return JSON.parse(s);}catch{return null;}};
|
| 145 |
+
const signToken=(payload,exp='7d')=>jwt.sign(payload,JWT_SECRET,{expiresIn:exp});
|
| 146 |
+
const verifyToken=t=>{try{return jwt.verify(t,JWT_SECRET);}catch{return null;}};
|
| 147 |
+
function authRequired(req,res,next){const t=req.cookies?.dsp_auth; if(!t) return res.status(401).json({ok:false,error:'נדרשת התחברות'}); const dec=verifyToken(t); if(!dec) return res.status(401).json({ok:false,error:'אסימון לא תקף'}); req.user=dec; next();}
|
| 148 |
+
const upload=multer({dest:path.join(os.tmpdir(),'deepstudy_uploads'),limits:{fileSize:32*1024*1024}});
|
| 149 |
+
|
| 150 |
+
async function extractText(filePath,originalName){
|
| 151 |
+
const ext=(path.extname(originalName||'').toLowerCase()||'').slice(1);
|
| 152 |
+
if(ext==='pdf'){const d=await pdfParse(fs.readFileSync(filePath)); return sanitize(d.text);}
|
| 153 |
+
if(ext==='docx'){const {value}=await mammoth.extractRawText({path:filePath}); return sanitize(value);}
|
| 154 |
+
if(ext==='txt'||ext===''){return sanitize(fs.readFileSync(filePath,'utf8'));}
|
| 155 |
+
throw new Error(`פורמט לא נתמך: ${ext} (pdf/docx/txt)`);
|
| 156 |
+
}
|
| 157 |
+
function chunkText(str,targetTokens=1200,overlapTokens=120){
|
| 158 |
+
const txt=sanitize(str); const charsPerTok=3; const chunkChars=targetTokens*charsPerTok; const overlapChars=overlapTokens*charsPerTok;
|
| 159 |
+
const out=[]; let i=0,idx=1; while(i<txt.length){const end=Math.min(txt.length,i+chunkChars); out.push({id:`S${idx}`,text:txt.slice(i,end)}); idx++; i=end-overlapChars; if(i<0) i=0; if(i>=txt.length) break;}
|
| 160 |
+
return out;
|
| 161 |
+
}
|
| 162 |
+
async function llm(messages,system){
|
| 163 |
+
if(!openaiConfigured){const last=messages[messages.length-1]?.content||''; return `🔁 מצב דמו:\n${last.slice(0,600)}\n\n[הדגמה]`;}
|
| 164 |
+
const r=await openaiClient.chat.completions.create({model:MODEL,temperature:0.35,messages:[{role:'system',content:system||'You are a kind Hebrew school tutor.'},...messages]});
|
| 165 |
+
return r.choices?.[0]?.message?.content?.trim()||'';
|
| 166 |
+
}
|
| 167 |
+
const mapPrompt=(goal,sid,text)=>[{role:'user',content:
|
| 168 |
+
`מקטע "${sid}". מטרה: ${sanitize(goal)||'הבנה + הכנה לבוחן'}.
|
| 169 |
+
"""
|
| 170 |
+
${text}
|
| 171 |
+
"""
|
| 172 |
+
צור תקציר (5–8 משפטים), נקודות מפתח, ומושגים. Markdown:
|
| 173 |
+
## ${sid}
|
| 174 |
+
### תקציר
|
| 175 |
+
- ...
|
| 176 |
+
### נקודות מפתח
|
| 177 |
+
- ...
|
| 178 |
+
### מושגים
|
| 179 |
+
- מושג | הסבר קצר`}];
|
| 180 |
+
function reducePrompt(goal,mapped,merged){return[{role:'user',content:
|
| 181 |
+
`אחד את סיכומי המקטעים ל"חבילת לימוד" בעברית עם [Si]. מטרה: ${sanitize(goal)||'הבנה + תרגול'}.
|
| 182 |
+
סיכומים:
|
| 183 |
+
"""
|
| 184 |
+
${mapped}
|
| 185 |
+
"""
|
| 186 |
+
(להקשר בלבד):
|
| 187 |
+
"""
|
| 188 |
+
${merged.slice(0,20000)}
|
| 189 |
+
"""
|
| 190 |
+
הפק Markdown:
|
| 191 |
+
# סיכום (8–12 משפטים, עם [Si])
|
| 192 |
+
# נקודות מפתח (בולטים + [Si])
|
| 193 |
+
# מילון מושגים (טבלה: מושג | הסבר קצר | מקטעים)
|
| 194 |
+
# כרטיסיות (8–14): שאלה → תשובה קצרה
|
| 195 |
+
# מבחן לדוגמה (10–14)
|
| 196 |
+
בסוף הוסף JSON תקין:
|
| 197 |
+
{"answerKey":[{"qid":"Q1","correct":"B","explanation":"..."}, ...]}`}];}
|
| 198 |
+
async function buildStudyPack(goal,merged){
|
| 199 |
+
const chunks=chunkText(merged,1200,120);
|
| 200 |
+
if(!chunks.length){return{studyPackMarkdown:'# סיכום\nדמו קצר.',answerKey:{answerKey:[]},sections:[]};}
|
| 201 |
+
const mapped=[]; for(const ch of chunks) mapped.push(await llm(mapPrompt(goal,ch.id,ch.text)));
|
| 202 |
+
const mappedMarkdown=mapped.join('\n\n'); const reduced=await llm(reducePrompt(goal,mappedMarkdown,merged));
|
| 203 |
+
let answerKey={answerKey:[]}; const m=reduced.match(/\{[\s\S]*\}/g)||[];
|
| 204 |
+
for(let i=m.length-1;i>=0;i--){const c=safeParseJSON(m[i]); if(c?.answerKey){answerKey=c;break;}}
|
| 205 |
+
return{studyPackMarkdown:reduced,answerKey,sections:chunks.map(c=>c.id)};
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
// ---------- AUTH ----------
|
| 209 |
+
app.post('/api/auth/signup',async(req,res)=>{
|
| 210 |
+
try{
|
| 211 |
+
const email=sanitize(req.body.email).toLowerCase(), pw=sanitize(req.body.password);
|
| 212 |
+
if(!email||!pw||pw.length<6) return res.status(400).json({ok:false,error:'אימייל/סיסמה לא תקינים'});
|
| 213 |
+
const users=readUsers(); if(users.find(u=>u.email===email)) return res.status(409).json({ok:false,error:'אימייל קיים'});
|
| 214 |
+
const hash=await bcrypt.hash(pw,10); const user={id:uuidv4(),email,passwordHash:hash,createdAt:Date.now(),emailVerified:false};
|
| 215 |
+
users.push(user); writeUsers(users);
|
| 216 |
+
if(transporter){
|
| 217 |
+
const t=signToken({action:'verify',uid:user.id},'2d'); const link=`${APP_BASE_URL}/verify?token=${t}`;
|
| 218 |
+
await transporter.sendMail({from:process.env.SMTP_FROM||'DeepStudy Pro <[email protected]>',to:email,subject:'ברוכה הבאה! אשרי את המייל 🎉',
|
| 219 |
+
html:`<div style="font-family:system-ui"><h2>ברוכה הבאה</h2><p>לאימות החשבון:</p><p><a href="${link}">לחצי כאן</a></p></div>`});
|
| 220 |
+
}
|
| 221 |
+
const token=signToken({uid:user.id,email:user.email}); res.cookie('dsp_auth',token,{httpOnly:true,sameSite:'lax',maxAge:7*24*3600*1000});
|
| 222 |
+
res.json({ok:true,user:{id:user.id,email:user.email,emailVerified:user.emailVerified},info:transporter?'נשלח מייל אימות':'דמו: אין SMTP'});
|
| 223 |
+
}catch(e){console.error(e);res.status(500).json({ok:false,error:'שגיאה בהרשמה'});}
|
| 224 |
+
});
|
| 225 |
+
app.post('/api/auth/login',async(req,res)=>{
|
| 226 |
+
try{
|
| 227 |
+
const email=sanitize(req.body.email).toLowerCase(), pw=sanitize(req.body.password);
|
| 228 |
+
const users=readUsers(); const u=users.find(x=>x.email===email); if(!u) return res.status(401).json({ok:false,error:'שגוי'});
|
| 229 |
+
const ok=await bcrypt.compare(pw,u.passwordHash); if(!ok) return res.status(401).json({ok:false,error:'שגוי'});
|
| 230 |
+
const token=signToken({uid:u.id,email:u.email}); res.cookie('dsp_auth',token,{httpOnly:true,sameSite:'lax',maxAge:7*24*3600*1000});
|
| 231 |
+
res.json({ok:true,user:{id:u.id,email:u.email,emailVerified:u.emailVerified}});
|
| 232 |
+
}catch(e){console.error(e);res.status(500).json({ok:false,error:'שגיאה בהתחברות'});}
|
| 233 |
+
});
|
| 234 |
+
app.post('/api/auth/logout',(req,res)=>{res.clearCookie('dsp_auth');res.json({ok:true});});
|
| 235 |
+
app.get('/api/auth/me',(req,res)=>{const t=req.cookies?.dsp_auth; const dec=t&&verifyToken(t); if(!dec) return res.json({ok:false});
|
| 236 |
+
const u=readUsers().find(x=>x.id===dec.uid); if(!u) return res.json({ok:false});
|
| 237 |
+
res.json({ok:true,user:{id:u.id,email:u.email,emailVerified:u.emailVerified}});
|
| 238 |
+
});
|
| 239 |
+
app.get('/api/auth/verify',(req,res)=>{const t=sanitize(req.query.token); const d=verifyToken(t); if(!d||d.action!=='verify') return res.status(400).json({ok:false,error:'טוקן לא תקף'});
|
| 240 |
+
const users=readUsers(); const u=users.find(x=>x.id===d.uid); if(!u) return res.status(400).json({ok:false,error:'לא קיים'}); if(!u.emailVerified){u.emailVerified=true; writeUsers(users);}
|
| 241 |
+
res.json({ok:true,verified:true});
|
| 242 |
+
});
|
| 243 |
+
app.post('/api/auth/request-reset',async(req,res)=>{const email=sanitize(req.body.email).toLowerCase(); const u=readUsers().find(x=>x.email===email);
|
| 244 |
+
if(u&&transporter){const t=signToken({action:'reset',uid:u.id},'2h'); const link=`${APP_BASE_URL}/reset?token=${t}`;
|
| 245 |
+
await transporter.sendMail({from:process.env.SMTP_FROM||'DeepStudy Pro <[email protected]>',to:email,subject:'איפוס סיסמה',html:`<div style="font-family:system-ui"><h2>איפוס</h2><a href="${link}">קישור לאיפוס</a></div>`});}
|
| 246 |
+
res.json({ok:true});
|
| 247 |
+
});
|
| 248 |
+
app.post('/api/auth/reset',async(req,res)=>{const {token,password}=req.body||{}; const d=verifyToken(sanitize(token));
|
| 249 |
+
if(!d||d.action!=='reset') return res.status(400).json({ok:false,error:'טוקן לא תקף'});
|
| 250 |
+
if(!password||String(password).length<6) return res.status(400).json({ok:false,error:'סיסמה קצרה'});
|
| 251 |
+
const users=readUsers(); const u=users.find(x=>x.id===d.uid); if(!u) return res.status(400).json({ok:false,error:'לא נמצא'}); u.passwordHash=await bcrypt.hash(String(password),10); writeUsers(users); res.json({ok:true});
|
| 252 |
+
});
|
| 253 |
+
|
| 254 |
+
// ---------- CORE ----------
|
| 255 |
+
app.get('/api/health',(_req,res)=>res.json({ok:true,model:openaiConfigured?MODEL:'DEMO',smtp:!!transporter}));
|
| 256 |
+
|
| 257 |
+
app.post('/api/study-pack',authRequired,upload.array('files',6),async(req,res)=>{
|
| 258 |
+
const cleanup=()=> (req.files||[]).forEach(f=>fs.existsSync(f.path)&&fs.unlinkSync(f.path));
|
| 259 |
+
try{
|
| 260 |
+
const goal=sanitize(req.body.goal).slice(0,600); let merged='';
|
| 261 |
+
if(req.files?.length){for(const f of req.files){merged+=`\n\n===== ${f.originalname} =====\n${await extractText(f.path,f.originalname)}\n`;}}
|
| 262 |
+
const raw=sanitize(req.body.text||''); if(raw) merged+=`\n\n===== Pasted Text =====\n${raw}\n`;
|
| 263 |
+
if(!merged.trim()) merged='דמו: אנרגיה, כוח, תאוצה, תנע ושימור אנרגיה.';
|
| 264 |
+
const pack=await buildStudyPack(goal,merged);
|
| 265 |
+
const packs=readPacks(); const id=uuidv4();
|
| 266 |
+
packs.push({id,uid:req.user.uid,goal,createdAt:Date.now(),markdown:pack.studyPackMarkdown,answerKey:pack.answerKey,sections:pack.sections});
|
| 267 |
+
writePacks(packs);
|
| 268 |
+
res.json({ok:true,id,...pack});
|
| 269 |
+
}catch(e){console.error(e);res.status(500).json({ok:false,error:'שגיאה ביצירת חבילת לימוד',details:String(e.message||e)});} finally{cleanup();}
|
| 270 |
+
});
|
| 271 |
+
app.get('/api/packs',authRequired,(req,res)=>{const p=readPacks().filter(x=>x.uid===req.user.uid).sort((a,b)=>b.createdAt-a.createdAt);
|
| 272 |
+
res.json({ok:true,packs:p.map(x=>({id:x.id,goal:x.goal,createdAt:x.createdAt}))});
|
| 273 |
+
});
|
| 274 |
+
app.get('/api/packs/:id',authRequired,(req,res)=>{const p=readPacks().find(x=>x.id===req.params.id&&x.uid===req.user.uid); if(!p) return res.status(404).json({ok:false,error:'לא נמצא'}); res.json({ok:true,pack:p});});
|
| 275 |
+
app.delete('/api/packs/:id',authRequired,(req,res)=>{const ps=readPacks(); const i=ps.findIndex(x=>x.id===req.params.id&&x.uid===req.user.uid); if(i===-1) return res.status(404).json({ok:false,error:'לא נמצא'}); ps.splice(i,1); writePacks(ps); res.json({ok:true});});
|
| 276 |
+
app.post('/api/grade',authRequired,async(req,res)=>{try{
|
| 277 |
+
const {questions,userAnswers,answerKey}=req.body||{}; if(!questions||!userAnswers||!answerKey) return res.status(400).json({ok:false,error:'חסר מידע'});
|
| 278 |
+
let out; if(!openaiConfigured){const per=Object.keys(userAnswers).map((qid,i)=>({qid,correct:i%2===0,feedback:i%2===0?'נכון!':'בדקי שוב'})); const c=per.filter(p=>p.correct).length; out={perQuestion:per,score:{correct:c,total:per.length||1,percent:per.length?Math.round(100*c/per.length):0}};}
|
| 279 |
+
else{const resp=await llm([{role:'user',content:`You are a deterministic grader. Return STRICT JSON:
|
| 280 |
+
{"perQuestion":[{"qid":"Q1","correct":true,"feedback":"..."}], "score":{"correct":N,"total":T,"percent":P}}`},{role:'user',content:JSON.stringify({questions,userAnswers,answerKey})}],'You are a JSON-only grader.'); const parsed=safeParseJSON(resp); out=parsed?.perQuestion&&parsed?.score?parsed:{perQuestion:[],score:{correct:0,total:0,percent:0}};}
|
| 281 |
+
res.json({ok:true,result:out});
|
| 282 |
+
}catch(e){console.error(e);res.status(500).json({ok:false,error:'שגיאה בבדיקה'});} });
|
| 283 |
+
app.get('/api/chat/stream',authRequired,async(req,res)=>{
|
| 284 |
+
res.set({'Cache-Control':'no-cache','Content-Type':'text/event-stream',Connection:'keep-alive'}); res.flushHeaders();
|
| 285 |
+
const history=safeParseJSON(req.query.history||'[]')||[]; const message=sanitize(req.query.message||''); const msgs=[]; for(const m of history) msgs.push({role:m.role==='assistant'?'assistant':'user',content:String(m.content||'')}); msgs.push({role:'user',content:message});
|
| 286 |
+
try{const reply=await llm(msgs,'You are a friendly Hebrew tutor. Keep it clear, stepwise, with one small example. Avoid unsafe content.');
|
| 287 |
+
const parts=reply.match(/.{1,60}/g)||[reply]; for(const p of parts){res.write(`data: ${JSON.stringify({chunk:p})}\n\n`); await new Promise(r=>setTimeout(r,14));}
|
| 288 |
+
res.write(`data: ${JSON.stringify({done:true})}\n\n`); res.end();
|
| 289 |
+
}catch(e){res.write(`data: ${JSON.stringify({error:'שגיאת צ׳אט'})}\n\n`); res.end();}
|
| 290 |
+
});
|
| 291 |
+
|
| 292 |
+
// ---------- AUX PAGES (verify/reset) ----------
|
| 293 |
+
app.get('/verify',(_req,res)=>{res.setHeader('Content-Type','text/html; charset=utf-8');res.end(`<!doctype html><meta charset="utf-8"/><title>אימות</title>
|
| 294 |
+
<style>body{font-family:Inter,system-ui;background:#0b1027;color:#fff;display:grid;place-items:center;height:100vh}
|
| 295 |
+
.card{background:rgba(255,255,255,.06);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.14);border-radius:16px;padding:20px;max-width:480px}
|
| 296 |
+
.ok{color:#7CFFB2}.err{color:#ff9a9a}</style>
|
| 297 |
+
<div class="card" id="c">מאמתים…</div>
|
| 298 |
+
<script>
|
| 299 |
+
(async()=>{const el=document.getElementById('c');const t=new URL(location.href).searchParams.get('token');try{const r=await fetch('/api/auth/verify?token='+encodeURIComponent(t));const j=await r.json();el.innerHTML=j.ok?'<h3 class="ok">המייל אומת ✔</h3>':'<h3 class="err">האימות נכשל</h3>';}catch{el.innerHTML='<h3 class="err">שגיאה</h3>';}})();
|
| 300 |
+
</script>`);});
|
| 301 |
+
app.get('/reset',(_req,res)=>{res.setHeader('Content-Type','text/html; charset=utf-8');res.end(`<!doctype html><meta charset="utf-8"/><title>איפוס סיסמה</title>
|
| 302 |
+
<style>body{font-family:Inter,system-ui;background:#0b1027;color:#fff;display:grid;place-items:center;height:100vh}
|
| 303 |
+
.card{background:rgba(255,255,255,.06);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.14);border-radius:16px;padding:20px;max-width:420px}
|
| 304 |
+
input{width:100%;padding:12px;border-radius:12px;border:1px solid rgba(255,255,255,.2);background:#0b1234;color:#fff}
|
| 305 |
+
button{margin-top:10px;padding:11px 16px;border-radius:12px;border:0;background:linear-gradient(90deg,#8eb1ff,#7affe1);color:#03122a;font-weight:800;cursor:pointer}
|
| 306 |
+
.ok{color:#7CFFB2}.err{color:#ff9a9a}</style>
|
| 307 |
+
<div class="card"><h3>איפוס סיסמה</h3><input id="pw" type="password" placeholder="סיסמה חדשה (6+)"><button id="go">איפוס</button><div id="out"></div></div>
|
| 308 |
+
<script>
|
| 309 |
+
const out=document.getElementById('out'),pw=document.getElementById('pw'),btn=document.getElementById('go');const t=new URL(location.href).searchParams.get('token');
|
| 310 |
+
btn.onclick=async()=>{out.textContent='…';try{const r=await fetch('/api/auth/reset',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({token:t,password:pw.value})});const j=await r.json();out.innerHTML=j.ok?'<span class="ok">עודכן ✔</span>':'<span class="err">'+(j.error||'שגיאה')+'</span>';}catch{out.innerHTML='<span class="err">שגיאה</span>';}}
|
| 311 |
+
</script>`);});
|
| 312 |
+
|
| 313 |
+
// ---------- MAIN (Luxe UI) ----------
|
| 314 |
+
app.get('/',(_req,res)=>{
|
| 315 |
+
res.setHeader('Content-Type','text/html; charset=utf-8');
|
| 316 |
+
res.end(`<!doctype html>
|
| 317 |
+
<html lang="he" dir="rtl">
|
| 318 |
+
<head>
|
| 319 |
+
<meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/>
|
| 320 |
+
<title>DeepStudy Pro MAX — Luxe</title>
|
| 321 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 322 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 323 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap" rel="stylesheet">
|
| 324 |
+
<style>
|
| 325 |
+
:root{
|
| 326 |
+
--bg:#050816; --ink:#EAF0FF; --muted:#B6C2FF; --line:rgba(255,255,255,.14);
|
| 327 |
+
--card:rgba(255,255,255,.06); --card-strong:rgba(255,255,255,.1);
|
| 328 |
+
--acc:#8EB1FF; --acc2:#7AFFE1; --danger:#ff8c8c; --ok:#7CFFB2; --warn:#ffd37a;
|
| 329 |
+
--ring:0 0 0 3px rgba(126,170,255,.35);
|
| 330 |
+
}
|
| 331 |
+
*{box-sizing:border-box}
|
| 332 |
+
html,body{height:100%}
|
| 333 |
+
body{
|
| 334 |
+
margin:0; color:var(--ink); font-family:Inter,system-ui,Segoe UI,Arial;
|
| 335 |
+
background:
|
| 336 |
+
radial-gradient(1200px 600px at 60% -200px,#1b2561,transparent),
|
| 337 |
+
linear-gradient(180deg,#050816 0%,#08122e 100%);
|
| 338 |
+
overflow-x:hidden;
|
| 339 |
+
}
|
| 340 |
+
@keyframes floaty{0%{transform:translateY(0)}50%{transform:translateY(-6px)}100%{transform:translateY(0)}}
|
| 341 |
+
@keyframes glow{0%{box-shadow:0 0 0 0 rgba(126,170,255,.12)}100%{box-shadow:0 0 0 14px rgba(126,170,255,0)}}
|
| 342 |
+
.wrap{max-width:1200px;margin:34px auto;padding:0 18px}
|
| 343 |
+
header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
|
| 344 |
+
.brand{display:flex;align-items:center;gap:12px;cursor:pointer}
|
| 345 |
+
.logo{width:42px;height:42px;border-radius:12px;background:
|
| 346 |
+
conic-gradient(from 220deg at 50% 50%, var(--acc), var(--acc2), var(--acc)); animation:floaty 6s ease-in-out infinite}
|
| 347 |
+
h1{margin:0;font-size:28px;font-weight:800;letter-spacing:.2px}
|
| 348 |
+
nav{display:flex;gap:8px;flex-wrap:wrap}
|
| 349 |
+
.pill{display:inline-flex;align-items:center;gap:8px;background:var(--card);backdrop-filter:blur(10px);
|
| 350 |
+
padding:8px 12px;border:1px solid var(--line);border-radius:999px;font-size:12px;color:var(--muted);cursor:pointer}
|
| 351 |
+
.pill:focus-visible{outline:none;box-shadow:var(--ring)}
|
| 352 |
+
.grid{display:grid;grid-template-columns:1.15fr .85fr;gap:16px}
|
| 353 |
+
@media(max-width:980px){.grid{grid-template-columns:1fr}}
|
| 354 |
+
.card{background:var(--card);backdrop-filter:blur(10px);border:1px solid var(--line);border-radius:20px;padding:16px;box-shadow:0 12px 40px rgba(0,0,0,.35)}
|
| 355 |
+
.card:hover{border-color:var(--card-strong)}
|
| 356 |
+
h3{margin:0 0 10px}
|
| 357 |
+
.row{display:flex;gap:10px;align-items:center;margin:10px 0}
|
| 358 |
+
input,textarea{
|
| 359 |
+
width:100%;padding:12px 14px;border-radius:12px;border:1px solid var(--line);background:#0A1133;color:var(--ink);
|
| 360 |
+
}
|
| 361 |
+
input:focus-visible,textarea:focus-visible{outline:none;box-shadow:var(--ring)}
|
| 362 |
+
textarea{min-height:110px}
|
| 363 |
+
input[type="file"]{border:1px dashed var(--line);padding:10px;border-radius:12px;width:100%;color:var(--muted);background:#0A1133}
|
| 364 |
+
.btn{cursor:pointer;border:0;border-radius:12px;padding:11px 16px;font-weight:800;background:linear-gradient(90deg,var(--acc),var(--acc2));color:#03122a;position:relative}
|
| 365 |
+
.btn:active{transform:translateY(1px)}
|
| 366 |
+
.btn.sec{background:transparent;color:var(--acc);border:1px solid var(--acc)}
|
| 367 |
+
.btn.ghost{background:transparent;border:1px dashed var(--line);color:var(--muted)}
|
| 368 |
+
.hr{height:1px;background:linear-gradient(90deg,transparent,var(--line),transparent);margin:16px 0}
|
| 369 |
+
.out{white-space:pre-wrap;line-height:1.6}
|
| 370 |
+
.small{font-size:12px;color:var(--muted)}
|
| 371 |
+
.toast{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);background:var(--card);border:1px solid var(--line);color:var(--ink);padding:12px 14px;border-radius:12px;display:none;backdrop-filter:blur(10px)}
|
| 372 |
+
/* Chat */
|
| 373 |
+
.chat{height:420px;overflow:auto;background:#081236;border-radius:16px;padding:12px;border:1px solid var(--line)}
|
| 374 |
+
.bubble{padding:10px 12px;border-radius:12px;margin:8px 0;max-width:85%}
|
| 375 |
+
.me{background:#0f1c4e;margin-left:auto;box-shadow:0 8px 18px rgba(0,0,0,.25)}
|
| 376 |
+
.bot{background:#0b1540;border:1px solid var(--line)}
|
| 377 |
+
/* Table */
|
| 378 |
+
.table{width:100%;border-collapse:collapse}
|
| 379 |
+
.table th,.table td{border:1px solid var(--line);padding:8px}
|
| 380 |
+
.table th{background:rgba(255,255,255,.04)}
|
| 381 |
+
/* Skeleton */
|
| 382 |
+
.skel{background:linear-gradient(90deg,rgba(255,255,255,.06),rgba(255,255,255,.12),rgba(255,255,255,.06));background-size:200% 100%;animation:shimmer 1.5s linear infinite;border-radius:8px}
|
| 383 |
+
@keyframes shimmer{0%{background-position:200% 0}100%{background-position:0 0}}
|
| 384 |
+
/* Toggle */
|
| 385 |
+
.switch{position:relative;width:46px;height:26px;background:rgba(255,255,255,.15);border:1px solid var(--line);border-radius:999px;cursor:pointer}
|
| 386 |
+
.knob{position:absolute;top:2px;right:2px;width:22px;height:22px;background:#fff;border-radius:50%;transition:.25s}
|
| 387 |
+
.switch.on .knob{right:22px}
|
| 388 |
+
.tip{color:var(--warn)}
|
| 389 |
+
/* Focus for links */
|
| 390 |
+
.linkLike{cursor:pointer;color:var(--acc)}
|
| 391 |
+
.linkLike:focus-visible{outline:none;box-shadow:var(--ring)}
|
| 392 |
+
/* Danger / OK text */
|
| 393 |
+
.ok{color:var(--ok)} .danger{color:var(--danger)}
|
| 394 |
+
</style>
|
| 395 |
+
</head>
|
| 396 |
+
<body>
|
| 397 |
+
<div class="wrap" aria-live="polite">
|
| 398 |
+
<header>
|
| 399 |
+
<div class="brand" id="brand" title="מידע">
|
| 400 |
+
<div class="logo" aria-hidden="true"></div><h1>DeepStudy Pro MAX</h1>
|
| 401 |
+
</div>
|
| 402 |
+
<nav>
|
| 403 |
+
<span class="pill" id="aboutBtn">על</span>
|
| 404 |
+
<span class="pill" id="helpBtn">עזרה</span>
|
| 405 |
+
<span class="pill" id="themePill" title="בהיר/כהה">
|
| 406 |
+
מצב תאורה
|
| 407 |
+
<span class="switch" id="themeSwitch"><span class="knob"></span></span>
|
| 408 |
+
</span>
|
| 409 |
+
<span class="pill" id="modelPill">מודל: —</span>
|
| 410 |
+
<span class="pill" id="authPill">לא מחובר/ת</span>
|
| 411 |
+
<span class="pill linkLike" id="logoutPill" style="display:none">יציאה</span>
|
| 412 |
+
</nav>
|
| 413 |
+
</header>
|
| 414 |
+
|
| 415 |
+
<div class="grid">
|
| 416 |
+
<div class="card">
|
| 417 |
+
<h3>1) יצירת חבילת לימוד</h3>
|
| 418 |
+
<div class="row"><input id="goal" type="text" placeholder="מטרה (למשל: 'להיערך למבחן על חשמל')" /></div>
|
| 419 |
+
<div class="row"><input id="files" type="file" multiple accept=".pdf,.docx,.txt" /></div>
|
| 420 |
+
<div class="row"><textarea id="rawText" placeholder="או הדביקי טקסט ידנית"></textarea></div>
|
| 421 |
+
<div class="row">
|
| 422 |
+
<button class="btn" id="buildBtn" title="נדרש להתחבר">צור חבילת לימוד</button>
|
| 423 |
+
<button class="btn sec" id="demoBtn" title="דמו מיידי">דמו מהיר</button>
|
| 424 |
+
<button class="btn ghost" id="downloadBtn" title="מוריד את החבילה הנוכחית כ־Markdown">הורדה</button>
|
| 425 |
+
</div>
|
| 426 |
+
<div class="hr"></div>
|
| 427 |
+
<div class="out" id="studyPackOut" aria-label="תוצר חבילת לימוד">
|
| 428 |
+
<div class="skel" style="height:14px;width:80%;margin-bottom:8px;"></div>
|
| 429 |
+
<div class="skel" style="height:14px;width:60%;margin-bottom:8px;"></div>
|
| 430 |
+
<div class="skel" style="height:14px;width:70%;"></div>
|
| 431 |
+
</div>
|
| 432 |
+
<div class="hr"></div>
|
| 433 |
+
|
| 434 |
+
<h3>בדיקת מבחן</h3>
|
| 435 |
+
<p class="small">הזיני JSON של שאלות/תשובות או השתמשי במפתח שנוצר.</p>
|
| 436 |
+
<textarea id="questionsJSON" placeholder='[{"qid":"Q1","type":"mcq","question":"...","choices":["A","B","C","D"]}]'></textarea>
|
| 437 |
+
<textarea id="userAnswersJSON" placeholder='{"Q1":"B","Q2":"True"}'></textarea>
|
| 438 |
+
<div class="row">
|
| 439 |
+
<button class="btn sec" id="gradeBtn">בדיקה וציון</button>
|
| 440 |
+
<button class="btn sec" id="refineBtn" title="שדרוג נושא ממוקד">שדרוג נושא</button>
|
| 441 |
+
</div>
|
| 442 |
+
<div class="out" id="gradeOut"></div>
|
| 443 |
+
</div>
|
| 444 |
+
|
| 445 |
+
<div class="card">
|
| 446 |
+
<h3>2) צ׳אט מורה + דשבורד</h3>
|
| 447 |
+
<div class="chat" id="chat" aria-label="צ'אט"></div>
|
| 448 |
+
<div class="row">
|
| 449 |
+
<input id="msg" type="text" placeholder="שאלה למורה... (דוגמה: 'הסבירי את חוק אום')" />
|
| 450 |
+
<button class="btn" id="send">שלח</button>
|
| 451 |
+
</div>
|
| 452 |
+
<p class="small tip">טיפ: <span class="linkLike" id="clearChat">ניקוי היסטוריה</span> • קיצור <b>↑</b> מחזיר הודעה אחרונה</p>
|
| 453 |
+
<div class="hr"></div>
|
| 454 |
+
|
| 455 |
+
<h3>החבילות שלי</h3>
|
| 456 |
+
<div id="packsWrap" class="out">—</div>
|
| 457 |
+
</div>
|
| 458 |
+
</div>
|
| 459 |
+
</div>
|
| 460 |
+
|
| 461 |
+
<div class="toast" id="toast"></div>
|
| 462 |
+
|
| 463 |
+
<!-- Modals -->
|
| 464 |
+
<div class="modal" id="authModal" style="display:none;align-items:center;justify-content:center;padding:16px;position:fixed;inset:0;background:rgba(0,0,0,.5);">
|
| 465 |
+
<div class="panel" style="max-width:460px;width:100%;background:var(--card);backdrop-filter:blur(10px);border:1px solid var(--line);border-radius:16px;padding:16px">
|
| 466 |
+
<h3>התחברות / הרשמה</h3>
|
| 467 |
+
<div class="row"><input id="email" type="email" placeholder="אימייל" /></div>
|
| 468 |
+
<div class="row"><input id="password" type="password" placeholder="סיסמה (6+)" /></div>
|
| 469 |
+
<div class="row">
|
| 470 |
+
<button class="btn" id="loginBtn">התחברות</button>
|
| 471 |
+
<button class="btn sec" id="signupBtn">הרשמה</button>
|
| 472 |
+
</div>
|
| 473 |
+
<div class="row">
|
| 474 |
+
<span class="linkLike" id="forgotBtn">שכחתי סיסמה</span>
|
| 475 |
+
</div>
|
| 476 |
+
<div class="row"><button class="btn ghost" id="closeAuth">סגירה</button></div>
|
| 477 |
+
</div>
|
| 478 |
+
</div>
|
| 479 |
+
|
| 480 |
+
<div class="modal" id="aboutModal" style="display:none;align-items:center;justify-content:center;padding:16px;position:fixed;inset:0;background:rgba(0,0,0,.5);">
|
| 481 |
+
<div class="panel" style="max-width:520px;width:100%;background:var(--card);backdrop-filter:blur(10px);border:1px solid var(--line);border-radius:16px;padding:16px">
|
| 482 |
+
<h3>על DeepStudy Pro MAX</h3>
|
| 483 |
+
<p>אין מבוי סתום: דמו, העלאה, צ׳אט, דשבורד — הכל זמין תמיד.</p>
|
| 484 |
+
<p class="small">לחצי בכל מקום ותקבלי טיפ קצר, מצב תאורה למעלה.</p>
|
| 485 |
+
<div class="row"><button class="btn ghost" id="closeAbout">סגירה</button></div>
|
| 486 |
+
</div>
|
| 487 |
+
</div>
|
| 488 |
+
|
| 489 |
+
<div class="modal" id="helpModal" style="display:none;align-items:center;justify-content:center;padding:16px;position:fixed;inset:0;background:rgba(0,0,0,.5);">
|
| 490 |
+
<div class="panel" style="max-width:520px;width:100%;background:var(--card);backdrop-filter:blur(10px);border:1px solid var(--line);border-radius:16px;padding:16px">
|
| 491 |
+
<h3>עזרה מהירה</h3>
|
| 492 |
+
<ul class="small">
|
| 493 |
+
<li>PDF / DOCX / TXT או הדבקת טקסט.</li>
|
| 494 |
+
<li>אין מפתח? <b>דמו</b> תמיד עובד.</li>
|
| 495 |
+
<li>החבילות נשמרות בלשונית “החבילות שלי”.</li>
|
| 496 |
+
<li>שחזור סיסמה דרך “שכחתי סיסמה”.</li>
|
| 497 |
+
</ul>
|
| 498 |
+
<div class="row"><button class="btn ghost" id="closeHelp">סגירה</button></div>
|
| 499 |
+
</div>
|
| 500 |
+
</div>
|
| 501 |
+
|
| 502 |
+
<script>
|
| 503 |
+
const $=id=>document.getElementById(id);
|
| 504 |
+
const toastEl=$('toast'); function toast(t){ toastEl.textContent=t; toastEl.style.display='block'; setTimeout(()=>toastEl.style.display='none',2200); }
|
| 505 |
+
['h3','.card','.pill','.logo','h1'].forEach(sel=>{ document.querySelectorAll(sel).forEach(el=>{ el.addEventListener('click',()=>toast('טיפ: העלי קבצים או השתמשי בדמו כדי לראות חבילת לימוד.')); }) });
|
| 506 |
+
|
| 507 |
+
/* Theme toggle */
|
| 508 |
+
const themeSwitch=$('themeSwitch'); const themePill=$('themePill');
|
| 509 |
+
const root=document.documentElement;
|
| 510 |
+
let light=localStorage.getItem('dsp_theme')==='light';
|
| 511 |
+
function applyTheme(){
|
| 512 |
+
if(light){
|
| 513 |
+
root.style.setProperty('--bg','#F7F9FF'); root.style.setProperty('--ink','#0F1636'); root.style.setProperty('--muted','#3B4780');
|
| 514 |
+
root.style.setProperty('--line','rgba(0,0,0,.12)'); root.style.setProperty('--card','rgba(255,255,255,.8)');
|
| 515 |
+
root.style.setProperty('--card-strong','rgba(0,0,0,.1)');
|
| 516 |
+
document.body.style.background='linear-gradient(180deg,#dde6ff 0%,#f2f6ff 100%)';
|
| 517 |
+
themeSwitch.classList.add('on');
|
| 518 |
+
} else {
|
| 519 |
+
root.style.cssText=''; document.body.style.background='';
|
| 520 |
+
themeSwitch.classList.remove('on');
|
| 521 |
+
}
|
| 522 |
+
}
|
| 523 |
+
applyTheme();
|
| 524 |
+
themePill.onclick=()=>{ light=!light; localStorage.setItem('dsp_theme',light?'light':'dark'); applyTheme(); };
|
| 525 |
+
|
| 526 |
+
/* Modals */
|
| 527 |
+
const brand=$('brand'), aboutBtn=$('aboutBtn'), helpBtn=$('helpBtn'), modelPill=$('modelPill'), authPill=$('authPill'), logoutPill=$('logoutPill');
|
| 528 |
+
const aboutModal=$('aboutModal'), helpModal=$('helpModal'), authModal=$('authModal');
|
| 529 |
+
$('closeAbout').onclick=()=>aboutModal.style.display='none';
|
| 530 |
+
$('closeHelp').onclick=()=>helpModal.style.display='none';
|
| 531 |
+
$('closeAuth').onclick=()=>authModal.style.display='none';
|
| 532 |
+
brand.onclick=()=>{ aboutModal.style.display='flex'; };
|
| 533 |
+
aboutBtn.onclick=()=>{ aboutModal.style.display='flex'; };
|
| 534 |
+
helpBtn.onclick=()=>{ helpModal.style.display='flex'; };
|
| 535 |
+
|
| 536 |
+
let me=null, latestMarkdown='', latestAnswerKey={answerKey:[]};
|
| 537 |
+
const buildBtn=$('buildBtn'), demoBtn=$('demoBtn'), downloadBtn=$('downloadBtn'), studyPackOut=$('studyPackOut');
|
| 538 |
+
const goal=$('goal'), files=$('files'), rawText=$('rawText');
|
| 539 |
+
const questionsJSONEl=$('questionsJSON'), userAnswersJSONEl=$('userAnswersJSON'), gradeBtn=$('gradeBtn'), gradeOut=$('gradeOut'), refineBtn=$('refineBtn');
|
| 540 |
+
const chatEl=$('chat'), msgEl=$('msg'), sendBtn=$('send'), clearChat=$('clearChat'), packsWrap=$('packsWrap');
|
| 541 |
+
|
| 542 |
+
/* Health */
|
| 543 |
+
async function health(){ try{ const r=await fetch('/api/health'); const j=await r.json();
|
| 544 |
+
modelPill.textContent='מודל: '+(j.model||'—')+(j.smtp?' • מייל פעיל':' • ללא מייל'); }catch{} }
|
| 545 |
+
health();
|
| 546 |
+
|
| 547 |
+
/* Auth */
|
| 548 |
+
async function refreshMe(){
|
| 549 |
+
try{ const r=await fetch('/api/auth/me',{credentials:'include'}); const j=await r.json();
|
| 550 |
+
if(j.ok){ me=j.user; authPill.textContent='מחובר/ת: '+(me.email||''); logoutPill.style.display='inline-flex'; loadPacks(); }
|
| 551 |
+
else{ me=null; authPill.textContent='לא מחובר/ת'; logoutPill.style.display='none'; packsWrap.textContent='—'; }
|
| 552 |
+
}catch{ me=null; authPill.textContent='לא מחובר/ת'; logoutPill.style.display='none'; }
|
| 553 |
+
}
|
| 554 |
+
refreshMe();
|
| 555 |
+
authPill.onclick=()=>{ authModal.style.display='flex'; };
|
| 556 |
+
logoutPill.onclick=async()=>{ await fetch('/api/auth/logout',{method:'POST',credentials:'include'}); await refreshMe(); toast('התנתקת'); };
|
| 557 |
+
|
| 558 |
+
const emailEl=$('email'), passwordEl=$('password'), forgotBtn=$('forgotBtn');
|
| 559 |
+
$('loginBtn').onclick=async()=>{ const email=emailEl.value.trim(), password=passwordEl.value.trim();
|
| 560 |
+
if(!email||!password) return toast('נא למלא אימייל וסיסמה');
|
| 561 |
+
const r=await fetch('/api/auth/login',{method:'POST',headers:{'Content-Type':'application/json'},credentials:'include',body:JSON.stringify({email,password})});
|
| 562 |
+
const j=await r.json(); if(j.ok){ authModal.style.display='none'; await refreshMe(); toast('התחברת ✔'); } else toast(j.error||'שגיאה');
|
| 563 |
+
};
|
| 564 |
+
$('signupBtn').onclick=async()=>{ const email=emailEl.value.trim(), password=passwordEl.value.trim();
|
| 565 |
+
if(!email||password.length<6) return toast('סיסמה 6+'); const r=await fetch('/api/auth/signup',{method:'POST',headers:{'Content-Type':'application/json'},credentials:'include',body:JSON.stringify({email,password})});
|
| 566 |
+
const j=await r.json(); if(j.ok){ authModal.style.display='none'; await refreshMe(); toast(j.info||'נרשמת!'); } else toast(j.error||'שגיאה');
|
| 567 |
+
};
|
| 568 |
+
forgotBtn.onclick=async()=>{ const email=prompt('כתבי אימייל לשחזור'); if(!email) return;
|
| 569 |
+
await fetch('/api/auth/request-reset',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({email})});
|
| 570 |
+
toast('אם המייל קיים ויש SMTP, נשלח קישור איפוס.');
|
| 571 |
+
};
|
| 572 |
+
|
| 573 |
+
/* Packs Dashboard */
|
| 574 |
+
async function loadPacks(){
|
| 575 |
+
if(!me){ packsWrap.textContent='—'; return; }
|
| 576 |
+
const r=await fetch('/api/packs',{credentials:'include'}); const j=await r.json();
|
| 577 |
+
if(!j.ok) return packsWrap.textContent='—';
|
| 578 |
+
if(!j.packs.length) { packsWrap.innerHTML='<span class="small">אין עדיין חבילות. השתמשי בדמו או צרי חדשה.</span>'; return; }
|
| 579 |
+
let html='<table class="table"><tr><th>מטרה</th><th>תאריך</th><th>פעולות</th></tr>';
|
| 580 |
+
j.packs.forEach(p=>{
|
| 581 |
+
const d=new Date(p.createdAt).toLocaleString();
|
| 582 |
+
html+=\`<tr><td>\${p.goal||'(ללא)'}</td><td>\${d}</td>
|
| 583 |
+
<td>
|
| 584 |
+
<button class="btn sec" data-open="\${p.id}">פתחי</button>
|
| 585 |
+
<button class="btn sec" data-export="\${p.id}">ייצוא</button>
|
| 586 |
+
<button class="btn ghost" data-del="\${p.id}">מחיקה</button>
|
| 587 |
+
</td></tr>\`;
|
| 588 |
+
});
|
| 589 |
+
html+='</table>';
|
| 590 |
+
packsWrap.innerHTML=html;
|
| 591 |
+
packsWrap.querySelectorAll('[data-open]').forEach(b=>b.onclick=()=>openPack(b.dataset.open));
|
| 592 |
+
packsWrap.querySelectorAll('[data-del]').forEach(b=>b.onclick=()=>deletePack(b.dataset.del));
|
| 593 |
+
packsWrap.querySelectorAll('[data-export]').forEach(b=>b.onclick=()=>exportPack(b.dataset.export));
|
| 594 |
+
}
|
| 595 |
+
async function openPack(id){
|
| 596 |
+
const r=await fetch('/api/packs/'+id,{credentials:'include'}); const j=await r.json();
|
| 597 |
+
if(!j.ok) return toast('שגיאה בפתיחה');
|
| 598 |
+
latestMarkdown=j.pack.markdown||''; latestAnswerKey=j.pack.answerKey||{answerKey:[]};
|
| 599 |
+
studyPackOut.textContent=latestMarkdown; toast('נפתח ✔');
|
| 600 |
+
}
|
| 601 |
+
async function deletePack(id){
|
| 602 |
+
if(!confirm('למחוק חבילה?')) return;
|
| 603 |
+
await fetch('/api/packs/'+id,{method:'DELETE',credentials:'include'}); toast('נמחק'); loadPacks();
|
| 604 |
+
}
|
| 605 |
+
async function exportPack(id){
|
| 606 |
+
const r=await fetch('/api/packs/'+id,{credentials:'include'}); const j=await r.json();
|
| 607 |
+
if(!j.ok) return toast('שגיאה בייצוא');
|
| 608 |
+
const md=j.pack.markdown||''; const blob=new Blob([md],{type:'text/markdown;charset=utf-8'});
|
| 609 |
+
const a=document.createElement('a'); a.href=URL.createObjectURL(blob); a.download='deepstudy_pack_'+id+'.md'; a.click(); URL.revokeObjectURL(a.href);
|
| 610 |
+
}
|
| 611 |
+
|
| 612 |
+
/* Study Pack */
|
| 613 |
+
buildBtn.onclick=async()=>{
|
| 614 |
+
if(!me){ authModal.style.display='flex'; return toast('התחברות נדרשת'); }
|
| 615 |
+
studyPackOut.innerHTML=\`
|
| 616 |
+
<div class="skel" style="height:16px;width:75%;margin-bottom:8px;"></div>
|
| 617 |
+
<div class="skel" style="height:16px;width:65%;margin-bottom:8px;"></div>
|
| 618 |
+
<div class="skel" style="height:16px;width:85%;"></div>\`;
|
| 619 |
+
const fd=new FormData(); if(goal.value.trim()) fd.append('goal',goal.value.trim()); if(rawText.value.trim()) fd.append('text',rawText.value.trim()); for(const f of files.files) fd.append('files',f);
|
| 620 |
+
const r=await fetch('/api/study-pack',{method:'POST',credentials:'include',body:fd}); const j=await r.json();
|
| 621 |
+
if(!j.ok){ studyPackOut.innerHTML='<span class="danger">❌ '+(j.error||'שגיאה')+'</span>'+(j.details?'<br><span class="small">'+j.details+'</span>':''); return; }
|
| 622 |
+
latestMarkdown=j.studyPackMarkdown||''; latestAnswerKey=j.answerKey||{answerKey:[]}; studyPackOut.textContent=latestMarkdown; toast('חבילה מוכנה ✔'); loadPacks();
|
| 623 |
+
};
|
| 624 |
+
demoBtn.onclick=async()=>{
|
| 625 |
+
studyPackOut.innerHTML=\`<div class="skel" style="height:16px;width:70%;margin-bottom:8px;"></div><div class="skel" style="height:16px;width:60%;"></div>\`;
|
| 626 |
+
try{
|
| 627 |
+
const demoText=(rawText.value.trim()||'')+'\\nדמו: אנרגיה, כוח, תאוצה, תנע ושימור אנרגיה.';
|
| 628 |
+
const fd=new FormData(); fd.append('goal',goal.value.trim()||'דמו'); fd.append('text',demoText);
|
| 629 |
+
const r=await fetch('/api/study-pack',{method:'POST',credentials:'include',body:fd});
|
| 630 |
+
const j=await r.json();
|
| 631 |
+
if(j.ok){ latestMarkdown=j.studyPackMarkdown||''; latestAnswerKey=j.answerKey||{answerKey:[]}; studyPackOut.textContent=latestMarkdown; toast('דמו ✔'); loadPacks(); }
|
| 632 |
+
else { latestMarkdown='# סיכום\\nדמו מקומי — הרשמי כדי לשמור לדשבורד.'; latestAnswerKey={answerKey:[]}; studyPackOut.textContent=latestMarkdown; toast('דמו מקומי ✔'); }
|
| 633 |
+
}catch{ latestMarkdown='# סיכום\\nדמו מקומי.'; studyPackOut.textContent=latestMarkdown; }
|
| 634 |
+
};
|
| 635 |
+
downloadBtn.onclick=()=>{ if(!latestMarkdown.trim()) return toast('אין תוכן להורדה'); const blob=new Blob([latestMarkdown],{type:'text/markdown;charset=utf-8'}); const a=document.createElement('a'); a.href=URL.createObjectURL(blob); a.download='deepstudy_pack.md'; a.click(); URL.revokeObjectURL(a.href); };
|
| 636 |
+
|
| 637 |
+
/* Grading */
|
| 638 |
+
gradeBtn.onclick=async()=>{
|
| 639 |
+
if(!me){ authModal.style.display='flex'; return toast('התחברות נדרשת'); }
|
| 640 |
+
gradeOut.textContent='בודק…';
|
| 641 |
+
let q=null,a=null; try{ q=JSON.parse(questionsJSONEl.value); }catch{ return gradeOut.textContent='JSON לא תקין בשאלות'; }
|
| 642 |
+
try{ a=JSON.parse(userAnswersJSONEl.value); }catch{ return gradeOut.textContent='JSON לא תקין בתשובות'; }
|
| 643 |
+
const r=await fetch('/api/grade',{method:'POST',headers:{'Content-Type':'application/json'},credentials:'include',body:JSON.stringify({questions:q,userAnswers:a,answerKey:latestAnswerKey})});
|
| 644 |
+
const j=await r.json(); if(!j.ok) return gradeOut.textContent='שגיאה בבדיקה';
|
| 645 |
+
const g=j.result; const lines=[]; lines.push('תוצאה: '+g.score.correct+'/'+g.score.total+' ('+g.score.percent+'%)'); lines.push(''); (g.perQuestion||[]).forEach(p=>lines.push(\`\${p.qid}: \${p.correct?'✓ נכון':'✗ שגוי'} — \${p.feedback||''}\`)); gradeOut.textContent=lines.join('\\n');
|
| 646 |
+
};
|
| 647 |
+
refineBtn.onclick=()=>{ const sel=prompt('איזה נושא לשדרג?'); if(!sel) return; msgEl.value='הרחיבי את הנושא: '+sel+' עם דוגמה מספרית ותרגיל קצר + פתרון.'; sendBtn.click(); };
|
| 648 |
+
|
| 649 |
+
/* Chat */
|
| 650 |
+
let chatHistory=JSON.parse(localStorage.getItem('dsp_chat')||'[]'); let lastUserMsg='';
|
| 651 |
+
function addBubble(t,who='bot'){ const b=document.createElement('div'); b.className='bubble '+(who==='me'?'me':'bot'); b.textContent=t; chatEl.appendChild(b); chatEl.scrollTop=chatEl.scrollHeight; }
|
| 652 |
+
function renderHistory(){ chatEl.innerHTML=''; chatHistory.forEach(m=>addBubble(m.content,m.role==='user'?'me':'bot')); } renderHistory();
|
| 653 |
+
$('clearChat').onclick=()=>{ chatHistory=[]; localStorage.setItem('dsp_chat','[]'); renderHistory(); toast('ניקינו את הצ׳אט'); };
|
| 654 |
+
$('send').onclick=async()=>{
|
| 655 |
+
if(!me){ authModal.style.display='flex'; return toast('התחברות נדרשת לצ׳אט'); }
|
| 656 |
+
const m=$('msg').value.trim(); if(!m) return; lastUserMsg=m; addBubble(m,'me'); $('msg').value=''; chatHistory.push({role:'user',content:m}); localStorage.setItem('dsp_chat',JSON.stringify(chatHistory));
|
| 657 |
+
const src=new EventSource('/api/chat/stream?'+new URLSearchParams({message:m,history:JSON.stringify(chatHistory.slice(-20))}),{withCredentials:true});
|
| 658 |
+
let acc=''; const typing=document.createElement('div'); typing.className='bubble bot'; typing.textContent='המורה מקלידה…'; chatEl.appendChild(typing);
|
| 659 |
+
src.onmessage=(e)=>{ const d=JSON.parse(e.data||'{}'); if(d.chunk){ acc+=d.chunk; typing.textContent=acc; } if(d.done){ chatHistory.push({role:'assistant',content:acc}); localStorage.setItem('dsp_chat',JSON.stringify(chatHistory)); src.close(); } if(d.error){ typing.textContent='שגיאה בצ׳אט'; src.close(); } };
|
| 660 |
+
};
|
| 661 |
+
document.addEventListener('keydown',(ev)=>{ if(ev.key==='ArrowUp' && document.activeElement===$('msg') && !$('msg').value) $('msg').value=lastUserMsg; });
|
| 662 |
+
</script>
|
| 663 |
+
</body>
|
| 664 |
+
</html>`);
|
| 665 |
+
});
|
| 666 |
+
|
| 667 |
+
if(!openaiConfigured) console.warn('⚠️ אין OPENAI_API_KEY — מצב דמו זמין (הכול עדיין עובד).');
|
| 668 |
+
if(!transporter) console.warn('⚠️ אין SMTP — אימות/שחזור יעבדו חלקית (UI+API), ללא שליחה אמיתית.');
|
| 669 |
+
app.listen(PORT,()=>console.log('DeepStudy Pro MAX — Luxe UI @ '+APP_BASE_URL));
|
| 670 |
+
npm i express multer openai pdf-parse mammoth cors dotenv uuid body-parser helmet express-rate-limit cookie-parser nodemailer bcryptjs jsonwebtoken
|
style.css
CHANGED
|
@@ -1,17 +1,20 @@
|
|
| 1 |
|
| 2 |
:root {
|
| 3 |
-
--primary: #
|
| 4 |
-
--primary-light: #
|
| 5 |
-
--secondary: #
|
| 6 |
-
--dark: #
|
| 7 |
-
--light: #
|
| 8 |
-
--gray: #
|
| 9 |
-
--success: #
|
| 10 |
-
--warning: #
|
| 11 |
-
--danger: #
|
| 12 |
-
--accent: #
|
| 13 |
-
--background: #
|
| 14 |
--card-bg: #ffffff;
|
|
|
|
|
|
|
|
|
|
| 15 |
}
|
| 16 |
* {
|
| 17 |
box-sizing: border-box;
|
|
@@ -19,11 +22,12 @@
|
|
| 19 |
padding: 0;
|
| 20 |
}
|
| 21 |
body {
|
| 22 |
-
font-family: '
|
| 23 |
background-color: var(--background);
|
| 24 |
-
color: var(--
|
| 25 |
direction: rtl;
|
| 26 |
-
line-height: 1.
|
|
|
|
| 27 |
}
|
| 28 |
.container {
|
| 29 |
max-width: 1200px;
|
|
@@ -32,12 +36,13 @@ body {
|
|
| 32 |
}
|
| 33 |
.hero {
|
| 34 |
text-align: center;
|
| 35 |
-
padding:
|
| 36 |
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
| 37 |
color: white;
|
| 38 |
-
border-radius:
|
| 39 |
-
margin-bottom:
|
| 40 |
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
|
|
|
| 41 |
}
|
| 42 |
.hero h1 {
|
| 43 |
font-size: 2.5rem;
|
|
|
|
| 1 |
|
| 2 |
:root {
|
| 3 |
+
--primary: #4f46e5;
|
| 4 |
+
--primary-light: #6366f1;
|
| 5 |
+
--secondary: #7c3aed;
|
| 6 |
+
--dark: #1e293b;
|
| 7 |
+
--light: #f8fafc;
|
| 8 |
+
--gray: #94a3b8;
|
| 9 |
+
--success: #10b981;
|
| 10 |
+
--warning: #f59e0b;
|
| 11 |
+
--danger: #ef4444;
|
| 12 |
+
--accent: #8b5cf6;
|
| 13 |
+
--background: #ffffff;
|
| 14 |
--card-bg: #ffffff;
|
| 15 |
+
--text-primary: #1e293b;
|
| 16 |
+
--text-secondary: #64748b;
|
| 17 |
+
--border: #e2e8f0;
|
| 18 |
}
|
| 19 |
* {
|
| 20 |
box-sizing: border-box;
|
|
|
|
| 22 |
padding: 0;
|
| 23 |
}
|
| 24 |
body {
|
| 25 |
+
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
| 26 |
background-color: var(--background);
|
| 27 |
+
color: var(--text-primary);
|
| 28 |
direction: rtl;
|
| 29 |
+
line-height: 1.5;
|
| 30 |
+
-webkit-font-smoothing: antialiased;
|
| 31 |
}
|
| 32 |
.container {
|
| 33 |
max-width: 1200px;
|
|
|
|
| 36 |
}
|
| 37 |
.hero {
|
| 38 |
text-align: center;
|
| 39 |
+
padding: 5rem 2rem;
|
| 40 |
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
| 41 |
color: white;
|
| 42 |
+
border-radius: 1rem;
|
| 43 |
+
margin-bottom: 2.5rem;
|
| 44 |
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
| 45 |
+
background-image: radial-gradient(circle at top right, rgba(255,255,255,0.1) 0%, transparent 30%);
|
| 46 |
}
|
| 47 |
.hero h1 {
|
| 48 |
font-size: 2.5rem;
|