File size: 6,419 Bytes
b95828a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
:root {
--background-color: #121212;
--card-background: #1e1e1e;
--text-color: #e0e0e0;
--primary-color: #03dac6; /* Teal accent */
--secondary-color: #bb86fc; /* Purple accent */
--border-color: #333333;
--rank1-color: #ffd700; /* Gold */
--rank2-color: #c0c0c0; /* Silver */
--rank3-color: #cd7f32; /* Bronze */
--hover-background: #2a2a2a;
}
body {
font-family: 'Inter', sans-serif;
background-color: var(--background-color);
color: var(--text-color);
margin: 0;
padding: 20px;
line-height: 1.6;
}
.container {
max-width: 1000px;
margin: 20px auto;
background-color: var(--card-background);
border-radius: 12px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
overflow: hidden; /* Ensures footer stays inside rounded corners */
}
header {
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
color: #000; /* Dark text on light gradient */
padding: 25px 30px;
text-align: center;
border-bottom: 1px solid var(--border-color);
}
header h1 {
margin: 0 0 10px 0;
font-size: 2.2rem;
font-weight: 700;
}
header p {
margin: 0;
font-size: 1rem;
opacity: 0.9;
}
#last-updated {
font-size: 0.8rem;
color: #333;
margin-top: 8px;
}
.leaderboard-header,
.leaderboard-row {
display: grid;
grid-template-columns: 60px 1fr 100px 170px 100px; /* Rank, User, Score, Time, Code */
align-items: center;
padding: 12px 30px;
border-bottom: 1px solid var(--border-color);
gap: 15px;
font-size: 0.95rem;
}
.leaderboard-header {
font-weight: 600;
background-color: rgba(255, 255, 255, 0.05); /* Slightly lighter header */
position: sticky; /* Make header sticky if leaderboard scrolls */
top: 0;
z-index: 10;
}
.leaderboard-row {
transition: background-color 0.2s ease-in-out, transform 0.2s ease;
}
.leaderboard-row:hover {
background-color: var(--hover-background);
transform: scale(1.01); /* Subtle zoom effect */
cursor: default;
}
.leaderboard-row:last-child {
border-bottom: none;
}
.rank {
font-weight: 700;
text-align: center;
font-size: 1.1em;
min-width: 40px; /* Ensure rank number doesn't wrap */
}
.username {
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.score {
text-align: right;
font-weight: 600;
color: var(--primary-color);
}
.timestamp {
font-size: 0.85em;
color: #aaa;
text-align: right;
}
.code-action {
text-align: center;
}
.view-code-btn {
background-color: var(--secondary-color);
color: var(--background-color);
border: none;
padding: 5px 12px;
border-radius: 5px;
cursor: pointer;
font-size: 0.8rem;
font-weight: 600;
transition: background-color 0.2s ease;
text-align: center;
}
.view-code-btn:hover {
background-color: #a06ef8; /* Slightly lighter purple */
}
/* Special ranks */
.leaderboard-row[data-rank="1"] .rank { color: var(--rank1-color); }
.leaderboard-row[data-rank="2"] .rank { color: var(--rank2-color); }
.leaderboard-row[data-rank="3"] .rank { color: var(--rank3-color); }
.leaderboard-row[data-rank="1"] { border-left: 4px solid var(--rank1-color); padding-left: 26px; }
.leaderboard-row[data-rank="2"] { border-left: 4px solid var(--rank2-color); padding-left: 26px; }
.leaderboard-row[data-rank="3"] { border-left: 4px solid var(--rank3-color); padding-left: 26px; }
#loading-indicator {
display: flex;
justify-content: center;
align-items: center;
padding: 50px;
font-size: 1.1rem;
color: #aaa;
gap: 10px;
}
.spinner {
border: 4px solid rgba(255, 255, 255, 0.1);
border-left-color: var(--primary-color);
border-radius: 50%;
width: 24px;
height: 24px;
animation: spin 1s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
footer {
text-align: center;
padding: 15px;
font-size: 0.9rem;
color: #888;
border-top: 1px solid var(--border-color);
background-color: rgba(0, 0, 0, 0.1);
}
/* Modal Styles */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 100; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgba(0, 0, 0, 0.7); /* Black w/ opacity */
padding-top: 60px; /* Location of the box */
}
.modal-content {
background-color: var(--card-background);
margin: 5% auto; /* 5% from the top and centered */
padding: 25px;
border: 1px solid var(--border-color);
border-radius: 8px;
width: 80%; /* Could be more or less, depending on screen size */
max-width: 900px;
position: relative;
box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.close-button {
color: #aaa;
position: absolute;
top: 10px;
right: 20px;
font-size: 28px;
font-weight: bold;
cursor: pointer;
}
.close-button:hover,
.close-button:focus {
color: #fff;
text-decoration: none;
}
#modal-username {
margin-top: 0;
margin-bottom: 20px;
color: var(--primary-color);
}
#modal-code {
background-color: #282c34; /* Match highlight.js theme background */
color: #abb2bf;
padding: 15px;
border-radius: 5px;
max-height: 60vh; /* Limit height and allow scroll */
overflow: auto;
display: block; /* Needed for <pre> */
white-space: pre-wrap; /* Wrap long lines */
word-break: break-all; /* Break words if needed */
}
/* Responsive adjustments (optional) */
@media (max-width: 768px) {
.leaderboard-header,
.leaderboard-row {
grid-template-columns: 40px 1fr 80px 80px; /* Adjust for smaller screens, hide timestamp maybe */
padding: 10px 15px;
gap: 10px;
font-size: 0.9rem;
}
.timestamp {
/* Hide timestamp column on small screens */
display: none;
}
.leaderboard-header .timestamp {
display: none;
}
.code-action {
/* Adjust button text or just show icon if needed */
grid-column: 4 / 5; /* Span correctly if timestamp is hidden */
}
.view-code-btn {
padding: 4px 8px;
font-size: 0.75rem;
}
header h1 {
font-size: 1.8rem;
}
.modal-content {
width: 95%;
}
} |