diff --git a/domains/lixi.json b/domains/lixi.json index 0dea837cd..5b05f2d3d 100644 --- a/domains/lixi.json +++ b/domains/lixi.json @@ -1,18 +1,106 @@ -// Additional information about the developer -const developerInfo = { - name: "Lixi", - role: "Developer", - expertise: ["Web Development", "AI"], - project: { - name: "AI Wonderland", - description: "An immersive AI project exploring the boundaries of technology.", - technologies: ["Machine Learning", "Natural Language Processing"] + /** + * 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; } -}; - -// Displaying the information -console.log("Hello, I'm Lixi " + developerInfo.name + ", a " + developerInfo.role + "."); -console.log("I specialize in " + developerInfo.expertise.join(', ') + "."); -console.log("Currently, I'm working on the project '" + developerInfo.project.name + "'."); -console.log("Description: " + developerInfo.project.description); -console.log("Technologies used: " + developerInfo.project.technologies.join(', ')); \ No newline at end of file + + /** + * 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