JoeSos commited on
Commit
63b1f08
·
verified ·
1 Parent(s): 2fa72c4

This is essentially the Menu experience I want to have. Can you integrate this such that is it works seamlessly with the other components.

Browse files
Files changed (2) hide show
  1. index.html +11 -8
  2. nav.js +91 -0
index.html CHANGED
@@ -5,9 +5,13 @@
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Boston Consulting Group | Bold Leadership. Lasting Impact.</title>
7
  <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
 
 
 
 
8
  <script src="https://cdn.tailwindcss.com"></script>
9
  <script src="https://unpkg.com/feather-icons"></script>
10
- <style>
11
  @import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap');
12
  body {
13
  font-family: 'Open Sans', sans-serif;
@@ -31,9 +35,11 @@
31
  </style>
32
  </head>
33
  <body class="antialiased">
34
- <!-- Navigation -->
35
- <nav class="bg-white shadow-md">
36
- <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
 
 
37
  <div class="flex justify-between h-16">
38
  <div class="flex">
39
  <div class="flex-shrink-0 flex items-center">
@@ -249,9 +255,6 @@
249
  </div>
250
  </div>
251
  </footer>
252
-
253
- <script>
254
- feather.replace();
255
- </script>
256
  </body>
257
  </html>
 
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Boston Consulting Group | Bold Leadership. Lasting Impact.</title>
7
  <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
8
+ <!-- React and React DOM -->
9
+ <script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin></script>
10
+ <script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" crossorigin></script>
11
+ <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
12
  <script src="https://cdn.tailwindcss.com"></script>
13
  <script src="https://unpkg.com/feather-icons"></script>
14
+ <style>
15
  @import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap');
16
  body {
17
  font-family: 'Open Sans', sans-serif;
 
35
  </style>
36
  </head>
37
  <body class="antialiased">
38
+ <!-- Root element for React -->
39
+ <div id="root"></div>
40
+
41
+ <!-- Navigation will be replaced by React component -->
42
+ <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
43
  <div class="flex justify-between h-16">
44
  <div class="flex">
45
  <div class="flex-shrink-0 flex items-center">
 
255
  </div>
256
  </div>
257
  </footer>
258
+ <script src="/static/js/nav.js"></script>
 
 
 
259
  </body>
260
  </html>
nav.js ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```html
2
+ <script type="text/babel">
3
+ const Nav = () => {
4
+ const [mobileMenuOpen, setMobileMenuOpen] = React.useState(false);
5
+
6
+ const toggleMobileMenu = () => {
7
+ setMobileMenuOpen(!mobileMenuOpen);
8
+ };
9
+
10
+ return (
11
+ <nav className="bg-white shadow-md">
12
+ <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
13
+ <div className="flex justify-between h-16">
14
+ <div className="flex">
15
+ <div className="flex-shrink-0 flex items-center">
16
+ <img className="h-8 w-auto" src="https://www.bcg.com/assets/images/BCG-logo.svg" alt="BCG Logo" />
17
+ </div>
18
+ <div className="hidden sm:ml-6 sm:flex sm:space-x-8">
19
+ <a href="#" className="nav-link border-transparent text-gray-500 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">Industries</a>
20
+ <a href="#" className="nav-link border-transparent text-gray-500 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">Capabilities</a>
21
+ <a href="#" className="nav-link border-transparent text-gray-500 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">Insights</a>
22
+ <a href="#" className="nav-link border-transparent text-gray-500 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">Careers</a>
23
+ <a href="#" className="nav-link border-transparent text-gray-500 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">About</a>
24
+ </div>
25
+ </div>
26
+ <div className="hidden sm:ml-6 sm:flex sm:items-center">
27
+ <button className="bg-white p-1 rounded-full text-gray-400 hover:text-gray-500 focus:outline-none">
28
+ <i data-feather="search"></i>
29
+ </button>
30
+ <button className="ml-4 bg-bcg-teal text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-opacity-90 focus:outline-none">
31
+ Contact Us
32
+ </button>
33
+ </div>
34
+ <div className="-mr-2 flex items-center sm:hidden">
35
+ <button
36
+ onClick={toggleMobileMenu}
37
+ type="button"
38
+ className="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none"
39
+ aria-controls="mobile-menu"
40
+ aria-expanded="false"
41
+ >
42
+ <i data-feather={mobileMenuOpen ? "x" : "menu"}></i>
43
+ </button>
44
+ </div>
45
+ </div>
46
+ </div>
47
+
48
+ {/* Mobile menu */}
49
+ {mobileMenuOpen && (
50
+ <div className="sm:hidden" id="mobile-menu">
51
+ <div className="pt-2 pb-3 space-y-1">
52
+ <a href="#" className="block pl-3 pr-4 py-2 border-l-4 border-bcg-teal text-base font-medium text-gray-700">Industries</a>
53
+ <a href="#" className="block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-500 hover:text-gray-700">Capabilities</a>
54
+ <a href="#" className="block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-500 hover:text-gray-700">Insights</a>
55
+ <a href="#" className="block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-500 hover:text-gray-700">Careers</a>
56
+ <a href="#" className="block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-500 hover:text-gray-700">About</a>
57
+ </div>
58
+ <div className="pt-4 pb-3 border-t border-gray-200">
59
+ <div className="flex items-center px-4 space-x-3">
60
+ <button className="bg-white p-1 rounded-full text-gray-400 hover:text-gray-500 focus:outline-none">
61
+ <i data-feather="search"></i>
62
+ </button>
63
+ <button className="bg-bcg-teal text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-opacity-90 focus:outline-none">
64
+ Contact Us
65
+ </button>
66
+ </div>
67
+ </div>
68
+ </div>
69
+ )}
70
+ </nav>
71
+ );
72
+ };
73
+
74
+ const App = () => {
75
+ return (
76
+ <div className="antialiased">
77
+ <Nav />
78
+ {/* Rest of your components will go here */}
79
+ </div>
80
+ );
81
+ };
82
+
83
+ const root = ReactDOM.createRoot(document.getElementById('root'));
84
+ root.render(<App />);
85
+
86
+ // Initialize feather icons after render
87
+ document.addEventListener('DOMContentLoaded', function() {
88
+ feather.replace();
89
+ });
90
+ </script>
91
+ >>>>>>> REPLACE