Giter VIP home page Giter VIP logo

team-profile-generator's Introduction

Team Profile Generator

Technology Used

Technology Used Resource URL
javascript JavaScript https://developer.mozilla.org/en-US/docs/Web/JavaScript
html Node.js https://developer.mozilla.org/en-US/docs/Glossary/Node.js

Description

This application will generate an HTML page for you and your team members. Follow the prompts in the terminal to add each team member's information and view the HTML generated dynamically in the /dist folder!

Functionality

View the walkthrough video here

Code Snippets

The below function generates the final HTML code by using template strings and custom class attributes/functions to dynamically insert content submitted by the user.

function generateHTML() {
    let gridContents = "";
    for(member of team) {
        gridContents += `
            <div class="col-auto mb-3">          
                <div class="card" style="width: 18rem;">
                    <div class="card-body">
                        <h5 class="card-title">${member.name}</h5>
                        <h6 class="card-subtitle mb-2 text-muted">${member.getRole()}</h6>
                        <ul class="list-group">
                            <li class="list-group-item">ID: ${member.id}</li>
                            <li class="list-group-item">Email: <a href="mailto: ${member.email}" class="card-link">${member.email}</a></li>
                            <li class="list-group-item">${getLastItemContents(member)}</li>
                        </ul>
                    </div>
                </div>
            </div>`
    }
    const finalHTML = `<!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Team</title>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
    </head>
    
    <body>
        <div class="container mt-4">
            <div class="jumbotron row justify-content-center">
                <h1 class="display-4">My Team</h1>
            </div>
            <div class="row justify-content-center">
                    ${gridContents}
            </div>
        </div>
    
    </body>
    </html>`

    fs.writeFile("./dist/output.html", finalHTML, (err) => {
        if (err) throw err;
        console.log("Your HTML file has been generated!");
    });
}

team-profile-generator's People

Contributors

mccoydidericksen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.