Skip to content

Commit

Permalink
tab and dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasank123k committed Jul 7, 2024
1 parent a2b7bbd commit 7476ce3
Show file tree
Hide file tree
Showing 8 changed files with 807 additions and 136 deletions.
26 changes: 26 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@mui/material": "^5.15.20",
"axios": "^1.7.2",
"react": "^18.2.0",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^18.2.0",
"react-icons": "^5.2.1",
"react-responsive-carousel": "^3.2.23",
Expand Down
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import LoginForm3 from './components/LoginForm/LoginForm3';
import ProgressBar from './components/ProgressBar/ProgressBar';
import Dropdown from './components/Dropdown/Dropdown';
import Template1 from './pages/Examples/Template1/Template1';
import Tab from './components/Tab/Tab';
import { AuthProvider } from './context/AuthContext';

const App: React.FC = () => {
Expand Down Expand Up @@ -93,6 +94,7 @@ const App: React.FC = () => {
<Route path="/loginform3" element={<LoginForm3 />} />
<Route path="/progressbar" element={<ProgressBar />} />
<Route path="dropdown" element={<Dropdown />} />
<Route path="/tab" element={<Tab />} />
</Routes>
<Footer></Footer>
</Router>
Expand Down
272 changes: 149 additions & 123 deletions src/components/Dropdown/Dropdown.module.css
Original file line number Diff line number Diff line change
@@ -1,124 +1,150 @@
.dropdownContainer {
display: flex;
justify-content: center;
margin: 20px 0;
flex-direction: column;
align-items: center;
}

.dropdown, .dropdown2, .dropdown3 {
position: relative;
display: inline-block;
margin-bottom: 20px;
}

.dropdownButton, .dropdownButton2, .dropdownButton3 {
background-color: #f8f8f8;
color: #333;
padding: 10px 20px;
font-size: 16px;
border: 1px solid #ddd;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
}

.dropdownButton:hover, .dropdownButton2:hover, .dropdownButton3:hover {
background-color: #e0e0e0;
}

.dropdownButton::after, .dropdownButton2::after, .dropdownButton3::after {
content: ' ▼';
font-size: 12px;
margin-left: 8px;
}

.dropdownMenu, .dropdownMenu2, .dropdownMenu3 {
display: block;
position: absolute;
background-color: white;
min-width: 200px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
border-radius: 4px;
z-index: 1;
margin-top: 8px;
padding: 10px 0;
}

.dropdownItem, .dropdownItem2, .dropdownItem3 {
color: #333;
padding: 12px 20px;
text-decoration: none;
display: block;
transition: background-color 0.3s ease;
}

.dropdownItem:hover, .dropdownItem2:hover, .dropdownItem3:hover {
background-color: #f1f1f1;
}

.icon {
margin-right: 10px;
}

.dropdownHeader {
padding: 12px 20px;
font-size: 14px;
color: #555;
border-bottom: 1px solid #ddd;
margin-bottom: 10px;
}

.codeBox {
margin-top: 20px;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
background-color: #2d2d2d;
color: #fff;
max-height: 300px;
overflow-y: scroll;
position: relative;
}

.toggleButtons {
display: flex;
justify-content: center;
gap: 10px;
margin-bottom: 10px;
}

.toggleButton {
padding: 5px 10px;
cursor: pointer;
border: 1px solid #ddd;
background-color: #444;
color: #fff;
border-radius: 3px;
}

.toggleButton.active {
background-color: #3b82f6;
border-color: #3b82f6;
}

.copyButton {
padding: 5px 10px;
cursor: pointer;
border: 1px solid #ddd;
background-color: #444;
color: #fff;
border-radius: 3px;
position: absolute;
top: 10px;
right: 10px;
}

.heading {
margin-top: 40px;
text-align: center;
font-size: 24px;
color: #333;
margin-bottom: 20px;
}

display: flex;
justify-content: center;
margin: 20px 0;
flex-direction: column;
align-items: center;
}

.dropdown, .dropdown2, .dropdown3, .dropdown4 {
position: relative;
display: inline-block;
margin-bottom: 20px;
}

.dropdownButton, .dropdownButton2, .dropdownButton3, .dropdownButton4 {
background-color: #f8f8f8;
color: #333;
padding: 10px 20px;
font-size: 16px;
border: 1px solid #ddd;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
}

.dropdownButton:hover, .dropdownButton2:hover, .dropdownButton3:hover, .dropdownButton4:hover {
background-color: #e0e0e0;
}

.dropdownButton::after, .dropdownButton2::after, .dropdownButton3::after, .dropdownButton4::after {
content: ' ▼';
font-size: 12px;
margin-left: 8px;
}

.dropdownMenu, .dropdownMenu2, .dropdownMenu3, .dropdownMenu4 {
display: block;
position: absolute;
background-color: white;
min-width: 200px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
border-radius: 4px;
z-index: 1;
margin-top: 8px;
padding: 10px 0;
}

.dropdownItem, .dropdownItem2, .dropdownItem3, .dropdownItem4 {
color: #333;
padding: 12px 20px;
text-decoration: none;
display: block;
transition: background-color 0.3s ease;
position: relative;
}

.dropdownItem:hover, .dropdownItem2:hover, .dropdownItem3:hover, .dropdownItem4:hover {
background-color: #f1f1f1;
}

.icon {
margin-right: 10px;
}

.dropdownHeader {
padding: 12px 20px;
font-size: 14px;
color: #555;
border-bottom: 1px solid #ddd;
margin-bottom: 10px;
}

.nestedDropdownMenu {
display: block;
position: absolute;
left: 100%;
top: 0;
background-color: white;
min-width: 200px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
border-radius: 4px;
z-index: 1;
margin-top: 0;
padding: 10px 0;
}

.nestedDropdownItem {
color: #333;
padding: 12px 20px;
text-decoration: none;
display: block;
transition: background-color 0.3s ease;
}

.nestedDropdownItem:hover {
background-color: #f1f1f1;
}

.codeBox {
margin-top: 20px;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
background-color: #2d2d2d;
color: #fff;
max-height: 300px;
overflow-y: scroll;
position: relative;
}

.toggleButtons {
display: flex;
justify-content: center;
gap: 10px;
margin-bottom: 10px;
}

.toggleButton {
padding: 5px 10px;
cursor: pointer;
border: 1px solid #ddd;
background-color: #444;
color: #fff;
border-radius: 3px;
}

.toggleButton.active {
background-color: #3b82f6;
border-color: #3b82f6;
}

.copyButton {
padding: 5px 10px;
cursor: pointer;
border: 1px solid #ddd;
background-color: #444;
color: #fff;
border-radius: 3px;
position: absolute;
top: 10px;
right: 10px;
}

.heading {
margin-top: 40px;
text-align: center;
font-size: 24px;
color: #333;
margin-bottom: 20px;
}
Loading

0 comments on commit 7476ce3

Please sign in to comment.