import { Project } from '../types';
export const SAMPLE_PROJECTS: Project[] = [
{
id: 'cyberpunk-pomodoro',
name: 'Cyberpunk Synthwave Pomodoro',
description: 'A neon-infused productivity timer with procedural Web Audio sound synthesis, task tracker, and particle ambience.',
createdAt: Date.now() - 86400000 * 2,
updatedAt: Date.now() - 86400000,
activeFileId: 'pomo-html',
files: [
{
id: 'pomo-html',
name: 'index.html',
path: '/index.html',
language: 'html',
content: `
Cyberpunk Synthwave Pomodoro
VIBE_POMO // V2.0
CYCLE #1
`
},
{
id: 'pomo-css',
name: 'style.css',
path: '/style.css',
language: 'css',
content: `/* Cyberpunk scanlines and custom styles */
body::before {
content: " ";
display: block;
position: fixed;
top: 0; left: 0; bottom: 0; right: 0;
background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
z-index: 99;
background-size: 100% 3px, 3px 100%;
pointer-events: none;
}
#progress-circle {
transition: stroke-dashoffset 0.8s ease-in-out;
}
button:focus-visible {
outline: 2px solid #00f3ff;
outline-offset: 2px;
}`
},
{
id: 'pomo-js',
name: 'app.js',
path: '/app.js',
language: 'javascript',
content: `// Cyberpunk Pomodoro State Machine with Web Audio API Sound Generator
const FOCUS_TIME = 25 * 60;
const BREAK_TIME = 5 * 60;
const CIRCLE_CIRCUMFERENCE = 691;
let timeLeft = FOCUS_TIME;
let totalTime = FOCUS_TIME;
let isRunning = false;
let isFocusMode = true;
let timerInterval = null;
let completedCycles = 0;
const timerDisplay = document.getElementById('timer-display');
const modeDisplay = document.getElementById('mode-display');
const toggleBtn = document.getElementById('toggle-btn');
const resetBtn = document.getElementById('reset-btn');
const modeBtn = document.getElementById('mode-btn');
const progressCircle = document.getElementById('progress-circle');
const sessionCount = document.getElementById('session-count');
const audioTestBtn = document.getElementById('audio-test');
const taskInput = document.getElementById('task-input');
const addTaskBtn = document.getElementById('add-task-btn');
const taskList = document.getElementById('task-list');
// Procedural Synth Sound Generator using Web Audio API
function playSynthChime(frequency = 880, type = 'sine', duration = 0.2) {
try {
const AudioCtx = window.AudioContext || window.webkitAudioContext;
if (!AudioCtx) return;
const ctx = new AudioCtx();
const osc = ctx.createOscillator();
const gain = ctx.createGain();
osc.type = type;
osc.frequency.setValueAtTime(frequency, ctx.currentTime);
gain.gain.setValueAtTime(0.15, ctx.currentTime);
gain.gain.exponentialRampToValueAtTime(0.001, ctx.currentTime + duration);
osc.connect(gain);
gain.connect(ctx.destination);
osc.start();
osc.stop(ctx.currentTime + duration);
} catch (e) {
console.warn('Audio not allowed yet:', e);
}
}
function updateDisplay() {
const mins = Math.floor(timeLeft / 60);
const secs = timeLeft % 60;
timerDisplay.textContent = \`\${String(mins).padStart(2, '0')}:\${String(secs).padStart(2, '0')}\`;
const fraction = timeLeft / totalTime;
const offset = CIRCLE_CIRCUMFERENCE * (1 - fraction);
progressCircle.style.strokeDashoffset = offset;
}
function toggleTimer() {
if (isRunning) {
clearInterval(timerInterval);
isRunning = false;
toggleBtn.textContent = 'RESUME';
playSynthChime(440, 'triangle', 0.1);
} else {
isRunning = true;
toggleBtn.textContent = 'PAUSE';
playSynthChime(660, 'sine', 0.15);
timerInterval = setInterval(() => {
if (timeLeft > 0) {
timeLeft--;
updateDisplay();
} else {
handleTimerComplete();
}
}, 1000);
}
}
function handleTimerComplete() {
clearInterval(timerInterval);
isRunning = false;
// Victory multi-tone chime
playSynthChime(880, 'sine', 0.2);
setTimeout(() => playSynthChime(1320, 'sine', 0.3), 150);
if (isFocusMode) {
completedCycles++;
sessionCount.textContent = \`CYCLE #\${completedCycles + 1}\`;
switchMode(false);
} else {
switchMode(true);
}
}
function resetTimer() {
clearInterval(timerInterval);
isRunning = false;
timeLeft = totalTime;
toggleBtn.textContent = 'START';
updateDisplay();
playSynthChime(330, 'square', 0.08);
}
function switchMode(toFocus = !isFocusMode) {
isFocusMode = toFocus;
if (isFocusMode) {
totalTime = FOCUS_TIME;
timeLeft = FOCUS_TIME;
modeDisplay.textContent = 'FOCUS SEQUENCE';
modeDisplay.className = 'text-xs font-mono uppercase tracking-widest text-[#ff007f] mt-2';
progressCircle.setAttribute('stroke', '#00f3ff');
} else {
totalTime = BREAK_TIME;
timeLeft = BREAK_TIME;
modeDisplay.textContent = 'RECHARGE INTERVAL';
modeDisplay.className = 'text-xs font-mono uppercase tracking-widest text-[#00ff66] mt-2';
progressCircle.setAttribute('stroke', '#00ff66');
}
resetTimer();
}
toggleBtn.addEventListener('click', toggleTimer);
resetBtn.addEventListener('click', resetTimer);
modeBtn.addEventListener('click', () => switchMode());
audioTestBtn.addEventListener('click', () => playSynthChime(880, 'sine', 0.25));
addTaskBtn.addEventListener('click', () => {
const text = taskInput.value.trim();
if (!text) return;
const li = document.createElement('li');
li.className = 'flex items-center justify-between bg-slate-950/40 px-3 py-1.5 rounded text-xs text-slate-300 border border-slate-800/80 cursor-pointer hover:border-[#00f3ff]/40';
li.innerHTML = \`โก \${text}โ\`;
li.querySelector('span:last-child').addEventListener('click', (e) => {
e.stopPropagation();
li.remove();
});
taskList.appendChild(li);
taskInput.value = '';
playSynthChime(550, 'sine', 0.08);
});
updateDisplay();
console.log('RiShre Cyberpunk Pomodoro ready.');`
}
]
},
{
id: 'glass-calculator',
name: 'Glassmorphic Scientific Calculator',
description: 'A frosted glass calculator featuring scientific math operations, calculation history tape, and haptic animations.',
createdAt: Date.now() - 86400000 * 4,
updatedAt: Date.now() - 86400000 * 2,
activeFileId: 'calc-html',
files: [
{
id: 'calc-html',
name: 'index.html',
path: '/index.html',
language: 'html',
content: `
Glassmorphic Calculator
`
},
{
id: 'calc-css',
name: 'style.css',
path: '/style.css',
language: 'css',
content: `button {
height: 52px;
border-radius: 14px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.15s ease-out;
cursor: pointer;
user-select: none;
}
button:active {
transform: scale(0.94);
}
.btn-num {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.08);
color: #f8fafc;
}
.btn-num:hover {
background: rgba(255, 255, 255, 0.12);
border-color: rgba(255, 255, 255, 0.2);
}
.btn-ctrl:hover, .btn-op:hover, .btn-sci:hover {
filter: brightness(1.2);
}
.btn-sci {
height: 38px;
background: rgba(14, 165, 233, 0.1);
border: 1px solid rgba(14, 165, 233, 0.2);
color: #38bdf8;
}`
},
{
id: 'calc-js',
name: 'app.js',
path: '/app.js',
language: 'javascript',
content: `// Glassmorphic Calculator Engine
let currentInput = '0';
let previousInput = '';
let currentOp = null;
let shouldResetDisplay = false;
const mainDisplay = document.getElementById('main-display');
const historyDisplay = document.getElementById('history-display');
const keypad = document.getElementById('keypad');
const sciPanel = document.getElementById('sci-panel');
const toggleSciBtn = document.getElementById('toggle-sci');
function updateDisplay() {
mainDisplay.textContent = currentInput;
if (currentOp && previousInput) {
historyDisplay.textContent = \`\${previousInput} \${currentOp}\`;
} else {
historyDisplay.textContent = '';
}
}
function handleNumber(num) {
if (shouldResetDisplay) {
currentInput = num;
shouldResetDisplay = false;
} else {
if (num === '.' && currentInput.includes('.')) return;
currentInput = currentInput === '0' && num !== '.' ? num : currentInput + num;
}
updateDisplay();
}
function handleOperator(op) {
if (currentOp && !shouldResetDisplay) {
calculate();
}
previousInput = currentInput;
currentOp = op;
shouldResetDisplay = true;
updateDisplay();
}
function calculate() {
if (!currentOp || shouldResetDisplay) return;
const prev = parseFloat(previousInput);
const curr = parseFloat(currentInput);
let result = 0;
switch (currentOp) {
case '+': result = prev + curr; break;
case '-': result = prev - curr; break;
case '*': result = prev * curr; break;
case '/':
if (curr === 0) {
currentInput = 'Error';
currentOp = null;
updateDisplay();
return;
}
result = prev / curr;
break;
default: return;
}
currentInput = String(Number(result.toFixed(8)));
currentOp = null;
shouldResetDisplay = true;
updateDisplay();
}
function handleScientific(func) {
const val = parseFloat(currentInput);
let res = 0;
switch (func) {
case 'sin': res = Math.sin(val); break;
case 'cos': res = Math.cos(val); break;
case 'tan': res = Math.tan(val); break;
case 'sqrt': res = Math.sqrt(val); break;
case 'pow': res = Math.pow(val, 2); break;
case 'pi': res = Math.PI; break;
}
currentInput = String(Number(res.toFixed(8)));
shouldResetDisplay = true;
updateDisplay();
}
keypad.addEventListener('click', (e) => {
const btn = e.target.closest('button');
if (!btn) return;
const action = btn.dataset.action;
const value = btn.dataset.value;
if (!action && value) {
handleNumber(value);
} else if (action === 'op') {
handleOperator(value);
} else if (action === 'equals') {
calculate();
} else if (action === 'clear') {
currentInput = '0';
previousInput = '';
currentOp = null;
shouldResetDisplay = false;
updateDisplay();
} else if (action === 'delete') {
currentInput = currentInput.length > 1 ? currentInput.slice(0, -1) : '0';
updateDisplay();
}
});
sciPanel.addEventListener('click', (e) => {
const btn = e.target.closest('button');
if (!btn) return;
handleScientific(btn.dataset.value);
});
toggleSciBtn.addEventListener('click', () => {
sciPanel.classList.toggle('hidden');
});
console.log('RiShre Glassmorphic Calculator initialized.');`
}
]
},
{
id: 'matrix-visualizer',
name: 'Quantum Audio Wave Sandbox',
description: 'An interactive canvas particle & wave simulation with generative ambient audio oscillators.',
createdAt: Date.now() - 86400000 * 5,
updatedAt: Date.now() - 86400000 * 3,
activeFileId: 'wave-html',
files: [
{
id: 'wave-html',
name: 'index.html',
path: '/index.html',
language: 'html',
content: `
Quantum Wave Visualizer
`
},
{
id: 'wave-css',
name: 'style.css',
path: '/style.css',
language: 'css',
content: `canvas {
touch-action: none;
}`
},
{
id: 'wave-js',
name: 'app.js',
path: '/app.js',
language: 'javascript',
content: `// Quantum Particle & Harmonic Wave Canvas
const canvas = document.getElementById('stage');
const ctx = canvas.getContext('2d');
const particleCountEl = document.getElementById('particle-count');
const fpsDisplay = document.getElementById('fps-display');
const toggleAudioBtn = document.getElementById('toggle-audio');
const speedBtn = document.getElementById('speed-btn');
let width = (canvas.width = window.innerWidth);
let height = (canvas.height = window.innerHeight);
let audioEnabled = false;
let audioCtx = null;
let speedMult = 1.0;
let lastTime = performance.now();
let frameCount = 0;
window.addEventListener('resize', () => {
width = canvas.width = window.innerWidth;
height = canvas.height = window.innerHeight;
});
const particles = [];
const NUM_PARTICLES = 160;
for (let i = 0; i < NUM_PARTICLES; i++) {
particles.push({
x: Math.random() * width,
y: Math.random() * height,
vx: (Math.random() - 0.5) * 1.5,
vy: (Math.random() - 0.5) * 1.5,
radius: Math.random() * 2 + 1,
hue: Math.random() * 60 + 170, // Cyan to Purple
});
}
function playTone(freq = 440) {
if (!audioEnabled) return;
try {
if (!audioCtx) audioCtx = new (window.AudioContext || window.webkitAudioContext)();
if (audioCtx.state === 'suspended') audioCtx.resume();
const osc = audioCtx.createOscillator();
const gain = audioCtx.createGain();
osc.frequency.setValueAtTime(freq, audioCtx.currentTime);
gain.gain.setValueAtTime(0.1, audioCtx.currentTime);
gain.gain.exponentialRampToValueAtTime(0.001, audioCtx.currentTime + 0.3);
osc.connect(gain);
gain.connect(audioCtx.destination);
osc.start();
osc.stop(audioCtx.currentTime + 0.3);
} catch (e) {}
}
canvas.addEventListener('click', (e) => {
const rect = canvas.getBoundingClientRect();
const x = e.clientX - rect.left;
const y = e.clientY - rect.top;
for (let i = 0; i < 15; i++) {
particles.push({
x, y,
vx: (Math.random() - 0.5) * 6,
vy: (Math.random() - 0.5) * 6,
radius: Math.random() * 3 + 1,
hue: Math.random() * 40 + 280,
});
}
playTone(220 + (y / height) * 660);
});
toggleAudioBtn.addEventListener('click', () => {
audioEnabled = !audioEnabled;
toggleAudioBtn.textContent = \`AUDIO: \${audioEnabled ? 'ON ๐' : 'OFF'}\`;
toggleAudioBtn.className = audioEnabled
? 'px-3 py-1.5 rounded-lg bg-cyan-500 text-slate-950 font-bold text-xs font-mono shadow-[0_0_15px_#06b6d4]'
: 'px-3 py-1.5 rounded-lg bg-cyan-950 border border-cyan-500/40 text-cyan-300 text-xs font-mono';
if (audioEnabled) playTone(520);
});
speedBtn.addEventListener('click', () => {
speedMult = speedMult === 1.0 ? 2.5 : speedMult === 2.5 ? 0.5 : 1.0;
speedBtn.textContent = \`WARP: \${speedMult}X\`;
});
function animate(now) {
frameCount++;
if (now - lastTime >= 1000) {
fpsDisplay.textContent = frameCount;
frameCount = 0;
lastTime = now;
particleCountEl.textContent = particles.length;
}
ctx.fillStyle = 'rgba(5, 7, 15, 0.25)';
ctx.fillRect(0, 0, width, height);
for (let i = 0; i < particles.length; i++) {
const p = particles[i];
p.x += p.vx * speedMult;
p.y += p.vy * speedMult;
if (p.x < 0 || p.x > width) p.vx *= -1;
if (p.y < 0 || p.y > height) p.vy *= -1;
ctx.beginPath();
ctx.arc(p.x, p.y, p.radius, 0, Math.PI * 2);
ctx.fillStyle = \`hsl(\${p.hue}, 90%, 65%)\`;
ctx.fill();
// Connect lines
for (let j = i + 1; j < particles.length; j++) {
const p2 = particles[j];
const dx = p.x - p2.x;
const dy = p.y - p2.y;
const dist = Math.sqrt(dx * dx + dy * dy);
if (dist < 85) {
ctx.beginPath();
ctx.moveTo(p.x, p.y);
ctx.lineTo(p2.x, p2.y);
ctx.strokeStyle = \`hsla(\${p.hue}, 90%, 65%, \${1 - dist / 85})\`;
ctx.lineWidth = 0.6;
ctx.stroke();
}
}
}
// Cap particles
if (particles.length > 250) {
particles.splice(0, particles.length - 250);
}
requestAnimationFrame(animate);
}
requestAnimationFrame(animate);
console.log('Quantum Sandbox active.');`
}
]
}
];