Amantro's picture
redesigne for modern and clean look
137467f verified
Raw History Blame Contribute Delete
12.2 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ScribbleSphere - Digital Notes</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.net.min.js"></script>
<style>
.note-card {
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
border: 1px solid rgba(226, 232, 240, 0.7);
}
.note-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
border-color: rgba(226, 232, 240, 1);
}
#vanta-bg {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
opacity: 0.06;
}
.editor-textarea {
min-height: 300px;
line-height: 1.6;
font-size: 15px;
color: #374151;
}
.editor-textarea:focus {
outline: none;
box-shadow: none;
}
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<div id="vanta-bg"></div>
<header class="bg-white border-b border-gray-100">
<div class="container mx-auto px-4 py-5">
<div class="flex justify-between items-center">
<div class="flex items-center space-x-3">
<div class="w-9 h-9 rounded-lg bg-indigo-50 flex items-center justify-center">
<i data-feather="edit-3" class="w-5 h-5 text-indigo-600"></i>
</div>
<h1 class="text-xl font-medium text-gray-800">ScribbleSphere</h1>
</div>
<button id="new-note-btn" class="bg-indigo-600 text-white px-4 py-2 rounded-lg font-medium flex items-center space-x-2 hover:bg-indigo-700 transition-all">
<i data-feather="plus" class="w-4 h-4"></i>
<span>New Note</span>
</button>
</div>
</div>
</header>
<main class="container mx-auto px-4 py-8 max-w-7xl">
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-5">
<!-- Note cards will go here -->
<div class="note-card bg-white rounded-lg p-5 flex flex-col">
<div class="flex justify-between items-start mb-3">
<h3 class="text-base font-medium text-gray-800 truncate max-w-[180px]">Welcome Note</h3>
<div class="flex space-x-1.5">
<button class="text-gray-400 hover:text-indigo-500 transition-colors">
<i data-feather="edit-2" class="w-4 h-4"></i>
</button>
<button class="text-gray-400 hover:text-red-500 transition-colors">
<i data-feather="trash-2" class="w-4 h-4"></i>
</button>
</div>
</div>
<p class="text-gray-500 text-sm mb-4 flex-grow leading-relaxed">
Welcome to ScribbleSphere! Start creating your notes by clicking the "New Note" button above.
</p>
<div class="text-xs text-gray-400 mt-auto">
Created: Just now
</div>
</div>
</div>
<!-- Note Editor Modal (hidden by default) -->
<div id="note-editor" class="fixed inset-0 bg-black/30 backdrop-blur-sm flex items-center justify-center hidden z-50 px-4">
<div class="bg-white rounded-lg w-full max-w-2xl shadow-xl overflow-hidden">
<div class="flex justify-between items-center border-b px-5 py-3.5">
<input type="text" id="note-title" placeholder="Note Title" class="text-base font-medium border-none focus:ring-0 w-full px-0 py-1 placeholder-gray-400">
<button id="close-editor" class="text-gray-400 hover:text-gray-600 transition-colors">
<i data-feather="x" class="w-5 h-5"></i>
</button>
</div>
<div class="p-5">
<textarea id="note-content" class="w-full h-64 border-none focus:ring-0 resize-none editor-textarea px-0 py-1 placeholder-gray-400 leading-relaxed" placeholder="Start typing your note here..."></textarea>
</div>
<div class="flex justify-end space-x-3 border-t px-5 py-3 bg-gray-50">
<button id="cancel-note" class="text-gray-500 hover:text-gray-700 px-3.5 py-1.5 rounded text-sm font-medium transition-colors">
Cancel
</button>
<button id="save-note" class="bg-indigo-600 text-white px-4 py-1.5 rounded text-sm font-medium hover:bg-indigo-700 transition-colors">
Save Note
</button>
</div>
</div>
</div>
</main>
<footer class="border-t mt-12">
<div class="container mx-auto px-4 py-5 text-center text-sm text-gray-400">
<p>ScribbleSphere - Minimal notes for clear thoughts</p>
</div>
</footer>
<script>
// Initialize Vanta.js background - simplified version
VANTA.NET({
el: "#vanta-bg",
mouseControls: false,
touchControls: false,
gyroControls: false,
minHeight: 200,
minWidth: 200,
scale: 1,
scaleMobile: 1,
color: 0x6366f1,
backgroundColor: 0xffffff,
points: 8,
maxDistance: 18,
spacing: 14
});
// Initialize Feather Icons
document.addEventListener('DOMContentLoaded', function() {
feather.replace();
// Note management functionality
const newNoteBtn = document.getElementById('new-note-btn');
const noteEditor = document.getElementById('note-editor');
const closeEditor = document.getElementById('close-editor');
const cancelNote = document.getElementById('cancel-note');
const saveNote = document.getElementById('save-note');
const noteTitle = document.getElementById('note-title');
const noteContent = document.getElementById('note-content');
const notesContainer = document.querySelector('.grid');
// Sample notes data (in a real app, this would come from a database)
let notes = [
{
id: Date.now(),
title: 'Welcome Note',
content: 'Welcome to ScribbleSphere! Start creating your notes by clicking the "New Note" button above. Your notes are automatically saved as you type.',
createdAt: 'Just now'
}
];
// Open editor for new note
newNoteBtn.addEventListener('click', () => {
noteTitle.value = '';
noteContent.value = '';
noteEditor.classList.remove('hidden');
noteTitle.focus();
});
// Close editor
function closeEditorModal() {
noteEditor.classList.add('hidden');
}
closeEditor.addEventListener('click', closeEditorModal);
cancelNote.addEventListener('click', closeEditorModal);
// Save note
saveNote.addEventListener('click', () => {
if (noteTitle.value.trim() === '' || noteContent.value.trim() === '') {
alert('Please enter both a title and content for your note.');
return;
}
const newNote = {
id: Date.now(),
title: noteTitle.value,
content: noteContent.value,
createdAt: new Date().toLocaleDateString()
};
notes.unshift(newNote);
renderNotes();
closeEditorModal();
});
// Render all notes
function renderNotes() {
notesContainer.innerHTML = '';
notes.forEach(note => {
const noteElement = document.createElement('div');
noteElement.className = 'note-card bg-white rounded-xl shadow-md p-6 flex flex-col';
noteElement.innerHTML = `
<div class="flex justify-between items-start mb-4">
<h3 class="text-lg font-semibold text-gray-800">${note.title}</h3>
<div class="flex space-x-2">
<button class="text-gray-500 hover:text-indigo-600 edit-btn" data-id="${note.id}">
<i data-feather="edit-2" class="w-4 h-4"></i>
</button>
<button class="text-gray-500 hover:text-red-600 delete-btn" data-id="${note.id}">
<i data-feather="trash-2" class="w-4 h-4"></i>
</button>
</div>
</div>
<p class="text-gray-600 mb-4 flex-grow">${note.content}</p>
<div class="text-sm text-gray-400 mt-auto">
Created: ${note.createdAt}
</div>
`;
notesContainer.appendChild(noteElement);
});
// Add event listeners to edit and delete buttons
document.querySelectorAll('.edit-btn').forEach(btn => {
btn.addEventListener('click', (e) => {
const noteId = parseInt(e.currentTarget.getAttribute('data-id'));
const noteToEdit = notes.find(note => note.id === noteId);
if (noteToEdit) {
noteTitle.value = noteToEdit.title;
noteContent.value = noteToEdit.content;
noteEditor.classList.remove('hidden');
// Update save button to handle editing
saveNote.onclick = function() {
noteToEdit.title = noteTitle.value;
noteToEdit.content = noteContent.value;
renderNotes();
closeEditorModal();
// Reset save button to create new notes
saveNote.onclick = originalSaveHandler;
};
}
});
});
document.querySelectorAll('.delete-btn').forEach(btn => {
btn.addEventListener('click', (e) => {
if (confirm('Are you sure you want to delete this note?')) {
const noteId = parseInt(e.currentTarget.getAttribute('data-id'));
notes = notes.filter(note => note.id !== noteId);
renderNotes();
}
});
});
feather.replace();
}
// Store original save handler
const originalSaveHandler = saveNote.onclick;
// Initial render
renderNotes();
});
</script>
</body>
</html>