Team Ai
Modelpublic

Programming-Clem/GenerateWeb

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
0likes
GenerateWeb.js43 linesDownload Raw Back to root
1// web_package.js2const fs = require('fs');3const path = require('path');4 5function createWebPage(backgroundColor, title, paragraph, description) {6    const htmlContent = `7<!DOCTYPE html>8<html lang="fr">9<head>10    <meta charset="UTF-8">11    <meta name="viewport" content="width=device-width, initial-scale=1.0">12    <title>${title}</title>13    <style>14        body {15            background-color: ${backgroundColor};16            color: black;17            font-family: Arial, sans-serif;18            text-align: center;19        }20    </style>21</head>22<body>23    <h1>${title}</h1>24    <p>${paragraph}</p>25    <div>${description}</div>26</body>27</html>28    `;29 30    const outputPath = path.join(__dirname, 'bzzbee.html');31    fs.writeFileSync(outputPath, htmlContent);32    console.log(`🍯 Page web créée à l'adresse: ${outputPath}`);33}34 35// Récupérer les arguments de la ligne de commande36const args = process.argv.slice(2);37if (args.length < 4) {38    console.log("Usage: node web_package.js <couleur_de_fond> <titre> <paragraphe> <description>");39    process.exit(1);40}41 42const [backgroundColor, title, paragraph, description] = args;43createWebPage(backgroundColor, title, paragraph, description);