Spaces:
Build error
Build error
Commit ·
844c2c6
1
Parent(s): f71a1c5
uodate UI
Browse files- frontend/src/App.css +2 -12
- frontend/src/App.js +65 -30
- frontend/src/components/modals/menueModal.css +92 -0
- frontend/src/components/modals/menueModal.js +25 -0
frontend/src/App.css
CHANGED
|
@@ -141,14 +141,10 @@ sup {
|
|
| 141 |
}
|
| 142 |
|
| 143 |
.version {
|
| 144 |
-
position: absolute;
|
| 145 |
-
right: 40px;
|
| 146 |
-
top: 20px;
|
| 147 |
font-family: "Open Sans", sans-serif;
|
| 148 |
color: #f5f5f5;
|
| 149 |
-
text-shadow: 0 0 5px
|
| 150 |
-
0 0 30px
|
| 151 |
-
animation: flicker 1s infinite;
|
| 152 |
font-family: "Rubik Burned", system-ui;
|
| 153 |
font-weight: 100;
|
| 154 |
font-style: normal;
|
|
@@ -163,10 +159,4 @@ sup {
|
|
| 163 |
width: 100px;
|
| 164 |
padding: 10px;
|
| 165 |
}
|
| 166 |
-
|
| 167 |
-
.version {
|
| 168 |
-
right: 10px;
|
| 169 |
-
top: 5px;
|
| 170 |
-
font-size: x-small;
|
| 171 |
-
}
|
| 172 |
}
|
|
|
|
| 141 |
}
|
| 142 |
|
| 143 |
.version {
|
|
|
|
|
|
|
|
|
|
| 144 |
font-family: "Open Sans", sans-serif;
|
| 145 |
color: #f5f5f5;
|
| 146 |
+
text-shadow: 0 0 5px rgb(51, 68, 255), 0 0 10px rgb(51, 221, 255), 0 0 15px rgb(51, 139, 255), 0 0 20px rgb(21, 0, 255),
|
| 147 |
+
0 0 30px rgb(0, 255, 208), 0 0 40px rgb(51, 204, 161), 0 0 50px rgb(51, 125, 204), 0 0 75px rgb(77, 51, 204);
|
|
|
|
| 148 |
font-family: "Rubik Burned", system-ui;
|
| 149 |
font-weight: 100;
|
| 150 |
font-style: normal;
|
|
|
|
| 159 |
width: 100px;
|
| 160 |
padding: 10px;
|
| 161 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
}
|
frontend/src/App.js
CHANGED
|
@@ -1,33 +1,60 @@
|
|
| 1 |
-
import React from
|
| 2 |
-
import {
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
import
|
| 10 |
-
import {
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
function Navbar() {
|
| 18 |
const location = useLocation();
|
| 19 |
const [hoveredLink, setHoveredLink] = React.useState(null);
|
| 20 |
const [prevLink, setPrevLink] = React.useState(null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
React.useEffect(() => {
|
| 23 |
-
const activeLink = document.querySelector(
|
|
|
|
|
|
|
| 24 |
if (activeLink) {
|
| 25 |
setPrevLink(activeLink);
|
| 26 |
}
|
| 27 |
}, [location.pathname]);
|
| 28 |
|
| 29 |
const handleMouseEnter = (e) => {
|
| 30 |
-
setPrevLink(document.querySelector(
|
| 31 |
setHoveredLink(e.target);
|
| 32 |
};
|
| 33 |
|
|
@@ -36,13 +63,12 @@ function Navbar() {
|
|
| 36 |
};
|
| 37 |
|
| 38 |
return (
|
| 39 |
-
|
| 40 |
<nav>
|
| 41 |
<ul className="nav-links">
|
| 42 |
<li>
|
| 43 |
<Link
|
| 44 |
to="/"
|
| 45 |
-
className={`nav-link ${location.pathname ===
|
| 46 |
onMouseEnter={handleMouseEnter}
|
| 47 |
onMouseLeave={handleMouseLeave}
|
| 48 |
>
|
|
@@ -52,7 +78,9 @@ function Navbar() {
|
|
| 52 |
<li>
|
| 53 |
<Link
|
| 54 |
to="/films"
|
| 55 |
-
className={`nav-link ${
|
|
|
|
|
|
|
| 56 |
onMouseEnter={handleMouseEnter}
|
| 57 |
onMouseLeave={handleMouseLeave}
|
| 58 |
>
|
|
@@ -62,7 +90,9 @@ function Navbar() {
|
|
| 62 |
<li>
|
| 63 |
<Link
|
| 64 |
to="/tvshows"
|
| 65 |
-
className={`nav-link ${
|
|
|
|
|
|
|
| 66 |
onMouseEnter={handleMouseEnter}
|
| 67 |
onMouseLeave={handleMouseLeave}
|
| 68 |
>
|
|
@@ -70,7 +100,12 @@ function Navbar() {
|
|
| 70 |
</Link>
|
| 71 |
</li>
|
| 72 |
<li>
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
</li>
|
| 75 |
</ul>
|
| 76 |
<span
|
|
@@ -95,7 +130,7 @@ function Navbar() {
|
|
| 95 |
: {}
|
| 96 |
}
|
| 97 |
/>
|
| 98 |
-
<
|
| 99 |
</nav>
|
| 100 |
);
|
| 101 |
}
|
|
@@ -109,14 +144,14 @@ function App() {
|
|
| 109 |
<Navbar />
|
| 110 |
</header>
|
| 111 |
<main>
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
</main>
|
| 121 |
</div>
|
| 122 |
</Router>
|
|
|
|
| 1 |
+
import React from "react";
|
| 2 |
+
import {
|
| 3 |
+
BrowserRouter as Router,
|
| 4 |
+
Route,
|
| 5 |
+
Routes,
|
| 6 |
+
Link,
|
| 7 |
+
useLocation,
|
| 8 |
+
} from "react-router-dom";
|
| 9 |
+
import { library } from "@fortawesome/fontawesome-svg-core";
|
| 10 |
+
import {
|
| 11 |
+
faSquareCaretLeft,
|
| 12 |
+
faSquareCaretRight,
|
| 13 |
+
faSquareCaretDown,
|
| 14 |
+
faEllipsisVertical,
|
| 15 |
+
faPlay,
|
| 16 |
+
} from "@fortawesome/free-solid-svg-icons";
|
| 17 |
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
| 18 |
+
import HomePage from "./pages/homePage";
|
| 19 |
+
import FilmsPage from "./pages/filmsPage";
|
| 20 |
+
import TvShowsPage from "./pages/tvshowsPage";
|
| 21 |
+
import FilmDetailsPage from "./pages/filmDetailsPage";
|
| 22 |
+
import { FilmProvider } from "./context/FilmContext";
|
| 23 |
+
import config from "./config";
|
| 24 |
+
import "./App.css";
|
| 25 |
+
import MenueModal from "./components/modals/menueModal";
|
| 26 |
|
| 27 |
+
library.add(
|
| 28 |
+
faSquareCaretLeft,
|
| 29 |
+
faSquareCaretRight,
|
| 30 |
+
faSquareCaretDown,
|
| 31 |
+
faEllipsisVertical,
|
| 32 |
+
faPlay
|
| 33 |
+
);
|
| 34 |
|
| 35 |
function Navbar() {
|
| 36 |
const location = useLocation();
|
| 37 |
const [hoveredLink, setHoveredLink] = React.useState(null);
|
| 38 |
const [prevLink, setPrevLink] = React.useState(null);
|
| 39 |
+
const [isModalOpen, setIsModalOpen] = React.useState(false);
|
| 40 |
+
const handleModalClose = () => {
|
| 41 |
+
setIsModalOpen(false);
|
| 42 |
+
};
|
| 43 |
+
const handleModalOpen = () => {
|
| 44 |
+
setIsModalOpen(!isModalOpen);
|
| 45 |
+
};
|
| 46 |
|
| 47 |
React.useEffect(() => {
|
| 48 |
+
const activeLink = document.querySelector(
|
| 49 |
+
`.nav-link[href="${location.pathname}"]`
|
| 50 |
+
);
|
| 51 |
if (activeLink) {
|
| 52 |
setPrevLink(activeLink);
|
| 53 |
}
|
| 54 |
}, [location.pathname]);
|
| 55 |
|
| 56 |
const handleMouseEnter = (e) => {
|
| 57 |
+
setPrevLink(document.querySelector(".nav-link.active"));
|
| 58 |
setHoveredLink(e.target);
|
| 59 |
};
|
| 60 |
|
|
|
|
| 63 |
};
|
| 64 |
|
| 65 |
return (
|
|
|
|
| 66 |
<nav>
|
| 67 |
<ul className="nav-links">
|
| 68 |
<li>
|
| 69 |
<Link
|
| 70 |
to="/"
|
| 71 |
+
className={`nav-link ${location.pathname === "/" ? "active" : ""}`}
|
| 72 |
onMouseEnter={handleMouseEnter}
|
| 73 |
onMouseLeave={handleMouseLeave}
|
| 74 |
>
|
|
|
|
| 78 |
<li>
|
| 79 |
<Link
|
| 80 |
to="/films"
|
| 81 |
+
className={`nav-link ${
|
| 82 |
+
location.pathname === "/films" ? "active" : ""
|
| 83 |
+
}`}
|
| 84 |
onMouseEnter={handleMouseEnter}
|
| 85 |
onMouseLeave={handleMouseLeave}
|
| 86 |
>
|
|
|
|
| 90 |
<li>
|
| 91 |
<Link
|
| 92 |
to="/tvshows"
|
| 93 |
+
className={`nav-link ${
|
| 94 |
+
location.pathname === "/tvshows" ? "active" : ""
|
| 95 |
+
}`}
|
| 96 |
onMouseEnter={handleMouseEnter}
|
| 97 |
onMouseLeave={handleMouseLeave}
|
| 98 |
>
|
|
|
|
| 100 |
</Link>
|
| 101 |
</li>
|
| 102 |
<li>
|
| 103 |
+
<FontAwesomeIcon
|
| 104 |
+
className="nav-link-menue"
|
| 105 |
+
icon="fa-solid fa-square-caret-down"
|
| 106 |
+
size="xl"
|
| 107 |
+
onClick={handleModalOpen}
|
| 108 |
+
/>
|
| 109 |
</li>
|
| 110 |
</ul>
|
| 111 |
<span
|
|
|
|
| 130 |
: {}
|
| 131 |
}
|
| 132 |
/>
|
| 133 |
+
<MenueModal isOpen={isModalOpen} onRequestClose={setIsModalOpen} />
|
| 134 |
</nav>
|
| 135 |
);
|
| 136 |
}
|
|
|
|
| 144 |
<Navbar />
|
| 145 |
</header>
|
| 146 |
<main>
|
| 147 |
+
<Routes>
|
| 148 |
+
<Route path="/" element={<HomePage />} />
|
| 149 |
+
<Route path="/films" element={<FilmsPage />} />
|
| 150 |
+
<Route path="/tvshows" element={<TvShowsPage />} />
|
| 151 |
+
<Route path="/film">
|
| 152 |
+
<Route path="/film/:title" element={<FilmDetailsPage />} />
|
| 153 |
+
</Route>
|
| 154 |
+
</Routes>
|
| 155 |
</main>
|
| 156 |
</div>
|
| 157 |
</Router>
|
frontend/src/components/modals/menueModal.css
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.menue-modal {
|
| 2 |
+
position: absolute;
|
| 3 |
+
top: 15%;
|
| 4 |
+
left: 50%;
|
| 5 |
+
transform: translate(-50%, -50%);
|
| 6 |
+
background: linear-gradient(135deg, #171717, #31506e); /* Deep blue gradient */
|
| 7 |
+
padding: 30px;
|
| 8 |
+
border: none;
|
| 9 |
+
border-radius: 20px;
|
| 10 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
|
| 11 |
+
color: #f0f0f0; /* Light gray text color */
|
| 12 |
+
text-align: center;
|
| 13 |
+
width: 90%;
|
| 14 |
+
max-width: 900px;
|
| 15 |
+
z-index: 1001;
|
| 16 |
+
animation: fadeIn 0.3s ease-out;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
.menue-modal-overlay {
|
| 20 |
+
background-color: rgba(0, 0, 0, 0.8);
|
| 21 |
+
z-index: 1000;
|
| 22 |
+
border: none;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
.modal-content {
|
| 26 |
+
display: flex;
|
| 27 |
+
flex-direction: column;
|
| 28 |
+
align-items: center;
|
| 29 |
+
border: none;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
.modal-actions {
|
| 33 |
+
display: flex;
|
| 34 |
+
justify-content: center;
|
| 35 |
+
gap: 15px;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.confirm-button {
|
| 39 |
+
background: #3f55d2; /* Soft blue for the confirm button */
|
| 40 |
+
color: #fff;
|
| 41 |
+
border: none;
|
| 42 |
+
padding: 12px 25px;
|
| 43 |
+
border-radius: 8px;
|
| 44 |
+
cursor: pointer;
|
| 45 |
+
font-size: 1.1rem;
|
| 46 |
+
transition: background 0.3s ease;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
.confirm-button:hover {
|
| 50 |
+
background: #4244b3; /* Slightly darker blue on hover */
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
.cancel-button {
|
| 54 |
+
background: #b0bec5; /* Light silver-blue for the cancel button */
|
| 55 |
+
color: #000; /* Dark text color for contrast */
|
| 56 |
+
border: none;
|
| 57 |
+
padding: 12px 25px;
|
| 58 |
+
border-radius: 8px;
|
| 59 |
+
cursor: pointer;
|
| 60 |
+
font-size: 1.1rem;
|
| 61 |
+
transition: background 0.3s ease;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.cancel-button:hover {
|
| 65 |
+
background: #90a4ae; /* Slightly darker silver-blue on hover */
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
@keyframes fadeIn {
|
| 69 |
+
from {
|
| 70 |
+
opacity: 0;
|
| 71 |
+
}
|
| 72 |
+
to {
|
| 73 |
+
opacity: 1;
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
@media (max-width: 768px) {
|
| 78 |
+
.menue-modal {
|
| 79 |
+
width: 85%;
|
| 80 |
+
padding: 20px;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
.modal-title {
|
| 84 |
+
font-size: 2rem;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
.confirm-button, .cancel-button {
|
| 88 |
+
padding: 10px 20px;
|
| 89 |
+
font-size: 1rem;
|
| 90 |
+
}
|
| 91 |
+
}
|
| 92 |
+
|
frontend/src/components/modals/menueModal.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React from "react";
|
| 2 |
+
import Modal from "react-modal";
|
| 3 |
+
import "./menueModal.css";
|
| 4 |
+
import config from "../../config";
|
| 5 |
+
|
| 6 |
+
Modal.setAppElement("#root");
|
| 7 |
+
|
| 8 |
+
const MenueModal = ({ isOpen, onRequestClose }) => {
|
| 9 |
+
|
| 10 |
+
return (
|
| 11 |
+
<Modal
|
| 12 |
+
isOpen={isOpen}
|
| 13 |
+
onRequestClose={onRequestClose}
|
| 14 |
+
contentLabel="Menue Modal"
|
| 15 |
+
className="menue-modal"
|
| 16 |
+
overlayClassName="menue-modal-overlay"
|
| 17 |
+
>
|
| 18 |
+
<div className="modal-content">
|
| 19 |
+
<label className="version">{config.version}</label>
|
| 20 |
+
</div>
|
| 21 |
+
</Modal>
|
| 22 |
+
);
|
| 23 |
+
};
|
| 24 |
+
|
| 25 |
+
export default MenueModal;
|