Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add tabs for challenges
  • Loading branch information
Harshit28j authored and lazyperson1020 committed Mar 25, 2025
commit 40998ce899c44e41b4da235294c066d55e920ea4
39 changes: 38 additions & 1 deletion frontend/src/css/modules/challenge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,41 @@ md-select .md-select-value span:first-child:after {

.filter-icon {
padding: 10px;
}
}
.no-margin {
margin: 0px;
}
.nav-underline {
display: flex;
justify-content: space-around;
border-bottom: 1px solid #e0e0e0;
li {
margin-bottom: -0.5%;
}

.nav-item {
flex: 1;
text-align: center;
color: #9e9e9e;

.nav-link {
display: block;
padding: 10px 0;
color: #9e9e9e;
text-decoration: none;
border: none;
background-color: transparent;
font-weight: bold;
transition: border-bottom 0.3s ease, color 0.3s ease;

&.active {
border-bottom: 2px solid #000;
color: #000;
}

&:hover {
color: #000;
}
}
}
}
34 changes: 31 additions & 3 deletions frontend/src/views/web/challenge-list.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
<section class="ev-sm-container ev-view challenge-container">
<p class="text-med-black fs-30 no-margin">All Challenges</p>
<!-- tabs for challenges -->
<div class="row">
<div class="col s12">
<ul class="nav nav-underline" ng-init="tab = 1">
<li class="nav-item">
<a href="#" ng-click="tab = 1" class="nav-link" ng-class="{'active': tab === 1}">
<strong class="text-med-black">Ongoing ({{challengeList.currentList.length}})</strong>
</a>
</li>
<li class="nav-item">
<a href="#" ng-click="tab = 2" class="nav-link" ng-class="{'active': tab === 2}">
<strong class="text-med-black">Upcoming ({{challengeList.upcomingList.length}})</strong>
</a>
</li>
<li class="nav-item">
<a href="#" ng-click="tab = 3" class="nav-link" ng-class="{'active': tab === 3}">
<strong class="text-med-black">Past ({{challengeList.pastList.length}})</strong>
</a>
</li>
</ul>
</div>
</div>

<!-- ongoing challenges -->
<div class="challenge-page-title" id = "ongoing-challenges"><strong class="text-med-black fs-18">Ongoing Challenges</strong></div>
<div ng-show="tab === 1" class="ongoing-challenges">
<div ng-if="challengeList.noneCurrentChallenge">None</div>
<div class="row">
<div class="col s12 m3" ng-repeat="challenge in challengeList.currentList"><a class="ev-card-hover" ui-sref="web.challenge-main.challenge-page({challengeId:challenge.id})">
Expand All @@ -22,6 +46,7 @@
<div class=" btn-card-detail waves-effect waves-dark w-300 fs-14"> <strong>View Details </strong> &nbsp; </div>
</div>
</a>
</div>
</div>
</div>

Expand All @@ -43,7 +68,7 @@
</div>

<!-- upcoming challenges -->
<div class="challenge-page-title"><strong class="text-med-black fs-18">Upcoming Challenges</strong></div>
<div ng-show="tab === 2" class="ongoing-challenges">
<div ng-if="challengeList.noneUpcomingChallenge">None</div>
<div class="row">
<div class="col s12 m3" ng-repeat="challenge in challengeList.upcomingList"><a class="ev-card-hover" ui-sref="web.challenge-main.challenge-page({challengeId:challenge.id})">
Expand All @@ -67,8 +92,10 @@
</a>
</div>
</div>
</div>

<!-- past challenges -->
<div class="challenge-page-title"><strong class="text-med-black fs-18">Past Challenges</strong></div>
<div ng-show="tab === 3" class="ongoing-challenges">
<div ng-if="challengeList.nonePastChallenge">None</div>
<div class="row">
<div class="col s12 m3" ng-repeat="challenge in challengeList.pastList">
Expand All @@ -91,6 +118,7 @@
<div class=" btn-card-detail waves-effect waves-dark w-300 fs-14"> <strong>View Details </strong> &nbsp; </div>
</div>
</a>
</div>
</div>
</div>
</section>
Expand Down