Spaces:
Running
Running
Add 3 files
Browse files- README.md +6 -4
- index.html +400 -19
- prompts.txt +1 -0
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
colorFrom: gray
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: gen-scenario
|
3 |
+
emoji: 🐳
|
4 |
colorFrom: gray
|
5 |
+
colorTo: purple
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,400 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="fr">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Maître du Jeu - Outil de Scénario</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
.fade-in {
|
11 |
+
animation: fadeIn 0.5s ease-in-out;
|
12 |
+
}
|
13 |
+
@keyframes fadeIn {
|
14 |
+
from { opacity: 0; transform: translateY(10px); }
|
15 |
+
to { opacity: 1; transform: translateY(0); }
|
16 |
+
}
|
17 |
+
.scene-card:hover {
|
18 |
+
transform: translateY(-5px);
|
19 |
+
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
|
20 |
+
}
|
21 |
+
.marker {
|
22 |
+
width: 12px;
|
23 |
+
height: 12px;
|
24 |
+
border-radius: 50%;
|
25 |
+
display: inline-block;
|
26 |
+
margin-right: 8px;
|
27 |
+
}
|
28 |
+
</style>
|
29 |
+
</head>
|
30 |
+
<body class="bg-gray-100 font-sans">
|
31 |
+
<div class="container mx-auto px-4 py-8">
|
32 |
+
<!-- Header -->
|
33 |
+
<header class="mb-10 text-center">
|
34 |
+
<h1 class="text-4xl font-bold text-indigo-800 mb-2">
|
35 |
+
<i class="fas fa-dragon mr-3"></i> Outil de Scénario RPG
|
36 |
+
</h1>
|
37 |
+
<p class="text-lg text-gray-600">Affinez votre aventure pour captiver vos joueurs</p>
|
38 |
+
</header>
|
39 |
+
|
40 |
+
<!-- Main Dashboard -->
|
41 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
42 |
+
<!-- Scenario Editor -->
|
43 |
+
<div class="lg:col-span-2 bg-white rounded-xl shadow-lg p-6 fade-in">
|
44 |
+
<div class="flex justify-between items-center mb-6">
|
45 |
+
<h2 class="text-2xl font-semibold text-gray-800">
|
46 |
+
<i class="fas fa-scroll mr-2 text-amber-600"></i> Éditeur de Scénario
|
47 |
+
</h2>
|
48 |
+
<button id="saveBtn" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg transition">
|
49 |
+
<i class="fas fa-save mr-2"></i> Enregistrer
|
50 |
+
</button>
|
51 |
+
</div>
|
52 |
+
|
53 |
+
<div class="mb-6">
|
54 |
+
<label class="block text-gray-700 mb-2 font-medium">Titre du Scénario</label>
|
55 |
+
<input type="text" id="scenarioTitle" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500" placeholder="L'Énigme du Pharaon Oublié">
|
56 |
+
</div>
|
57 |
+
|
58 |
+
<div class="mb-6">
|
59 |
+
<label class="block text-gray-700 mb-2 font-medium">Style de Jeu</label>
|
60 |
+
<div class="grid grid-cols-3 gap-3">
|
61 |
+
<button class="style-btn px-4 py-2 border rounded-lg hover:bg-gray-50" data-style="action">
|
62 |
+
<i class="fas fa-fist-raised mr-2 text-red-500"></i> Action
|
63 |
+
</button>
|
64 |
+
<button class="style-btn px-4 py-2 border rounded-lg hover:bg-gray-50" data-style="mystere">
|
65 |
+
<i class="fas fa-search mr-2 text-blue-500"></i> Mystère
|
66 |
+
</button>
|
67 |
+
<button class="style-btn px-4 py-2 border rounded-lg hover:bg-gray-50" data-style="drame">
|
68 |
+
<i class="fas fa-theater-masks mr-2 text-purple-500"></i> Drame
|
69 |
+
</button>
|
70 |
+
</div>
|
71 |
+
</div>
|
72 |
+
|
73 |
+
<div class="mb-6">
|
74 |
+
<label class="block text-gray-700 mb-2 font-medium">Description</label>
|
75 |
+
<textarea id="scenarioDesc" rows="4" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500" placeholder="Décrivez l'ambiance générale, les enjeux principaux..."></textarea>
|
76 |
+
</div>
|
77 |
+
|
78 |
+
<div class="mb-6">
|
79 |
+
<div class="flex justify-between items-center mb-2">
|
80 |
+
<label class="block text-gray-700 font-medium">Scènes</label>
|
81 |
+
<button id="addSceneBtn" class="text-indigo-600 hover:text-indigo-800">
|
82 |
+
<i class="fas fa-plus-circle mr-1"></i> Ajouter une scène
|
83 |
+
</button>
|
84 |
+
</div>
|
85 |
+
<div id="scenesContainer" class="space-y-4">
|
86 |
+
<!-- Scenes will be added here dynamically -->
|
87 |
+
</div>
|
88 |
+
</div>
|
89 |
+
</div>
|
90 |
+
|
91 |
+
<!-- Player Preferences & Tools -->
|
92 |
+
<div class="space-y-6">
|
93 |
+
<!-- Player Preferences -->
|
94 |
+
<div class="bg-white rounded-xl shadow-lg p-6 fade-in">
|
95 |
+
<h2 class="text-xl font-semibold text-gray-800 mb-4">
|
96 |
+
<i class="fas fa-users mr-2 text-blue-500"></i> Préférences des Joueurs
|
97 |
+
</h2>
|
98 |
+
|
99 |
+
<div class="mb-4">
|
100 |
+
<label class="block text-gray-700 mb-2">Style préféré</label>
|
101 |
+
<div class="flex items-center space-x-4">
|
102 |
+
<div class="flex items-center">
|
103 |
+
<input type="radio" id="prefCombat" name="playerPref" class="mr-2" checked>
|
104 |
+
<label for="prefCombat">Combat</label>
|
105 |
+
</div>
|
106 |
+
<div class="flex items-center">
|
107 |
+
<input type="radio" id="prefRoleplay" name="playerPref" class="mr-2">
|
108 |
+
<label for="prefRoleplay">Roleplay</label>
|
109 |
+
</div>
|
110 |
+
<div class="flex items-center">
|
111 |
+
<input type="radio" id="prefPuzzle" name="playerPref" class="mr-2">
|
112 |
+
<label for="prefPuzzle">Énigmes</label>
|
113 |
+
</div>
|
114 |
+
</div>
|
115 |
+
</div>
|
116 |
+
|
117 |
+
<div class="mb-4">
|
118 |
+
<label class="block text-gray-700 mb-2">Niveau d'immersion</label>
|
119 |
+
<input type="range" min="1" max="5" value="3" class="w-full">
|
120 |
+
<div class="flex justify-between text-xs text-gray-500 mt-1">
|
121 |
+
<span>Léger</span>
|
122 |
+
<span>Moyen</span>
|
123 |
+
<span>Profond</span>
|
124 |
+
</div>
|
125 |
+
</div>
|
126 |
+
|
127 |
+
<div>
|
128 |
+
<label class="block text-gray-700 mb-2">Notes spéciales</label>
|
129 |
+
<textarea class="w-full px-3 py-2 border border-gray-300 rounded-lg" rows="3" placeholder="Allergies, limites, attentes..."></textarea>
|
130 |
+
</div>
|
131 |
+
</div>
|
132 |
+
|
133 |
+
<!-- Scenario Analysis -->
|
134 |
+
<div class="bg-white rounded-xl shadow-lg p-6 fade-in">
|
135 |
+
<h2 class="text-xl font-semibold text-gray-800 mb-4">
|
136 |
+
<i class="fas fa-chart-pie mr-2 text-green-500"></i> Analyse du Scénario
|
137 |
+
</h2>
|
138 |
+
|
139 |
+
<div class="space-y-3">
|
140 |
+
<div class="flex items-center">
|
141 |
+
<div class="w-8 h-8 bg-indigo-100 rounded-full flex items-center justify-center mr-3">
|
142 |
+
<i class="fas fa-balance-scale text-indigo-600"></i>
|
143 |
+
</div>
|
144 |
+
<div class="flex-1">
|
145 |
+
<div class="flex justify-between">
|
146 |
+
<span class="text-sm font-medium">Équilibre</span>
|
147 |
+
<span class="text-xs text-gray-500">60%</span>
|
148 |
+
</div>
|
149 |
+
<div class="w-full bg-gray-200 rounded-full h-1.5">
|
150 |
+
<div class="bg-indigo-600 h-1.5 rounded-full" style="width: 60%"></div>
|
151 |
+
</div>
|
152 |
+
</div>
|
153 |
+
</div>
|
154 |
+
|
155 |
+
<div class="flex items-center">
|
156 |
+
<div class="w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center mr-3">
|
157 |
+
<i class="fas fa-running text-blue-600"></i>
|
158 |
+
</div>
|
159 |
+
<div class="flex-1">
|
160 |
+
<div class="flex justify-between">
|
161 |
+
<span class="text-sm font-medium">Rythme</span>
|
162 |
+
<span class="text-xs text-gray-500">45%</span>
|
163 |
+
</div>
|
164 |
+
<div class="w-full bg-gray-200 rounded-full h-1.5">
|
165 |
+
<div class="bg-blue-600 h-1.5 rounded-full" style="width: 45%"></div>
|
166 |
+
</div>
|
167 |
+
</div>
|
168 |
+
</div>
|
169 |
+
|
170 |
+
<div class="flex items-center">
|
171 |
+
<div class="w-8 h-8 bg-purple-100 rounded-full flex items-center justify-center mr-3">
|
172 |
+
<i class="fas fa-heart text-purple-600"></i>
|
173 |
+
</div>
|
174 |
+
<div class="flex-1">
|
175 |
+
<div class="flex justify-between">
|
176 |
+
<span class="text-sm font-medium">Engagement</span>
|
177 |
+
<span class="text-xs text-gray-500">75%</span>
|
178 |
+
</div>
|
179 |
+
<div class="w-full bg-gray-200 rounded-full h-1.5">
|
180 |
+
<div class="bg-purple-600 h-1.5 rounded-full" style="width: 75%"></div>
|
181 |
+
</div>
|
182 |
+
</div>
|
183 |
+
</div>
|
184 |
+
</div>
|
185 |
+
|
186 |
+
<button id="analyzeBtn" class="mt-4 w-full bg-indigo-600 hover:bg-indigo-700 text-white py-2 rounded-lg transition">
|
187 |
+
<i class="fas fa-magic mr-2"></i> Optimiser automatiquement
|
188 |
+
</button>
|
189 |
+
</div>
|
190 |
+
</div>
|
191 |
+
</div>
|
192 |
+
</div>
|
193 |
+
|
194 |
+
<!-- Scene Template (Hidden) -->
|
195 |
+
<template id="sceneTemplate">
|
196 |
+
<div class="scene-card bg-gray-50 border border-gray-200 rounded-lg p-4 transition duration-300">
|
197 |
+
<div class="flex justify-between items-start mb-3">
|
198 |
+
<div>
|
199 |
+
<span class="marker bg-indigo-500"></span>
|
200 |
+
<input type="text" class="scene-title font-medium bg-transparent border-b border-dashed border-gray-300 focus:border-indigo-500 focus:outline-none" placeholder="Titre de la scène">
|
201 |
+
</div>
|
202 |
+
<div class="flex space-x-2">
|
203 |
+
<button class="scene-move-up text-gray-400 hover:text-indigo-600">
|
204 |
+
<i class="fas fa-arrow-up"></i>
|
205 |
+
</button>
|
206 |
+
<button class="scene-move-down text-gray-400 hover:text-indigo-600">
|
207 |
+
<i class="fas fa-arrow-down"></i>
|
208 |
+
</button>
|
209 |
+
<button class="scene-delete text-gray-400 hover:text-red-600">
|
210 |
+
<i class="fas fa-trash"></i>
|
211 |
+
</button>
|
212 |
+
</div>
|
213 |
+
</div>
|
214 |
+
<textarea class="scene-desc w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500" rows="3" placeholder="Description, objectifs, PNJs impliqués..."></textarea>
|
215 |
+
<div class="mt-3 flex items-center text-sm">
|
216 |
+
<div class="mr-4">
|
217 |
+
<label class="inline-flex items-center">
|
218 |
+
<input type="checkbox" class="scene-important rounded text-indigo-600">
|
219 |
+
<span class="ml-2">Scène clé</span>
|
220 |
+
</label>
|
221 |
+
</div>
|
222 |
+
<div>
|
223 |
+
<label class="inline-flex items-center">
|
224 |
+
<input type="checkbox" class="scene-combat rounded text-red-600">
|
225 |
+
<span class="ml-2">Combat</span>
|
226 |
+
</label>
|
227 |
+
</div>
|
228 |
+
</div>
|
229 |
+
</div>
|
230 |
+
</template>
|
231 |
+
|
232 |
+
<script>
|
233 |
+
document.addEventListener('DOMContentLoaded', function() {
|
234 |
+
// Initialize scenario data
|
235 |
+
let scenarioData = {
|
236 |
+
title: "",
|
237 |
+
description: "",
|
238 |
+
style: "",
|
239 |
+
scenes: []
|
240 |
+
};
|
241 |
+
|
242 |
+
// Style selection
|
243 |
+
const styleButtons = document.querySelectorAll('.style-btn');
|
244 |
+
styleButtons.forEach(button => {
|
245 |
+
button.addEventListener('click', function() {
|
246 |
+
styleButtons.forEach(btn => btn.classList.remove('bg-indigo-100', 'border-indigo-300'));
|
247 |
+
this.classList.add('bg-indigo-100', 'border-indigo-300');
|
248 |
+
scenarioData.style = this.dataset.style;
|
249 |
+
});
|
250 |
+
});
|
251 |
+
|
252 |
+
// Add new scene
|
253 |
+
const addSceneBtn = document.getElementById('addSceneBtn');
|
254 |
+
const scenesContainer = document.getElementById('scenesContainer');
|
255 |
+
const sceneTemplate = document.getElementById('sceneTemplate');
|
256 |
+
|
257 |
+
addSceneBtn.addEventListener('click', function() {
|
258 |
+
const sceneClone = sceneTemplate.content.cloneNode(true);
|
259 |
+
const sceneElement = sceneClone.querySelector('.scene-card');
|
260 |
+
|
261 |
+
// Generate unique ID for the scene
|
262 |
+
const sceneId = Date.now();
|
263 |
+
sceneElement.dataset.id = sceneId;
|
264 |
+
|
265 |
+
// Add to DOM
|
266 |
+
scenesContainer.appendChild(sceneClone);
|
267 |
+
|
268 |
+
// Add to data model
|
269 |
+
scenarioData.scenes.push({
|
270 |
+
id: sceneId,
|
271 |
+
title: "",
|
272 |
+
description: "",
|
273 |
+
isImportant: false,
|
274 |
+
hasCombat: false
|
275 |
+
});
|
276 |
+
|
277 |
+
// Focus on the new scene title
|
278 |
+
sceneElement.querySelector('.scene-title').focus();
|
279 |
+
|
280 |
+
// Add event listeners to the new scene
|
281 |
+
setupSceneEvents(sceneElement);
|
282 |
+
});
|
283 |
+
|
284 |
+
// Setup scene event listeners
|
285 |
+
function setupSceneEvents(sceneElement) {
|
286 |
+
const sceneId = sceneElement.dataset.id;
|
287 |
+
const sceneIndex = scenarioData.scenes.findIndex(s => s.id == sceneId);
|
288 |
+
|
289 |
+
// Title change
|
290 |
+
sceneElement.querySelector('.scene-title').addEventListener('input', function() {
|
291 |
+
scenarioData.scenes[sceneIndex].title = this.value;
|
292 |
+
});
|
293 |
+
|
294 |
+
// Description change
|
295 |
+
sceneElement.querySelector('.scene-desc').addEventListener('input', function() {
|
296 |
+
scenarioData.scenes[sceneIndex].description = this.value;
|
297 |
+
});
|
298 |
+
|
299 |
+
// Important toggle
|
300 |
+
sceneElement.querySelector('.scene-important').addEventListener('change', function() {
|
301 |
+
scenarioData.scenes[sceneIndex].isImportant = this.checked;
|
302 |
+
updateSceneMarker(sceneElement, this.checked);
|
303 |
+
});
|
304 |
+
|
305 |
+
// Combat toggle
|
306 |
+
sceneElement.querySelector('.scene-combat').addEventListener('change', function() {
|
307 |
+
scenarioData.scenes[sceneIndex].hasCombat = this.checked;
|
308 |
+
});
|
309 |
+
|
310 |
+
// Delete button
|
311 |
+
sceneElement.querySelector('.scene-delete').addEventListener('click', function() {
|
312 |
+
if (confirm("Supprimer cette scène ?")) {
|
313 |
+
sceneElement.remove();
|
314 |
+
scenarioData.scenes.splice(sceneIndex, 1);
|
315 |
+
}
|
316 |
+
});
|
317 |
+
|
318 |
+
// Move up
|
319 |
+
sceneElement.querySelector('.scene-move-up').addEventListener('click', function() {
|
320 |
+
if (sceneIndex > 0) {
|
321 |
+
swapScenes(sceneIndex, sceneIndex - 1);
|
322 |
+
}
|
323 |
+
});
|
324 |
+
|
325 |
+
// Move down
|
326 |
+
sceneElement.querySelector('.scene-move-down').addEventListener('click', function() {
|
327 |
+
if (sceneIndex < scenarioData.scenes.length - 1) {
|
328 |
+
swapScenes(sceneIndex, sceneIndex + 1);
|
329 |
+
}
|
330 |
+
});
|
331 |
+
}
|
332 |
+
|
333 |
+
// Update scene marker color based on importance
|
334 |
+
function updateSceneMarker(sceneElement, isImportant) {
|
335 |
+
const marker = sceneElement.querySelector('.marker');
|
336 |
+
marker.className = 'marker';
|
337 |
+
marker.classList.add(isImportant ? 'bg-red-500' : 'bg-indigo-500');
|
338 |
+
}
|
339 |
+
|
340 |
+
// Swap scenes in both DOM and data model
|
341 |
+
function swapScenes(indexA, indexB) {
|
342 |
+
// Swap in data model
|
343 |
+
[scenarioData.scenes[indexA], scenarioData.scenes[indexB]] =
|
344 |
+
[scenarioData.scenes[indexB], scenarioData.scenes[indexA]];
|
345 |
+
|
346 |
+
// Swap in DOM
|
347 |
+
const sceneElements = scenesContainer.querySelectorAll('.scene-card');
|
348 |
+
if (indexA < sceneElements.length && indexB < sceneElements.length) {
|
349 |
+
scenesContainer.insertBefore(sceneElements[indexA], sceneElements[indexB].nextSibling);
|
350 |
+
}
|
351 |
+
}
|
352 |
+
|
353 |
+
// Save scenario
|
354 |
+
document.getElementById('saveBtn').addEventListener('click', function() {
|
355 |
+
scenarioData.title = document.getElementById('scenarioTitle').value;
|
356 |
+
scenarioData.description = document.getElementById('scenarioDesc').value;
|
357 |
+
|
358 |
+
// Collect all scene data from DOM
|
359 |
+
const sceneElements = scenesContainer.querySelectorAll('.scene-card');
|
360 |
+
sceneElements.forEach((sceneElement, index) => {
|
361 |
+
const sceneId = sceneElement.dataset.id;
|
362 |
+
const sceneIndex = scenarioData.scenes.findIndex(s => s.id == sceneId);
|
363 |
+
|
364 |
+
if (sceneIndex !== -1) {
|
365 |
+
scenarioData.scenes[sceneIndex].title = sceneElement.querySelector('.scene-title').value;
|
366 |
+
scenarioData.scenes[sceneIndex].description = sceneElement.querySelector('.scene-desc').value;
|
367 |
+
scenarioData.scenes[sceneIndex].isImportant = sceneElement.querySelector('.scene-important').checked;
|
368 |
+
scenarioData.scenes[sceneIndex].hasCombat = sceneElement.querySelector('.scene-combat').checked;
|
369 |
+
}
|
370 |
+
});
|
371 |
+
|
372 |
+
// In a real app, you would save to a database or localStorage
|
373 |
+
console.log("Scénario enregistré :", scenarioData);
|
374 |
+
|
375 |
+
// Show success message
|
376 |
+
const btn = this;
|
377 |
+
const originalText = btn.innerHTML;
|
378 |
+
btn.innerHTML = '<i class="fas fa-check mr-2"></i> Enregistré !';
|
379 |
+
btn.classList.remove('bg-green-600');
|
380 |
+
btn.classList.add('bg-green-500');
|
381 |
+
|
382 |
+
setTimeout(() => {
|
383 |
+
btn.innerHTML = originalText;
|
384 |
+
btn.classList.remove('bg-green-500');
|
385 |
+
btn.classList.add('bg-green-600');
|
386 |
+
}, 2000);
|
387 |
+
});
|
388 |
+
|
389 |
+
// Analyze scenario
|
390 |
+
document.getElementById('analyzeBtn').addEventListener('click', function() {
|
391 |
+
// In a real app, this would analyze the scenario structure
|
392 |
+
alert("Analyse en cours... Cette fonctionnalité analyserait l'équilibre entre combats, dialogues et énigmes, et suggérerait des ajustements.");
|
393 |
+
});
|
394 |
+
|
395 |
+
// Initialize with a default scene
|
396 |
+
addSceneBtn.click();
|
397 |
+
});
|
398 |
+
</script>
|
399 |
+
<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=ZoroaStrella/gen-scenario" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
400 |
+
</html>
|
prompts.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Relire et Affiner le Scénario : Adaptez-le à votre style de maîtrise et aux préférences de vos joueurs.
|