kdp-magic-maker-pro / editor.html
HM1234's picture
FIx all the buttons in the editor
c9a1011 verified
Raw History Blame Contribute Delete
10.7 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Editor | KDP Magic Maker Pro</title>
<link rel="stylesheet" href="style.css">
<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://cdnjs.cloudflare.com/ajax/libs/fabric.js/5.3.1/fabric.min.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: {
500: '#10b981',
},
secondary: {
500: '#06b6d4',
}
}
}
}
}
</script>
</head>
<body class="bg-gray-50 min-h-screen flex flex-col">
<custom-navbar></custom-navbar>
<div class="flex flex-1 overflow-hidden">
<!-- Sidebar -->
<aside class="w-64 bg-white border-r border-gray-200 flex flex-col">
<div class="p-4 border-b border-gray-200">
<h2 class="text-lg font-semibold text-gray-800">My Project</h2>
<p class="text-sm text-gray-500">Untitled Journal</p>
</div>
<!-- Template Selection -->
<div class="p-4 border-b border-gray-200">
<h3 class="text-sm font-medium text-gray-500 uppercase tracking-wider mb-2">Templates</h3>
<div class="space-y-2">
<button class="w-full flex items-center p-2 rounded-md transition-all bg-primary-50 text-primary-700 hover:bg-primary-100 border border-primary-200">
<i data-feather="book" class="mr-2 w-4 h-4"></i>
<span class="text-sm font-medium">6x9 Lined Journal</span>
</button>
<button class="w-full flex items-center p-2 rounded-md transition-all hover:bg-gray-50 text-gray-700 border border-transparent hover:border-gray-200">
<i data-feather="grid" class="mr-2 w-4 h-4"></i>
<span class="text-sm">8.5x11 Planner</span>
</button>
<button class="w-full flex items-center p-2 rounded-md transition-all hover:bg-gray-50 text-gray-700 border border-transparent hover:border-gray-200">
<i data-feather="book-open" class="mr-2 w-4 h-4"></i>
<span class="text-sm">5x8 Novel</span>
</button>
</div>
</div>
<!-- Pages Panel -->
<div class="flex-1 overflow-y-auto p-4">
<div class="flex justify-between items-center mb-2">
<h3 class="text-sm font-medium text-gray-500 uppercase tracking-wider">Pages</h3>
<button class="text-primary-500 hover:text-primary-700 transition-colors">
<i data-feather="plus" class="w-4 h-4"></i>
</button>
</div>
<div class="space-y-2">
<div class="p-2 border rounded-md bg-gray-50">
<div class="text-xs text-gray-500 mb-1">Front Matter</div>
<div class="flex items-center">
<i data-feather="file-text" class="text-gray-500 mr-2"></i>
<span class="text-sm">Title Page</span>
</div>
</div>
<div class="p-2 border rounded-md">
<div class="flex items-center">
<i data-feather="file-text" class="text-gray-500 mr-2"></i>
<span class="text-sm">Copyright</span>
</div>
</div>
<div class="p-2 border rounded-md bg-primary-50 border-primary-200">
<div class="text-xs text-gray-500 mb-1">Main Content</div>
<div class="flex items-center">
<i data-feather="file-text" class="text-primary-500 mr-2"></i>
<span class="text-sm font-medium">Page 1</span>
</div>
</div>
<div class="p-2 border rounded-md">
<div class="flex items-center">
<i data-feather="file-text" class="text-gray-500 mr-2"></i>
<span class="text-sm">Page 2</span>
</div>
</div>
</div>
</div>
<div class="p-4 border-t border-gray-200">
<button class="w-full bg-primary-500 hover:bg-primary-600 text-white py-2 px-4 rounded-md flex items-center justify-center transition-all shadow hover:shadow-md">
<i data-feather="download" class="mr-2 w-4 h-4"></i>
<span class="font-medium">Export for KDP</span>
</button>
</div>
</aside>
<!-- Main Editor Area -->
<main class="flex-1 overflow-auto bg-gray-100 p-8 flex items-center justify-center">
<div id="editor-canvas-container" class="relative">
<canvas id="editor-canvas" width="612" height="792" class="bg-white shadow-lg" style="border: 1px solid #e5e7eb;"></canvas>
<div class="absolute top-4 right-4 bg-white rounded-md shadow-sm p-2 flex space-x-1">
<button class="p-1.5 rounded hover:bg-gray-100 text-gray-600 hover:text-gray-900 transition-colors" title="Add Text">
<i data-feather="type" class="w-4 h-4"></i>
</button>
<button class="p-1.5 rounded hover:bg-gray-100 text-gray-600 hover:text-gray-900 transition-colors" title="Add Image">
<i data-feather="image" class="w-4 h-4"></i>
</button>
<button class="p-1.5 rounded hover:bg-gray-100 text-gray-600 hover:text-gray-900 transition-colors" title="Add Shape">
<i data-feather="square" class="w-4 h-4"></i>
</button>
<button class="p-1.5 rounded hover:bg-gray-100 text-gray-600 hover:text-gray-900 transition-colors" title="Draw">
<i data-feather="pen-tool" class="w-4 h-4"></i>
</button>
</div>
<div class="absolute bottom-4 right-4 bg-white rounded-md shadow-sm p-2 text-xs text-gray-500">
6" x 9" @ 300 DPI
</div>
</div>
</main>
<!-- Properties Panel -->
<aside class="w-64 bg-white border-l border-gray-200 p-4">
<h3 class="text-sm font-medium text-gray-500 uppercase tracking-wider mb-4">Properties</h3>
<div class="space-y-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Text Content</label>
<textarea class="w-full border border-gray-300 rounded-md p-2 text-sm" rows="4">Write your text here...</textarea>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Font</label>
<select class="w-full border border-gray-300 rounded-md p-2 text-sm">
<option>Times New Roman</option>
<option>Georgia</option>
<option>Arial</option>
<option>Helvetica</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Font Size</label>
<input type="range" min="8" max="72" value="12" class="w-full">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Color</label>
<div class="flex space-x-2">
<div class="w-6 h-6 rounded-full bg-black border-2 border-gray-300"></div>
<div class="w-6 h-6 rounded-full bg-gray-500 border-2 border-gray-300"></div>
<div class="w-6 h-6 rounded-full bg-primary-500 border-2 border-gray-300"></div>
<div class="w-6 h-6 rounded-full bg-secondary-500 border-2 border-gray-300"></div>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Alignment</label>
<div class="flex space-x-2">
<button class="p-1.5 rounded hover:bg-gray-100 text-gray-600 hover:text-gray-900 transition-colors" title="Align Left">
<i data-feather="align-left" class="w-4 h-4"></i>
</button>
<button class="p-1.5 rounded hover:bg-gray-100 text-gray-600 hover:text-gray-900 transition-colors" title="Align Center">
<i data-feather="align-center" class="w-4 h-4"></i>
</button>
<button class="p-1.5 rounded hover:bg-gray-100 text-gray-600 hover:text-gray-900 transition-colors" title="Align Right">
<i data-feather="align-right" class="w-4 h-4"></i>
</button>
<button class="p-1.5 rounded hover:bg-gray-100 text-gray-600 hover:text-gray-900 transition-colors" title="Justify">
<i data-feather="align-justify" class="w-4 h-4"></i>
</button>
</div>
</div>
</div>
</aside>
</div>
<script src="components/navbar.js"></script>
<script src="components/footer.js"></script>
<script src="script.js"></script>
<script>
feather.replace();
// Initialize Fabric.js canvas
document.addEventListener('DOMContentLoaded', function() {
const canvas = new fabric.Canvas('editor-canvas', {
backgroundColor: '#ffffff'
});
// Add sample text
const text = new fabric.Text('Double click to edit text', {
left: 100,
top: 100,
fontFamily: 'Times New Roman',
fontSize: 18,
fill: '#1f2937'
});
canvas.add(text);
});
</script>
</body>
</html>