Skip to content

Commit

Permalink
Leaderboard optimization and and blog 7&8 optimization (#224)
Browse files Browse the repository at this point in the history
This PR contains two parts. 

1. Leaderboard optimization by @HuanzhiMao , including adding the
summary table, support expand/collapse, add vote feature, and style fix.
2. Blog 7&8 optimization by @CharlieJCJ , including formatting and
grammar fix

---------

Co-authored-by: Charlie Cheng-Jie Ji <[email protected]>
  • Loading branch information
HuanzhiMao and CharlieJCJ authored Mar 1, 2024
1 parent 63b88ca commit 42c325e
Show file tree
Hide file tree
Showing 10 changed files with 1,467 additions and 524 deletions.
54 changes: 49 additions & 5 deletions assets/css/api-explorer.css
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,6 @@
#report-issue-btn {
background-color: #a53931;
color: white;
border: 2px solid transparent;
padding: 8px 16px;
font-size: 14px;
border-radius: 3px;
cursor: pointer;
transition: background-color 0.3s, border-color 0.3s;
}

Expand All @@ -204,4 +199,53 @@
/* Even darker for the pressed effect */
transform: scale(0.98);
/* Slightly smaller on click */
}

@media only screen and (max-width: 768px) {
#report-issue-btn {
padding: 0;
}
}


.thumbs {
background-color: #4CAF50;
/* Green background */
color: white;
/* White text */
}


.thumbs-down {
background-color: #f44336;
/* Red background */
}

.button-container {
display: flex;
justify-content: space-between;
/* This will ensure the children take up full space between them */
width: 100%;
/* Adjust this as needed */
align-items: center;
}


.button-container button {
font-size: 16px;
/* Adjust the font size as needed */
color: white;
/* Text color */
/* Background color */
border: none;
border-radius: 5px;
/* Rounded corners */
padding: 10px 20px;
/* Padding inside the button */
margin: 0 10px;
/* Space between buttons */
cursor: pointer;
/* Changes the cursor to a pointer on hover */
transition: background-color 0.3s ease;
/* Smooth transition for hover effect */
}
4 changes: 2 additions & 2 deletions assets/css/common-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ h2 {




/*
.navbar {
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
}
} */



Expand Down
2 changes: 1 addition & 1 deletion assets/css/contact.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ form input, form textarea {
border: 2px solid transparent;
border-radius: 3px;
color: white;
transition: background 0.3s ease;
transition: 0.3s ease;
margin: 0 auto;
min-width: 120px;
}
Expand Down
65 changes: 56 additions & 9 deletions assets/css/leaderboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,42 @@
background-color: #e57e81;
}

#leaderboard td:nth-child(6),
#leaderboard td:nth-child(7),
#leaderboard td:nth-child(8),
#leaderboard td:nth-child(6),
#leaderboard td:nth-child(8) {
background-color: #48eac9;
}

#leaderboard td:nth-child(11),
#leaderboard td:nth-child(10),
#leaderboard td:nth-child(12),
#leaderboard td:nth-child(9) {
background-color: #7ad5f0;
}


#leaderboard td:nth-child(10),
#leaderboard td:nth-child(11),
#leaderboard td:nth-child(12),
#leaderboard td:nth-child(15),
#leaderboard td:nth-child(14),
#leaderboard td:nth-child(16),
#leaderboard td:nth-child(13) {
background-color: #d5f8d5;
}

#leaderboard td:nth-child(14) {
#leaderboard td:nth-child(17) {
background-color: #65d57f;
}



/* Ensure the table uses the full width of its container */
table {
width: 100%;
table-layout: fixed;
table-layout: auto;
border-collapse: collapse;
width: auto; /* Allows the table to expand naturally based on content */
border-collapse: collapse;
table-layout: auto; /* Default layout for the table */
align-items: center;
justify-content: center;
}


Expand All @@ -82,6 +89,8 @@ table {
max-height: 500px; /* Set the maximum height of the table to 8 rows */
display: block;
border: 1px solid #ddd; /* Optional: Adds a border for better visibility */
align-items: center;
justify-content: center;
}


Expand Down Expand Up @@ -114,4 +123,42 @@ table {
#myChart {
width: 100%; /* Adjust the width to your preference */
}
}
}

.detail-row {
display: none; /* Hide detail rows initially */
}

.detail-small-header {
display: none; /* Hide detail headers initially */
}

.detail-header {
display: none; /* Hide detail headers initially */
}

.summary-small-header {
display: "";
}

.summary-row {
display: "";
}


#expand-btn {
font-size: 14px;
/* Adjust the font size as needed */
color: white;
/* Text color */
background-color: #6c757d;
/* Background color */
border: none;
border-radius: 5px;
/* Rounded corners */
padding: 5px 5px;
cursor: pointer;
/* Changes the cursor to a pointer on hover */
transition: background-color 0.3s ease;
/* Smooth transition for hover effect */
}
127 changes: 127 additions & 0 deletions assets/css/model_info_dashboard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#model_info_dashboard {
width: 90%;
border-collapse: collapse;
justify-content: center;
}

#model_info_dashboard th,
#model_info_dashboard td {
border: 1px solid #ddd;
padding: 8px;
text-align: center;
}

#model_info_dashboard tbody tr:nth-child(1),
#model_info_dashboard tbody tr:nth-child(2),
#model_info_dashboard tbody tr:nth-child(4),
#model_info_dashboard tbody tr:nth-child(5),
#model_info_dashboard tbody tr:nth-child(6),
#model_info_dashboard tbody tr:nth-child(7),
#model_info_dashboard tbody tr:nth-child(8),
#model_info_dashboard tbody tr:nth-child(9),
#model_info_dashboard tbody tr:nth-child(10),
#model_info_dashboard tbody tr:nth-child(13),
#model_info_dashboard tbody tr:nth-child(14){
background-color: white;
/* Lightest yellow for rank 1 */
}


#model_info_dashboard tbody tr:nth-child(3),
#model_info_dashboard tbody tr:nth-child(11),
#model_info_dashboard tbody tr:nth-child(12),
#model_info_dashboard tbody tr:nth-child(15),
#model_info_dashboard tbody tr:nth-child(16),
#model_info_dashboard tbody tr:nth-child(17),
#model_info_dashboard tbody tr:nth-child(18){
background-color: #DFEBEB;
/* Darker yellow for rank 3 */
}

/* #model_info_dashboard td:nth-child(2) {
background-color: white;
} */

/* #model_info_dashboard td:nth-child(6),
#model_info_dashboard td:nth-child(7),
#model_info_dashboard td:nth-child(8),
#model_info_dashboard td:nth-child(9) {
background-color: white;
}
#model_info_dashboard td:nth-child(10),
#model_info_dashboard td:nth-child(11),
#model_info_dashboard td:nth-child(12),
#model_info_dashboard td:nth-child(13) {
background-color:white;
}
#model_info_dashboard td:nth-child(14) {
background-color: white;
} */



/* Ensure the table uses the full width of its container */
table {
width: 100%;
table-layout: fixed;
border-collapse: collapse;
width: auto; /* Allows the table to expand naturally based on content */
border-collapse: collapse;
table-layout: auto; /* Default layout for the table */
}



#model_info_dashboard td, #model_info_dashboard th {
word-wrap: break-word; /* Allows words to break and wrap to the next line */
overflow-wrap: break-word; /* Ensures wrapping at break points */
padding: 8px; /* Adjust padding as needed */
text-align: center; /* Keeps text centered, adjust as needed */
border: 1px solid #ddd;
}




.table-container {
overflow-x: auto; /* Enable horizontal scrolling */
overflow-y: auto; /* Enable vertical scrolling */
-webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS devices */
width: 100%; /* Full width of the parent */
max-width: 100%; /* Ensure the container does not exceed the width of the parent */
max-height: 500px; /* Set the maximum height of the table to 8 rows */
display: block;
border: 1px solid #ddd; /* Optional: Adds a border for better visibility */
}





.group1 col {
width: 5px;
}


.group2 col, .group3 col, .group4 col, .group5 col, .group6 col, .group7 col, .group8 col {
width: auto;
}



#myChart {
display: block;
margin: auto; /* Center the canvas */
width: 80%; /* Adjust the width to your preference */
height: auto; /* This will maintain the aspect ratio */
max-height: 600px; /* Optional: to ensure it doesn't get too tall */
align-items: center;
justify-content: center;
}


@media only screen and (max-width: 768px) {
#myChart {
width: 100%; /* Adjust the width to your preference */
}
}
2 changes: 1 addition & 1 deletion blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<!-- Navigation Bar -->
<div class="navbar" style="position: absolute; top: 0; right: 20px; padding: 10px; z-index: 100; font-size: 18px;">
<a href="index.html">Home</a>
<a href="leaderboard.html">Leaderboard</a>
<a href="">Blog</a>
<a href="leaderboard.html">Leaderboard</a>
<a href="apizoo/">API Zoo Index</a>
</div>

Expand Down
Loading

0 comments on commit 42c325e

Please sign in to comment.