mirror of
https://github.com/DerTyp7/dertyp7.github.io.git
synced 2025-10-29 12:52:08 +01:00
add header component
This commit is contained in:
10
src/App.tsx
Normal file
10
src/App.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import "@styles/App.scss";
|
||||
import Header from "@components/Header";
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<div id="app">
|
||||
<Header />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
18
src/components/Header.tsx
Normal file
18
src/components/Header.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import "@styles/Header.scss";
|
||||
export default function Header() {
|
||||
return (
|
||||
<header className="header">
|
||||
<div className="logo">brandname</div>
|
||||
<div className="links">
|
||||
<a href="">Link1</a>
|
||||
<a href="">Link2</a>
|
||||
<a href="">Link3</a>
|
||||
<a href="">Link4</a>
|
||||
</div>
|
||||
<div className="control">
|
||||
<div>Theme</div>
|
||||
<div>Language</div>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import App from "./pages/App.tsx";
|
||||
import App from "./App.tsx";
|
||||
import "@styles/index.scss";
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root")!).render(
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import "@styles/App.scss";
|
||||
|
||||
function App() {
|
||||
return <>Test</>;
|
||||
}
|
||||
|
||||
export default App;
|
||||
@@ -0,0 +1,4 @@
|
||||
#app {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
42
src/styles/Header.scss
Normal file
42
src/styles/Header.scss
Normal file
@@ -0,0 +1,42 @@
|
||||
.header {
|
||||
padding: 1rem 2rem;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 5rem;
|
||||
flex-direction: row;
|
||||
|
||||
.logo {
|
||||
flex: 0.5;
|
||||
}
|
||||
|
||||
.links {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
|
||||
a {
|
||||
margin-left: 1rem;
|
||||
text-decoration: none;
|
||||
color: #323232;
|
||||
font-weight: 600;
|
||||
font-size: 1.2rem;
|
||||
transition: all 0.1s ease-in-out;
|
||||
border-bottom: 3px solid transparent;
|
||||
|
||||
&:hover {
|
||||
color: #000000;
|
||||
border-color: #000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.control {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
flex: 0.5;
|
||||
}
|
||||
}
|
||||
@@ -13,3 +13,9 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user