diff --git a/src/App.js b/src/App.js deleted file mode 100644 index f4fad47..0000000 --- a/src/App.js +++ /dev/null @@ -1,102 +0,0 @@ -import React from 'react'; -import f22 from './img/raptor-1040097_1920.png' -import harrier from './img/av-8b-harrier-1986422_1920.jpg' -import './app.css'; -import './header.css' - -class App extends React.Component { - render() { - const items = Array(100).fill(1).map((x, y) => x + y) - .map(x => ); - - return ( -
-
-

Hugos Lieblingsflugzeuge

- -
-
-
- {items} - -
-
-
-
- ); - } -} - -export default App; - -class Navigation extends React.Component { - render() { - return ( - - ) - } -} - -class Footer extends React.Component { - render() { - return ( - - ) - } -} - - -class ModelImage extends React.Component { - constructor(props) { - super(props); - this.state = { - img: '', - name: '', - } - } - - static getDerivedStateFromProps(props) { - return {img: props.img, name: props.name}; - } - - render() { - return ( -
- {this.state.name}/ -
{this.state.name}
-
- ); - } -} \ No newline at end of file diff --git a/src/app.js b/src/app.js new file mode 100644 index 0000000..7aa0b19 --- /dev/null +++ b/src/app.js @@ -0,0 +1,82 @@ +import React from 'react'; +import './app.css'; +import './template.css' +import Content from "./content"; + +class App extends React.Component { + render() { + return ( +
+
+ +

Hugos Lieblingsflugzeuge

+
+
+ +
+
+
+ ); + } +} + +export default App; + +class Navigation extends React.Component { + render() { + return ( + + ) + } +} + +class Footer extends React.Component { + render() { + return ( + + ) + } +} \ No newline at end of file diff --git a/src/content.js b/src/content.js new file mode 100644 index 0000000..8fe216c --- /dev/null +++ b/src/content.js @@ -0,0 +1,43 @@ +import React from 'react'; +import f22 from './img/raptor-1040097_1920.png' +import harrier from './img/av-8b-harrier-1986422_1920.jpg' + +class Content extends React.Component { + render() { + const items = Array(100).fill(1).map((x, y) => x + y) + .map(x => ); + + return ( +
+ {items} + +
+ ) + } +} + +export default Content; + + +class ModelImage extends React.Component { + constructor(props) { + super(props); + this.state = { + img: '', + name: '', + } + } + + static getDerivedStateFromProps(props) { + return {img: props.img, name: props.name}; + } + + render() { + return ( +
+ {this.state.name}/ +
{this.state.name}
+
+ ); + } +} \ No newline at end of file diff --git a/src/header.css b/src/header.css deleted file mode 100644 index 4cea75e..0000000 --- a/src/header.css +++ /dev/null @@ -1,75 +0,0 @@ -header { - grid-area: header; -} - -/*Navigation*/ -nav { - list-style-type: none; - margin: 0; - padding: 0; - overflow: visible; - background-color: rgb(176, 194, 206); - width: 100%; -} - -nav ul li { - float: left; - border-right: 1px solid gray; - height: 100%; - width: 19.9%; - position: relative; - display: inline-block; -} - -nav ul li:hover { - background-color: darkgray; - color: #111111; - transition-duration: 0.4s; -} - -nav ul li div a { - font-size: 18pt; - display: block; - color: #666666; - text-align: center; - text-decoration: none; - padding: 8px; - height: 100%; - width: 100%; -} - - - -nav ul li > a button { - font-size: 20pt; - background-color: rgb(176, 194, 206); - border: none; - padding: 9px 0 9px 0; - cursor: pointer; - margin: auto; - width: 100%; -} - - -nav ul li div { - display: none; - position: absolute; - z-index: 1; - width: 100%; -} - -nav ul li:hover div { - display: block; - background-color: rgb(206, 224, 236); -} - -nav ul li div a { - text-decoration: none; - color: black; - font-size: 16pt; -} - -nav ul li div a:hover { - background-color: darkgray; - color: #111111; -} diff --git a/src/index.js b/src/index.js index 2a431a4..ab640f7 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import App from "./App"; +import App from "./app"; ReactDOM.render( diff --git a/src/template.css b/src/template.css new file mode 100644 index 0000000..13ee1eb --- /dev/null +++ b/src/template.css @@ -0,0 +1,96 @@ +:root { + --nav-color: rgb(176, 194, 206); + --nav-hover-color: darkgrey; +} + +header { + grid-area: header; +} + +header h1 { + margin-top: 50px; + text-align: center; +} + +/*Navigation*/ +nav { + list-style-type: none; + margin: 0; + padding: 0; + overflow: visible; + background-color: var(--nav-color); + width: 100%; + + position: fixed; + top: 0; + height: 50px; +} + +/*main ul*/ +nav ul { + height: 100%; + margin: 0; + padding: 0; +} + +/*nav li item*/ +nav ul li { + float: left; + border-right: 1px solid gray; + height: 100%; + width: 15%; + position: relative; + display: inline-block; + + font-size: 1.5em; + background-color: var(--nav-color); + cursor: pointer; + margin: auto; +} + +/*nav li item on hover*/ +nav ul li:hover { + background-color: darkgray; + color: var(--nav-hover-color); + transition-duration: 0.4s; +} + +/*all nav button*/ +nav ul li button { + display: block; + text-align: center; + color: black; + width: 100%; + height: 100%; + background-color: var(--nav-color); + border: none; + cursor: pointer; +} + +/*all nav button focus - remove outline so it looks like a normal link*/ +nav ul li button:focus { + outline: 0; +} + +/*all nav a hover*/ +nav ul li button:hover { + background-color: var(--nav-hover-color); +} + +/*drop menu*/ +nav ul li div { + display: none; + background-color: var(--nav-color); + z-index: 1; + width: 100%; +} + +/*drop menu main hover*/ +nav ul li:hover div { + display: block; +} + +/*drop menu button*/ +nav ul li div button { + padding: 8px 0 8px 0; +} \ No newline at end of file