commit b7aa72c02361a6a699ce38ac22caabf7f940ba48
Author: root <root@hub.scroll.pub> Date: 2024-12-28 11:30:46 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..fa8680b --- /dev/null +++ b/body.html @@ -0,0 +1,51 @@ +<header> + <h1>Simulateur de Prêt Immobilier</h1> + <p>Comparez les taux et calculez vos mensualités en quelques clics.</p> +</header> + +<main> + <section class="calculator"> + <div class="input-group"> + <label for="amount">Montant du prêt (€)</label> + <input type="number" id="amount" placeholder="Ex: 200000" min="0"> + </div> + <div class="input-group"> + <label for="duration">Durée (années)</label> + <input type="number" id="duration" placeholder="Ex: 20" min="1"> + </div> + <div class="input-group"> + <label for="rate">Taux d'intérêt (%)</label> + <input type="number" id="rate" placeholder="Ex: 1.5" step="0.01" min="0"> + </div> + <button id="calculate">Calculer</button> + </section> + + <section class="results"> + <h2>Résultats</h2> + <div class="result-card"> + <p>Mensualité</p> + <span id="monthlyPayment">-</span> + </div> + <div class="result-card"> + <p>Coût total du crédit</p> + <span id="totalCost">-</span> + </div> + </section> + + <section class="comparison"> + <h2>Comparer les taux</h2> + <div class="rate-inputs"> + <input type="number" class="rate" placeholder="Taux 1" step="0.01" min="0"> + <input type="number" class="rate" placeholder="Taux 2" step="0.01" min="0"> + <input type="number" class="rate" placeholder="Taux 3" step="0.01" min="0"> + </div> + <button id="compare">Comparer</button> + <div class="comparison-results"> + <!-- Results will be injected here by JavaScript --> + </div> + </section> +</main> + +<footer> + <p>Un outil simple et efficace pour vos projets immobiliers.</p> +</footer> \ No newline at end of file diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..c6c5396 --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://pretimmobilier.scroll.pub +metaTags +editButton /edit.html +title Simulateur de Prêt Immobilier en France +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..db8a6a6 --- /dev/null +++ b/prompt.json @@ -0,0 +1,25 @@ +{ + "id": "ac6393c8-744f-4796-9821-e18cfa579713", + "object": "chat.completion", + "created": 1735385420, + "model": "deepseek-chat", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "---domain---\npretimmobilier.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://pretimmobilier.scroll.pub\nmetaTags\neditButton /edit.html\ntitle Simulateur de Prêt Immobilier en France\nstyle.css\nbody.html\nscript.js\n---body.html---\n<header>\n <h1>Simulateur de Prêt Immobilier</h1>\n <p>Comparez les taux et calculez vos mensualités en quelques clics.</p>\n</header>\n\n<main>\n <section class=\"calculator\">\n <div class=\"input-group\">\n <label for=\"amount\">Montant du prêt (€)</label>\n <input type=\"number\" id=\"amount\" placeholder=\"Ex: 200000\" min=\"0\">\n </div>\n <div class=\"input-group\">\n <label for=\"duration\">Durée (années)</label>\n <input type=\"number\" id=\"duration\" placeholder=\"Ex: 20\" min=\"1\">\n </div>\n <div class=\"input-group\">\n <label for=\"rate\">Taux d'intérêt (%)</label>\n <input type=\"number\" id=\"rate\" placeholder=\"Ex: 1.5\" step=\"0.01\" min=\"0\">\n </div>\n <button id=\"calculate\">Calculer</button>\n </section>\n\n <section class=\"results\">\n <h2>Résultats</h2>\n <div class=\"result-card\">\n <p>Mensualité</p>\n <span id=\"monthlyPayment\">-</span>\n </div>\n <div class=\"result-card\">\n <p>Coût total du crédit</p>\n <span id=\"totalCost\">-</span>\n </div>\n </section>\n\n <section class=\"comparison\">\n <h2>Comparer les taux</h2>\n <div class=\"rate-inputs\">\n <input type=\"number\" class=\"rate\" placeholder=\"Taux 1\" step=\"0.01\" min=\"0\">\n <input type=\"number\" class=\"rate\" placeholder=\"Taux 2\" step=\"0.01\" min=\"0\">\n <input type=\"number\" class=\"rate\" placeholder=\"Taux 3\" step=\"0.01\" min=\"0\">\n </div>\n <button id=\"compare\">Comparer</button>\n <div class=\"comparison-results\">\n <!-- Results will be injected here by JavaScript -->\n </div>\n </section>\n</main>\n\n<footer>\n <p>Un outil simple et efficace pour vos projets immobiliers.</p>\n</footer>\n---style.css---\n:root {\n --primary-color: #2c3e50;\n --secondary-color: #3498db;\n --background-color: #f5f6fa;\n --text-color: #333;\n --border-radius: 8px;\n --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n}\n\nbody {\n font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n margin: 0;\n padding: 0;\n background-color: var(--background-color);\n color: var(--text-color);\n line-height: 1.6;\n}\n\nheader {\n background-color: var(--primary-color);\n color: white;\n padding: 2rem;\n text-align: center;\n}\n\nmain {\n max-width: 800px;\n margin: 2rem auto;\n padding: 1rem;\n}\n\n.calculator, .comparison {\n background: white;\n padding: 2rem;\n border-radius: var(--border-radius);\n box-shadow: var(--box-shadow);\n margin-bottom: 2rem;\n}\n\n.input-group {\n margin-bottom: 1rem;\n}\n\nlabel {\n display: block;\n margin-bottom: 0.5rem;\n font-weight: bold;\n}\n\ninput {\n width: 100%;\n padding: 0.75rem;\n border: 1px solid #ddd;\n border-radius: var(--border-radius);\n font-size: 1rem;\n}\n\nbutton {\n width: 100%;\n padding: 1rem;\n background-color: var(--secondary-color);\n color: white;\n border: none;\n border-radius: var(--border-radius);\n font-size: 1rem;\n cursor: pointer;\n transition: background-color 0.3s ease;\n}\n\nbutton:hover {\n background-color: #2980b9;\n}\n\n.results {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n gap: 1rem;\n margin-top: 2rem;\n}\n\n.result-card {\n background: white;\n padding: 1.5rem;\n border-radius: var(--border-radius);\n box-shadow: var(--box-shadow);\n text-align: center;\n}\n\n.result-card p {\n margin: 0;\n font-size: 1.1rem;\n}\n\n.result-card span {\n font-size: 1.5rem;\n font-weight: bold;\n color: var(--secondary-color);\n}\n\n.comparison-results {\n margin-top: 1rem;\n}\n\nfooter {\n text-align: center;\n padding: 1rem;\n background-color: var(--primary-color);\n color: white;\n margin-top: 2rem;\n}\n\n@media (max-width: 600px) {\n main {\n padding: 0.5rem;\n }\n\n .calculator, .comparison {\n padding: 1rem;\n }\n}\n---script.js---\nfunction calculateLoan(amount, duration, rate) {\n const monthlyRate = rate / 100 / 12;\n const numberOfPayments = duration * 12;\n const monthlyPayment = (amount * monthlyRate) / (1 - Math.pow(1 + monthlyRate, -numberOfPayments));\n const totalCost = monthlyPayment * numberOfPayments;\n return { monthlyPayment, totalCost };\n}\n\nfunction formatCurrency(amount) {\n return new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR' }).format(amount);\n}\n\ndocument.getElementById('calculate').addEventListener('click', () => {\n const amount = parseFloat(document.getElementById('amount').value);\n const duration = parseFloat(document.getElementById('duration').value);\n const rate = parseFloat(document.getElementById('rate').value);\n\n if (isNaN(amount) || isNaN(duration) || isNaN(rate)) {\n alert('Veuillez remplir tous les champs correctement.');\n return;\n }\n\n const { monthlyPayment, totalCost } = calculateLoan(amount, duration, rate);\n document.getElementById('monthlyPayment').textContent = formatCurrency(monthlyPayment);\n document.getElementById('totalCost').textContent = formatCurrency(totalCost);\n});\n\ndocument.getElementById('compare').addEventListener('click', () => {\n const rates = Array.from(document.querySelectorAll('.rate')).map(input => parseFloat(input.value)).filter(rate => !isNaN(rate));\n if (rates.length < 2) {\n alert('Veuillez entrer au moins deux taux pour comparer.');\n return;\n }\n\n const amount = parseFloat(document.getElementById('amount').value);\n const duration = parseFloat(document.getElementById('duration').value);\n\n if (isNaN(amount) || isNaN(duration)) {\n alert('Veuillez d\\'abord entrer un montant et une durée.');\n return;\n }\n\n const comparisonResults = document.querySelector('.comparison-results');\n comparisonResults.innerHTML = '';\n\n rates.forEach(rate => {\n const { monthlyPayment, totalCost } = calculateLoan(amount, duration, rate);\n const resultDiv = document.createElement('div');\n resultDiv.className = 'result-card';\n resultDiv.innerHTML = `\n <p>Taux: ${rate}%</p>\n <p>Mensualité: ${formatCurrency(monthlyPayment)}</p>\n <p>Coût total: ${formatCurrency(totalCost)}</p>\n `;\n comparisonResults.appendChild(resultDiv);\n });\n});\n---end---" + }, + "logprobs": null, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 284, + "completion_tokens": 1783, + "total_tokens": 2067, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 284 + }, + "system_fingerprint": "fp_f1afce2943" +} \ No newline at end of file diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..c32db0e --- /dev/null +++ b/readme.scroll @@ -0,0 +1,2 @@ +# pretimmobilier1.scroll.pub +Website generated by DeepSeek from prompt: creer un site pour simuler un emprunt de credit immobilier en france avec la possibilité d'entrer plus taux et de les comparer. sois créatif avec un design joli et mis en forme pour les montants \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..29b25e1 --- /dev/null +++ b/script.js @@ -0,0 +1,57 @@ +function calculateLoan(amount, duration, rate) { + const monthlyRate = rate / 100 / 12; + const numberOfPayments = duration * 12; + const monthlyPayment = (amount * monthlyRate) / (1 - Math.pow(1 + monthlyRate, -numberOfPayments)); + const totalCost = monthlyPayment * numberOfPayments; + return { monthlyPayment, totalCost }; +} + +function formatCurrency(amount) { + return new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR' }).format(amount); +} + +document.getElementById('calculate').addEventListener('click', () => { + const amount = parseFloat(document.getElementById('amount').value); + const duration = parseFloat(document.getElementById('duration').value); + const rate = parseFloat(document.getElementById('rate').value); + + if (isNaN(amount) || isNaN(duration) || isNaN(rate)) { + alert('Veuillez remplir tous les champs correctement.'); + return; + } + + const { monthlyPayment, totalCost } = calculateLoan(amount, duration, rate); + document.getElementById('monthlyPayment').textContent = formatCurrency(monthlyPayment); + document.getElementById('totalCost').textContent = formatCurrency(totalCost); +}); + +document.getElementById('compare').addEventListener('click', () => { + const rates = Array.from(document.querySelectorAll('.rate')).map(input => parseFloat(input.value)).filter(rate => !isNaN(rate)); + if (rates.length < 2) { + alert('Veuillez entrer au moins deux taux pour comparer.'); + return; + } + + const amount = parseFloat(document.getElementById('amount').value); + const duration = parseFloat(document.getElementById('duration').value); + + if (isNaN(amount) || isNaN(duration)) { + alert('Veuillez d\'abord entrer un montant et une durée.'); + return; + } + + const comparisonResults = document.querySelector('.comparison-results'); + comparisonResults.innerHTML = ''; + + rates.forEach(rate => { + const { monthlyPayment, totalCost } = calculateLoan(amount, duration, rate); + const resultDiv = document.createElement('div'); + resultDiv.className = 'result-card'; + resultDiv.innerHTML = ` + <p>Taux: ${rate}%</p> + <p>Mensualité: ${formatCurrency(monthlyPayment)}</p> + <p>Coût total: ${formatCurrency(totalCost)}</p> + `; + comparisonResults.appendChild(resultDiv); + }); +}); \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..a40a43a --- /dev/null +++ b/style.css @@ -0,0 +1,120 @@ +:root { + --primary-color: #2c3e50; + --secondary-color: #3498db; + --background-color: #f5f6fa; + --text-color: #333; + --border-radius: 8px; + --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); +} + +body { + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + margin: 0; + padding: 0; + background-color: var(--background-color); + color: var(--text-color); + line-height: 1.6; +} + +header { + background-color: var(--primary-color); + color: white; + padding: 2rem; + text-align: center; +} + +main { + max-width: 800px; + margin: 2rem auto; + padding: 1rem; +} + +.calculator, .comparison { + background: white; + padding: 2rem; + border-radius: var(--border-radius); + box-shadow: var(--box-shadow); + margin-bottom: 2rem; +} + +.input-group { + margin-bottom: 1rem; +} + +label { + display: block; + margin-bottom: 0.5rem; + font-weight: bold; +} + +input { + width: 100%; + padding: 0.75rem; + border: 1px solid #ddd; + border-radius: var(--border-radius); + font-size: 1rem; +} + +button { + width: 100%; + padding: 1rem; + background-color: var(--secondary-color); + color: white; + border: none; + border-radius: var(--border-radius); + font-size: 1rem; + cursor: pointer; + transition: background-color 0.3s ease; +} + +button:hover { + background-color: #2980b9; +} + +.results { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + gap: 1rem; + margin-top: 2rem; +} + +.result-card { + background: white; + padding: 1.5rem; + border-radius: var(--border-radius); + box-shadow: var(--box-shadow); + text-align: center; +} + +.result-card p { + margin: 0; + font-size: 1.1rem; +} + +.result-card span { + font-size: 1.5rem; + font-weight: bold; + color: var(--secondary-color); +} + +.comparison-results { + margin-top: 1rem; +} + +footer { + text-align: center; + padding: 1rem; + background-color: var(--primary-color); + color: white; + margin-top: 2rem; +} + +@media (max-width: 600px) { + main { + padding: 0.5rem; + } + + .calculator, .comparison { + padding: 1rem; + } +} \ No newline at end of file