fix: Day 02

pull/268/head
Helder Cambuta 3 years ago
parent 2923763a12
commit 8b2cbdf8c3

@ -0,0 +1,3 @@
{
"nuxt.isNuxtApp": false
}

@ -0,0 +1,65 @@
<!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>Day 02 - Exercise</title>
<link
href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500|Roboto:300,400,500&display=swap"
rel="stylesheet"
/>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
height: 100%;
line-height: 1.5;
font-family: "Montserrat";
font-weight: 300;
color: white;
background-color: #242424;
}
.root {
min-height: 100%;
position: relative;
}
</style>
</head>
<body>
<div class="root"></div>
<script
crossorigin
src="https://unpkg.com/react@18/umd/react.development.js"
></script>
<script
crossorigin
src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"
></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel">
// JSX element, app
const app = (
<div className="app">
</div>
);
const container = document.querySelector(".root");
const root = ReactDOM.createRoot(container);
root.render(app);
</script>
</body>
</html>

@ -0,0 +1,197 @@
<!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>30 Days of React - Day 02</title>
<link
href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500|Roboto:300,400,500&display=swap"
rel="stylesheet"
/>
<style>
/* == General style === */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
height: 100%;
line-height: 1.5;
font-family: "Montserrat";
font-weight: 300;
color: white;
background-color: #242424;
}
.root {
min-height: 100%;
position: relative;
}
.header-wrapper,
.main-wrapper,
.footer-wrapper {
width: 85%;
margin: auto;
}
.header-wrapper,
.main-wrapper {
padding: 10px;
margin: 2px auto;
}
h1 {
font-size: 56px;
font-weight: 300;
}
h2,
h3 {
font-weight: 300;
}
header {
background-color: #202020;
padding: 10px;
}
main {
padding: 10px;
padding-bottom: 60px;
}
ul {
margin-left: 15px;
}
ul li {
list-style: none;
}
footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px;
background: #202020;
}
.footer-wrapper {
font-weight: 400;
text-align: center;
line-height: 60px;
}
</style>
</head>
<body>
<div class="root"></div>
<script
crossorigin
src="https://unpkg.com/react@18/umd/react.development.js"
></script>
<script
crossorigin
src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"
></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel">
const welcome = "Welcome to 30 Days Of React Challenge";
const title = "Getting Started React";
const subtitle = "JavaScript Library";
const author = {
firstName: "Asabeneh",
lastName: "Yetayeh",
};
const date = "March 14, 2023";
// JSX Element, header
const header = (
<header>
<div>
<h1>{welcome}</h1>
<h2>{title}</h2>
<h3>{subtitle}</h3>
<p>
Instructor: {author.firstName} {author.lastName}
</p>
<small>Date: {date}</small>
</div>
</header>
);
const numOne = 3;
const numTwo = 2;
const result = (
<p>
{numOne} + {numTwo} = {numOne + numTwo}
</p>
);
const yearBorn = 1820;
const currentYear = 2020;
const age = currentYear - yearBorn;
const personAge = (
<p>
{" "}
{author.firstName} {author.lastName} is {age} years old
</p>
);
// JSX element, main
const techs = ["HTML", "CSS", "JavaScript"];
const techsFormatted = techs.map((tech) => <li key={tech}>{tech}</li>);
// JSX element, main
const main = (
<main>
<div className="main-wrapper">
<p>
Prerequisite to get started{" "}
<strong>
<em>react.js</em>
</strong>
:
</p>
<ul>{techsFormatted}</ul>
{result}
{personAge}
</div>
</main>
);
const copyRight = "Copyright 2023";
// JSX element, footer
const footer = (
<footer>
<div className="footer-wrapper">
<p>{copyRight}</p>
</div>
</footer>
);
// JSX element, app
const app = (
<div className="app">
{header}
{main}
{footer}
</div>
);
const container = document.querySelector(".root");
const root = ReactDOM.createRoot(container);
root.render(app);
</script>
</body>
</html>
Loading…
Cancel
Save