:root {
--neon-cyan: #00f7ff;
--quantum-purple: #bc13fe;
--matrix-green: #0f0;
--cyber-black: #000212;
--error-red: #ff003c;
--cyber-gradient: linear-gradient(135deg,
var(--neon-cyan) 0%,
var(--quantum-purple) 50%,
var(--matrix-green) 100%);
}
body {
background: var(--cyber-black);
color: var(--neon-cyan);
font-family: 'Orbitron', sans-serif;
min-height: 100vh;
margin: 0;
overflow-x: hidden;
}
.neural-mainframe {
background: radial-gradient(ellipse at center,
rgba(0,2,18,0.97) 0%,
rgba(10,0,25,0.95) 100%);
border: 3px solid var(--quantum-purple);
padding: 2rem;
margin: 2rem;
box-shadow: 0 0 50px rgba(188,19,254,0.4);
position: relative;
overflow: hidden;
}
.quantum-btn {
background: var(--cyber-gradient);
border: 2px solid var(--neon-cyan);
padding: 1.2rem 2.5rem;
color: white;
clip-path: polygon(15% 0, 85% 0, 100% 50%, 85% 100%, 15% 100%, 0 50%);
cursor: pointer;
transition: all 0.3s;
margin: 1rem 0;
position: relative;
}
.quantum-btn:hover {
filter: hue-rotate(45deg);
transform: scale(1.05);
box-shadow: 0 0 25px var(--neon-cyan),
0 0 35px var(--quantum-purple);
}
.neon-input {
background: rgba(255,255,255,0.05);
border: 2px solid var(--neon-cyan);
color: var(--matrix-green);
padding: 1rem;
margin: 1rem 0;
font-family: 'Source Code Pro', monospace;
font-size: 1.2rem;
text-shadow: 0 0 10px var(--matrix-green);
width: 100%;
}
.hologram-display {
background: linear-gradient(45deg,
rgba(0,247,255,0.1),
rgba(188,19,254,0.1));
border: 1px solid var(--neon-cyan);
padding: 1.5rem;
margin: 2rem 0;
position: relative;
overflow: hidden;
animation: hologram-pulse 2s infinite;
}
@keyframes hologram-pulse {
0%, 100% { opacity: 0.8; }
50% { opacity: 1; }
}
@keyframes grid-scan {
0% { transform: translate(-50%, -50%); }
100% { transform: translate(50%, 50%); }
}
import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin';
import * as crypto from 'crypto';
import SMSActivate from 'sms-activate-api';
admin.initializeApp();
const db = admin.firestore();
const smsClient = new SMSActivate(functions.config().sms.key);
const generateQuantumKey = (): string => {
return crypto.randomBytes(48).toString('hex') +
crypto.randomBytes(24).toString('base64')
.replace(/\+/g, '-')
.replace(/\//g, '_');
};
export const initiateVerification = functions.https.onCall(async (data) => {
try {
if (!/^\d{10}$/.test(data.phone)) {
throw new functions.https.HttpsError(
'invalid-argument',
'INVALID_NEURAL_ID_FORMAT'
);
}
const activation = await smsClient.getNumber({
service: 'tg',
country: 0,
verification: true
});
await db.collection('quantumVerifications').doc(data.phone).set({
activationId: activation.id,
number: activation.number,
timestamp: admin.firestore.FieldValue.serverTimestamp(),
attempts: 0,
status: 'PENDING'
});
return {
status: 'QUANTUM_SMS_INITIATED',
security: 'AES-256 + ChaCha20'
};
} catch (error) {
throw new functions.https.HttpsError(
'internal',
'NEURAL_NETWORK_OVERLOAD'
);
}
});
export const validateVerification = functions.https.onCall(async (data) => {
try {
if (!/^\d{6}$/.test(data.code)) {
throw new functions.https.HttpsError(
'invalid-argument',
'INVALID_CODESTREAM_FORMAT'
);
}
const doc = await db.collection('quantumVerifications')
.doc(data.phone).get();
if (!doc.exists) throw new Error('QUANTUM_ENTANGLEMENT_FAILURE');
const status = await smsClient.setStatus({
id: doc.data()!.activationId,
status: 1
});
if (status !== 'ACCESS_READY') throw new Error('TEMPORAL_ANOMALY_DETECTED');
const apiKey = generateQuantumKey();
await db.collection('quantumUsers').doc(data.phone).set({
apiKey,
generationCount: 1,
lastAccessed: admin.firestore.FieldValue.serverTimestamp(),
securityLevel: 'QUANTUM_256'
});
return {
apiKey,
status: 'QUANTUM_LINK_ESTABLISHED',
security: 'AES-256 + ChaCha20 + HSM'
};
} catch (error) {
throw new functions.https.HttpsError(
'permission-denied',
error.message || 'AUTHENTICATION_FAILURE'
);
}
});
{
"hosting": {
"public": "public",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [{
"source": "**",
"destination": "/index.html"
}],
"headers": [{
"source": "**",
"headers": [
{"key": "Content-Security-Policy", "value": "default-src 'self' https:"},
{"key": "X-Content-Type-Options", "value": "nosniff"},
{"key": "X-Frame-Options", "value": "DENY"},
{"key": "Strict-Transport-Security", "value": "max-age=63072000"}
]
}]
},
"functions": {
"predeploy": ["npm --prefix functions run build"],
"source": "functions"
},
"firestore": {
"rules": "firestore.rules"
}
}
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /quantumUsers/{phone} {
allow read, write: if request.auth != null &&
request.auth.token.phone == phone;
}
match /quantumVerifications/{phone} {
allow write: if request.auth != null;
allow read: if false;
}
}
}
# Install dependencies
npm install -g firebase-tools
npm install --prefix functions sms-activate-api crypto firebase-admin firebase-functions typescript
# Initialize project
firebase init
# Set environment config
firebase functions:config:set sms.key="your_sms_activate_key"
# Deploy full stack
firebase deploy --project your-project-id