Skip to content

Commit

Permalink
feat: add triangle indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxilll committed Apr 23, 2024
1 parent 37b1565 commit d63885b
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 25 deletions.
64 changes: 42 additions & 22 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
.App {
color: black;
text-align: center;
max-width: 800px;
margin: 0 auto;
max-width: 800px;
margin: 0 auto;
}

.container {
Expand Down Expand Up @@ -68,14 +68,14 @@
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 10px;
margin-bottom: 20px;
gap: 10px;
margin-bottom: 20px;
}

.threshold-button {
padding: 10px 20px;
margin-right: 10px;
margin-bottom: 10px;
margin-right: 10px;
margin-bottom: 10px;
border: none;
border-radius: 20px;
background-color: #fff;
Expand All @@ -88,41 +88,41 @@
}

.threshold-button:hover {
background-color: #f0f0f0;
background-color: #f0f0f0;
}

.threshold-button.selected {
background-color: #007bff;
color: #fff;
background-color: #007bff;
color: #fff;
}

.header {
display: flex;
justify-content: center;
align-items: center;
justify-content: center;
align-items: center;
padding: 1rem;
background-color: #eceff1;
background-color: #eceff1;
}

.logo-image {
width: 150px;
width: 150px;
height: auto;
margin-bottom: 1rem;
margin-bottom: 1rem;
}

.logo-text {
font-family: 'Roboto', sans-serif;
font-family: 'Roboto', sans-serif;
font-size: 40px;
color: #333;
margin-right: 8px;
text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
margin-right: 8px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.logo-svg {
width: 50px;
height: auto;
vertical-align: middle;
margin-bottom: 4px;
vertical-align: middle;
margin-bottom: 4px;
}

.logo-container {
Expand All @@ -132,8 +132,28 @@
padding: 10px;
border-radius: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
background: white;
background: white;
cursor: pointer;
margin-bottom: 20px;
margin-top: 20px;
margin-bottom: 20px;
margin-top: 20px;
}

.dropdown-indicator {
display: inline-block;
margin-left: 5px;
transition: transform 0.3s ease;
}

.dropdown-indicator::after {
content: '';
display: inline-block;
vertical-align: middle;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 6px solid #333;
margin-left: 2px;
}

.dropdown-indicator.open::after {
transform: rotate(180deg);
}
13 changes: 10 additions & 3 deletions src/components/TabsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@ export const TabsList: React.FC<TabsListProps> = ({
}) => {
const [isOpen, setIsOpen] = useState(false);

const toggleList = () => {
setIsOpen(!isOpen);
};

return (
<div>
{title && (
<h2 onClick={() => setIsOpen(!isOpen)} style={{ cursor: 'pointer' }}>
{title} ({tabs.length})
</h2>
<div onClick={toggleList} style={{ cursor: 'pointer', position: 'relative' }}>
<h2 onClick={toggleList} style={{ cursor: 'pointer' }}>
{title} ({tabs.length})
<span className={`dropdown-indicator ${isOpen ? 'open' : ''}`}></span>
</h2>
</div>
)}
{isOpen && (
<ul className="tabs-list">
Expand Down

0 comments on commit d63885b

Please sign in to comment.