commit ee95842cd640fac9bfa790f3069c86bb7282a50b
Author: root <root@hub.scroll.pub> Date: 2024-12-31 13:26:39 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..2bb0cad --- /dev/null +++ b/body.html @@ -0,0 +1,18 @@ +<header> + <h1>Discutez avec Jules César</h1> + <p>Posez vos questions sur la guerre des Gaules</p> +</header> + +<main> + <div class="chat-container"> + <div id="chat-history" class="chat-history"></div> + <div class="input-container"> + <input type="text" id="user-input" placeholder="Posez votre question ici..." aria-label="Entrez votre question"> + <button id="send-btn">Envoyer</button> + </div> + </div> +</main> + +<footer> + <p>Une expérience interactive avec le célèbre général romain</p> +</footer> \ No newline at end of file diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..53f3811 --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://cesar.scroll.pub +metaTags +editButton /edit.html +title Discutez avec Jules César +style.css +body.html +script.js \ No newline at end of file diff --git a/prompt.json b/prompt.json new file mode 100644 index 0000000..17f32ac --- /dev/null +++ b/prompt.json @@ -0,0 +1,25 @@ +{ + "id": "52750f77-cb16-42d3-bdc0-1197a5efec2a", + "object": "chat.completion", + "created": 1735651579, + "model": "deepseek-chat", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "\n\n---domain---\ncesar.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://cesar.scroll.pub\nmetaTags\neditButton /edit.html\ntitle Discutez avec Jules César\nstyle.css\nbody.html\nscript.js\n---body.html---\n<header>\n <h1>Discutez avec Jules César</h1>\n <p>Posez vos questions sur la guerre des Gaules</p>\n</header>\n\n<main>\n <div class=\"chat-container\">\n <div id=\"chat-history\" class=\"chat-history\"></div>\n <div class=\"input-container\">\n <input type=\"text\" id=\"user-input\" placeholder=\"Posez votre question ici...\" aria-label=\"Entrez votre question\">\n <button id=\"send-btn\">Envoyer</button>\n </div>\n </div>\n</main>\n\n<footer>\n <p>Une expérience interactive avec le célèbre général romain</p>\n</footer>\n---style.css---\n:root {\n --primary-color: #c82333;\n --secondary-color: #e9ecef;\n --background-color: #f8f9fa;\n --text-color: #212529;\n --border-radius: 8px;\n --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n}\n\nbody {\n font-family: 'Georgia', serif;\n background-color: var(--background-color);\n color: var(--text-color);\n margin: 0;\n padding: 20px;\n line-height: 1.6;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n}\n\nheader {\n text-align: center;\n margin-bottom: 2rem;\n}\n\nheader h1 {\n color: var(--primary-color);\n font-size: 2.5rem;\n margin-bottom: 0.5rem;\n}\n\n.chat-container {\n max-width: 800px;\n margin: 0 auto;\n background: white;\n border-radius: var(--border-radius);\n box-shadow: var(--shadow);\n padding: 20px;\n flex: 1;\n display: flex;\n flex-direction: column;\n}\n\n.chat-history {\n flex: 1;\n overflow-y: auto;\n margin-bottom: 1rem;\n padding: 1rem;\n background: var(--secondary-color);\n border-radius: var(--border-radius);\n}\n\n.message {\n margin-bottom: 1rem;\n padding: 0.75rem;\n border-radius: var(--border-radius);\n max-width: 70%;\n}\n\n.user-message {\n background: var(--primary-color);\n color: white;\n margin-left: auto;\n}\n\n.caesar-message {\n background: white;\n border: 1px solid var(--secondary-color);\n margin-right: auto;\n}\n\n.input-container {\n display: flex;\n gap: 10px;\n}\n\ninput {\n flex: 1;\n padding: 0.75rem;\n border: 1px solid var(--secondary-color);\n border-radius: var(--border-radius);\n}\n\nbutton {\n background: var(--primary-color);\n color: white;\n border: none;\n padding: 0.75rem 1.5rem;\n border-radius: var(--border-radius);\n cursor: pointer;\n transition: background 0.3s ease;\n}\n\nbutton:hover {\n background: #a71d2a;\n}\n\nfooter {\n text-align: center;\n margin-top: 2rem;\n padding: 1rem;\n color: #6c757d;\n}\n\n@media (max-width: 768px) {\n header h1 {\n font-size: 2rem;\n }\n \n .chat-container {\n padding: 15px;\n }\n \n .message {\n max-width: 85%;\n }\n}\n---script.js---\nconst chatHistory = document.getElementById('chat-history');\nconst userInput = document.getElementById('user-input');\nconst sendBtn = document.getElementById('send-btn');\n\nconst caesarResponses = [\n \"Veni, vidi, vici!\",\n \"La Gaule est divisée en trois parties...\",\n \"La fortune sourit aux audacieux.\",\n \"Alea jacta est!\",\n \"La discipline est la force principale des armées.\",\n \"La guerre des Gaules fut une grande épreuve.\",\n \"Les Belges sont les plus braves de tous les Gaulois.\",\n \"La stratégie est essentielle dans toute campagne militaire.\",\n \"Les Gaulois étaient de redoutables adversaires.\",\n \"La victoire appartient à ceux qui savent l'attendre.\"\n];\n\nfunction addMessage(text, isUser) {\n const messageDiv = document.createElement('div');\n messageDiv.classList.add('message');\n messageDiv.classList.add(isUser ? 'user-message' : 'caesar-message');\n messageDiv.textContent = text;\n chatHistory.appendChild(messageDiv);\n chatHistory.scrollTop = chatHistory.scrollHeight;\n}\n\nfunction getCaesarResponse() {\n const randomIndex = Math.floor(Math.random() * caesarResponses.length);\n return caesarResponses[randomIndex];\n}\n\nsendBtn.addEventListener('click', () => {\n const question = userInput.value.trim();\n if (question) {\n addMessage(question, true);\n userInput.value = '';\n setTimeout(() => {\n addMessage(getCaesarResponse(), false);\n }, 1000);\n }\n});\n\nuserInput.addEventListener('keypress', (e) => {\n if (e.key === 'Enter') {\n sendBtn.click();\n }\n});\n---end---" + }, + "logprobs": null, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 262, + "completion_tokens": 1223, + "total_tokens": 1485, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 262 + }, + "system_fingerprint": "fp_f1afce2943" +} \ No newline at end of file diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..4d6d2c8 --- /dev/null +++ b/readme.scroll @@ -0,0 +1,2 @@ +# cesar.scroll.pub +Website generated by DeepSeek from prompt: Créer un site qui permette de discuter avec Jules César et de lui poser des questions sur la guerre des Gaules \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..6efcb04 --- /dev/null +++ b/script.js @@ -0,0 +1,47 @@ +const chatHistory = document.getElementById('chat-history'); +const userInput = document.getElementById('user-input'); +const sendBtn = document.getElementById('send-btn'); + +const caesarResponses = [ + "Veni, vidi, vici!", + "La Gaule est divisée en trois parties...", + "La fortune sourit aux audacieux.", + "Alea jacta est!", + "La discipline est la force principale des armées.", + "La guerre des Gaules fut une grande épreuve.", + "Les Belges sont les plus braves de tous les Gaulois.", + "La stratégie est essentielle dans toute campagne militaire.", + "Les Gaulois étaient de redoutables adversaires.", + "La victoire appartient à ceux qui savent l'attendre." +]; + +function addMessage(text, isUser) { + const messageDiv = document.createElement('div'); + messageDiv.classList.add('message'); + messageDiv.classList.add(isUser ? 'user-message' : 'caesar-message'); + messageDiv.textContent = text; + chatHistory.appendChild(messageDiv); + chatHistory.scrollTop = chatHistory.scrollHeight; +} + +function getCaesarResponse() { + const randomIndex = Math.floor(Math.random() * caesarResponses.length); + return caesarResponses[randomIndex]; +} + +sendBtn.addEventListener('click', () => { + const question = userInput.value.trim(); + if (question) { + addMessage(question, true); + userInput.value = ''; + setTimeout(() => { + addMessage(getCaesarResponse(), false); + }, 1000); + } +}); + +userInput.addEventListener('keypress', (e) => { + if (e.key === 'Enter') { + sendBtn.click(); + } +}); \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..7e41a7b --- /dev/null +++ b/style.css @@ -0,0 +1,118 @@ +:root { + --primary-color: #c82333; + --secondary-color: #e9ecef; + --background-color: #f8f9fa; + --text-color: #212529; + --border-radius: 8px; + --shadow: 0 4px 6px rgba(0, 0, 0, 0.1); +} + +body { + font-family: 'Georgia', serif; + background-color: var(--background-color); + color: var(--text-color); + margin: 0; + padding: 20px; + line-height: 1.6; + min-height: 100vh; + display: flex; + flex-direction: column; +} + +header { + text-align: center; + margin-bottom: 2rem; +} + +header h1 { + color: var(--primary-color); + font-size: 2.5rem; + margin-bottom: 0.5rem; +} + +.chat-container { + max-width: 800px; + margin: 0 auto; + background: white; + border-radius: var(--border-radius); + box-shadow: var(--shadow); + padding: 20px; + flex: 1; + display: flex; + flex-direction: column; +} + +.chat-history { + flex: 1; + overflow-y: auto; + margin-bottom: 1rem; + padding: 1rem; + background: var(--secondary-color); + border-radius: var(--border-radius); +} + +.message { + margin-bottom: 1rem; + padding: 0.75rem; + border-radius: var(--border-radius); + max-width: 70%; +} + +.user-message { + background: var(--primary-color); + color: white; + margin-left: auto; +} + +.caesar-message { + background: white; + border: 1px solid var(--secondary-color); + margin-right: auto; +} + +.input-container { + display: flex; + gap: 10px; +} + +input { + flex: 1; + padding: 0.75rem; + border: 1px solid var(--secondary-color); + border-radius: var(--border-radius); +} + +button { + background: var(--primary-color); + color: white; + border: none; + padding: 0.75rem 1.5rem; + border-radius: var(--border-radius); + cursor: pointer; + transition: background 0.3s ease; +} + +button:hover { + background: #a71d2a; +} + +footer { + text-align: center; + margin-top: 2rem; + padding: 1rem; + color: #6c757d; +} + +@media (max-width: 768px) { + header h1 { + font-size: 2rem; + } + + .chat-container { + padding: 15px; + } + + .message { + max-width: 85%; + } +} \ No newline at end of file