File size: 10,740 Bytes
4c260b4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c9a1011
 
 
4c260b4
c9a1011
 
 
4c260b4
c9a1011
 
 
4c260b4
c9a1011
4c260b4
 
 
 
 
 
c9a1011
 
4c260b4
c9a1011
4c260b4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c9a1011
 
 
4c260b4
c9a1011
4c260b4
 
 
 
 
 
 
c9a1011
 
4c260b4
c9a1011
 
4c260b4
c9a1011
 
4c260b4
c9a1011
 
4c260b4
c9a1011
4c260b4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c9a1011
 
4c260b4
c9a1011
 
4c260b4
c9a1011
 
4c260b4
c9a1011
 
4c260b4
c9a1011
4c260b4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!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>