forked from vishanurag/Canvas-Editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
about.html
399 lines (334 loc) · 12.4 KB
/
about.html
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Creative Canvas Tool</title>
<!-- Single bootstrap inclusion -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/5.3.0/css/bootstrap.min.css">
<link rel="stylesheet" href="src/Styles/scroll.css">
<!-- External styles -->
<link rel="stylesheet" href="./src/Styles/Style.css">
<link rel="stylesheet" href="./src/Styles/Responsive.css">
<!-- Font Awesome icons -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
body {
background-color: #eef1f5;
font-family: 'Arial', sans-serif;
color: #333;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.header {
text-align: center;
padding: 20px;
}
.header img {
height: 100px;
width: auto;
border-radius: 50px;
margin-bottom: 20px;
}
.header h1 {
font-size: 2.5rem;
font-weight: bold;
color: #007bff;
margin-bottom: 10px;
}
.header h1 a {
color: inherit;
text-decoration: none;
}
.header h3 {
font-size: 1.2rem;
line-height: 1.5;
margin-top: 15px;
color: #555;
}
/* Canvas Container */
.canvas-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: #ffffff;
border-radius: 10px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
padding: 20px;
margin: 20px 0;
}
#mainCanvas {
width: 100%;
height: 60vh;
border: 2px solid #007bff;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
background-color: #f0f0f0;
}
.btn {
margin: 5px;
transition: background-color 0.3s, transform 0.2s;
}
.btn:hover {
background-color: #0056b3 !important;
color: white;
transform: scale(1.05);
}
.btn:active {
transform: scale(0.95);
}
.form-control {
border-radius: 5px;
}
/* Scroll Up Button Styling */
.scroll-up {
position: fixed;
bottom: 40px;
right: 30px;
background-color: #007bff;
color: white;
border: none;
border-radius: 50%;
padding: 15px;
font-size: 20px;
cursor: pointer;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
transition: opacity 0.3s ease, transform 0.3s ease;
opacity: 0;
visibility: hidden;
z-index: 1000; /* Added z-index to ensure it's above other elements */
}
.scroll-up.show {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
.scroll-up:hover {
background-color: #0056b3;
transform: scale(1.1);
}
.scroll-up:active {
transform: scale(0.95);
}
</style>
<style>
/* Circle styles */
.circle {
height: 24px;
width: 24px;
border-radius: 50%;
background-color: black;
position: fixed;
top: 0;
left: 0;
pointer-events: none;
z-index: 99999999;
transition: transform 0.1s ease-out;
}
</style>
</head>
<body>
<!-- Preloader HTML omitted for brevity -->
<!-- Circles -->
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="container">
<div class="header text-center">
<h1 class="display-4" ">
<img src="download (1).webp" style="height: 100px; width: auto;
border-radius: 50px 50px 50px 50px ; margin-right: 70px;">
<a href="/" style="color: inherit; text-decoration: none;margin-bottom: 50px;">Creative Canvas Tool Build the future</a>
<img src="download (1).png" alt="Logo">
<h1>
<a href="/">Creative Canvas Tool - Build the Future</a>
</h1>
<h3 class="lead">
Introducing Creative Canvas: a dynamic tool designed to unleash your imagination and elevate your
creative projects! Whether you’re an artist, designer, or simply someone who loves to explore ideas,
Creative Canvas provides a flexible platform where you can sketch, brainstorm, and bring your visions to
life. With intuitive features and an array of customizable templates, you can easily collaborate with
others or work solo to refine your concepts. Dive into a world of creativity and let your ideas flow
freely on your digital canvas!
</h3>
</div>
<div class="canvas-container">
<canvas id="mainCanvas"></canvas>
<div style="height: 1500px; background: lightgrey;">
<!-- Long content goes here -->
</div>
</div>
</div>
<!-- Scroll Up Button -->
<button id="scrollUpBtn" class="scroll-up">
<i class="fas fa-arrow-up"></i>
</button>
<script>
document.addEventListener('DOMContentLoaded', function () {
const scrollUpBtn = document.getElementById('scrollUpBtn');
// Function to show or hide the scroll-up button based on scroll position
window.addEventListener('scroll', function () {
if (window.scrollY > 300) {
scrollUpBtn.classList.add('show');
} else {
scrollUpBtn.classList.remove('show');
}
});
// Scroll to top when the button is clicked
scrollUpBtn.addEventListener('click', function () {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
});
});
</script>
<script>
document.addEventListener("DOMContentLoaded", function () {
const canvas = document.getElementById('mainCanvas');
const ctx = canvas.getContext('2d');
// Set canvas dimensions dynamically based on window size
function setCanvasSize() {
canvas.width = window.innerWidth * 0.8;
canvas.height = window.innerHeight * 0.5;
}
window.addEventListener('resize', setCanvasSize);
setCanvasSize(); // Set the initial canvas size
let history = [];
let redoStack = [];
// Function to save the canvas state
function saveCanvasState() {
history.push(ctx.getImageData(0, 0, canvas.width, canvas.height));
redoStack = [];
if (history.length > 10) history.shift(); // Limit history to 10 states
}
// Function to set the canvas background color
function setCanvasBackgroundColor(color) {
ctx.fillStyle = color;
ctx.fillRect(0, 0, canvas.width, canvas.height);
saveCanvasState(); // Save state after setting the background color
}
// Initial background color
const bgColorPicker = document.getElementById('bgColorPicker');
bgColorPicker && setCanvasBackgroundColor(bgColorPicker.value);
// Background color change event
bgColorPicker?.addEventListener('input', function () {
setCanvasBackgroundColor(this.value);
});
// Add text functionality
document.getElementById('addText')?.addEventListener('click', function () {
const textData = document.getElementById('textData').value;
const textSize = document.getElementById('textSize').value;
const textColor = document.getElementById('colorPicker').value;
const x = 50; // Default text x position, make customizable
const y = 50; // Default text y position, make customizable
if (textData) {
saveCanvasState();
ctx.fillStyle = textColor;
ctx.font = `${textSize}px Arial`;
ctx.fillText(textData, x, y); // Position text on canvas
document.getElementById('textData').value = '';
} else {
alert('Please enter some text!');
}
});
// Upload image functionality
document.getElementById('uploadImage')?.addEventListener('click', function () {
const input = document.createElement('input');
input.type = 'file';
input.accept = 'image/*';
input.onchange = function (e) {
const file = e.target.files[0];
const reader = new FileReader();
reader.onload = function (event) {
const img = new Image();
img.onload = function () {
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
saveCanvasState(); // Save state after uploading image
};
img.src = event.target.result;
};
reader.readAsDataURL(file);
};
input.click();
});
});
</script>
<script>
window.gtranslateSettings = {
"default_language": "en",
"detect_browser_language": true,
"wrapper_selector": ".gtranslate_wrapper"
};
</script>
<script src="https://cdn.gtranslate.net/widgets/latest/float.js" defer></script>
<script>
// Coordinates for the cursor
const coords = { x: 0, y: 0 };
const circles = document.querySelectorAll(".circle");
// Colors for the circles
const colors = [
"#ffb56b", "#fdaf69", "#f89d63", "#f59761", "#ef865e", "#ec805d",
"#e36e5c", "#df685c", "#d5585c", "#d1525c", "#c5415d", "#c03b5d",
"#b22c5e", "#ac265e", "#9c155f", "#950f5f", "#830060", "#7c0060",
"#680060", "#60005f", "#48005f", "#3d005e"
];
// Assign colors and initial position to each circle
circles.forEach(function (circle, index) {
circle.x = 0;
circle.y = 0;
circle.style.backgroundColor = colors[index % colors.length];
});
// Update the coordinates when the mouse moves
window.addEventListener("mousemove", function (e) {
coords.x = e.clientX;
coords.y = e.clientY;
});
// Animation function to move the circles
function animateCircles() {
let x = coords.x;
let y = coords.y;
circles.forEach(function (circle, index) {
// Update the position and scale of each circle
circle.style.left = x - 12 + "px";
circle.style.top = y - 12 + "px";
circle.style.scale = (circles.length - index) / circles.length;
circle.x = x;
circle.y = y;
// Get the next circle in the sequence
const nextCircle = circles[index + 1] || circles[0];
x += (nextCircle.x - x) * 0.3;
y += (nextCircle.y - y) * 0.3;
});
// Repeat the animation
requestAnimationFrame(animateCircles);
}
// Start the animation
animateCircles();
</script>
</body>
</html>