lll / index.html
Tiago009's picture
Add 3 files
92c9786 verified
Raw History Blame Contribute Delete
33 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Notion Clone</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.sidebar {
transition: all 0.3s ease;
}
.page-block:hover {
background-color: rgba(55, 53, 47, 0.08);
}
.draggable {
cursor: move;
}
.dragging {
opacity: 0.5;
}
.ProseMirror {
min-height: 100px;
padding: 10px;
border: 1px solid #e5e7eb;
border-radius: 0.375rem;
}
.ProseMirror:focus {
outline: none;
border-color: #3b82f6;
}
.ProseMirror > * + * {
margin-top: 0.75em;
}
.ProseMirror ul, .ProseMirror ol {
padding: 0 1rem;
}
.ProseMirror h1 {
font-size: 2em;
margin: 1em 0 0.5em 0;
}
.ProseMirror h2 {
font-size: 1.5em;
margin: 1em 0 0.5em 0;
}
.ProseMirror h3 {
font-size: 1.17em;
margin: 1em 0 0.5em 0;
}
[contenteditable="true"]:empty:before {
content: attr(data-placeholder);
color: #9ca3af;
}
.block-menu {
display: none;
position: absolute;
z-index: 100;
width: 240px;
background: white;
border-radius: 6px;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
padding: 6px;
}
.block-menu-item {
padding: 8px 12px;
border-radius: 4px;
cursor: pointer;
}
.block-menu-item:hover {
background-color: rgba(55, 53, 47, 0.08);
}
.database-view {
border: 1px solid #e5e7eb;
border-radius: 0.375rem;
overflow: hidden;
}
.database-header {
background-color: #f9fafb;
border-bottom: 1px solid #e5e7eb;
}
.database-row:hover {
background-color: rgba(55, 53, 47, 0.04);
}
.property-select {
appearance: none;
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
background-repeat: no-repeat;
background-position: right 0.5rem center;
background-size: 1em;
}
.toggle-container {
width: 40px;
height: 20px;
border-radius: 10px;
position: relative;
cursor: pointer;
}
.toggle-knob {
width: 16px;
height: 16px;
border-radius: 50%;
position: absolute;
top: 2px;
transition: all 0.2s ease;
}
</style>
</head>
<body class="bg-gray-50 h-screen flex overflow-hidden">
<!-- Sidebar -->
<div class="sidebar bg-gray-100 w-64 h-full flex flex-col border-r border-gray-200">
<!-- Workspace selector -->
<div class="p-4 border-b border-gray-200 flex items-center justify-between">
<div class="flex items-center space-x-2">
<div class="w-6 h-6 bg-blue-500 rounded flex items-center justify-center text-white">
<i class="fas fa-book text-xs"></i>
</div>
<span class="font-medium">My Workspace</span>
</div>
<button class="text-gray-500 hover:text-gray-700">
<i class="fas fa-chevron-down"></i>
</button>
</div>
<!-- Search and Quick Actions -->
<div class="p-3 border-b border-gray-200">
<div class="relative">
<input type="text" placeholder="Search" class="w-full bg-white rounded px-3 py-2 text-sm border border-gray-200 focus:outline-none focus:ring-1 focus:ring-blue-500">
<i class="fas fa-search absolute right-3 top-2.5 text-gray-400"></i>
</div>
<div class="flex justify-between mt-2 text-sm text-gray-500">
<button id="new-page-btn" class="hover:bg-gray-200 px-2 py-1 rounded">
<i class="fas fa-plus mr-1"></i> New page
</button>
<button class="hover:bg-gray-200 px-2 py-1 rounded">
<i class="fas fa-cog"></i>
</button>
</div>
</div>
<!-- Navigation -->
<div class="flex-1 overflow-y-auto">
<div class="py-2">
<div class="px-3 py-1 text-xs font-medium text-gray-500 uppercase tracking-wider">Favorites</div>
<div class="page-block px-3 py-1.5 text-sm flex items-center cursor-pointer draggable">
<i class="fas fa-star text-yellow-400 mr-2"></i>
<span>Getting Started</span>
</div>
<div class="page-block px-3 py-1.5 text-sm flex items-center cursor-pointer draggable">
<i class="fas fa-star text-yellow-400 mr-2"></i>
<span>Personal Notes</span>
</div>
</div>
<div class="py-2">
<div class="px-3 py-1 text-xs font-medium text-gray-500 uppercase tracking-wider">Private</div>
<div class="page-block px-3 py-1.5 text-sm flex items-center cursor-pointer draggable">
<i class="far fa-file mr-2"></i>
<span>Daily Journal</span>
</div>
<div class="page-block px-3 py-1.5 text-sm flex items-center cursor-pointer draggable">
<i class="far fa-file mr-2"></i>
<span>Project Ideas</span>
</div>
<div class="page-block px-3 py-1.5 text-sm flex items-center cursor-pointer draggable">
<i class="far fa-file mr-2"></i>
<span>Reading List</span>
</div>
</div>
<div class="py-2">
<div class="px-3 py-1 text-xs font-medium text-gray-500 uppercase tracking-wider">Shared</div>
<div class="page-block px-3 py-1.5 text-sm flex items-center cursor-pointer draggable">
<i class="fas fa-users mr-2 text-blue-500"></i>
<span>Team Projects</span>
</div>
<div class="page-block px-3 py-1.5 text-sm flex items-center cursor-pointer draggable">
<i class="fas fa-users mr-2 text-blue-500"></i>
<span>Meeting Notes</span>
</div>
</div>
</div>
<!-- User profile -->
<div class="p-3 border-t border-gray-200 flex items-center">
<div class="w-8 h-8 rounded-full bg-purple-500 flex items-center justify-center text-white font-medium">JD</div>
<div class="ml-2 flex-1">
<div class="text-sm font-medium">John Doe</div>
<div class="text-xs text-gray-500">Free Plan</div>
</div>
<button class="text-gray-500 hover:text-gray-700">
<i class="fas fa-ellipsis-h"></i>
</button>
</div>
</div>
<!-- Main content -->
<div class="flex-1 flex flex-col overflow-hidden">
<!-- Top bar -->
<div class="bg-white border-b border-gray-200 p-2 flex items-center justify-between">
<div class="flex items-center">
<button id="sidebar-toggle" class="p-2 rounded hover:bg-gray-100 mr-1">
<i class="fas fa-bars"></i>
</button>
<div class="flex items-center">
<i class="far fa-file mr-2 text-gray-500"></i>
<span class="font-medium">Untitled</span>
</div>
</div>
<div class="flex items-center space-x-2">
<button class="p-2 rounded hover:bg-gray-100">
<i class="fas fa-share"></i>
</button>
<button class="p-2 rounded hover:bg-gray-100">
<i class="fas fa-comment"></i>
</button>
<button class="p-2 rounded hover:bg-gray-100">
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="w-px h-6 bg-gray-200 mx-1"></div>
<button class="px-3 py-1 bg-blue-500 text-white rounded hover:bg-blue-600 text-sm">
Share
</button>
</div>
</div>
<!-- Page content -->
<div class="flex-1 overflow-y-auto p-6">
<div class="max-w-3xl mx-auto">
<!-- Page title -->
<div class="mb-6">
<div class="flex items-center">
<div id="page-title" class="text-4xl font-bold outline-none" contenteditable="true" data-placeholder="Untitled">My New Page</div>
</div>
</div>
<!-- Editor toolbar -->
<div class="flex items-center space-x-1 mb-4 p-2 bg-white rounded-lg shadow-sm border border-gray-200 sticky top-0 z-10">
<button class="p-2 hover:bg-gray-100 rounded" title="Text" data-command="paragraph">
<i class="fas fa-font"></i>
</button>
<button class="p-2 hover:bg-gray-100 rounded" title="Heading 1" data-command="heading" data-level="1">
<i class="fas fa-heading"></i>
</button>
<button class="p-2 hover:bg-gray-100 rounded" title="Heading 2" data-command="heading" data-level="2">
<i class="fas fa-heading" style="font-size: 0.8em;"></i>
</button>
<div class="w-px h-6 bg-gray-200 mx-1"></div>
<button class="p-2 hover:bg-gray-100 rounded" title="Bold" data-command="bold">
<i class="fas fa-bold"></i>
</button>
<button class="p-2 hover:bg-gray-100 rounded" title="Italic" data-command="italic">
<i class="fas fa-italic"></i>
</button>
<button class="p-2 hover:bg-gray-100 rounded" title="Underline" data-command="underline">
<i class="fas fa-underline"></i>
</button>
<button class="p-2 hover:bg-gray-100 rounded" title="Strikethrough" data-command="strike">
<i class="fas fa-strikethrough"></i>
</button>
<div class="w-px h-6 bg-gray-200 mx-1"></div>
<button class="p-2 hover:bg-gray-100 rounded" title="Bullet List" data-command="bulletList">
<i class="fas fa-list-ul"></i>
</button>
<button class="p-2 hover:bg-gray-100 rounded" title="Numbered List" data-command="orderedList">
<i class="fas fa-list-ol"></i>
</button>
<button class="p-2 hover:bg-gray-100 rounded" title="Checkbox" data-command="taskList">
<i class="fas fa-check-square"></i>
</button>
<div class="w-px h-6 bg-gray-200 mx-1"></div>
<button class="p-2 hover:bg-gray-100 rounded" title="Code" data-command="code">
<i class="fas fa-code"></i>
</button>
<button class="p-2 hover:bg-gray-100 rounded" title="Quote" data-command="blockquote">
<i class="fas fa-quote-right"></i>
</button>
<div class="w-px h-6 bg-gray-200 mx-1"></div>
<button class="p-2 hover:bg-gray-100 rounded" title="Link" data-command="link">
<i class="fas fa-link"></i>
</button>
<button class="p-2 hover:bg-gray-100 rounded" title="Image" data-command="image">
<i class="fas fa-image"></i>
</button>
<button class="p-2 hover:bg-gray-100 rounded" title="Table" data-command="table">
<i class="fas fa-table"></i>
</button>
</div>
<!-- Editor content -->
<div id="editor" class="bg-white rounded-lg border border-gray-200">
<div class="ProseMirror">
<p>This is a basic Notion-like editor. You can start typing here...</p>
<p></p>
<h2>Features</h2>
<ul>
<li>Sidebar navigation</li>
<li>Rich text editing</li>
<li>Drag and drop blocks</li>
<li>Responsive design</li>
</ul>
<p></p>
<h3>Try it out!</h3>
<p>Click anywhere to start editing. Use the toolbar above to format your text.</p>
<p></p>
<div class="database-view mt-4">
<div class="database-header grid grid-cols-4 gap-2 p-2 font-medium text-sm text-gray-600">
<div>Task</div>
<div>Status</div>
<div>Priority</div>
<div>Due Date</div>
</div>
<div class="database-row grid grid-cols-4 gap-2 p-2 border-t border-gray-200 text-sm">
<div contenteditable="true">Complete project proposal</div>
<div>
<select class="property-select bg-gray-100 rounded px-2 py-1 text-sm w-full">
<option>Not started</option>
<option>In progress</option>
<option selected>Completed</option>
</select>
</div>
<div>
<select class="property-select bg-gray-100 rounded px-2 py-1 text-sm w-full">
<option>Low</option>
<option selected>Medium</option>
<option>High</option>
</select>
</div>
<div contenteditable="true">2023-06-15</div>
</div>
<div class="database-row grid grid-cols-4 gap-2 p-2 border-t border-gray-200 text-sm">
<div contenteditable="true">Review design mockups</div>
<div>
<select class="property-select bg-gray-100 rounded px-2 py-1 text-sm w-full">
<option>Not started</option>
<option selected>In progress</option>
<option>Completed</option>
</select>
</div>
<div>
<select class="property-select bg-gray-100 rounded px-2 py-1 text-sm w-full">
<option>Low</option>
<option selected>Medium</option>
<option>High</option>
</select>
</div>
<div contenteditable="true">2023-06-20</div>
</div>
<div class="p-2 border-t border-gray-200 text-sm text-gray-500 hover:bg-gray-50 cursor-pointer">
<i class="fas fa-plus mr-2"></i> Add a row
</div>
</div>
<p></p>
<div class="flex items-center mt-4">
<div class="toggle-container bg-gray-300 mr-2">
<div class="toggle-knob bg-white left-2"></div>
</div>
<span>Toggle switch</span>
</div>
</div>
</div>
<!-- Block menu (hidden by default) -->
<div id="block-menu" class="block-menu">
<div class="block-menu-item" data-type="text">
<i class="fas fa-font mr-2"></i> Text
</div>
<div class="block-menu-item" data-type="heading1">
<i class="fas fa-heading mr-2"></i> Heading 1
</div>
<div class="block-menu-item" data-type="heading2">
<i class="fas fa-heading mr-2" style="font-size: 0.8em;"></i> Heading 2
</div>
<div class="block-menu-item" data-type="bullet-list">
<i class="fas fa-list-ul mr-2"></i> Bullet list
</div>
<div class="block-menu-item" data-type="numbered-list">
<i class="fas fa-list-ol mr-2"></i> Numbered list
</div>
<div class="block-menu-item" data-type="toggle">
<i class="fas fa-caret-right mr-2"></i> Toggle list
</div>
<div class="block-menu-item" data-type="quote">
<i class="fas fa-quote-right mr-2"></i> Quote
</div>
<div class="block-menu-item" data-type="divider">
<i class="fas fa-minus mr-2"></i> Divider
</div>
<div class="block-menu-item" data-type="code">
<i class="fas fa-code mr-2"></i> Code
</div>
<div class="block-menu-item" data-type="database">
<i class="fas fa-table mr-2"></i> Database
</div>
</div>
<!-- Add block button -->
<div class="mt-4 flex justify-center">
<button id="add-block-btn" class="flex items-center text-gray-500 hover:text-gray-700 hover:bg-gray-100 px-3 py-1 rounded">
<i class="fas fa-plus mr-2"></i> Add a new block
</button>
</div>
</div>
</div>
</div>
<!-- New page modal (hidden by default) -->
<div id="new-page-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg p-6 w-96">
<h3 class="text-lg font-medium mb-4">Create new page</h3>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Page name</label>
<input type="text" id="new-page-name" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Add to</label>
<select class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
<option>Private</option>
<option>Favorites</option>
<option>Shared</option>
</select>
</div>
<div class="flex justify-end space-x-2">
<button id="cancel-new-page" class="px-4 py-2 text-gray-700 rounded hover:bg-gray-100">Cancel</button>
<button id="create-new-page" class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600">Create</button>
</div>
</div>
</div>
<script>
// Toggle sidebar
document.getElementById('sidebar-toggle').addEventListener('click', function() {
document.querySelector('.sidebar').classList.toggle('hidden');
});
// Make blocks draggable
const pageBlocks = document.querySelectorAll('.page-block');
let draggedItem = null;
pageBlocks.forEach(block => {
block.setAttribute('draggable', 'true');
block.addEventListener('dragstart', function() {
draggedItem = this;
setTimeout(() => {
this.classList.add('dragging');
}, 0);
});
block.addEventListener('dragend', function() {
this.classList.remove('dragging');
});
});
// Handle drop
document.querySelector('.sidebar > div:nth-child(3)').addEventListener('dragover', function(e) {
e.preventDefault();
});
document.querySelector('.sidebar > div:nth-child(3)').addEventListener('drop', function(e) {
e.preventDefault();
if (draggedItem) {
this.appendChild(draggedItem);
}
});
// Simple editor functionality
document.querySelectorAll('[contenteditable="true"]').forEach(element => {
element.addEventListener('focus', function() {
if (this.textContent === this.getAttribute('data-placeholder')) {
this.textContent = '';
}
});
element.addEventListener('blur', function() {
if (this.textContent === '') {
this.textContent = this.getAttribute('data-placeholder');
}
});
});
// New page modal
document.getElementById('new-page-btn').addEventListener('click', function() {
document.getElementById('new-page-modal').classList.remove('hidden');
});
document.getElementById('cancel-new-page').addEventListener('click', function() {
document.getElementById('new-page-modal').classList.add('hidden');
});
document.getElementById('create-new-page').addEventListener('click', function() {
const pageName = document.getElementById('new-page-name').value || 'Untitled';
// Create new page in sidebar
const privateSection = document.querySelector('.sidebar > div:nth-child(3) > div:nth-child(2)');
const newPage = document.createElement('div');
newPage.className = 'page-block px-3 py-1.5 text-sm flex items-center cursor-pointer draggable';
newPage.innerHTML = `<i class="far fa-file mr-2"></i><span>${pageName}</span>`;
privateSection.appendChild(newPage);
document.getElementById('new-page-modal').classList.add('hidden');
document.getElementById('new-page-name').value = '';
});
// Block menu functionality
const blockMenu = document.getElementById('block-menu');
const addBlockBtn = document.getElementById('add-block-btn');
addBlockBtn.addEventListener('click', function(e) {
const rect = this.getBoundingClientRect();
blockMenu.style.display = 'block';
blockMenu.style.top = `${rect.bottom}px`;
blockMenu.style.left = `${rect.left}px`;
});
document.addEventListener('click', function(e) {
if (!blockMenu.contains(e.target) && e.target !== addBlockBtn) {
blockMenu.style.display = 'none';
}
});
blockMenu.querySelectorAll('.block-menu-item').forEach(item => {
item.addEventListener('click', function() {
const type = this.getAttribute('data-type');
const editor = document.querySelector('.ProseMirror');
let newBlock;
switch(type) {
case 'text':
newBlock = document.createElement('p');
newBlock.textContent = 'Type here...';
break;
case 'heading1':
newBlock = document.createElement('h1');
newBlock.textContent = 'Heading 1';
break;
case 'heading2':
newBlock = document.createElement('h2');
newBlock.textContent = 'Heading 2';
break;
case 'bullet-list':
newBlock = document.createElement('ul');
newBlock.innerHTML = '<li>List item</li>';
break;
case 'numbered-list':
newBlock = document.createElement('ol');
newBlock.innerHTML = '<li>List item</li>';
break;
case 'toggle':
newBlock = document.createElement('div');
newBlock.className = 'toggle-block';
newBlock.innerHTML = `
<div class="flex items-center cursor-pointer">
<i class="fas fa-caret-right mr-2"></i>
<span>Toggle heading</span>
</div>
<div class="toggle-content pl-6 mt-2 hidden">
<p>Toggle content</p>
</div>
`;
break;
case 'quote':
newBlock = document.createElement('blockquote');
newBlock.textContent = 'Quote';
break;
case 'divider':
newBlock = document.createElement('hr');
break;
case 'code':
newBlock = document.createElement('pre');
newBlock.innerHTML = '<code>// Code block</code>';
break;
case 'database':
newBlock = document.createElement('div');
newBlock.className = 'database-view mt-4';
newBlock.innerHTML = `
<div class="database-header grid grid-cols-3 gap-2 p-2 font-medium text-sm text-gray-600">
<div>Name</div>
<div>Type</div>
<div>Tags</div>
</div>
<div class="database-row grid grid-cols-3 gap-2 p-2 border-t border-gray-200 text-sm">
<div contenteditable="true">New item</div>
<div>
<select class="property-select bg-gray-100 rounded px-2 py-1 text-sm w-full">
<option>Text</option>
<option>Number</option>
<option>Select</option>
</select>
</div>
<div>
<select class="property-select bg-gray-100 rounded px-2 py-1 text-sm w-full">
<option>Tag 1</option>
<option>Tag 2</option>
</select>
</div>
</div>
<div class="p-2 border-t border-gray-200 text-sm text-gray-500 hover:bg-gray-50 cursor-pointer">
<i class="fas fa-plus mr-2"></i> Add a row
</div>
`;
break;
}
newBlock.setAttribute('contenteditable', 'true');
editor.appendChild(newBlock);
blockMenu.style.display = 'none';
if (type !== 'divider') {
newBlock.focus();
}
});
});
// Toggle switch functionality
document.querySelector('.toggle-container').addEventListener('click', function() {
const knob = this.querySelector('.toggle-knob');
if (this.classList.contains('bg-gray-300')) {
this.classList.remove('bg-gray-300');
this.classList.add('bg-blue-500');
knob.classList.remove('left-2');
knob.classList.add('left-[22px]');
} else {
this.classList.remove('bg-blue-500');
this.classList.add('bg-gray-300');
knob.classList.remove('left-[22px]');
knob.classList.add('left-2');
}
});
// Toggle block functionality
document.addEventListener('click', function(e) {
if (e.target.closest('.toggle-block')) {
const toggleBlock = e.target.closest('.toggle-block');
const content = toggleBlock.querySelector('.toggle-content');
const icon = toggleBlock.querySelector('i');
if (content.classList.contains('hidden')) {
content.classList.remove('hidden');
icon.classList.remove('fa-caret-right');
icon.classList.add('fa-caret-down');
} else {
content.classList.add('hidden');
icon.classList.remove('fa-caret-down');
icon.classList.add('fa-caret-right');
}
}
});
// Add row to database
document.addEventListener('click', function(e) {
if (e.target.closest('.database-view') && e.target.textContent.includes('Add a row')) {
const database = e.target.closest('.database-view');
const rows = database.querySelectorAll('.database-row');
const lastRow = rows[rows.length - 1];
const newRow = lastRow.cloneNode(true);
// Clear editable content
newRow.querySelectorAll('[contenteditable="true"]').forEach(cell => {
cell.textContent = '';
});
// Reset selects
newRow.querySelectorAll('select').forEach(select => {
select.selectedIndex = 0;
});
database.insertBefore(newRow, e.target);
}
});
// Simple text formatting
document.querySelectorAll('[data-command]').forEach(button => {
button.addEventListener('click', function() {
const command = this.getAttribute('data-command');
const level = this.getAttribute('data-level');
document.execCommand(command, false, level || null);
});
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Tiago009/lll" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>