aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components
diff options
context:
space:
mode:
authorWolfboy248 <georgejvindkarlsen@gmail.com>2025-08-19 13:23:56 +0200
committerWolfboy248 <georgejvindkarlsen@gmail.com>2025-08-19 13:23:56 +0200
commit97be0afd140c7c9e1fd03ba5ab4e486d90907129 (patch)
treeab9dcf8ebab077b5fc7ab149c6ce8c13c21caaab /frontend/src/components
parentorganised pages, started work on theme (diff)
downloadlphub-97be0afd140c7c9e1fd03ba5ab4e486d90907129.tar.gz
lphub-97be0afd140c7c9e1fd03ba5ab4e486d90907129.tar.bz2
lphub-97be0afd140c7c9e1fd03ba5ab4e486d90907129.zip
organised pages, started work on theme
Diffstat (limited to 'frontend/src/components')
-rw-r--r--frontend/src/components/GameCategory.tsx6
-rw-r--r--frontend/src/components/GameEntry.tsx6
-rw-r--r--frontend/src/components/Sidebar.tsx43
3 files changed, 30 insertions, 25 deletions
diff --git a/frontend/src/components/GameCategory.tsx b/frontend/src/components/GameCategory.tsx
index b18c9d9..7ae3850 100644
--- a/frontend/src/components/GameCategory.tsx
+++ b/frontend/src/components/GameCategory.tsx
@@ -11,12 +11,12 @@ interface GameCategoryProps {
11const GameCategory: React.FC<GameCategoryProps> = ({ cat, game }) => { 11const GameCategory: React.FC<GameCategoryProps> = ({ cat, game }) => {
12 return ( 12 return (
13 <Link 13 <Link
14 className="bg-surface text-center w-full h-[100px] rounded-3xl text-foreground m-3 hover:bg-surface1 transition-colors flex flex-col justify-between p-4" 14 className="bg-block text-center w-full rounded-3xl text-foreground transition-colors flex flex-col justify-between p-2"
15 to={"/games/" + game.id + "?cat=" + cat.category.id} 15 to={"/games/" + game.id + "?cat=" + cat.category.id}
16 > 16 >
17 <p className="text-3xl font-semibold">{cat.category.name}</p> 17 <span className="text-2xl font-barlow-semicondensed-regular">{cat.category.name}</span>
18 <br /> 18 <br />
19 <p className="font-bold text-4xl">{cat.portal_count}</p> 19 <span className="text-5xl font-barlow-semicondensed-semibold">{cat.portal_count}</span>
20 </Link> 20 </Link>
21 ); 21 );
22}; 22};
diff --git a/frontend/src/components/GameEntry.tsx b/frontend/src/components/GameEntry.tsx
index f8fd179..6f2b194 100644
--- a/frontend/src/components/GameEntry.tsx
+++ b/frontend/src/components/GameEntry.tsx
@@ -18,18 +18,18 @@ const GameEntry: React.FC<GameEntryProps> = ({ game }) => {
18 18
19 return ( 19 return (
20 <Link to={"/games/" + game.id} className="w-full"> 20 <Link to={"/games/" + game.id} className="w-full">
21 <div className="w-full h-64 bg-mantle rounded-3xl overflow-hidden my-6"> 21 <div className="w-full h-64 bg-panel rounded-3xl overflow-hidden my-6">
22 <div className="w-full h-1/2 bg-cover overflow-hidden relative"> 22 <div className="w-full h-1/2 bg-cover overflow-hidden relative">
23 <div 23 <div
24 style={{ backgroundImage: `url(${game.image})` }} 24 style={{ backgroundImage: `url(${game.image})` }}
25 className="w-full h-full backdrop-blur-sm blur-sm bg-cover" 25 className="w-full h-full backdrop-blur-sm blur-sm bg-cover"
26 ></div> 26 ></div>
27 <span className="absolute inset-0 flex justify-center items-center"> 27 <span className="absolute inset-0 flex justify-center items-center">
28 <b className="text-[56px] font-[--font-barlow-condensed-bold] text-white">{game.name}</b> 28 <b className="text-[56px] font-barlow-condensed-bold text-white">{game.name}</b>
29 </span> 29 </span>
30 </div> 30 </div>
31 <div className="flex justify-center items-center h-1/2"> 31 <div className="flex justify-center items-center h-1/2">
32 <div className="flex flex-row justify-between w-full"> 32 <div className="flex flex-row justify-between w-full gap-3 m-3">
33 {catInfo.map((cat, index) => { 33 {catInfo.map((cat, index) => {
34 return ( 34 return (
35 <GameCategory key={index} cat={cat} game={game} /> 35 <GameCategory key={index} cat={cat} game={game} />
diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx
index 88a5297..0083a3e 100644
--- a/frontend/src/components/Sidebar.tsx
+++ b/frontend/src/components/Sidebar.tsx
@@ -23,15 +23,15 @@ interface SidebarProps {
23 onUploadRun: () => void; 23 onUploadRun: () => void;
24} 24}
25 25
26function OpenSidebarIcon(){ 26function OpenSidebarIcon() {
27 return ( 27 return (
28 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-panel-right-close-icon lucide-panel-right-close"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M15 3v18"/><path d="m8 9 3 3-3 3"/></svg> 28 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-panel-right-close-icon lucide-panel-right-close"><rect width="18" height="18" x="3" y="3" rx="2" /><path d="M15 3v18" /><path d="m8 9 3 3-3 3" /></svg>
29 ) 29 )
30} 30}
31 31
32function ClosedSidebarIcon(){ 32function ClosedSidebarIcon() {
33 return ( 33 return (
34<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-panel-right-open-icon lucide-panel-right-open"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M15 3v18"/><path d="m10 15-3-3 3-3"/></svg> ) 34 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-panel-right-open-icon lucide-panel-right-open"><rect width="18" height="18" x="3" y="3" rx="2" /><path d="M15 3v18" /><path d="m10 15-3-3 3-3" /></svg>)
35} 35}
36 36
37const Sidebar: React.FC<SidebarProps> = ({ 37const Sidebar: React.FC<SidebarProps> = ({
@@ -43,7 +43,7 @@ const Sidebar: React.FC<SidebarProps> = ({
43 const [searchData, setSearchData] = React.useState<Search | undefined>( 43 const [searchData, setSearchData] = React.useState<Search | undefined>(
44 undefined 44 undefined
45 ); 45 );
46 const [isSidebarLocked, setIsSidebarLocked] = React.useState<boolean>(false); 46 // const [isSidebarLocked, setIsSidebarLocked] = React.useState<boolean>(false);
47 const [isSidebarOpen, setSidebarOpen] = React.useState<boolean>(false); 47 const [isSidebarOpen, setSidebarOpen] = React.useState<boolean>(false);
48 const [selectedButtonIndex, setSelectedButtonIndex] = React.useState<number>(1); 48 const [selectedButtonIndex, setSelectedButtonIndex] = React.useState<number>(1);
49 49
@@ -100,17 +100,16 @@ const Sidebar: React.FC<SidebarProps> = ({
100 const getButtonClasses = (buttonIndex: number) => { 100 const getButtonClasses = (buttonIndex: number) => {
101 const baseClasses = "flex items-center gap-3 w-full text-left bg-inherit cursor-pointer border-none rounded-lg py-3 px-3 transition-all duration-300 hover:bg-surface1"; 101 const baseClasses = "flex items-center gap-3 w-full text-left bg-inherit cursor-pointer border-none rounded-lg py-3 px-3 transition-all duration-300 hover:bg-surface1";
102 const selectedClasses = selectedButtonIndex === buttonIndex ? "bg-primary text-background" : "bg-transparent text-foreground"; 102 const selectedClasses = selectedButtonIndex === buttonIndex ? "bg-primary text-background" : "bg-transparent text-foreground";
103 103
104 return `${baseClasses} ${selectedClasses}`; 104 return `${baseClasses} ${selectedClasses}`;
105 }; 105 };
106 106
107 const iconClasses = "w-6 h-6 flex-shrink-0"; 107 const iconClasses = "w-6 h-6 flex-shrink-0";
108 108
109 return ( 109 return (
110 <div className={`fixed top-0 left-0 h-screen bg-surface border-r border-border transition-all duration-300 z-10 overflow-hidden ${ 110 <div className={`w-80 not-md:w-full text-white bg-block
111 isSidebarOpen ? 'w-80' : 'w-20' 111 }`}>
112 }`}> 112 <div className="flex items-center px-4 border-b border-border">
113 <div className="flex items-center h-20 px-4 border-b border-border">
114 <Link to="/" tabIndex={-1} className="flex items-center flex-1 cursor-pointer select-none min-w-0"> 113 <Link to="/" tabIndex={-1} className="flex items-center flex-1 cursor-pointer select-none min-w-0">
115 <img src={LogoIcon} alt="Logo" className="w-12 h-12 flex-shrink-0" /> 114 <img src={LogoIcon} alt="Logo" className="w-12 h-12 flex-shrink-0" />
116 {isSidebarOpen && ( 115 {isSidebarOpen && (
@@ -124,7 +123,7 @@ const Sidebar: React.FC<SidebarProps> = ({
124 </div> 123 </div>
125 )} 124 )}
126 </Link> 125 </Link>
127 126
128 <button 127 <button
129 onClick={_handle_sidebar_toggle} 128 onClick={_handle_sidebar_toggle}
130 className="ml-2 p-2 rounded-lg hover:bg-surface1 transition-colors text-foreground" 129 className="ml-2 p-2 rounded-lg hover:bg-surface1 transition-colors text-foreground"
@@ -135,9 +134,9 @@ const Sidebar: React.FC<SidebarProps> = ({
135 </div> 134 </div>
136 135
137 {/* Sidebar Content */} 136 {/* Sidebar Content */}
138 <div 137 <div
139 ref={sidebarRef} 138 ref={sidebarRef}
140 className="flex flex-col h-[calc(100vh-80px)] overflow-y-auto overflow-x-hidden" 139 className="flex flex-col overflow-y-auto overflow-x-hidden"
141 > 140 >
142 {isSidebarOpen && ( 141 {isSidebarOpen && (
143 <div className="p-4 border-b border-border min-w-0"> 142 <div className="p-4 border-b border-border min-w-0">
@@ -145,7 +144,7 @@ const Sidebar: React.FC<SidebarProps> = ({
145 <img src={SearchIcon} alt="Search" className={iconClasses} /> 144 <img src={SearchIcon} alt="Search" className={iconClasses} />
146 <span className="text-white font-[--font-barlow-semicondensed-regular] truncate">Search</span> 145 <span className="text-white font-[--font-barlow-semicondensed-regular] truncate">Search</span>
147 </div> 146 </div>
148 147
149 <div className="min-w-0"> 148 <div className="min-w-0">
150 <input 149 <input
151 ref={searchbarRef} 150 ref={searchbarRef}
@@ -214,7 +213,9 @@ const Sidebar: React.FC<SidebarProps> = ({
214 ].map(({ to, refIndex, icon, alt, label }) => ( 213 ].map(({ to, refIndex, icon, alt, label }) => (
215 <Link to={to} tabIndex={-1} key={refIndex}> 214 <Link to={to} tabIndex={-1} key={refIndex}>
216 <button 215 <button
217 ref={el => sidebarButtonRefs.current[refIndex] = el} 216 ref={el => {
217 sidebarButtonRefs.current[refIndex] = el
218 }}
218 className={getButtonClasses(refIndex)} 219 className={getButtonClasses(refIndex)}
219 onClick={() => handle_sidebar_click(refIndex)} 220 onClick={() => handle_sidebar_click(refIndex)}
220 > 221 >
@@ -254,8 +255,10 @@ const Sidebar: React.FC<SidebarProps> = ({
254 </div> 255 </div>
255 256
256 <Link to="/rules" tabIndex={-1}> 257 <Link to="/rules" tabIndex={-1}>
257 <button 258 <button
258 ref={el => sidebarButtonRefs.current[5] = el} 259 ref={el => {
260 sidebarButtonRefs.current[5] = el
261 }}
259 className={getButtonClasses(5)} 262 className={getButtonClasses(5)}
260 onClick={() => handle_sidebar_click(5)} 263 onClick={() => handle_sidebar_click(5)}
261 > 264 >
@@ -265,8 +268,10 @@ const Sidebar: React.FC<SidebarProps> = ({
265 </Link> 268 </Link>
266 269
267 <Link to="/about" tabIndex={-1}> 270 <Link to="/about" tabIndex={-1}>
268 <button 271 <button
269 ref={el => sidebarButtonRefs.current[6] = el} 272 ref={el => {
273 sidebarButtonRefs.current[6] = el
274 }}
270 className={getButtonClasses(6)} 275 className={getButtonClasses(6)}
271 onClick={() => handle_sidebar_click(6)} 276 onClick={() => handle_sidebar_click(6)}
272 > 277 >