AnanthZeke commited on
Commit
113b6b6
1 Parent(s): 9bee96c

intialized dash app

Browse files
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from dash import Dash
2
+ from index import layout, register_callbacks
3
+
4
+ app = Dash(__name__, suppress_callback_exceptions=True)
5
+ app.layout = layout
6
+
7
+ # Register callbacks
8
+ register_callbacks(app)
9
+
10
+ if __name__ == "__main__":
11
+ app.run_server(debug=True)
assets/navbar.css ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* assets/styles.css */
2
+ .navbar {
3
+ background-color: #333;
4
+ padding: 10px;
5
+ }
6
+
7
+ .nav-link {
8
+ color: white;
9
+ margin-right: 15px;
10
+ text-decoration: none;
11
+ }
12
+
13
+ .nav-link:hover {
14
+ text-decoration: underline;
15
+ }
16
+
17
+ .home-content, .explorer-content {
18
+ padding: 20px;
19
+ }
20
+
21
+ .logo {
22
+ max-width: 200px;
23
+ margin-top: 20px;
24
+ }
assets/pokemon_logo.jpeg ADDED
index.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from dash import dcc, html
2
+ from dash.dependencies import Input, Output
3
+ from pages import home, explorer, comparison, team_builder
4
+
5
+ def layout():
6
+ return html.Div([
7
+ dcc.Location(id='url', refresh=False),
8
+ html.Div(id='page-content')
9
+ ])
10
+
11
+ def register_callbacks(app):
12
+ @app.callback(Output('page-content', 'children'),
13
+ [Input('url', 'pathname')])
14
+ def display_page(pathname):
15
+ if pathname == '/explorer':
16
+ return explorer.layout()
17
+ elif pathname == '/comparison':
18
+ return comparison.layout()
19
+ elif pathname == '/team-builder':
20
+ return team_builder.layout()
21
+ else:
22
+ return home.layout()
pages/comparison.py ADDED
File without changes
pages/explorer.py ADDED
File without changes
pages/home.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from dash import html
2
+ from pages.utils import navbar
3
+
4
+ def layout():
5
+ return html.Div([
6
+ # Navbar
7
+ navbar(),
8
+
9
+ # Home Page Content
10
+ html.Div([
11
+ html.H1("Welcome to the Pokémon Dashboard"),
12
+ html.P("Explore detailed Pokémon data, compare stats, and build your ultimate team."),
13
+ html.Img(src="assets/pokemon_logo.jpeg", alt="Pokémon Logo", className="logo"),
14
+ ], className='home-content')
15
+ ])
pages/team_builder.py ADDED
File without changes
pages/utils.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # utils/navbar.py
2
+ import dash_bootstrap_components as dbc
3
+ from dash import html, dcc
4
+
5
+ def navbar():
6
+ return html.Nav([
7
+ dcc.Link('Home', href='/', className='nav-link'),
8
+ dcc.Link('Data Explorer', href='/explorer', className='nav-link'),
9
+ dcc.Link('Comparison Tool', href='/comparison', className='nav-link'),
10
+ dcc.Link('Team Builder', href='/team-builder', className='nav-link'),
11
+ ], className='navbar')