849 行
28 KiB
HTML
849 行
28 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Minecraft Problem Library</title>
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/remixicon/4.6.0/remixicon.min.css" rel="stylesheet">
|
|
<style>
|
|
/* Font Loading */
|
|
@font-face {
|
|
font-family: 'Press Start 2P';
|
|
src: url('https://fonts.gstatic.com/s/pressstart2p/v15/e3t4euO8T-267oIAQAu6jDQyK3nVivM.woff2') format('woff2');
|
|
font-display: swap;
|
|
}
|
|
|
|
@font-face {
|
|
font-family: 'MiSans-Regular';
|
|
src: url('https://assets-persist.lovart.ai/agent-static-assets/MiSans-Regular.ttf');
|
|
}
|
|
|
|
:root {
|
|
--mc-dirt-dark: #5e4032;
|
|
--mc-dirt-light: #866043;
|
|
--mc-grass-side: #7CB342;
|
|
--mc-grass-top: #558B2F;
|
|
--mc-stone: #757575;
|
|
--mc-stone-light: #9E9E9E;
|
|
--mc-wood-dark: #4E342E;
|
|
--mc-wood-light: #795548;
|
|
--mc-plank: #A1887F;
|
|
--mc-text-shadow: 2px 2px 0 #000;
|
|
--mc-bg: #1e1e1e;
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
body {
|
|
font-family: 'MiSans-Regular', sans-serif;
|
|
background-color: #121212;
|
|
color: white;
|
|
width: 1920px;
|
|
min-height: 100vh;
|
|
overflow-x: hidden;
|
|
background-image:
|
|
linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)),
|
|
url('https://images.unsplash.com/photo-1587573088697-b4f9d17102dd?q=80&w=2669&auto=format&fit=crop'); /* Minecraft-like texture bg */
|
|
background-size: cover;
|
|
background-attachment: fixed;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
/* Minecraft Button Utility */
|
|
.mc-btn {
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 12px;
|
|
padding: 12px 20px;
|
|
border: 4px solid #000;
|
|
background: #9E9E9E;
|
|
color: #fff;
|
|
text-shadow: 2px 2px #333;
|
|
cursor: pointer;
|
|
box-shadow: inset -4px -4px 0px #555, inset 4px 4px 0px #DDD;
|
|
text-decoration: none;
|
|
display: inline-block;
|
|
transition: transform 0.1s;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.mc-btn:active {
|
|
box-shadow: inset -4px -4px 0px #DDD, inset 4px 4px 0px #555;
|
|
transform: translateY(2px);
|
|
}
|
|
|
|
.mc-btn.green {
|
|
background: #7CB342;
|
|
box-shadow: inset -4px -4px 0px #33691E, inset 4px 4px 0px #AED581;
|
|
}
|
|
.mc-btn.green:active {
|
|
box-shadow: inset -4px -4px 0px #AED581, inset 4px 4px 0px #33691E;
|
|
}
|
|
|
|
/* Top Navigation */
|
|
.top-nav {
|
|
height: 70px;
|
|
background-color: rgba(0,0,0,0.8);
|
|
border-bottom: 4px solid #3e3e3e;
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 0 40px;
|
|
justify-content: space-between;
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 100;
|
|
}
|
|
|
|
.nav-brand {
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 20px;
|
|
color: #FFEB3B;
|
|
text-shadow: var(--mc-text-shadow);
|
|
margin-right: 60px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
.nav-links {
|
|
display: flex;
|
|
gap: 10px;
|
|
}
|
|
|
|
.nav-item {
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 12px;
|
|
color: #ccc;
|
|
text-decoration: none;
|
|
padding: 10px 20px;
|
|
border: 2px solid transparent;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.nav-item:hover, .nav-item.active {
|
|
color: #fff;
|
|
background: rgba(255,255,255,0.1);
|
|
border: 2px solid #fff;
|
|
text-shadow: 2px 2px 0 #000;
|
|
}
|
|
|
|
.user-info {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 15px;
|
|
}
|
|
|
|
.user-avatar {
|
|
width: 40px;
|
|
height: 40px;
|
|
border: 2px solid #fff;
|
|
image-rendering: pixelated;
|
|
}
|
|
|
|
/* Layout Container */
|
|
.container {
|
|
display: flex;
|
|
flex: 1;
|
|
max-width: 1920px;
|
|
}
|
|
|
|
/* Sidebar */
|
|
.sidebar {
|
|
width: 280px;
|
|
background-color: #5D4037; /* Dark Wood */
|
|
border-right: 4px solid #3E2723;
|
|
display: flex;
|
|
flex-direction: column;
|
|
padding: 20px;
|
|
background-image: repeating-linear-gradient(
|
|
45deg,
|
|
rgba(255,255,255,0.05) 0px,
|
|
rgba(255,255,255,0.05) 2px,
|
|
transparent 2px,
|
|
transparent 10px
|
|
);
|
|
}
|
|
|
|
.sidebar-menu {
|
|
list-style: none;
|
|
margin-bottom: auto;
|
|
}
|
|
|
|
.menu-item {
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.menu-link {
|
|
display: block;
|
|
padding: 15px;
|
|
background: #8D6E63; /* Plank color */
|
|
color: #fff;
|
|
text-decoration: none;
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 10px;
|
|
border: 4px solid #3E2723;
|
|
box-shadow: inset 2px 2px 0 rgba(255,255,255,0.2);
|
|
transition: transform 0.1s;
|
|
}
|
|
|
|
.menu-link:hover {
|
|
transform: scale(1.02);
|
|
background: #A1887F;
|
|
}
|
|
|
|
.menu-link.active {
|
|
background: #7CB342;
|
|
border-color: #33691E;
|
|
}
|
|
|
|
.daily-quest-panel {
|
|
background: #263238;
|
|
border: 4px solid #000;
|
|
padding: 15px;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.quest-title {
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 12px;
|
|
color: #FFEB3B;
|
|
margin-bottom: 10px;
|
|
text-shadow: 1px 1px #000;
|
|
}
|
|
|
|
.quest-progress {
|
|
height: 20px;
|
|
background: #37474F;
|
|
border: 2px solid #000;
|
|
position: relative;
|
|
}
|
|
|
|
.quest-bar {
|
|
height: 100%;
|
|
width: 60%;
|
|
background: #29B6F6;
|
|
box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2);
|
|
}
|
|
|
|
.quest-text {
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 10px;
|
|
margin-top: 8px;
|
|
text-align: right;
|
|
color: #B0BEC5;
|
|
}
|
|
|
|
/* Main Content */
|
|
.main-content {
|
|
flex: 1;
|
|
padding: 40px;
|
|
background: rgba(0,0,0,0.4);
|
|
backdrop-filter: blur(5px);
|
|
}
|
|
|
|
.page-header {
|
|
display: flex;
|
|
align-items: center;
|
|
margin-bottom: 30px;
|
|
gap: 15px;
|
|
}
|
|
|
|
.page-title {
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 32px;
|
|
color: #fff;
|
|
text-shadow: 4px 4px 0 #000;
|
|
}
|
|
|
|
/* Stats Cards */
|
|
.stats-row {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, 1fr);
|
|
gap: 20px;
|
|
margin-bottom: 30px;
|
|
}
|
|
|
|
.stat-card {
|
|
background: #546E7A; /* Stone Blue */
|
|
border: 4px solid #263238;
|
|
padding: 20px;
|
|
position: relative;
|
|
box-shadow: 6px 6px 0 rgba(0,0,0,0.5);
|
|
}
|
|
|
|
.stat-card::after {
|
|
content: '';
|
|
position: absolute;
|
|
top: 4px;
|
|
left: 4px;
|
|
right: 4px;
|
|
bottom: 4px;
|
|
border: 2px dashed rgba(255,255,255,0.1);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.stat-label {
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 10px;
|
|
color: #CFD8DC;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.stat-value {
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 24px;
|
|
color: #fff;
|
|
text-shadow: 2px 2px 0 #000;
|
|
}
|
|
|
|
/* Filters */
|
|
.filter-section {
|
|
background: #3E2723;
|
|
border: 4px solid #000;
|
|
padding: 15px;
|
|
margin-bottom: 20px;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 15px;
|
|
align-items: center;
|
|
}
|
|
|
|
.category-tabs {
|
|
display: flex;
|
|
gap: 8px;
|
|
margin-right: auto;
|
|
}
|
|
|
|
.tab-btn {
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 10px;
|
|
padding: 10px 15px;
|
|
background: #5D4037;
|
|
border: 2px solid #8D6E63;
|
|
color: #D7CCC8;
|
|
cursor: pointer;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.tab-btn.active {
|
|
background: #7CB342;
|
|
color: white;
|
|
border-color: #AED581;
|
|
box-shadow: 0 4px 0 #33691E;
|
|
transform: translateY(-2px);
|
|
}
|
|
|
|
.filter-controls {
|
|
display: flex;
|
|
gap: 10px;
|
|
}
|
|
|
|
.mc-select {
|
|
font-family: 'MiSans-Regular', sans-serif; /* Readable font for dropdown */
|
|
font-size: 14px;
|
|
padding: 8px;
|
|
background: #D7CCC8;
|
|
border: 3px solid #5D4037;
|
|
color: #3E2723;
|
|
outline: none;
|
|
cursor: pointer;
|
|
min-width: 120px;
|
|
}
|
|
|
|
.mc-input {
|
|
font-family: 'MiSans-Regular', sans-serif;
|
|
font-size: 14px;
|
|
padding: 8px 12px;
|
|
background: #212121;
|
|
border: 3px solid #616161;
|
|
color: #fff;
|
|
width: 200px;
|
|
}
|
|
|
|
.mc-search-btn {
|
|
background: #FFB74D;
|
|
border: 3px solid #E65100;
|
|
color: #3E2723;
|
|
padding: 0 15px;
|
|
cursor: pointer;
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 10px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
/* Problem Table */
|
|
.problem-table-container {
|
|
background: #8D6E63; /* Plank */
|
|
border: 4px solid #3E2723;
|
|
padding: 10px;
|
|
box-shadow: 8px 8px 0 rgba(0,0,0,0.5);
|
|
}
|
|
|
|
.problem-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
.problem-table th {
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 10px;
|
|
text-align: left;
|
|
padding: 15px;
|
|
background: #5D4037;
|
|
color: #FFCC80;
|
|
border-bottom: 4px solid #3E2723;
|
|
}
|
|
|
|
.problem-table td {
|
|
padding: 12px 15px;
|
|
border-bottom: 2px solid #5D4037;
|
|
color: #3E2723;
|
|
font-size: 14px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.problem-table tr:hover td {
|
|
background-color: rgba(255,255,255,0.1);
|
|
}
|
|
|
|
.problem-table tr:last-child td {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.status-icon {
|
|
font-size: 18px;
|
|
}
|
|
.status-solved { color: #2E7D32; }
|
|
.status-locked { color: #616161; }
|
|
.status-attempted { color: #F57F17; }
|
|
|
|
.difficulty-stars {
|
|
display: flex;
|
|
gap: 2px;
|
|
}
|
|
.star {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.tag-badge {
|
|
background: #3E2723;
|
|
color: #D7CCC8;
|
|
padding: 2px 6px;
|
|
font-size: 12px;
|
|
border-radius: 2px;
|
|
display: inline-block;
|
|
margin-right: 4px;
|
|
}
|
|
|
|
.table-btn {
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 8px;
|
|
padding: 6px 10px;
|
|
border: 2px solid #000;
|
|
background: #FFB74D;
|
|
color: #000;
|
|
text-decoration: none;
|
|
display: inline-block;
|
|
box-shadow: inset -2px -2px 0 #E65100, inset 2px 2px 0 #FFE0B2;
|
|
}
|
|
|
|
.table-btn:hover {
|
|
transform: scale(1.05);
|
|
}
|
|
|
|
/* Pagination */
|
|
.pagination {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
margin-top: 20px;
|
|
gap: 15px;
|
|
}
|
|
|
|
.page-info {
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 10px;
|
|
color: #fff;
|
|
}
|
|
|
|
/* Right Floating Panel */
|
|
.right-panel {
|
|
width: 260px;
|
|
padding: 20px;
|
|
margin-right: 20px;
|
|
}
|
|
|
|
.task-card {
|
|
background: #F5F5F5; /* Paper */
|
|
border: 4px solid #424242;
|
|
padding: 15px;
|
|
box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
|
|
position: sticky;
|
|
top: 100px;
|
|
}
|
|
|
|
.task-card::before {
|
|
content: '';
|
|
display: block;
|
|
height: 10px;
|
|
background: #B71C1C; /* Red tape */
|
|
width: 40px;
|
|
margin: -25px auto 15px;
|
|
box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
|
|
}
|
|
|
|
.task-header {
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 12px;
|
|
color: #212121;
|
|
margin-bottom: 15px;
|
|
text-align: center;
|
|
border-bottom: 2px dashed #9E9E9E;
|
|
padding-bottom: 10px;
|
|
}
|
|
|
|
.task-list {
|
|
list-style: none;
|
|
}
|
|
|
|
.task-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
margin-bottom: 12px;
|
|
font-size: 13px;
|
|
color: #424242;
|
|
}
|
|
|
|
.mc-checkbox {
|
|
appearance: none;
|
|
width: 16px;
|
|
height: 16px;
|
|
border: 2px solid #000;
|
|
background: #fff;
|
|
cursor: pointer;
|
|
position: relative;
|
|
}
|
|
|
|
.mc-checkbox:checked {
|
|
background: #7CB342;
|
|
}
|
|
|
|
.mc-checkbox:checked::after {
|
|
content: '✔';
|
|
position: absolute;
|
|
top: -3px;
|
|
left: 1px;
|
|
font-size: 12px;
|
|
color: #fff;
|
|
}
|
|
|
|
.xp-reward {
|
|
font-family: 'Press Start 2P', cursive;
|
|
font-size: 8px;
|
|
color: #F57F17;
|
|
margin-left: auto;
|
|
}
|
|
|
|
/* Responsive */
|
|
@media (max-width: 1200px) {
|
|
.stats-row {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<nav class="top-nav">
|
|
<div class="nav-brand">
|
|
<i class="ri-book-3-fill" style="color: #8D6E63; font-size: 24px;"></i>
|
|
CRAFT CODE
|
|
</div>
|
|
<div class="nav-links">
|
|
<a href="#" class="nav-item">HOME</a>
|
|
<a href="#" class="nav-item active">PROBLEMS</a>
|
|
<a href="#" class="nav-item">CONTEST</a>
|
|
<a href="#" class="nav-item">LEADERBOARD</a>
|
|
</div>
|
|
<div class="user-info">
|
|
<img src="https://api.dicebear.com/7.x/pixel-art/svg?seed=Felix" alt="User" class="user-avatar">
|
|
<div style="font-family: 'Press Start 2P'; font-size: 10px; color: #fff;">Steve</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="container">
|
|
<!-- Sidebar -->
|
|
<aside class="sidebar">
|
|
<ul class="sidebar-menu">
|
|
<li class="menu-item"><a href="#" class="menu-link active">ALL PROBLEMS</a></li>
|
|
<li class="menu-item"><a href="#" class="menu-link">ALGORITHMS</a></li>
|
|
<li class="menu-item"><a href="#" class="menu-link">DATA STRUCTURES</a></li>
|
|
<li class="menu-item"><a href="#" class="menu-link">MATH</a></li>
|
|
<li class="menu-item"><a href="#" class="menu-link">STRINGS</a></li>
|
|
<li class="menu-item"><a href="#" class="menu-link">DYNAMIC PROG</a></li>
|
|
</ul>
|
|
|
|
<div class="daily-quest-panel">
|
|
<div class="quest-title">DAILY QUEST</div>
|
|
<div class="quest-progress">
|
|
<div class="quest-bar"></div>
|
|
</div>
|
|
<div class="quest-text">3/5 COMPLETED</div>
|
|
</div>
|
|
</aside>
|
|
|
|
<!-- Main Content -->
|
|
<main class="main-content">
|
|
<div class="page-header">
|
|
<i class="ri-book-read-line" style="font-size: 32px; color: #FFD54F;"></i>
|
|
<h1 class="page-title">PROBLEM LIBRARY</h1>
|
|
</div>
|
|
|
|
<div class="stats-row">
|
|
<div class="stat-card">
|
|
<div class="stat-label">TOTAL PROBLEMS</div>
|
|
<div class="stat-value">1,556</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div class="stat-label">COMPLETED</div>
|
|
<div class="stat-value" style="color: #7CB342;">128</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div class="stat-label">PASS RATE</div>
|
|
<div class="stat-value" style="color: #FFB74D;">85%</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="filter-section">
|
|
<div class="category-tabs">
|
|
<button class="tab-btn active" onclick="switchTab(this)">CSP-J</button>
|
|
<button class="tab-btn" onclick="switchTab(this)">CSP-S</button>
|
|
<button class="tab-btn" onclick="switchTab(this)">NOIP</button>
|
|
</div>
|
|
|
|
<div class="filter-controls">
|
|
<select class="mc-select">
|
|
<option>All Difficulty</option>
|
|
<option>1 Star</option>
|
|
<option>2 Stars</option>
|
|
<option>3 Stars</option>
|
|
<option>4 Stars</option>
|
|
<option>5 Stars</option>
|
|
</select>
|
|
<select class="mc-select">
|
|
<option>All Tags</option>
|
|
<option>Array</option>
|
|
<option>Stack</option>
|
|
<option>Queue</option>
|
|
</select>
|
|
<input type="text" class="mc-input" id="searchInput" placeholder="Search problems...">
|
|
<button class="mc-search-btn" onclick="filterTable()">
|
|
<i class="ri-search-2-line"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="problem-table-container">
|
|
<table class="problem-table" id="problemTable">
|
|
<thead>
|
|
<tr>
|
|
<th width="50">STS</th>
|
|
<th width="60">ID</th>
|
|
<th>TITLE</th>
|
|
<th width="100">RATE</th>
|
|
<th width="100">DIFF</th>
|
|
<th width="150">TAGS</th>
|
|
<th width="80">ACT</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<!-- Data rows will be populated by JS -->
|
|
<tr>
|
|
<td><i class="ri-checkbox-circle-fill status-solved status-icon"></i></td>
|
|
<td>1001</td>
|
|
<td>A+B Problem</td>
|
|
<td>95%</td>
|
|
<td>
|
|
<div class="difficulty-stars">
|
|
<i class="ri-star-fill star" style="color:#7CB342"></i>
|
|
<i class="ri-star-line star" style="color:#757575"></i>
|
|
<i class="ri-star-line star" style="color:#757575"></i>
|
|
</div>
|
|
</td>
|
|
<td><span class="tag-badge">Math</span></td>
|
|
<td><a href="#" class="table-btn">SOLVE</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td><i class="ri-lock-fill status-locked status-icon"></i></td>
|
|
<td>1002</td>
|
|
<td>Fibonacci Sequence</td>
|
|
<td>45%</td>
|
|
<td>
|
|
<div class="difficulty-stars">
|
|
<i class="ri-star-fill star" style="color:#FFB74D"></i>
|
|
<i class="ri-star-fill star" style="color:#FFB74D"></i>
|
|
<i class="ri-star-line star" style="color:#757575"></i>
|
|
</div>
|
|
</td>
|
|
<td><span class="tag-badge">DP</span></td>
|
|
<td><a href="#" class="table-btn">SOLVE</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="pagination">
|
|
<button class="mc-btn">PREV</button>
|
|
<div class="page-info">PAGE 1 / 32</div>
|
|
<button class="mc-btn green">NEXT</button>
|
|
</div>
|
|
</main>
|
|
|
|
<!-- Right Panel -->
|
|
<aside class="right-panel">
|
|
<div class="task-card">
|
|
<div class="task-header">DAILY TASKS</div>
|
|
<ul class="task-list">
|
|
<li class="task-item">
|
|
<input type="checkbox" class="mc-checkbox" checked>
|
|
<span>Login Daily</span>
|
|
<span class="xp-reward">+10XP</span>
|
|
</li>
|
|
<li class="task-item">
|
|
<input type="checkbox" class="mc-checkbox" checked>
|
|
<span>Solve 1 Easy</span>
|
|
<span class="xp-reward">+20XP</span>
|
|
</li>
|
|
<li class="task-item">
|
|
<input type="checkbox" class="mc-checkbox">
|
|
<span>Solve 1 Medium</span>
|
|
<span class="xp-reward">+50XP</span>
|
|
</li>
|
|
<li class="task-item">
|
|
<input type="checkbox" class="mc-checkbox">
|
|
<span>Submit 5 times</span>
|
|
<span class="xp-reward">+15XP</span>
|
|
</li>
|
|
<li class="task-item">
|
|
<input type="checkbox" class="mc-checkbox">
|
|
<span>Review Code</span>
|
|
<span class="xp-reward">+30XP</span>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</aside>
|
|
</div>
|
|
|
|
<script>
|
|
// Sample Data Generation
|
|
const problems = [
|
|
{ id: '1001', title: 'A+B Problem', rate: '98%', diff: 1, tags: ['Math'], status: 'solved' },
|
|
{ id: '1002', title: 'Knapsack Problem', rate: '45%', diff: 3, tags: ['DP', 'Math'], status: 'attempted' },
|
|
{ id: '1003', title: 'Binary Tree Traversal', rate: '60%', diff: 2, tags: ['Tree', 'DFS'], status: 'locked' },
|
|
{ id: '1004', title: 'Shortest Path (Dijkstra)', rate: '32%', diff: 4, tags: ['Graph'], status: 'locked' },
|
|
{ id: '1005', title: 'String Matching (KMP)', rate: '28%', diff: 5, tags: ['String'], status: 'locked' },
|
|
{ id: '1006', title: 'Counting Sort', rate: '75%', diff: 2, tags: ['Sort'], status: 'solved' },
|
|
{ id: '1007', title: 'N-Queens', rate: '40%', diff: 3, tags: ['Backtrack'], status: 'locked' },
|
|
{ id: '1008', title: 'Union Find', rate: '55%', diff: 3, tags: ['DS'], status: 'attempted' },
|
|
{ id: '1009', title: 'Segment Tree Range Sum', rate: '20%', diff: 5, tags: ['Tree'], status: 'locked' },
|
|
{ id: '1010', title: 'Prim MST', rate: '35%', diff: 4, tags: ['Graph'], status: 'locked' }
|
|
];
|
|
|
|
function getStatusIcon(status) {
|
|
if (status === 'solved') return '<i class="ri-checkbox-circle-fill status-solved status-icon"></i>';
|
|
if (status === 'attempted') return '<i class="ri-record-circle-fill status-attempted status-icon"></i>';
|
|
return '<i class="ri-lock-fill status-locked status-icon"></i>';
|
|
}
|
|
|
|
function getStars(count) {
|
|
let html = '<div class="difficulty-stars">';
|
|
const colors = ['#7CB342', '#29B6F6', '#FFB74D', '#FF7043', '#D32F2F']; // Color coding
|
|
const color = colors[count - 1] || '#757575';
|
|
|
|
for(let i=0; i<5; i++) {
|
|
if(i < count) {
|
|
html += `<i class="ri-star-fill star" style="color:${color}"></i>`;
|
|
} else {
|
|
html += `<i class="ri-star-line star" style="color:#757575"></i>`;
|
|
}
|
|
}
|
|
html += '</div>';
|
|
return html;
|
|
}
|
|
|
|
function renderTable(data) {
|
|
const tbody = document.querySelector('#problemTable tbody');
|
|
tbody.innerHTML = '';
|
|
|
|
data.forEach(p => {
|
|
const tr = document.createElement('tr');
|
|
tr.innerHTML = `
|
|
<td>${getStatusIcon(p.status)}</td>
|
|
<td>${p.id}</td>
|
|
<td style="cursor:pointer;" onclick="window.location.href='code-editor.html?id=${p.id}'">${p.title}</td>
|
|
<td>${p.rate}</td>
|
|
<td>${getStars(p.diff)}</td>
|
|
<td>${p.tags.map(t => `<span class="tag-badge">${t}</span>`).join('')}</td>
|
|
<td><a href="code-editor.html?id=${p.id}" class="table-btn">SOLVE</a></td>
|
|
`;
|
|
tbody.appendChild(tr);
|
|
});
|
|
}
|
|
|
|
// Tab Switching Logic
|
|
function switchTab(element) {
|
|
document.querySelectorAll('.tab-btn').forEach(btn => btn.classList.remove('active'));
|
|
element.classList.add('active');
|
|
// Mock data change
|
|
const shuffled = [...problems].sort(() => 0.5 - Math.random());
|
|
renderTable(shuffled);
|
|
}
|
|
|
|
// Filter Logic
|
|
function filterTable() {
|
|
const term = document.getElementById('searchInput').value.toLowerCase();
|
|
const filtered = problems.filter(p =>
|
|
p.title.toLowerCase().includes(term) ||
|
|
p.id.includes(term) ||
|
|
p.tags.some(t => t.toLowerCase().includes(term))
|
|
);
|
|
renderTable(filtered);
|
|
}
|
|
|
|
// Real-time search
|
|
document.getElementById('searchInput').addEventListener('input', filterTable);
|
|
|
|
// Sidebar Active State
|
|
document.querySelectorAll('.menu-link').forEach(link => {
|
|
link.addEventListener('click', (e) => {
|
|
e.preventDefault();
|
|
document.querySelectorAll('.menu-link').forEach(l => l.classList.remove('active'));
|
|
link.classList.add('active');
|
|
});
|
|
});
|
|
|
|
// Initialize
|
|
renderTable(problems);
|
|
|
|
// Save checkbox state to localStorage
|
|
document.querySelectorAll('.mc-checkbox').forEach((box, index) => {
|
|
const saved = localStorage.getItem(`task-${index}`);
|
|
if(saved !== null) {
|
|
box.checked = saved === 'true';
|
|
}
|
|
|
|
box.addEventListener('change', () => {
|
|
localStorage.setItem(`task-${index}`, box.checked);
|
|
});
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
</html> |