Files
marketing/update-analysis.js
T
2026-04-22 18:23:41 +05:00

222 lines
5.5 KiB
JavaScript

const fs = require('fs');
const path = require('path');
const targetPath = path.join(__dirname, 'src/views/pages/marketing/MarketingAnalysisV3.vue');
if (!fs.existsSync(targetPath)) {
console.error('File not found: MarketingAnalysisV3.vue');
process.exit(1);
}
let content = fs.readFileSync(targetPath, 'utf8');
const newStyle = `<style scoped>
/* ═══════════════════════════════════════════
PREMIUM 3D BASE - ANALYSIS V3
═══════════════════════════════════════════ */
.analysis-container {
max-width: 1400px;
margin: 0 auto;
padding: 40px 24px 120px;
}
.dashboard-grid {
display: flex;
flex-direction: column;
gap: 40px;
}
/* ═══════════════════════════════════════════
LOADING STATE - 3D SHIMMER & GLOW
═══════════════════════════════════════════ */
.loading-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 160px 0;
gap: 40px;
background: rgba(255, 255, 255, 0.4);
backdrop-filter: blur(20px);
border-radius: 32px;
border: 1px solid rgba(255, 255, 255, 0.8);
box-shadow: 0 20px 60px rgba(45, 123, 255, 0.05);
}
.loader-wrap {
position: relative;
width: 120px;
height: 120px;
display: flex;
align-items: center;
justify-content: center;
}
.loader-circle {
position: absolute;
inset: 0;
border: 2px dashed rgba(45, 123, 255, 0.2);
border-radius: 50%;
animation: spin 10s linear infinite;
}
.loader-inner-circle {
position: absolute;
inset: -10px;
border: 3px solid transparent;
border-top-color: #2D7BFF;
border-bottom-color: #8B5CF6;
border-radius: 50%;
animation: spin 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
box-shadow: 0 0 20px rgba(45, 123, 255, 0.3);
}
.loader-logo {
font-size: 14px;
z-index: 2;
box-shadow: 0 8px 24px rgba(45, 123, 255, 0.5);
background: linear-gradient(135deg, #2D7BFF, #1a6bff);
color: #fff;
width: 56px;
height: 56px;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
font-weight: 900;
letter-spacing: 0.05em;
}
.loading-info {
text-align: center;
}
.loading-title {
font-size: 18px;
font-weight: 900;
color: #0F172A;
margin-bottom: 8px;
text-transform: uppercase;
letter-spacing: 0.1em;
background: linear-gradient(135deg, #2D7BFF, #8B5CF6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
filter: drop-shadow(0 2px 4px rgba(45,123,255,0.2));
}
.loading-sub {
font-size: 14px;
color: #64748B;
max-width: 340px;
margin: 0 auto 20px;
line-height: 1.6;
font-weight: 500;
}
.loading-dots {
display: flex;
justify-content: center;
gap: 8px;
}
.loading-dots .dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: rgba(15, 23, 42, 0.1);
transition: all 0.3s;
}
.loading-dots .dot.active {
background: #2D7BFF;
transform: scale(1.5);
box-shadow: 0 0 12px rgba(45, 123, 255, 0.6);
}
/* ═══════════════════════════════════════════
ERROR STATE - PREMIUM RED
═══════════════════════════════════════════ */
.error-state {
display: flex;
flex-direction: column;
align-items: center;
padding: 120px 0;
gap: 24px;
text-align: center;
background: #fff;
border-radius: 32px;
border: 1px dashed rgba(239, 68, 68, 0.3);
box-shadow: 0 20px 40px rgba(239, 68, 68, 0.05);
}
.error-icon {
width: 80px;
height: 80px;
border-radius: 20px;
background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.02));
border: 1px solid rgba(239, 68, 68, 0.3);
display: flex;
align-items: center;
justify-content: center;
color: #EF4444;
font-size: 32px;
box-shadow: inset 0 2px 4px rgba(255,255,255,0.8), 0 8px 24px rgba(239, 68, 68, 0.15);
}
.error-title {
font-size: 24px;
font-weight: 900;
color: #0F172A;
letter-spacing: -0.02em;
}
.error-desc {
font-size: 15px;
color: #64748B;
max-width: 420px;
line-height: 1.6;
font-weight: 500;
}
.kai-btn-secondary {
margin-top: 16px;
background: #fff;
border: 1px solid rgba(15, 23, 42, 0.1);
color: #334155;
padding: 14px 28px;
border-radius: 12px;
font-size: 13px;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 0.05em;
transition: all 0.3s;
cursor: pointer;
box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
}
.kai-btn-secondary:hover {
background: #0F172A;
border-color: transparent;
color: #fff;
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
</style>`;
const startIndex = content.indexOf('<style scoped>');
const endIndex = content.indexOf('</style>') + '</style>'.length;
if (startIndex !== -1 && endIndex !== -1) {
const updatedContent = content.substring(0, startIndex) + newStyle + content.substring(endIndex);
fs.writeFileSync(targetPath, updatedContent);
console.log('MarketingAnalysisV3.vue CSS updated successfully!');
} else {
// If there's no <style scoped>, append it
fs.writeFileSync(targetPath, content + '\n' + newStyle);
console.log('MarketingAnalysisV3.vue CSS appended successfully!');
}