Spaces:
Running

ef-calc / index.html
ekowflow's picture
Add 2 files
127afa6 verified
Raw History Blame Contribute Delete
79.3 kB
<!DOCTYPE html> <html lang="fr"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Calculateur Budget Audiovisuel</title> <script src="https://cdn.tailwindcss.com"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <script> tailwind.config = { theme: { extend: { colors: { primary: '#3B82F6', secondary: '#10B981', dark: '#1F2937', light: '#F3F4F6', accent: '#F59E0B', danger: '#EF4444', success: '#10B981', purple: '#8B5CF6', indigo: '#6366F1' } } } } </script> <style> .section-header { transition: all 0.3s ease; } .section-header:hover { transform: translateY(-2px); } .cost-item { transition: all 0.2s ease; } .cost-item:hover { background-color: #f8fafc; } .summary-card { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03); transition: all 0.3s ease; } .summary-card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.05); } .progress-bar { height: 8px; border-radius: 4px; background-color: #e5e7eb; overflow: hidden; } .progress-fill { height: 100%; transition: width 0.5s ease; } .animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } .marge-positive { color: #10B981; } .marge-negative { color: #EF4444; } .financial-card { border-left: 4px solid; } .financial-card-primary { border-left-color: #3B82F6; } .financial-card-success { border-left-color: #10B981; } .financial-card-accent { border-left-color: #F59E0B; } .financial-card-purple { border-left-color: #8B5CF6; } .project-card { transition: all 0.2s ease; } .project-card:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); } .fade-enter-active, .fade-leave-active { transition: opacity 0.3s; } .fade-enter, .fade-leave-to { opacity: 0; } </style> </head> <body class="bg-gray-50 min-h-screen"> <div id="app" class="container mx-auto px-4 py-8"> <!-- Projects List View --> <div v-if="currentView === 'list'" class="projects-list"> <header class="mb-10 text-center"> <h1 class="text-4xl font-bold text-dark mb-2">Gestion des Projets</h1> <p class="text-gray-600">Liste de vos projets audiovisuels</p> </header> <div class="flex justify-between items-center mb-6"> <h2 class="text-2xl font-semibold text-dark">Mes Projets</h2> <button @click="createNewProject" class="bg-primary hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm font-medium transition-colors flex items-center"> <i class="fas fa-plus mr-2"></i> Nouveau Projet </button> </div> <div v-if="projects.length === 0" class="bg-white rounded-lg shadow-md p-8 text-center"> <i class="fas fa-folder-open text-gray-300 text-5xl mb-4"></i> <h3 class="text-xl font-medium text-gray-700 mb-2">Aucun projet enregistré</h3> <p class="text-gray-500 mb-4">Commencez par créer un nouveau projet pour démarrer</p> <button @click="createNewProject" class="bg-primary hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm font-medium transition-colors"> Créer un premier projet </button> </div> <div v-else class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"> <div v-for="project in projects" :key="project.id" class="project-card bg-white rounded-lg shadow-md overflow-hidden"> <div class="p-6"> <div class="flex justify-between items-start mb-3"> <h3 class="text-xl font-semibold text-dark truncate">{{ project.name || 'Projet sans nom' }}</h3> <span class="bg-blue-100 text-blue-800 text-xs font-medium px-2.5 py-0.5 rounded">{{ project.date || 'Non daté' }}</span> </div> <p class="text-gray-600 mb-1"><span class="font-medium">Client:</span> {{ project.client || 'Non spécifié' }}</p> <p class="text-gray-600 mb-4"><span class="font-medium">Budget:</span> {{ project.budget ? project.budget.toFixed(2) + ' €' : 'Non défini' }}</p> <div class="flex justify-between items-center mb-3"> <div> <p class="text-sm text-gray-500">Total facturé</p> <p class="text-lg font-bold">{{ calculateProjectTotal(project).toFixed(2) }} €</p> </div> <div> <p class="text-sm text-gray-500">Marge totale</p> <p class="text-lg font-bold" :class="{'text-success': calculateProjectMargin(project) >= 0, 'text-danger': calculateProjectMargin(project) < 0}"> {{ calculateProjectMargin(project).toFixed(2) }} € </p> </div> </div> <div class="mt-4 pt-4 border-t border-gray-100 flex justify-between"> <button @click="editProject(project.id)" class="text-primary hover:text-blue-700 font-medium text-sm flex items-center"> <i class="fas fa-edit mr-2"></i> Modifier </button> <button @click="confirmDeleteProject(project.id)" class="text-danger hover:text-red-700 font-medium text-sm flex items-center"> <i class="fas fa-trash-alt mr-2"></i> Supprimer </button> </div> </div> </div> </div> </div> <!-- Project Editor View --> <div v-if="currentView === 'editor'" class="project-editor"> <header class="mb-10 text-center"> <h1 class="text-4xl font-bold text-dark mb-2">Calculateur Budget Audiovisuel</h1> <p class="text-gray-600">Outil interne de calcul des coûts et marges</p> </header> <div class="flex justify-between items-center mb-6"> <h2 class="text-2xl font-semibold text-dark">{{ currentProject.name || 'Nouveau Projet' }}</h2> <div class="flex space-x-3"> <button @click="saveProject" class="bg-primary hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm font-medium transition-colors flex items-center"> <i class="fas fa-save mr-2"></i> Enregistrer </button> <button @click="returnToList" class="bg-gray-500 hover:bg-gray-600 text-white px-4 py-2 rounded-md text-sm font-medium transition-colors flex items-center"> <i class="fas fa-arrow-left mr-2"></i> Retour </button> </div> </div> <!-- Financial Summary at the top --> <div class="grid grid-cols-1 lg:grid-cols-4 gap-6 mb-10"> <!-- Total Facturé --> <div class="financial-card financial-card-primary bg-white rounded-lg shadow p-6"> <div class="flex items-center justify-between"> <div> <p class="text-sm text-gray-500">Total Facturé</p> <p class="text-2xl font-bold" id="total-estimated">0 €</p> </div> <div class="bg-blue-100 p-3 rounded-full"> <i class="fas fa-euro-sign text-primary text-xl"></i> </div> </div> <div class="mt-4 pt-4 border-t border-gray-100"> <p class="text-sm text-gray-500">Budget client</p> <p class="font-medium" id="project-budget-display">0 €</p> </div> </div> <!-- Marge Prestataires --> <div class="financial-card financial-card-success bg-white rounded-lg shadow p-6"> <div class="flex items-center justify-between"> <div> <p class="text-sm text-gray-500">Marge Prestataires</p> <p class="text-2xl font-bold" id="marge-presta-total">0 €</p> </div> <div class="bg-green-100 p-3 rounded-full"> <i class="fas fa-hand-holding-usd text-success text-xl"></i> </div> </div> <div class="mt-4 pt-4 border-t border-gray-100"> <p class="text-sm text-gray-500">Coûts prestataires</p> <p class="font-medium" id="total-presta">0 €</p> </div> </div> <!-- Marge Honoraires --> <div class="financial-card financial-card-accent bg-white rounded-lg shadow p-6"> <div class="flex items-center justify-between"> <div> <p class="text-sm text-gray-500">Marge Honoraires</p> <p class="text-2xl font-bold" id="marge-honoraires-total">0 €</p> </div> <div class="bg-yellow-100 p-3 rounded-full"> <i class="fas fa-file-invoice-dollar text-accent text-xl"></i> </div> </div> <div class="mt-4 pt-4 border-t border-gray-100"> <p class="text-sm text-gray-500">Total honoraires</p> <p class="font-medium" id="honoraires-total-summary">0 €</p> </div> </div> <!-- Marge Totale --> <div class="financial-card financial-card-purple bg-white rounded-lg shadow p-6"> <div class="flex items-center justify-between"> <div> <p class="text-sm text-gray-500">Marge Totale</p> <p class="text-2xl font-bold" id="marge-totale">0 €</p> </div> <div class="bg-purple-100 p-3 rounded-full"> <i class="fas fa-chart-line text-purple-500 text-xl"></i> </div> </div> <div class="mt-4 pt-4 border-t border-gray-100"> <p class="text-sm text-gray-500">Taux de marge</p> <p class="font-medium" id="taux-marge-summary">0%</p> </div> </div> </div> <div class="grid grid-cols-1 lg:grid-cols-3 gap-8"> <!-- Left Column - Sections --> <div class="lg:col-span-2 space-y-8"> <!-- Pre-production Section --> <div class="bg-white rounded-lg shadow-md overflow-hidden"> <div class="section-header bg-primary text-white px-6 py-4 flex justify-between items-center cursor-pointer" @click="toggleSection('preprod')"> <h2 class="text-xl font-semibold">Pré-production</h2> <i class="fas fa-chevron-down transform transition-transform duration-300" :class="{'rotate-180': !sectionsVisible.preprod}" id="preprod-arrow"></i> </div> <div class="px-6 py-4" :class="{'hidden': !sectionsVisible.preprod}" id="preprod-section"> <div class="mb-4"> <button @click="addCostItem('preprod')" class="bg-secondary hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium transition-colors"> <i class="fas fa-plus mr-2"></i>Ajouter un poste </button> </div> <div id="preprod-costs" class="space-y-3"> <!-- Cost items will be added here --> <div v-for="(item, index) in costItems.preprod" :key="item.id" class="cost-item bg-gray-50 p-4 rounded-md border border-gray-200"> <div class="flex justify-between items-start mb-3"> <div class="w-full mr-4"> <label class="block text-sm font-medium text-gray-700 mb-1">Description</label> <input type="text" v-model="item.description" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> <button @click="removeCostItem('preprod', index)" class="text-danger hover:text-red-700"> <i class="fas fa-trash"></i> </button> </div> <div class="grid grid-cols-3 gap-4 mb-3"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Prix client (€)</label> <input type="number" min="0" step="10" v-model="item.cost" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Coût presta (€)</label> <input type="number" min="0" step="10" v-model="item.prestaCost" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Quantité</label> <input type="number" min="1" v-model="item.quantity" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Notes</label> <textarea v-model="item.notes" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"></textarea> </div> <div class="mt-2 grid grid-cols-2 gap-4 text-sm"> <div> <span class="font-medium">Total client:</span> <span>{{ (item.cost * item.quantity).toFixed(2) }} €</span> </div> <div> <span class="font-medium">Total presta:</span> <span>{{ (item.prestaCost * item.quantity).toFixed(2) }} €</span> </div> </div> <div class="mt-1 text-right text-xs"> <span class="font-medium">Marge:</span> <span :class="{'text-success': (item.cost - item.prestaCost) >= 0, 'text-danger': (item.cost - item.prestaCost) < 0}"> {{ ((item.cost - item.prestaCost) * item.quantity).toFixed(2) }} € ({{ item.prestaCost > 0 ? ((item.cost - item.prestaCost) / item.prestaCost * 100).toFixed(1) : '∞' }}%) </span> </div> </div> </div> </div> </div> <!-- Production Section --> <div class="bg-white rounded-lg shadow-md overflow-hidden"> <div class="section-header bg-primary text-white px-6 py-4 flex justify-between items-center cursor-pointer" @click="toggleSection('prod')"> <h2 class="text-xl font-semibold">Production</h2> <i class="fas fa-chevron-down transform transition-transform duration-300" :class="{'rotate-180': !sectionsVisible.prod}" id="prod-arrow"></i> </div> <div class="px-6 py-4" :class="{'hidden': !sectionsVisible.prod}" id="prod-section"> <div class="mb-4"> <button @click="addCostItem('prod')" class="bg-secondary hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium transition-colors"> <i class="fas fa-plus mr-2"></i>Ajouter un poste </button> </div> <div id="prod-costs" class="space-y-3"> <div v-for="(item, index) in costItems.prod" :key="item.id" class="cost-item bg-gray-50 p-4 rounded-md border border-gray-200"> <div class="flex justify-between items-start mb-3"> <div class="w-full mr-4"> <label class="block text-sm font-medium text-gray-700 mb-1">Description</label> <input type="text" v-model="item.description" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> <button @click="removeCostItem('prod', index)" class="text-danger hover:text-red-700"> <i class="fas fa-trash"></i> </button> </div> <div class="grid grid-cols-3 gap-4 mb-3"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Prix client (€)</label> <input type="number" min="0" step="10" v-model="item.cost" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Coût presta (€)</label> <input type="number" min="0" step="10" v-model="item.prestaCost" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Quantité</label> <input type="number" min="1" v-model="item.quantity" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Notes</label> <textarea v-model="item.notes" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"></textarea> </div> <div class="mt-2 grid grid-cols-2 gap-4 text-sm"> <div> <span class="font-medium">Total client:</span> <span>{{ (item.cost * item.quantity).toFixed(2) }} €</span> </div> <div> <span class="font-medium">Total presta:</span> <span>{{ (item.prestaCost * item.quantity).toFixed(2) }} €</span> </div> </div> <div class="mt-1 text-right text-xs"> <span class="font-medium">Marge:</span> <span :class="{'text-success': (item.cost - item.prestaCost) >= 0, 'text-danger': (item.cost - item.prestaCost) < 0}"> {{ ((item.cost - item.prestaCost) * item.quantity).toFixed(2) }} € ({{ item.prestaCost > 0 ? ((item.cost - item.prestaCost) / item.prestaCost * 100).toFixed(1) : '∞' }}%) </span> </div> </div> </div> </div> </div> <!-- Post-production Section --> <div class="bg-white rounded-lg shadow-md overflow-hidden"> <div class="section-header bg-primary text-white px-6 py-4 flex justify-between items-center cursor-pointer" @click="toggleSection('postprod')"> <h2 class="text-xl font-semibold">Post-production</h2> <i class="fas fa-chevron-down transform transition-transform duration-300" :class="{'rotate-180': !sectionsVisible.postprod}" id="postprod-arrow"></i> </div> <div class="px-6 py-4" :class="{'hidden': !sectionsVisible.postprod}" id="postprod-section"> <div class="mb-4"> <button @click="addCostItem('postprod')" class="bg-secondary hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium transition-colors"> <i class="fas fa-plus mr-2"></i>Ajouter un poste </button> </div> <div id="postprod-costs" class="space-y-3"> <div v-for="(item, index) in costItems.postprod" :key="item.id" class="cost-item bg-gray-50 p-4 rounded-md border border-gray-200"> <div class="flex justify-between items-start mb-3"> <div class="w-full mr-4"> <label class="block text-sm font-medium text-gray-700 mb-1">Description</label> <input type="text" v-model="item.description" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> <button @click="removeCostItem('postprod', index)" class="text-danger hover:text-red-700"> <i class="fas fa-trash"></i> </button> </div> <div class="grid grid-cols-3 gap-4 mb-3"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Prix client (€)</label> <input type="number" min="0" step="10" v-model="item.cost" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Coût presta (€)</label> <input type="number" min="0" step="10" v-model="item.prestaCost" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Quantité</label> <input type="number" min="1" v-model="item.quantity" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Notes</label> <textarea v-model="item.notes" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"></textarea> </div> <div class="mt-2 grid grid-cols-2 gap-4 text-sm"> <div> <span class="font-medium">Total client:</span> <span>{{ (item.cost * item.quantity).toFixed(2) }} €</span> </div> <div> <span class="font-medium">Total presta:</span> <span>{{ (item.prestaCost * item.quantity).toFixed(2) }} €</span> </div> </div> <div class="mt-1 text-right text-xs"> <span class="font-medium">Marge:</span> <span :class="{'text-success': (item.cost - item.prestaCost) >= 0, 'text-danger': (item.cost - item.prestaCost) < 0}"> {{ ((item.cost - item.prestaCost) * item.quantity).toFixed(2) }} € ({{ item.prestaCost > 0 ? ((item.cost - item.prestaCost) / item.prestaCost * 100).toFixed(1) : '∞' }}%) </span> </div> </div> </div> </div> </div> <!-- Frais annexes Section --> <div class="bg-white rounded-lg shadow-md overflow-hidden"> <div class="section-header bg-accent text-white px-6 py-4 flex justify-between items-center cursor-pointer" @click="toggleSection('frais')"> <h2 class="text-xl font-semibold">Frais annexes</h2> <i class="fas fa-chevron-down transform transition-transform duration-300" :class="{'rotate-180': !sectionsVisible.frais}" id="frais-arrow"></i> </div> <div class="px-6 py-4" :class="{'hidden': !sectionsVisible.frais}" id="frais-section"> <div class="mb-4"> <button @click="addCostItem('frais')" class="bg-secondary hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium transition-colors"> <i class="fas fa-plus mr-2"></i>Ajouter des frais </button> <div class="mt-3 flex items-center"> <label for="frais-logistiques" class="text-sm text-gray-700 mr-2">Frais logistiques (%):</label> <input type="number" id="frais-logistiques" min="0" max="100" v-model="fraisLogistiquesPercent" @change="updateBudgetSummary()" class="w-16 px-2 py-1 border rounded-md text-sm"> <span class="text-sm text-gray-600 ml-1">%</span> </div> </div> <div id="frais-costs" class="space-y-3"> <div v-for="(item, index) in costItems.frais" :key="item.id" class="cost-item bg-gray-50 p-4 rounded-md border border-gray-200"> <div class="flex justify-between items-start mb-3"> <div class="w-full mr-4"> <label class="block text-sm font-medium text-gray-700 mb-1">Description</label> <input type="text" v-model="item.description" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> <button @click="removeCostItem('frais', index)" class="text-danger hover:text-red-700"> <i class="fas fa-trash"></i> </button> </div> <div class="grid grid-cols-2 gap-4 mb-3"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Prix client (€)</label> <input type="number" min="0" step="10" v-model="item.cost" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Quantité</label> <input type="number" min="1" v-model="item.quantity" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Notes</label> <textarea v-model="item.notes" @change="updateBudgetSummary()" class="w-full px-3 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"></textarea> </div> <div class="mt-2 grid grid-cols-1 gap-4 text-sm"> <div> <span class="font-medium">Total client:</span> <span>{{ (item.cost * item.quantity).toFixed(2) }} €</span> </div> </div> </div> </div> </div> </div> <!-- Dépenses imprévues Section --> <div class="bg-white rounded-lg shadow-md overflow-hidden"> <div class="section-header bg-danger text-white px-6 py-4 flex justify-between items-center cursor-pointer" @click="toggleSection('imprevu')"> <h2 class="text-xl font-semibold">Dépenses imprévues</h2> <i class="fas fa-chevron-down transform transition-transform duration-300" :class="{'rotate-180': !sectionsVisible.imprevu}" id="imprevu-arrow"></i> </div> <div class="px-6 py-4" :class="{'hidden': !sectionsVisible.imprevu}" id="imprevu-section"> <div class="mb-4"> <div class="flex items-center"> <label for="imprevu-percent" class="text-sm text-gray-700 mr-2">Pourcentage sur budget global:</label> <input type="number" id="imprevu-percent" min="0" max="100" v-model="imprevuPercent" @change="updateBudgetSummary()" class="w-16 px-2 py-1 border rounded-md text-sm"> <span class="text-sm text-gray-600 ml-1">%</span> </div> </div> <div id="imprevu-costs" class="space-y-3"> <div v-for="(item, index) in costItems.imprevu" :key="item.id" class="cost-item bg-gray-50 p-4 rounded-md border border-gray-200"> <div class="flex justify-between items-center"> <div class="font-medium">Dépenses imprévues</div> <div class="text-lg font-semibold">{{ item.cost.toFixed(2) }} €</div> </div> <div class="text-xs text-gray-500 mt-1">{{ item.notes }}</div> </div> </div> </div> </div> <!-- Honoraires Section --> <div class="bg-white rounded-lg shadow-md overflow-hidden"> <div class="section-header bg-purple-600 text-white px-6 py-4 flex justify-between items-center cursor-pointer" @click="toggleSection('honoraires')"> <h2 class="text-xl font-semibold">Nos honoraires</h2> <i class="fas fa-chevron-down transform transition-transform duration-300" :class="{'rotate-180': !sectionsVisible.honoraires}" id="honoraires-arrow"></i> </div> <div class="px-6 py-4" :class="{'hidden': !sectionsVisible.honoraires}" id="honoraires-section"> <div class="mb-4"> <div class="flex items-center"> <label for="honoraires-percent" class="text-sm text-gray-700 mr-2">Pourcentage sur budget global:</label> <input type="number" id="honoraires-percent" min="0" max="100" v-model="honorairesPercent" @change="updateBudgetSummary()" class="w-16 px-2 py-1 border rounded-md text-sm"> <span class="text-sm text-gray-600 ml-1">%</span> </div> </div> <div id="honoraires-costs" class="space-y-3"> <div v-for="(item, index) in costItems.honoraires" :key="item.id" class="cost-item bg-gray-50 p-4 rounded-md border border-gray-200"> <div class="flex justify-between items-center"> <div class="font-medium">Nos honoraires</div> <div class="text-lg font-semibold">{{ item.cost.toFixed(2) }} €</div> </div> <div class="text-xs text-gray-500 mt-1">{{ item.notes }}</div> </div> </div> </div> </div> </div> <!-- Right Column - Summary and Project Info --> <div class="space-y-6"> <!-- Project Info Card --> <div class="bg-white rounded-lg shadow-md p-6 summary-card"> <h2 class="text-xl font-semibold text-dark mb-4">Informations projet</h2> <div class="space-y-4"> <div> <label for="project-name" class="block text-sm font-medium text-gray-700 mb-1">Nom du projet</label> <input type="text" id="project-name" v-model="currentProject.name" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> <div> <label for="project-client" class="block text-sm font-medium text-gray-700 mb-1">Client</label> <input type="text" id="project-client" v-model="currentProject.client" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> <div> <label for="project-date" class="block text-sm font-medium text-gray-700 mb-1">Date de livraison</label> <input type="date" id="project-date" v-model="currentProject.date" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> <div> <label for="project-budget" class="block text-sm font-medium text-gray-700 mb-1">Budget client (€)</label> <input type="number" id="project-budget" min="0" step="100" v-model="currentProject.budget" @change="updateBudgetSummary()" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary text-sm"> </div> </div> </div> <!-- Detailed Financial Summary --> <div class="bg-white rounded-lg shadow-md p-6 summary-card"> <h2 class="text-xl font-semibold text-dark mb-4">Détails financiers</h2> <div class="space-y-4"> <div class="grid grid-cols-2 gap-4"> <div class="bg-gray-50 p-3 rounded-md"> <p class="text-sm text-gray-600">Pré-production</p> <p class="font-medium">{{ calculateSectionTotals('preprod').clientTotal.toFixed(2) }} €</p> <p class="text-xs text-gray-500">Presta: {{ calculateSectionTotals('preprod').prestaTotal.toFixed(2) }} €</p> <p class="text-xs text-success">Marge: {{ (calculateSectionTotals('preprod').clientTotal - calculateSectionTotals('preprod').prestaTotal).toFixed(2) }} €</p> </div> <div class="bg-gray-50 p-3 rounded-md"> <p class="text-sm text-gray-600">Production</p> <p class="font-medium">{{ calculateSectionTotals('prod').clientTotal.toFixed(2) }} €</p> <p class="text-xs text-gray-500">Presta: {{ calculateSectionTotals('prod').prestaTotal.toFixed(2) }} €</p> <p class="text-xs text-success">Marge: {{ (calculateSectionTotals('prod').clientTotal - calculateSectionTotals('prod').prestaTotal).toFixed(2) }} €</p> </div> <div class="bg-gray-50 p-3 rounded-md"> <p class="text-sm text-gray-600">Post-production</p> <p class="font-medium">{{ calculateSectionTotals('postprod').clientTotal.toFixed(2) }} €</p> <p class="text-xs text-gray-500">Presta: {{ calculateSectionTotals('postprod').prestaTotal.toFixed(2) }} €</p> <p class="text-xs text-success">Marge: {{ (calculateSectionTotals('postprod').clientTotal - calculateSectionTotals('postprod').prestaTotal).toFixed(2) }} €</p> </div> <div class="bg-gray-50 p-3 rounded-md"> <p class="text-sm text-gray-600">Frais annexes</p> <p class="font-medium">{{ calculateSectionTotals('frais').clientTotal.toFixed(2) }} €</p> <p class="text-xs text-gray-500">Logistique: {{ (calculateSectionTotals('frais').clientTotal * fraisLogistiquesPercent / 100).toFixed(2) }} €</p> <p class="text-xs text-success">Gain: {{ (calculateSectionTotals('frais').clientTotal - (calculateSectionTotals('frais').clientTotal * fraisLogistiquesPercent / 100)).toFixed(2) }} €</p> </div> </div> <div class="bg-gray-50 p-3 rounded-md"> <div class="flex justify-between"> <p class="text-sm text-gray-600">Imprévus ({{ imprevuPercent }}%)</p> <p class="font-medium">{{ calculateSectionTotals('imprevu').clientTotal.toFixed(2) }} €</p> </div> <div class="flex justify-between mt-1"> <p class="text-xs text-gray-500">Marge imprévus</p> <p class="text-xs text-success">{{ (calculateSectionTotals('imprevu').clientTotal - calculateSectionTotals('imprevu').prestaTotal).toFixed(2) }} €</p> </div> </div> <div class="bg-gray-50 p-3 rounded-md"> <div class="flex justify-between"> <p class="text-sm text-gray-600">Honoraires ({{ honorairesPercent }}%)</p> <p class="font-medium">{{ calculateSectionTotals('honoraires').clientTotal.toFixed(2) }} €</p> </div> <div class="flex justify-between mt-1"> <p class="text-xs text-gray-500">Marge honoraires</p> <p class="text-xs text-success">{{ calculateSectionTotals('honoraires').clientTotal.toFixed(2) }} €</p> </div> </div> <div class="border-t border-gray-200 pt-4 mt-2"> <div class="flex justify-between"> <p class="text-sm text-gray-600">Frais logistiques</p> <p class="font-medium">{{ (calculateSectionTotals('frais').clientTotal * fraisLogistiquesPercent / 100).toFixed(2) }} €</p> </div> <div class="flex justify-between mt-2"> <p class="text-sm text-gray-600">Marge prestataires</p> <p class="font-medium text-success">{{ (calculateSectionTotals('preprod').clientTotal - calculateSectionTotals('preprod').prestaTotal + calculateSectionTotals('prod').clientTotal - calculateSectionTotals('prod').prestaTotal + calculateSectionTotals('postprod').clientTotal - calculateSectionTotals('postprod').prestaTotal).toFixed(2) }} €</p> </div> <div class="flex justify-between mt-2"> <p class="text-sm text-gray-600">Marge totale</p> <p class="font-medium text-purple-600">{{ calculateTotalMargin().toFixed(2) }} €</p> </div> </div> <div class="mt-4"> <div class="flex justify-between text-sm mb-1"> <span>Utilisation du budget:</span> <span>{{ calculateBudgetUsage() }}%</span> </div> <div class="progress-bar"> <div id="budget-progress" class="progress-fill" :class="{'bg-primary': calculateBudgetUsage() <= 70, 'bg-accent': calculateBudgetUsage() > 70 && calculateBudgetUsage() <= 90, 'bg-danger': calculateBudgetUsage() > 90}" :style="'width: ' + calculateBudgetUsage() + '%'"></div> </div> </div> <div id="budget-alert" class="hidden mt-3 p-3 rounded-md text-sm"></div> </div> </div> <!-- Export Options --> <div class="bg-white rounded-lg shadow-md p-6 summary-card"> <h2 class="text-xl font-semibold text-dark mb-4">Export</h2> <div class="space-y-3"> <button @click="generatePDF" class="w-full bg-primary hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm font-medium transition-colors flex items-center justify-center"> <i class="fas fa-file-pdf mr-2"></i> Générer PDF </button> <button @click="exportToExcel" class="w-full bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium transition-colors flex items-center justify-center"> <i class="fas fa-file-excel mr-2"></i> Exporter Excel </button> <button @click="copyToClipboard" class="w-full bg-gray-600 hover:bg-gray-700 text-white px-4 py-2 rounded-md text-sm font-medium transition-colors flex items-center justify-center"> <i class="fas fa-copy mr-2"></i> Copier le résumé </button> </div> </div> </div> </div> </div> <!-- Delete Confirmation Modal --> <div v-if="showDeleteModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"> <div class="bg-white rounded-lg shadow-xl p-6 w-full max-w-md"> <h3 class="text-xl font-semibold text-dark mb-4">Confirmer la suppression</h3> <p class="text-gray-600 mb-6">Êtes-vous sûr de vouloir supprimer ce projet ? Cette action est irréversible.</p> <div class="flex justify-end space-x-4"> <button @click="showDeleteModal = false" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50"> Annuler </button> <button @click="deleteProject" class="px-4 py-2 bg-danger hover:bg-red-700 text-white rounded-md text-sm font-medium"> Supprimer </button> </div> </div> </div> </div> <script src="https://cdn.jsdelivr.net/npm/vue@3.2.47/dist/vue.global.min.js"></script> <script> const { createApp, ref, reactive, computed, onMounted } = Vue; createApp({ setup() { // State management const currentView = ref('list'); const projects = ref([]); const currentProject = reactive({ id: null, name: '', client: '', date: '', budget: 0, costItems: { preprod: [], prod: [], postprod: [], frais: [], imprevu: [], honoraires: [] }, settings: { fraisLogistiquesPercent: 5, imprevuPercent: 10, honorairesPercent: 15 } }); // UI state const sectionsVisible = reactive({ preprod: true, prod: true, postprod: true, frais: true, imprevu: true, honoraires: true }); const showDeleteModal = ref(false); const projectToDelete = ref(null); // Computed properties for form bindings const fraisLogistiquesPercent = computed({ get: () => currentProject.settings.fraisLogistiquesPercent, set: (value) => { currentProject.settings.fraisLogistiquesPercent = parseFloat(value) || 0; updateBudgetSummary(); } }); const imprevuPercent = computed({ get: () => currentProject.settings.imprevuPercent, set: (value) => { currentProject.settings.imprevuPercent = parseFloat(value) || 0; updateBudgetSummary(); } }); const honorairesPercent = computed({ get: () => currentProject.settings.honorairesPercent, set: (value) => { currentProject.settings.honorairesPercent = parseFloat(value) || 0; updateBudgetSummary(); } }); // Cost items proxy for easier access const costItems = computed(() => currentProject.costItems); // Initialize the app onMounted(() => { loadProjects(); // Set today's date as default const today = new Date().toISOString().split('T')[0]; currentProject.date = today; // Load sample data if no projects exist if (projects.value.length === 0) { loadSampleData(); } }); // Navigation functions function createNewProject() { resetCurrentProject(); currentView.value = 'editor'; } function editProject(projectId) { const project = projects.value.find(p => p.id === projectId); if (project) { Object.assign(currentProject, JSON.parse(JSON.stringify(project))); currentView.value = 'editor'; } } function returnToList() { currentView.value = 'list'; } // Project CRUD operations function loadProjects() { const savedProjects = localStorage.getItem('av_projects'); if (savedProjects) { projects.value = JSON.parse(savedProjects); } } function saveProjects() { localStorage.setItem('av_projects', JSON.stringify(projects.value)); } function saveProject() { if (!currentProject.id) { // New project - generate ID currentProject.id = Date.now(); projects.value.push(JSON.parse(JSON.stringify(currentProject))); } else { // Existing project - update const index = projects.value.findIndex(p => p.id === currentProject.id); if (index !== -1) { projects.value[index] = JSON.parse(JSON.stringify(currentProject)); } } saveProjects(); // Show success message const alertEl = document.getElementById('budget-alert'); alertEl.innerHTML = ` <div class="bg-success text-white"> <i class="fas fa-check-circle mr-2"></i> Projet enregistré avec succès </div> `; alertEl.classList.remove('hidden'); setTimeout(() => { alertEl.classList.add('hidden'); }, 3000); } function confirmDeleteProject(projectId) { projectToDelete.value = projectId; showDeleteModal.value = true; } function deleteProject() { projects.value = projects.value.filter(p => p.id !== projectToDelete.value); saveProjects(); showDeleteModal.value = false; projectToDelete.value = null; } function resetCurrentProject() { currentProject.id = null; currentProject.name = ''; currentProject.client = ''; currentProject.date = new Date().toISOString().split('T')[0]; currentProject.budget = 0; currentProject.costItems = { preprod: [], prod: [], postprod: [], frais: [], imprevu: [], honoraires: [] }; currentProject.settings = { fraisLogistiquesPercent: 5, imprevuPercent: 10, honorairesPercent: 15 }; } // Cost items management function addCostItem(section) { const newItem = { id: Date.now(), description: '', cost: 0, prestaCost: section === 'frais' ? 0 : 0, quantity: 1, notes: '' }; currentProject.costItems[section].push(newItem); updateBudgetSummary(); } function removeCostItem(section, index) { currentProject.costItems[section].splice(index, 1); updateBudgetSummary(); } function toggleSection(section) { sectionsVisible[section] = !sectionsVisible[section]; } // Calculations function calculateSectionTotals(section) { const clientTotal = currentProject.costItems[section].reduce((total, item) => { return total + (item.cost * item.quantity); }, 0); const prestaTotal = currentProject.costItems[section].reduce((total, item) => { return total + (item.prestaCost * item.quantity); }, 0); return { clientTotal, prestaTotal }; } function calculateProjectTotal(project) { const preprod = project.costItems.preprod.reduce((sum, item) => sum + (item.cost * item.quantity), 0); const prod = project.costItems.prod.reduce((sum, item) => sum + (item.cost * item.quantity), 0); const postprod = project.costItems.postprod.reduce((sum, item) => sum + (item.cost * item.quantity), 0); const frais = project.costItems.frais.reduce((sum, item) => sum + (item.cost * item.quantity), 0); const imprevu = project.costItems.imprevu.reduce((sum, item) => sum + (item.cost * item.quantity), 0); const honoraires = project.costItems.honoraires.reduce((sum, item) => sum + (item.cost * item.quantity), 0); return preprod + prod + postprod + frais + imprevu + honoraires; } function calculateProjectMargin(project) { const preprod = project.costItems.preprod.reduce((sum, item) => sum + ((item.cost - item.prestaCost) * item.quantity), 0); const prod = project.costItems.prod.reduce((sum, item) => sum + ((item.cost - item.prestaCost) * item.quantity), 0); const postprod = project.costItems.postprod.reduce((sum, item) => sum + ((item.cost - item.prestaCost) * item.quantity), 0); const fraisTotal = project.costItems.frais.reduce((sum, item) => sum + (item.cost * item.quantity), 0); const fraisGain = fraisTotal - (fraisTotal * (project.settings.fraisLogistiquesPercent / 100)); const imprevuTotal = project.costItems.imprevu.reduce((sum, item) => sum + (item.cost * item.quantity), 0); const imprevuGain = imprevuTotal - imprevuTotal; // No gain on imprevu const honorairesTotal = project.costItems.honoraires.reduce((sum, item) => sum + (item.cost * item.quantity), 0); return preprod + prod + postprod + fraisGain + imprevuGain + honorairesTotal; } function calculateTotalMargin() { return calculateProjectMargin(currentProject); } function calculateBudgetUsage() { if (currentProject.budget <= 0) return 0; const total = calculateProjectTotal(currentProject); const percentage = (total / currentProject.budget) * 100; return Math.min(percentage, 100); } function updateBudgetSummary() { // Update imprevu costs updateImprevuCosts(); // Update honoraires costs updateHonorairesCosts(); } function updateImprevuCosts() { const percent = currentProject.settings.imprevuPercent; const otherSectionsClientTotal = calculateSectionTotals('preprod').clientTotal + calculateSectionTotals('prod').clientTotal + calculateSectionTotals('postprod').clientTotal + calculateSectionTotals('frais').clientTotal; const imprevuClientTotal = otherSectionsClientTotal * (percent / 100); // If there are no imprevu items, create one if (currentProject.costItems.imprevu.length === 0) { const newItem = { id: Date.now(), description: 'Dépenses imprévues', cost: imprevuClientTotal, prestaCost: imprevuClientTotal, quantity: 1, notes: `Calculé automatiquement (${percent}% du budget global)` }; currentProject.costItems.imprevu.push(newItem); } else { // Update the first imprevu item (we assume it's the auto-calculated one) const item = currentProject.costItems.imprevu[0]; item.cost = imprevuClientTotal; item.prestaCost = imprevuClientTotal; item.notes = `Calculé automatiquement (${percent}% du budget global)`; } } function updateHonorairesCosts() { const percent = currentProject.settings.honorairesPercent; const otherSectionsClientTotal = calculateSectionTotals('preprod').clientTotal + calculateSectionTotals('prod').clientTotal + calculateSectionTotals('postprod').clientTotal + calculateSectionTotals('frais').clientTotal + calculateSectionTotals('imprevu').clientTotal; const honorairesClientTotal = otherSectionsClientTotal * (percent / 100); // If there are no honoraires items, create one if (currentProject.costItems.honoraires.length === 0) { const newItem = { id: Date.now(), description: 'Nos honoraires', cost: honorairesClientTotal, prestaCost: 0, quantity: 1, notes: `Calculé automatiquement (${percent}% du budget global)` }; currentProject.costItems.honoraires.push(newItem); } else { // Update the first honoraires item (we assume it's the auto-calculated one) const item = currentProject.costItems.honoraires[0]; item.cost = honorairesClientTotal; item.notes = `Calculé automatiquement (${percent}% du budget global)`; } } // Export functions function generatePDF() { alert('Fonctionnalité PDF à implémenter'); } function exportToExcel() { alert('Fonctionnalité Excel à implémenter'); } function copyToClipboard() { const projectName = currentProject.name || 'Sans nom'; const client = currentProject.client || 'Non spécifié'; const date = currentProject.date || 'Non spécifiée'; const budget = currentProject.budget || 0; const preprodTotals = calculateSectionTotals('preprod'); const prodTotals = calculateSectionTotals('prod'); const postprodTotals = calculateSectionTotals('postprod'); const fraisTotals = calculateSectionTotals('frais'); const imprevuTotals = calculateSectionTotals('imprevu'); const honorairesTotals = calculateSectionTotals('honoraires'); const fraisLogistiquesTotal = fraisTotals.clientTotal * (currentProject.settings.fraisLogistiquesPercent / 100); const clientTotal = preprodTotals.clientTotal + prodTotals.clientTotal + postprodTotals.clientTotal + fraisTotals.clientTotal + imprevuTotals.clientTotal + honorairesTotals.clientTotal; const prestaTotal = preprodTotals.prestaTotal + prodTotals.prestaTotal + postprodTotals.prestaTotal + imprevuTotals.prestaTotal; const totalCosts = prestaTotal + fraisLogistiquesTotal; const margeBrute = clientTotal - totalCosts; const tauxMarge = totalCosts > 0 ? (margeBrute / totalCosts * 100) : (clientTotal > 0 ? Infinity : 0); // Calculate margins for each section const preprodMarge = preprodTotals.clientTotal - preprodTotals.prestaTotal; const prodMarge = prodTotals.clientTotal - prodTotals.prestaTotal; const postprodMarge = postprodTotals.clientTotal - postprodTotals.prestaTotal; const fraisGain = fraisTotals.clientTotal - fraisLogistiquesTotal; const imprevuMarge = imprevuTotals.clientTotal - imprevuTotals.prestaTotal; const honorairesMarge = honorairesTotals.clientTotal; const margePrestaTotal = preprodMarge + prodMarge + postprodMarge; const margeHonorairesTotal = honorairesMarge; const margeTotale = margePrestaTotal + margeHonorairesTotal + fraisGain + imprevuMarge; const text = `Résumé du projet: ${projectName} Client: ${client} Date de livraison: ${date} Budget client: ${budget.toFixed(2)} € Détails des coûts: - Pré-production: ${preprodTotals.clientTotal.toFixed(2)} € (Presta: ${preprodTotals.prestaTotal.toFixed(2)} €, Marge: ${preprodMarge.toFixed(2)} €) - Production: ${prodTotals.clientTotal.toFixed(2)} € (Presta: ${prodTotals.prestaTotal.toFixed(2)} €, Marge: ${prodMarge.toFixed(2)} €) - Post-production: ${postprodTotals.clientTotal.toFixed(2)} € (Presta: ${postprodTotals.prestaTotal.toFixed(2)} €, Marge: ${postprodMarge.toFixed(2)} €) - Frais annexes: ${fraisTotals.clientTotal.toFixed(2)} € (Logistique: ${fraisLogistiquesTotal.toFixed(2)} €, Gain: ${fraisGain.toFixed(2)} €) - Imprévus: ${imprevuTotals.clientTotal.toFixed(2)} € (Marge: ${imprevuMarge.toFixed(2)} €) - Honoraires: ${honorairesTotals.clientTotal.toFixed(2)} € (Marge: ${honorairesMarge.toFixed(2)} €) TOTAL FACTURÉ CLIENT: ${clientTotal.toFixed(2)} € TOTAL COÛTS PRESTATAIRES: ${prestaTotal.toFixed(2)} € FRAIS LOGISTIQUES: ${fraisLogistiquesTotal.toFixed(2)} € MARGE PRESTATAIRES: ${margePrestaTotal.toFixed(2)} € MARGE HONORAIRES: ${margeHonorairesTotal.toFixed(2)} € MARGE TOTALE: ${margeTotale.toFixed(2)} € (${isFinite(tauxMarge) ? tauxMarge.toFixed(1) : '∞'}%) `; navigator.clipboard.writeText(text).then(() => { const alertEl = document.getElementById('budget-alert'); alertEl.innerHTML = ` <div class="bg-success text-white"> <i class="fas fa-check-circle mr-2"></i> Résumé copié dans le presse-papier </div> `; alertEl.classList.remove('hidden'); setTimeout(() => { alertEl.classList.add('hidden'); }, 3000); }); } // Sample data for demo function loadSampleData() { // Pre-production addCostItem('preprod'); currentProject.costItems.preprod[0].description = 'Écriture du scénario'; currentProject.costItems.preprod[0].cost = 1200; currentProject.costItems.preprod[0].prestaCost = 800; addCostItem('preprod'); currentProject.costItems.preprod[1].description = 'Repérages'; currentProject.costItems.preprod[1].cost = 800; currentProject.costItems.preprod[1].prestaCost = 500; currentProject.costItems.preprod[1].quantity = 2; // Production addCostItem('prod'); currentProject.costItems.prod[0].description = 'Tournage - Équipe technique'; currentProject.costItems.prod[0].cost = 2500; currentProject.costItems.prod[0].prestaCost = 1800; currentProject.costItems.prod[0].quantity = 3; addCostItem('prod'); currentProject.costItems.prod[1].description = 'Location matériel'; currentProject.costItems.prod[1].cost = 1800; currentProject.costItems.prod[1].prestaCost = 1500; // Post-production addCostItem('postprod'); currentProject.costItems.postprod[0].description = 'Montage vidéo'; currentProject.costItems.postprod[0].cost = 2000; currentProject.costItems.postprod[0].prestaCost = 1200; addCostItem('postprod'); currentProject.costItems.postprod[1].description = 'Étalonnage'; currentProject.costItems.postprod[1].cost = 1500; currentProject.costItems.postprod[1].prestaCost = 1000; // Frais annexes addCostItem('frais'); currentProject.costItems.frais[0].description = 'Déplacements'; currentProject.costItems.frais[0].cost = 500; // Set initial budget currentProject.budget = 20000; currentProject.name = "Projet Démo"; currentProject.client = "Client Test"; // Update everything updateBudgetSummary(); } return { currentView, projects, currentProject, sectionsVisible, showDeleteModal, fraisLogistiquesPercent, imprevuPercent, honorairesPercent, costItems, createNewProject, editProject, returnToList, saveProject, confirmDeleteProject, deleteProject, addCostItem, removeCostItem, toggleSection, calculateSectionTotals, calculateProjectTotal, calculateProjectMargin, calculateTotalMargin, calculateBudgetUsage, updateBudgetSummary, generatePDF, exportToExcel, copyToClipboard }; } }).mount('#app'); </script> <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=ekowflow/ef-calc" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> </html>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculateur Budget Audiovisuel</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#3B82F6',
secondary: '#10B981',
dark: '#1F2937',
light: '#F3F4F6',
accent: '#F59E0B',
danger: '#EF4444',
success: '#10B981',
purple: '#8B5CF6',
indigo: '#6366F1'
}
}
}
}
</script>
<style>
.section-header {
transition: all 0.3s ease;
}
.section-header:hover {
transform: translateY(-2px);
}
.cost-item {
transition: all 0.2s ease;
}
.cost-item:hover {
background-color: #f8fafc;
}
.summary-card {
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
transition: all 0.3s ease;
}
.summary-card:hover {
transform: translateY(-3px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.progress-bar {
height: 8px;
border-radius: 4px;
background-color: #e5e7eb;
overflow: hidden;
}
.progress-fill {
height: 100%;
transition: width 0.5s ease;
}
.animate-pulse {
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.marge-positive {
color: #10B981;
}
.marge-negative {
color: #EF4444;
}
.financial-card {
border-left: 4px solid;
}
.financial-card-primary {
border-left-color: #3B82F6;
}
.financial-card-success {
border-left-color: #10B981;
}
.financial-card-accent {
border-left-color: #F59E0B;
}
.financial-card-purple {
border-left-color: #8B5CF6;
}
.project-card {
transition: all 0.2s ease;
}
.project-card:hover {
transform: translateY(-2px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.fade-enter-active, .fade-leave-active {
transition: opacity 0.3s;
}
.fade-enter, .fade-leave-to {
opacity: 0;
}
</style>