Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<!-- all files will be rendered into this div -->
<div id="root"></div>
<!--
This HTML file is a template.
Expand Down
17 changes: 16 additions & 1 deletion src/App.css
Original file line number Diff line number Diff line change
@@ -1,28 +1,43 @@
.App {
/* create class "App" */
.App {
/* aligns all text centered */
text-align: center;
}

/* create class "App-logo */
.App-logo {
/* logo animation 20 second spin loop */
animation: App-logo-spin infinite 20s linear;
/* logo height of 80px */
height: 80px;
}

/* create class "App-header */
.App-header {
/* header background color */
background-color: #222;
/* header height */
height: 150px;
/* header padding (space between border and element */
padding: 20px;
/* header text color */
color: white;
}

/* create class "App-title */
.App-title {
/* title font size */
font-size: 1.5em;
}

/* create class "App-intro */
.App-intro {
/* intro font size */
font-size: large;
}

@keyframes App-logo-spin {
/* logo animation spin start & end */
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
12 changes: 10 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
// import react for this project
import React, { Component } from 'react';
// import app.css file from components folder on line 2
import './App.css';
// import Header file from components folder on line 2
import Header from './Header';
// import SectionMain file from components folder on line 2
import SectionMain from './SectionMain';
// import Aside file from components folder on line 2
import Aside from './Aside';
// import Footer file from components folder on line 2
import Footer from './Footer';

// create class-based component
class App extends Component {

// render method
render() {
// return rendered HTML of the individual sections
return (
<div className="App">
<Header backColor="green" width="50%"></Header>
Expand All @@ -18,5 +26,5 @@ class App extends Component {
);
}
}

// export App so it can be accessed in index.js
export default App;
1 change: 1 addition & 0 deletions src/Aside.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* declare class for aside section, set height, width, background color, and float it to the left edge of the viewport or preceding section */
.Aside{
height: 300px;
width: 20%;
Expand Down
7 changes: 7 additions & 0 deletions src/Aside.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
// import react for this project
import React, { Component } from 'react';
// import Aside styling file from src
import './Aside.css';

// create class-based component for the aside section
class Aside extends Component {
// render method
render() {
// return rendered HTML of the aside section
return (
// aside has class name so we can apply CSS styling to it, camelCase indicates JSX
<aside className="Aside">
</aside>

);
}
}

// export Aside component so it can be imported to App (parent component)
export default Aside;
1 change: 1 addition & 0 deletions src/Footer.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* create class "Footer", sets section height, background color, and moves footer below any floating elements */
.Footer{
height: 200px;
background: orange;
Expand Down
7 changes: 7 additions & 0 deletions src/Footer.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
// import react for this project
import React, { Component } from 'react';
// import Footer styling file from src
import './Footer.css';

// create class-based component
class Footer extends Component {
// render method
render() {
// return rendered HTML of the footer
return (
// footer has class name so we can apply CSS styling to it, camelCase indicates JSX
<footer className="Footer">
</footer>

);
}
}

// export Footer so it can be imported to App (parent component)
export default Footer;
1 change: 1 addition & 0 deletions src/Header.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* create Header-main class, set header height to 300px */
.Header-main{
height: 300px;
}
8 changes: 7 additions & 1 deletion src/Header.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
// import react and component for use in this file
import React, { Component } from 'react';
// import Header styling file from src
import './Header.css';

// establish class-based component for Header element
class Header extends Component {
// render style variable and return header with styling
render() {
const style = {
// grab styling from App.js (defined in return on line 21)
width: this.props.width,
backgroundColor: this.props.backColor
}
Expand All @@ -15,7 +20,8 @@ class Header extends Component {
}
}

// export Header component
export default Header;


// well that's an interesting comment right there...wonder what you were going to do with it?
//document.querySelector("header").style.backgroundColor = "red"
1 change: 1 addition & 0 deletions src/SectionMain.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* declare class for main content section, set height, width, background color, and float it to the left edge of the viewport or preceding section */
.SectionMain{
height: 300px;
width: 80%;
Expand Down
7 changes: 7 additions & 0 deletions src/SectionMain.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
// import react for this project
import React, { Component } from 'react';
// import SectionMain styling file from src
import './SectionMain.css';

// create class-based component for main section
class SectionMain extends Component {
// render method
render() {
// return rendered HTML of the main section
return (
// section has class name so we can apply CSS styling to it, camelCase indicates JSX
<section className="SectionMain">
</section>

);
}
}

// export SectionMain so it can be imported to App (parent component)
export default SectionMain;
1 change: 1 addition & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* declare style rule for body tag, set margin, padding, and base font-family */
body {
margin: 0;
padding: 0;
Expand Down
12 changes: 10 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import React from 'react';
// file used to render app component
// import react so we can use methods in this file
import React from 'react';
// import react-dom, another package we installed, the virtual DOM, important so we can refresh individual elements
import ReactDOM from 'react-dom';
// import index.css from src file
import './index.css';
// import App.js from src file
import App from './App';
// import registerServiceWorker from src file, created during the "npx react-create-app _______" process
// for functionality during loss of connectivity
import registerServiceWorker from './registerServiceWorker';


// virtual DOM renders the App component into root (a div in public/index.html)
ReactDOM.render(<App />, document.getElementById('root'));
// calls registerServiceWorker function
registerServiceWorker();