The user wants a digital portfolio showcase with rubrics and reviewer roles. This is a complex interactive application that needs:
- Portfolio Display - Showcasing digital work/projects
- Rubrics System - Evaluation criteria with scoring
- Reviewer Roles - Different types of reviewers with different permissions
Let me design this thoughtfully:
Features to include:
- Portfolio cards/projects that can be viewed
- A rubric scoring panel for reviewers
- Different reviewer roles (e.g., Admin, Senior Reviewer, Junior Reviewer)
- Interactive scoring system
- Summary/dashboard view
- Comments/feedback system
Design Direction:
- Professional, clean aesthetic - maybe a dark theme with sharp accents
- A distinctive font pairing - something like "Space Grotesk" for headlines + "DM Sans" for body
- Color scheme: Dark slate background with a vibrant accent (maybe electric cyan or coral)
- Card-based layout with glass-morphism touches
- Staggered animations for entries
Interactions:
- Tab switching between portfolio items
- Rubric scoring with sliders/inputs
- Role switching to show different permissions
- Expand/collapse project details
- Submit review functionality
- Filter/sort portfolios
Data Structure:
- Portfolio items with title, author, description, tags, thumbnail
- Rubrics with criteria, max scores, descriptions
- Reviewers with roles and permissions
- Reviews with scores and comments
Let me build this comprehensive single-page application.
Digital Portfolio Showcase with Rubrics & Reviewer Roles
A professional portfolio review system with role-based permissions, interactive rubric scoring, and a refined dark aesthetic.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Portfolio Review System</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=DM+Sans:wght@400;500;600&display=swap" rel="stylesheet">
<style>
:root {
--bg: #0a0a0f;
--bg-elevated: #12121a;
--card: #1a1a24;
--card-hover: #22222e;
--border: #2a2a38;
--fg: #f0f0f5;
--muted: #7a7a8c;
--accent: #00d4aa;
--accent-dim: rgba(0, 212, 170, 0.15);
--warning: #ffaa00;
--danger: #ff4466;
--info: #4488ff;
}
* {
box-sizing: border-box;
}
body {
font-family: 'DM Sans', sans-serif;
background: var(--bg);
color: var(--fg);
min-height: 100vh;
}
h1, h2, h3, h4 {
font-family: 'Space Grotesk', sans-serif;
}
.bg-noise {
background-image:
radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 212, 170, 0.08), transparent),
radial-gradient(ellipse 60% 40% at 100% 100%, rgba(68, 136, 255, 0.05), transparent),
url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}
.scrollbar-thin::-webkit-scrollbar {
width: 6px;
height: 6px;
}
.scrollbar-thin::-webkit-scrollbar-track {
background: var(--bg-elevated);
}
.scrollbar-thin::-webkit-scrollbar-thumb {
background: var(--border);
border-radius: 3px;
}
.scrollbar-thin::-webkit-scrollbar-thumb:hover {
background: var(--muted);
}
@keyframes fadeSlideUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes scaleIn {
from {
opacity: 0;
transform: scale(0.95);
}
to {
opacity: 1;
transform: scale(1);
}
}
@keyframes pulse-glow {
0%, 100% {
box-shadow: 0 0 0 0 rgba(0, 212, 170, 0);
}
50% {
box-shadow: 0 0 20px 4px rgba(0, 212, 170, 0.3);
}
}
.animate-fade-up {
animation: fadeSlideUp 0.5s ease-out forwards;
opacity: 0;
}
.animate-scale-in {
animation: scaleIn 0.3s ease-out forwards;
}
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
@media (prefers-reduced-motion: reduce) {
.animate-fade-up,
.animate-scale-in {
animation: none;
opacity: 1;
transform: none;
}
}
.slider-track {
-webkit-appearance: none;
appearance: none;
background: var(--border);
height: 6px;
border-radius: 3px;
outline: none;
}
.slider-track::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--accent);
cursor: pointer;
border: 3px solid var(--bg);
transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.slider-track::-webkit-slider-thumb:hover {
transform: scale(1.15);
box-shadow: 0 0 10px rgba(0, 212, 170, 0.5);
}
.slider-track:focus::-webkit-slider-thumb {
box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.3);
}
.role-badge {
transition: all 0.2s ease;
}
.role-badge:hover {
transform: translateY(-2px);
}
.portfolio-card {
transition: all 0.25s ease;
}
.portfolio-card:hover {
transform: translateY(-4px);
border-color: var(--accent);
}
.tab-indicator {
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.score-ring {
transition: stroke-dashoffset 0.6s ease;
}
.btn-primary {
position: relative;
overflow: hidden;
}
.btn-primary::after {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
transform: translateX(-100%);
transition: transform 0.5s ease;
}
.btn-primary:hover::after {
transform: translateX(100%);
}
.focus-ring:focus-visible {
outline: none;
box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}
</style>
</head>
<body class="bg-noise">
<!-- Header -->
<header class="sticky top-0 z-50 border-b backdrop-blur-xl" style="background: rgba(10,10,15,0.85); border-color: var(--border);">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex items-center justify-between h-16">
<div class="flex items-center gap-3">
<div class="w-9 h-9 rounded-lg flex items-center justify-center" style="background: var(--accent-dim); border: 1px solid var(--accent);">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="color: var(--accent);">
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/>
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/>
</svg>
</div>
<h1 class="text-lg font-bold tracking-tight">Portfolio Review</h1>
</div>
<!-- Role Switcher -->
<div class="flex items-center gap-4">
<span class="text-sm" style="color: var(--muted);">View as:</span>
<div class="flex gap-2" id="roleSwitcher" role="tablist" aria-label="Select reviewer role">
<!-- Roles rendered by JS -->
</div>
</div>
</div>
</div>
</header>
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<!-- Stats Overview -->
<section class="mb-8 animate-fade-up">
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
<div class="p-4 rounded-xl" style="background: var(--card); border: 1px solid var(--border);">
<p class="text-sm mb-1" style="color: var(--muted);">Total Portfolios</p>
<p class="text-2xl font-bold" id="statTotal">--</p>
</div>
<div class="p-4 rounded-xl" style="background: var(--card); border: 1px solid var(--border);">
<p class="text-sm mb-1" style="color: var(--muted);">Pending Review</p>
<p class="text-2xl font-bold" style="color: var(--warning);" id="statPending">--</p>
</div>
<div class="p-4 rounded-xl" style="background: var(--card); border: 1px solid var(--border);">
<p class="text-sm mb-1" style="color: var(--muted);">Completed</p>
<p class="text-2xl font-bold" style="color: var(--accent);" id="statCompleted">--</p>
</div>
<div class="p-4 rounded-xl" style="background: var(--card); border: 1px solid var(--border);">
<p class="text-sm mb-1" style="color: var(--muted);">Avg Score</p>
<p class="text-2xl font-bold" id="statAvgScore">--</p>
</div>
</div>
</section>
<!-- Main Content Grid -->
<div class="grid lg:grid-cols-3 gap-6">
<!-- Portfolio List -->
<section class="lg:col-span-2 animate-fade-up stagger-1">
<div class="flex items-center justify-between mb-4">
<h2 class="text-xl font-bold">Portfolios</h2>
<div class="flex gap-2">
<select id="filterStatus" class="px-3 py-1.5 rounded-lg text-sm focus-ring" style="background: var(--card); border: 1px solid var(--border); color: var(--fg);">
<option value="all">All Status</option>
<option value="pending">Pending</option>
<option value="reviewed">Reviewed</option>
</select>
</div>
</div>
<div id="portfolioList" class="space-y-3 max-h-[calc(100vh-320px)] overflow-y-auto scrollbar-thin pr-2">
<!-- Portfolio cards rendered by JS -->
</div>
</section>
<!-- Review Panel -->
<section class="animate-fade-up stagger-2">
<div class="sticky top-24">
<div id="reviewPanel" class="rounded-2xl p-5" style="background: var(--card); border: 1px solid var(--border);">
<!-- Review content rendered by JS -->
<div class="text-center py-12" style="color: var(--muted);">
<svg class="w-12 h-12 mx-auto mb-3 opacity-50" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
<path d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/>
<path d="M9 12h6M9 16h6"/>
</svg>
<p class="text-sm">Select a portfolio to review</p>
</div>
</div>
</div>
</section>
</div>
</main>
<!-- Toast Notification -->
<div id="toast" class="fixed bottom-6 right-6 px-4 py-3 rounded-xl shadow-2xl transform translate-y-20 opacity-0 transition-all duration-300 z-50" style="background: var(--card); border: 1px solid var(--border);">
<div class="flex items-center gap-3">
<div id="toastIcon"></div>
<span id="toastMessage" class="text-sm font-medium"></span>
</div>
</div>
<script>
// ============ DATA ============
const roles = [
{ id: 'admin', name: 'Admin', color: '#ff4466', permissions: ['view', 'score', 'comment', 'approve', 'delete'] },
{ id: 'senior', name: 'Senior Reviewer', color: '#00d4aa', permissions: ['view', 'score', 'comment', 'approve'] },
{ id: 'junior', name: 'Junior Reviewer', color: '#4488ff', permissions: ['view', 'score', 'comment'] }
];
const rubrics = [
{ id: 'concept', name: 'Concept & Creativity', maxScore: 25, description: 'Originality and creative thinking' },
{ id: 'execution', name: 'Technical Execution', maxScore: 25, description: 'Craft and technical proficiency' },
{ id: 'presentation', name: 'Presentation', maxScore: 20, description: 'Visual communication and clarity' },
{ id: 'process', name: 'Process Documentation', maxScore: 15, description: 'Documentation of workflow and iterations' },
{ id: 'impact', name: 'Impact & Relevance', maxScore: 15, description: 'Contextual relevance and potential impact' }
];
const portfolios = [
{
id: 1,
title: 'Sustainable Fashion Collection',
author: 'Elena Vasquez',
avatar: 'EV',
category: 'Fashion Design',
status: 'pending',
thumbnail: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
description: 'A zero-waste fashion line using innovative pattern cutting techniques and recycled materials.',
scores: {},
comment: ''
},
{
id: 2,
title: 'Fintech Mobile App',
author: 'Marcus Chen',
avatar: 'MC',
category: 'UI/UX Design',
status: 'reviewed',
thumbnail: 'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)',
description: 'A personal finance management app focused on accessibility and financial literacy.',
scores: { concept: 20, execution: 22, presentation: 18, process: 12, impact: 13 },
comment: 'Excellent user research and inclusive design approach.'
},
{
id: 3,
title: 'Architectural Visualization',
author: 'Sofia Andersson',
avatar: 'SA',
category: '3D Design',
status: 'pending',
thumbnail: 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
description: 'Photorealistic renders of sustainable housing concepts for urban environments.',
scores: {},
comment: ''
},
{
id: 4,
title: 'Brand Identity System',
author: 'James Okonkwo',
avatar: 'JO',
category: 'Brand Design',
status: 'reviewed',
thumbnail: 'linear-gradient(135deg, #fa709a 0%, #fee140 100%)',
description: 'Complete brand identity for a tech startup including logo, typography, and guidelines.',
scores: { concept: 23, execution: 24, presentation: 19, process: 14, impact: 12 },
comment: 'Outstanding attention to detail and comprehensive system thinking.'
},
{
id: 5,
title: 'Motion Graphics Reel',
author: 'Aisha Patel',
avatar: 'AP',
category: 'Motion Design',
status: 'pending',
thumbnail: 'linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)',
description: 'Collection of animated pieces for broadcast and digital media campaigns.',
scores: {},
comment: ''
},
{
id: 6,
title: 'Editorial Photography Series',
author: 'Lucas Rivera',
avatar: 'LR',
category: 'Photography',
status: 'pending',
thumbnail: 'linear-gradient(135deg, #d299c2 0%, #fef9d7 100%)',
description: 'Documentary series exploring urban transformation in post-industrial cities.',
scores: {},
comment: ''
}
];
// ============ STATE ============
let currentRole = roles[1]; // Default to Senior Reviewer
let selectedPortfolio = null;
let currentScores = {};
// ============ DOM ELEMENTS ============
const roleSwitcher = document.getElementById('roleSwitcher');
const portfolioList = document.getElementById('portfolioList');
const reviewPanel = document.getElementById('reviewPanel');
const filterStatus = document.getElementById('filterStatus');
// ============ UTILITY FUNCTIONS ============
function calculateTotal(scores) {
if (!scores || Object.keys(scores).length === 0) return 0;
return Object.values(scores).reduce((sum, s) => sum + (s || 0), 0);
}
function getMaxPossibleScore() {
return rubrics.reduce((sum, r) => sum + r.maxScore, 0);
}
function getScoreGrade(score) {
const max = getMaxPossibleScore();
const pct = (score / max) * 100;
if (pct >= 90) return { label: 'Excellent', color: '#00d4aa' };
if (pct >= 75) return { label: 'Strong', color: '#4488ff' };
if (pct >= 60) return { label: 'Good', color: '#ffaa00' };
return { label: 'Needs Work', color: '#ff4466' };
}
function hasPermission(perm) {
return currentRole.permissions.includes(perm);
}
function showToast(message, type = 'success') {
const toast = document.getElementById('toast');
const toastIcon = document.getElementById('toastIcon');
const toastMessage = document.getElementById('toastMessage');
const icons = {
success: `<svg class="w-5 h-5" style="color: var(--accent);" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22,4 12,14.01 9,11.01"/></svg>`,
error: `<svg class="w-5 h-5" style="color: var(--danger);" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>`,
info: `<svg class="w-5 h-5" style="color: var(--info);" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>`
};
toastIcon.innerHTML = icons[type];
toastMessage.textContent = message;
toast.classList.remove('translate-y-20', 'opacity-0');
toast.classList.add('translate-y-0', 'opacity-100');
setTimeout(() => {
toast.classList.remove('translate-y-0', 'opacity-100');
toast.classList.add('translate-y-20', 'opacity-0');
}, 3000);
}
// ============ RENDER FUNCTIONS ============
function renderRoleSwitcher() {
roleSwitcher.innerHTML = roles.map(role => `
<button
class="role-badge px-3 py-1.5 rounded-lg text-sm font-medium transition-all focus-ring ${currentRole.id === role.id ? 'ring-2' : ''}"
style="background: ${currentRole.id === role.id ? role.color + '22' : 'var(--card)'};
border: 1px solid ${currentRole.id === role.id ? role.color : 'var(--border)'};
color: ${currentRole.id === role.id ? role.color : 'var(--muted)'};
${currentRole.id === role.id ? `box-shadow: 0 0 0 2px ${role.color}33` : ''}"
data-role="${role.id}"
role="tab"
aria-selected="${currentRole.id === role.id}"
aria-label="Switch to ${role.name} role"
>
${role.name}
</button>
`).join('');
roleSwitcher.querySelectorAll('button').forEach(btn => {
btn.addEventListener('click', () => {
currentRole = roles.find(r => r.id === btn.dataset.role);
renderRoleSwitcher();
renderPortfolioList();
if (selectedPortfolio) {
renderReviewPanel(selectedPortfolio);
}
showToast(`Switched to ${currentRole.name}`, 'info');
});
});
}
function renderPortfolioList() {
const filter = filterStatus.value;
let filtered = portfolios;
if (filter === 'pending') {
filtered = portfolios.filter(p => p.status === 'pending');
} else if (filter === 'reviewed') {
filtered = portfolios.filter(p => p.status === 'reviewed');
}
portfolioList.innerHTML = filtered.map((portfolio, index) => {
const total = calculateTotal(portfolio.scores);
const grade = getScoreGrade(total);
const isSelected = selectedPortfolio && selectedPortfolio.id === portfolio.id;
return `
<article
class="portfolio-card rounded-xl p-4 cursor-pointer focus-ring animate-fade-up stagger-${Math.min(index + 1, 6)}"
style="background: var(--card); border: 2px solid ${isSelected ? 'var(--accent)' : 'var(--border)'};"
data-id="${portfolio.id}"
tabindex="0"
role="button"
aria-pressed="${isSelected}"
aria-label="Select portfolio: ${portfolio.title}"
>
<div class="flex gap-4">
<div class="w-16 h-16 rounded-lg flex-shrink-0" style="background: ${portfolio.thumbnail};"></div>
<div class="flex-1 min-w-0">
<div class="flex items-start justify-between gap-2 mb-1">
<h3 class="font-semibold truncate">${portfolio.title}</h3>
<span class="px-2 py-0.5 rounded text-xs font-medium flex-shrink-0"
style="background: ${portfolio.status === 'reviewed' ? 'rgba(0,212,170,0.15)' : 'rgba(255,170,0,0.15)'};
color: ${portfolio.status === 'reviewed' ? 'var(--accent)' : 'var(--warning)'};">
${portfolio.status === 'reviewed' ? 'Reviewed' : 'Pending'}
</span>
</div>
<p class="text-sm mb-2" style="color: var(--muted);">${portfolio.author}</p>
<div class="flex items-center gap-3">
<span class="text-xs px-2 py-0.5 rounded" style="background: var(--bg); color: var(--muted);">${portfolio.category}</span>
${portfolio.status === 'reviewed' ? `
<span class="text-xs font-medium" style="color: ${grade.color};">
${total}/${getMaxPossibleScore()} pts
</span>
` : ''}
</div>
</div>
</div>
</article>
`;
}).join('');
portfolioList.querySelectorAll('.portfolio-card').forEach(card => {
const handler = () => {
const id = parseInt(card.dataset.id);
selectedPortfolio = portfolios.find(p => p.id === id);
currentScores = { ...selectedPortfolio.scores };
renderPortfolioList();
renderReviewPanel(selectedPortfolio);
};
card.addEventListener('click', handler);
card.addEventListener('keydown', (e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
handler();
}
});
});
}
function renderReviewPanel(portfolio) {
const total = calculateTotal(currentScores);
const maxScore = getMaxPossibleScore();
const grade = getScoreGrade(total);
const progressPct = (total / maxScore) * 100;
const circumference = 2 * Math.PI * 40;
const strokeDashoffset = circumference * (1 - progressPct / 100);
reviewPanel.innerHTML = `
<div class="animate-scale-in">
<!-- Header -->
<div class="flex items-start justify-between mb-5">
<div>
<h3 class="font-bold text-lg mb-1">${portfolio.title}</h3>
<p class="text-sm" style="color: var(--muted);">by ${portfolio.author}</p>
</div>
<div class="w-16 h-16 rounded-lg" style="background: ${portfolio.thumbnail};"></div>
</div>
<p class="text-sm mb-5" style="color: var(--muted);">${portfolio.description}</p>
<!-- Score Circle -->
<div class="flex items-center justify-center mb-6">
<div class="relative">
<svg width="100" height="100" viewBox="0 0 100 100">
<circle cx="50" cy="50" r="40" fill="none" stroke="var(--border)" stroke-width="6"/>
<circle cx="50" cy="50" r="40" fill="none" stroke="${grade.color}" stroke-width="6"
stroke-linecap="round" stroke-dasharray="${circumference}"
stroke-dashoffset="${Math.max(0, strokeDashoffset)}"
transform="rotate(-90 50 50)" class="score-ring"/>
</svg>
<div class="absolute inset-0 flex flex-col items-center justify-center">
<span class="text-2xl font-bold">${total}</span>
<span class="text-xs" style="color: var(--muted);">/ ${maxScore}</span>
</div>
</div>
<div class="ml-4">
<span class="text-sm font-medium" style="color: ${grade.color};">${grade.label}</span>
<p class="text-xs mt-1" style="color: var(--muted);">Overall Score</p>
</div>
</div>
<!-- Rubrics -->
<div class="space-y-4 mb-5">
<h4 class="text-sm font-semibold uppercase tracking-wide" style="color: var(--muted);">Evaluation Rubric</h4>
${rubrics.map(rubric => {
const value = currentScores[rubric.id] || 0;
const canScore = hasPermission('score');
return `
<div class="p-3 rounded-lg" style="background: var(--bg-elevated);">
<div class="flex items-center justify-between mb-2">
<div>
<span class="text-sm font-medium">${rubric.name}</span>
<p class="text-xs" style="color: var(--muted);">${rubric.description}</p>
</div>
<span class="text-sm font-bold tabular-nums" style="color: ${value > 0 ? 'var(--accent)' : 'var(--muted)'};">
${value}/${rubric.maxScore}
</span>
</div>
${canScore ? `
<input
type="range"
min="0"
max="${rubric.maxScore}"
value="${value}"
class="slider-track w-full focus-ring"
data-rubric="${rubric.id}"
aria-label="${rubric.name} score"
/>
` : `
<div class="h-1.5 rounded-full" style="background: var(--border);">
<div class="h-full rounded-full transition-all" style="width: ${(value / rubric.maxScore) * 100}%; background: var(--muted);"></div>
</div>
`}
</div>
`;
}).join('')}
</div>
<!-- Comment -->
${hasPermission('comment') ? `
<div class="mb-5">
<label class="text-sm font-semibold uppercase tracking-wide block mb-2" style="color: var(--muted);">
Feedback Comment
</label>
<textarea
id="commentInput"
class="w-full p-3 rounded-lg text-sm resize-none focus-ring"
style="background: var(--bg-elevated); border: 1px solid var(--border); color: var(--fg);"
rows="3"
placeholder="Provide constructive feedback..."
>${portfolio.comment || ''}</textarea>
</div>
` : ''}
<!-- Actions -->
<div class="flex gap-3">
${hasPermission('approve') ? `
<button
id="submitReview"
class="btn-primary flex-1 px-4 py-2.5 rounded-lg font-medium text-sm transition-all focus-ring"
style="background: var(--accent); color: var(--bg);"
>
Submit Review
</button>
` : ''}
${hasPermission('delete') ? `
<button
id="deletePortfolio"
class="px-4 py-2.5 rounded-lg font-medium text-sm transition-all focus-ring"
style="background: rgba(255,68,102,0.15); color: var(--danger); border: 1px solid var(--danger);"
>
Delete
</button>
` : ''}
${!hasPermission('approve') && !hasPermission('delete') ? `
<div class="flex-1 p-3 rounded-lg text-center text-sm" style="background: var(--bg-elevated); color: var(--muted);">
View only - ${currentRole.name} role
</div>
` : ''}
</div>
<!-- Permission Info -->
<div class="mt-4 pt-4 flex items-center gap-2" style="border-top: 1px solid var(--border);">
<div class="w-2 h-2 rounded-full" style="background: ${currentRole.color};"></div>
<span class="text-xs" style="color: var(--muted);">
Permissions: ${currentRole.permissions.join(', ')}
</span>
</div>
</div>
`;
// Attach event listeners
reviewPanel.querySelectorAll('.slider-track').forEach(slider => {
slider.addEventListener('input', (e) => {
const rubricId = e.target.dataset.rubric;
const value = parseInt(e.target.value);
currentScores[rubricId] = value;
renderReviewPanel(portfolio);
});
});
const submitBtn = document.getElementById('submitReview');
if (submitBtn) {
submitBtn.addEventListener('click', () => {
portfolio.scores = { ...currentScores };
portfolio.status = 'reviewed';
const commentInput = document.getElementById('commentInput');
if (commentInput) {
portfolio.comment = commentInput.value;
}
renderPortfolioList();
updateStats();
showToast('Review submitted successfully!', 'success');
});
}
const deleteBtn = document.getElementById('deletePortfolio');
if (deleteBtn) {
deleteBtn.addEventListener('click', () => {
const idx = portfolios.findIndex(p => p.id === portfolio.id);
if (idx > -1) {
portfolios.splice(idx, 1);
selectedPortfolio = null;
renderPortfolioList();
updateStats();
reviewPanel.innerHTML = `
<div class="text-center py-12" style="color: var(--muted);">
<svg class="w-12 h-12 mx-auto mb-3 opacity-50" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
<path d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/>
<path d="M9 12h6M9 16h6"/>
</svg>
<p class="text-sm">Select a portfolio to review</p>
</div>
`;
showToast('Portfolio deleted', 'error');
}
});
}
}
function updateStats() {
const total = portfolios.length;
const pending = portfolios.filter(p => p.status === 'pending').length;
const completed = portfolios.filter(p => p.status === 'reviewed').length;
const reviewedPortfolios = portfolios.filter(p => p.status === 'reviewed');
const avgScore = reviewedPortfolios.length > 0
? Math.round(reviewedPortfolios.reduce((sum, p) => sum + calculateTotal(p.scores), 0) / reviewedPortfolios.length)
: 0;
document.getElementById('statTotal').textContent = total;
document.getElementById('statPending').textContent = pending;
document.getElementById('statCompleted').textContent = completed;
document.getElementById('statAvgScore').textContent = avgScore;
}
// ============ EVENT LISTENERS ============
filterStatus.addEventListener('change', renderPortfolioList);
// ============ INITIALIZATION ============
function init() {
renderRoleSwitcher();
renderPortfolioList();
updateStats();
}
// Check for reduced motion preference
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
if (prefersReducedMotion) {
document.querySelectorAll('.animate-fade-up, .animate-scale-in').forEach(el => {
el.style.animation = 'none';
el.style.opacity = '1';
el.style.transform = 'none';
});
}
init();
</script>
</body>
</html>
Key Features
1. Role-Based Access Control
- Admin: Full permissions (view, score, comment, approve, delete)
- Senior Reviewer: Can review and approve portfolios
- Junior Reviewer: View and score only, cannot approve
2. Interactive Rubric System
- 5 evaluation criteria with weighted scoring (100 points total)
- Real-time score calculation with animated progress ring
- Visual grade system (Excellent/Strong/Good/Needs Work)
3. Portfolio Management
- Filter by status (All/Pending/Reviewed)
- Visual portfolio cards with gradient thumbnails
- Status badges and score summaries
4. Design Highlights
- Dark theme with cyan accent and atmospheric gradients
- Space Grotesk + DM Sans typography pairing
- Staggered entrance animations with reduced-motion support
- Custom slider controls with hover/focus states
5. Interactions
- Role switching updates permissions in real-time
- Score sliders with immediate visual feedback
- Toast notifications for actions
- Keyboard-accessible navigation