From 7133c2a7fd83a4b527c1e917519cbca26dc69bb7 Mon Sep 17 00:00:00 2001 From: !Lixi! <101387561+Lixi002@users.noreply.github.com> Date: Tue, 9 Jan 2024 07:45:46 +0100 Subject: [PATCH] lixi.json aktualisieren --- domains/lixi.json | 107 +--------------------------------------------- 1 file changed, 1 insertion(+), 106 deletions(-) diff --git a/domains/lixi.json b/domains/lixi.json index 5b05f2d3d..501a6bbaf 100644 --- a/domains/lixi.json +++ b/domains/lixi.json @@ -1,106 +1 @@ - /** - * Represents a person with information about their skills and project. - */ -class Person { - /** - * Constructor for the Person class. - * - * @param {string} name - The name of the person. - * @param {string} profession - The profession of the person. - * @param {string[]} skills - An array of skills the person has. - * @param {string} project - The project the person is working on. - */ - constructor(name, profession, skills, project) { - /** @private */ - this.name = name; - - /** @private */ - this.profession = profession; - - /** @private */ - this.skills = skills; - - /** @private */ - this.project = project; - } - - /** - * Getter method to retrieve the name of the person. - * - * @returns {string} The name of the person. - */ - getName() { - return this.name; - } - - /** - * Getter method to retrieve the profession of the person. - * - * @returns {string} The profession of the person. - */ - getProfession() { - return this.profession; - } - - /** - * Getter method to retrieve the skills of the person. - * - * @returns {string[]} The skills of the person. - */ - getSkills() { - return this.skills; - } - - /** - * Getter method to retrieve the project of the person. - * - * @returns {string} The project of the person. - */ - getProject() { - return this.project; - } -} - -/** - * Generates an interactive webpage with information about a person. - * - * @param {Person} person - The person object containing the information. - */ -function generateWebpage(person) { - // Create HTML elements - const container = document.createElement('div'); - const nameElement = document.createElement('h1'); - const professionElement = document.createElement('h2'); - const skillsElement = document.createElement('ul'); - const projectElement = document.createElement('p'); - - // Set content for HTML elements - nameElement.textContent = `Name: ${person.getName()}`; - professionElement.textContent = `Profession: ${person.getProfession()}`; - person.getSkills().forEach(skill => { - const skillItem = document.createElement('li'); - skillItem.textContent = skill; - skillsElement.appendChild(skillItem); - }); - projectElement.textContent = `Project: ${person.getProject()}`; - - // Append elements to container - container.appendChild(nameElement); - container.appendChild(professionElement); - container.appendChild(skillsElement); - container.appendChild(projectElement); - - // Append container to the body of the webpage - document.body.appendChild(container); -} - -// Create a person object -const person = new Person( - "Lixi", - "Dev", - ["C#", "Python", "Java"], - "DevcoAI" -); - -// Generate the webpage with the person's information -generateWebpage(person); \ No newline at end of file + \ No newline at end of file