GithubHelp home page GithubHelp logo

hectorchec / mslearn-copilot-codespaces-javascript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoftdocs/mslearn-copilot-codespaces-javascript

0.0 0.0 0.0 2.25 MB

License: Creative Commons Attribution 4.0 International

JavaScript 85.19% CSS 11.14% HTML 3.68%

mslearn-copilot-codespaces-javascript's Introduction

Open in GitHub Codespaces

Use GitHub Copilot to write JavaScript

Explore how you can modify a JavaScript repository using code suggestions from GitHub Copilot to modify and customize a web application. By working with this repository, you'll quickly get hands-on with a JavaScript web app for a portfolio site.

Requirements

  1. Enable your GitHub Copilot service
  2. Open this repository with Codespaces

๐Ÿ’ช๐Ÿฝ Exercise

In this template portfolio, we have a React based web application ready for you to easily customize and deploy using only your web browser.

๐Ÿ›  Step 1: Customize the web app

Customize the portfolio with your own links. Go to src/App.jsx and update the siteProps with your information. The siteProps variable is a JavaScript object that holds key value pairs used to customize the site, it should look like this:

const siteProps = {
  name: "Alexandrie Grenier",
  title: "Web Designer & Content Creator",
  email: "[email protected]",
  gitHub: "microsoft",
  instagram: "microsoft",
  linkedIn: "satyanadella",
  medium: "",
  twitter: "microsoft",
  youTube: "Code",
};

๐Ÿ”Ž Step 2: Animate the social media icons with a prompt

Next, generate a new endpoint with GitHub Copilot by adding the comment:

An animation can make the social media section more eye-catching. Ask Copilotโ€™s help to animate the icons. Write the following prompt in the src/styles.css file:

/* add an amazing animation to the social icons */

The suggestion from Copilot should look similar to the following:

img.socialIcon:hover {
  animation: bounce 0.5s;
  animation-iteration-count: infinite;
}

@keyframes bounce {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

๐Ÿš€ Step 3: Work with the suggestion

Accept the suggestion by pressing the tab key. If you don't receive the exact same suggestion, then you can either experiment with the suggestion provided or keep typing the CSS code until it matches.

Your site should already be running in your Codespace, and the change will reload onto the page automatically. To see them, hover over one of your social media icons in the footer to see the magic!

Congratulations, through the exercise, you haven't only used copilot to generate code but also done it in an interactive and fun way! You can use GitHub Copilot to not only generate code, but write documentation, test your applications and more.

mslearn-copilot-codespaces-javascript's People

Contributors

microsoftopensource avatar alfredodeza avatar saragibby avatar microsoft-github-operations[bot] 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.