How to Earn Money by Making Name Slips and Notebook Labels on
Fiverr, Upwork, and Freelancing Platforms
In today’s digital age, freelancing has opened up countless opportunities for people to monetize their skills. One such skill that is often overlooked but in high demand is designing name slips and notebook labels. Whether for students, offices, or personal use, customized labels add a professional and organized touch.
If you have an eye for design and attention to detail, you can turn this skill into a profitable side hustle or even a full-time business on platforms like Fiverr, Upwork, and other freelancing websites.
What Are Name Slips and Notebook Labels?
Name Slips: Small adhesive labels with a person’s name, often used on books, folders, or personal items.
Notebook Labels: Custom-designed stickers for notebooks, including subject names, decorative elements, or motivational quotes.
These labels can be handmade, digitally designed, or printed, depending on the client’s needs.
Why Is This Skill in Demand?
Students & Teachers – Schools and colleges require labeled notebooks for organization.
Offices & Businesses – Professional labeling for files and documents.
Parents & Individuals – Personalizing books, gifts, and stationery.
Event Planners – Custom labels for workshops, seminars, and giveaways.
How to Start Earning from Name Slips & Notebook Labels
1. Learn Basic Design Skills
You don’t need to be a professional designer, but knowing tools like:
Canva (Beginner-friendly)
Adobe Illustrator/Photoshop (Advanced designs)
Microsoft Word/Google Docs (Simple templates)
will help you create attractive labels.
2. Set Up Your Freelance Profile
Fiverr: Create a gig offering custom name slips and notebook labels.
Example: "I will design 10 custom notebook labels in 24 hours for $5"
Upwork: Bid on projects related to stationery design and labeling.
Etsy: Sell printable PDF labels for passive income.
3. Offer Different Styles & Customizations
Minimalist Designs (Clean, professional look)
Cute & Aesthetic Labels (For kids and students)
Themed Labels (Seasonal, motivational, or branded)
Printable vs. Physical Labels (Digital files or printed & shipped)
4. Promote Your Services
Social Media (Instagram, Pinterest, Facebook) – Share your designs.
YouTube/TikTok – Create short tutorials on label-making.
Local Markets & Schools – Partner with stationery shops.
How Much Can You Earn?
Beginners: $5–$20 per order (Fiverr, Upwork)
Advanced Designers: $30–$100+ for bulk orders
Passive Income: Selling digital label templates on Etsy ($2–$10 per download)
Final Tips for Success
✔ Start with simple, affordable packages to attract clients.
✔ Offer fast delivery (24–48 hours) for higher ratings.
✔ Collect testimonials to build credibility.
✔ Upsell additional services (matching bookmarks, stickers).
Conclusion
Designing name slips and notebook labels is a simple yet profitable freelancing skill. With creativity and marketing, you can turn this into a steady income stream on Fiverr, Upwork, and beyond.
Start today and turn your labeling skills into cash! 🚀
Would you like help setting up your first Fiverr gig or designing sample labels? Let me know in the comments!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>StickerSpark - Create Amazing Stickers!</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
/* --- Global Resets & Base Styles --- */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f4f7f6; /* Light neutral background */
color: #333;
line-height: 1.6;
display: flex;
flex-direction: column;
min-height: 100vh;
}
.container {
width: 90%;
max-width: 1200px;
margin: 0 auto;
padding: 0 15px;
}
h1, h2, h3 {
margin-bottom: 0.8em;
color: #2c3e50; /* Darker heading color */
}
/* --- Header --- */
.main-header {
background: #ffffff; /* Clean white header */
color: #333;
padding: 1em 0;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
position: sticky;
top: 0;
z-index: 1000;
}
.main-header .container {
display: flex;
justify-content: space-between;
align-items: center;
}
.main-header .logo {
font-size: 1.8em;
font-weight: bold;
color: #e74c3c; /* Primary color for logo */
}
.main-header .logo .fa-star { /* Example icon */
margin-right: 5px;
}
.main-nav ul {
list-style: none;
display: flex;
}
.main-nav ul li {
margin-left: 20px;
}
.main-nav ul li a {
text-decoration: none;
color: #555;
font-weight: 500;
transition: color 0.3s ease;
}
.main-nav ul li a:hover, .main-nav ul li a.active {
color: #e74c3c; /* Primary color on hover/active */
}
/* --- Hero Section (Sticker Maker Area) --- */
.hero-section {
background: linear-gradient(135deg, #6DD5FA, #FF758C); /* Eye-catching gradient */
color: #fff;
padding: 40px 0;
text-align: center;
flex-grow: 1; /* Make hero section take available space */
}
.hero-section h1 {
font-size: 2.8em;
margin-bottom: 0.5em;
color: #fff;
text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}
.hero-section .subtitle {
font-size: 1.2em;
margin-bottom: 30px;
opacity: 0.9;
}
.sticker-maker-wrapper {
display: flex;
flex-direction: column;
align-items: center;
gap: 30px;
}
/* --- Controls Panel (Updated Styling) --- */
.controls-panel {
background: rgba(255, 255, 255, 0.95); /* Slightly transparent white */
padding: 25px;
border-radius: 12px;
box-shadow: 0 5px 15px rgba(0,0,0,0.15);
width: 95%;
max-width: 900px; /* Wider for more controls */
display: flex;
flex-wrap: wrap;
gap: 20px;
justify-content: center;
color: #333; /* Text color inside panel */
}
.control-group {
background-color: #fdfdfd; /* Slightly off-white for groups */
border: 1px solid #e0e0e0;
padding: 15px;
border-radius: 8px;
min-width: 220px;
flex-grow: 1;
flex-basis: 250px;
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.control-group h3 {
margin-top: 0;
font-size: 1.1em;
color: #e74c3c; /* Primary color for group titles */
border-bottom: 2px solid #f0f0f0;
padding-bottom: 8px;
margin-bottom: 15px;
}
.control-group h3 .fas { /* Icon in heading */
margin-right: 8px;
}
input[type="text"], input[type="number"], select, input[type="file"] {
padding: 10px; /* Increased padding */
margin-bottom: 12px;
border: 1px solid #ccc;
border-radius: 6px; /* Softer radius */
width: calc(100% - 22px);
box-sizing: border-box;
transition: border-color 0.3s ease;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus {
border-color: #e74c3c; /* Primary color on focus */
outline: none;
box-shadow: 0 0 5px rgba(231, 76, 60, 0.3);
}
input[type="color"] {
padding: 0;
height: 40px; /* Increased height */
width: 60px; /* Increased width */
vertical-align: middle;
border-radius: 6px;
border: 1px solid #ccc;
margin-bottom: 10px;
cursor: pointer;
}
label {
margin-right: 5px;
font-size: 0.95em;
display: block;
margin-bottom: 5px;
font-weight: 500;
color: #555;
}
button {
padding: 10px 18px;
background-color: #e74c3c; /* Primary color for buttons */
color: white;
border: none;
font-size: 1em;
font-weight: 500;
border-radius: 6px;
cursor: pointer;
margin: 5px 2px;
width: auto;
transition: background-color 0.3s ease, transform 0.1s ease;
}
button:hover {
background-color: #c0392b; /* Darker primary on hover */
transform: translateY(-1px);
}
button:active {
transform: translateY(0px);
}
button.danger {
background-color: #c0392b; /* Consistent danger color */
}
button.danger:hover {
background-color: #a93226;
}
button.secondary {
background-color: #3498db; /* Secondary action color */
}
button.secondary:hover {
background-color: #2980b9;
}
.control-group button {
width: calc(50% - 4px);
}
.control-group button.full-width {
width: calc(100% - 4px);
}
/* --- Sticker Display Area --- */
#stickerDisplayArea {
width: 100%;
padding: 20px 0;
display: flex;
justify-content: center;
align-items: flex-start;
margin-top: 20px; /* Space above sticker */
}
.sticker-container {
background-color: #ffcc99; /* Default, can be changed */
border: 3px solid #4a4a4a;
border-radius: 15px; /* Softer radius */
width: 90%;
max-width: 480px;
min-height: 220px;
padding: 20px;
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
overflow: hidden;
box-shadow: 0 8px 25px rgba(0,0,0,0.2); /* More prominent shadow */
user-select: none;
box-sizing: border-box;
transition: transform 0.3s ease; /* For subtle hover effect if added */
}
/* .sticker-container:hover {
transform: scale(1.02);
} */
.sticker-container .form-section {
width: 100%;
text-align: left;
z-index: 1;
margin-bottom: 15px;
}
.sticker-container .form-section p,
.sticker-container .custom-fields-container .custom-field-item {
font-size: 0.9em;
margin: 8px 0;
word-break: break-word;
color: #2c3e50; /* Darker text on sticker */
}
.sticker-container .form-section p strong,
.sticker-container .custom-fields-container .custom-field-item strong {
color: #1a252f; /* Even darker for labels */
}
.sticker-container .form-section span,
.sticker-container .custom-fields-container .custom-field-value {
display: inline-block;
border-bottom: 1px dotted #555; /* Darker dotted line */
min-width: 90px;
min-height: 18px;
}
.custom-field-item strong {
margin-right: 5px;
}
.sticker-container .uploadedImage {
position: relative;
max-height: 90px;
max-width: 90px;
cursor: grab;
user-select: none;
transform-origin: center center;
z-index: 0;
margin-top: 10px;
align-self: center;
border-radius: 8px; /* Rounded corners for image */
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
/* --- Footer --- */
.main-footer {
background: #2c3e50; /* Dark footer */
color: #ecf0f1; /* Light text on dark footer */
text-align: center;
padding: 2em 0;
margin-top: auto; /* Pushes footer to bottom */
}
.main-footer p {
margin-bottom: 0.5em;
}
.social-links a {
color: #ecf0f1;
margin: 0 10px;
font-size: 1.5em;
transition: color 0.3s ease;
}
.social-links a:hover {
color: #e74c3c; /* Primary color on hover */
}
/* --- Media Queries for Responsiveness --- */
@media (max-width: 768px) { /* Tablet and Mobile */
.main-header .container {
flex-direction: column;
text-align: center;
}
.main-nav ul {
margin-top: 10px;
justify-content: center;
}
.main-nav ul li {
margin: 0 10px;
}
.hero-section h1 {
font-size: 2.2em;
}
.hero-section .subtitle {
font-size: 1em;
}
.control-group {
flex-basis: 100%; /* Each group takes full width */
}
.control-group button { /* Make buttons in groups full width */
width: calc(100% - 4px);
}
.control-group button + button { /* If two buttons are still side-by-side, fix */
/* width: calc(100% - 4px); */ /* Re-evaluate if needed */
}
}
@media (min-width: 769px) { /* Desktop and larger tablets */
.sticker-container {
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
max-width: 520px; /* Slightly wider on desktop */
}
.sticker-container .form-section {
width: 65%;
margin-bottom: 0;
}
.sticker-container .form-section p,
.sticker-container .custom-fields-container .custom-field-item {
font-size: 1em;
}
.sticker-container .uploadedImage {
position: absolute;
max-height: 110px;
max-width: 110px;
top: 20px;
right: 20px;
margin-top: 0;
align-self: auto;
}
.control-group button { /* Revert button width for desktop */
width: auto;
}
.control-group button.full-width {
width: calc(100% - 4px);
}
}
</style>
</head>
<body>
<header class="main-header">
<div class="container">
<div class="logo"><i class="fas fa-star"></i> StickerSpark</div>
<nav class="main-nav">
<ul>
<li><a href="techpk" class="active">Create</a></li>
<li><a href="techpk">Features</a></li>
<li><a href="techpk">Pricing</a></li>
<li><a href="techpk">Contact</a></li>
</ul>
</nav>
</div>
</header>
<main class="hero-section">
<div class="container">
<h1>Creativity with Custom Stickers!</h1>
<p class="subtitle">Design personalized stickers in minutes. Easy, fast, and fun!</p>
<div class="sticker-maker-wrapper">
<div class="controls-panel">
<div class="control-group">
<h3><i class="fas fa-pencil-alt"></i> Default Content</h3>
<label for="nameInput">Name:</label>
<input type="text" id="nameInput" placeholder="e.g., Techpk" oninput="updateStickerContent()">
<label for="classInput">Class:</label>
<input type="text" id="classInput" placeholder="e.g., Grade 10" oninput="updateStickerContent()">
<label for="subjectInput">Subject:</label>
<input type="text" id="subjectInput" placeholder="e.g., Mathematics" oninput="updateStickerContent()">
<label for="rollNoInput">Roll Number:</label>
<input type="text" id="rollNoInput" placeholder="e.g., 23" oninput="updateStickerContent()">
<label for="imageInput">Your Image:</label>
<input type="file" id="imageInput" accept="image/*" onchange="updateStickerImage()">
</div>
<div class="control-group">
<h3><i class="fas fa-plus-circle"></i> Custom Fields</h3>
<button onclick="addCustomFieldToSticker()" class="full-width"><i class="fas fa-plus"></i> Add Field</button>
<button onclick="removeLastCustomFieldFromSticker()" class="danger full-width"><i class="fas fa-trash-alt"></i> Remove Last</button>
</div>
<div class="control-group">
<h3><i class="fas fa-palette"></i> Sticker Style</h3>
<label for="stickerColorInput">Background:</label>
<input type="color" id="stickerColorInput" value="#ffcc99" onchange="changeStickerBgColor()"><br>
<label for="fontColorInput">Font Color:</label>
<input type="color" id="fontColorInput" value="#2c3e50" onchange="changeFontColor()"><br>
<label for="fontSizeInput">Font Size (px):</label>
<input type="number" id="fontSizeInput" value="14" min="8" max="72" onchange="changeFontSize()"><br>
<button onclick="toggleBold()"><i class="fas fa-bold"></i> Bold</button>
<button onclick="toggleItalic()"><i class="fas fa-italic"></i> Italic</button>
<button onclick="toggleUnderline()" class="full-width"><i class="fas fa-underline"></i> Underline</button>
</div>
<div class="control-group">
<h3><i class="fas fa-image"></i> Image Controls</h3>
<button onclick="adjustImageScale(0.1)"><i class="fas fa-search-plus"></i> Zoom In</button>
<button onclick="adjustImageScale(-0.1)"><i class="fas fa-search-minus"></i> Zoom Out</button>
<button onclick="resetImage()" class="secondary full-width"><i class="fas fa-sync-alt"></i> Reset Image</button>
</div>
<div class="control-group">
<h3><i class="fas fa-download"></i> Actions</h3>
<button onclick="downloadSticker()" class="full-width"><i class="fas fa-check-circle"></i> Download Sticker</button>
</div>
</div>
<div id="stickerDisplayArea">
<div id="mySticker" class="sticker-container">
<div class="form-section">
<p><strong>Name :</strong> <span class="nameText">Your Name</span></p>
<p><strong>Class :</strong> <span class="classText">Your Class</span></p>
<p><strong>Subject :</strong> <span class="subjectText">Your Subject</span></p>
<p><strong>Roll No. :</strong> <span class="rollNoText">00</span></p>
<div class="custom-fields-container">
<!-- Custom fields will be added here -->
</div>
</div>
<img class="uploadedImage" id="stickerImage" src="" alt="Upload an image" style="display:none;">
</div>
</div>
</div>
</div>
</main>
<footer class="main-footer">
<div class="container">
<p>© 2023 StickerSpark. All Rights Reserved.</p>
<p>Made with <i class="fas fa-heart" style="color: #e74c3c;"></i> for Techpk</p>
<div class="social-links">
<a href="techpk" aria-label="Facebook"><i class="fab fa-facebook-f"></i></a>
<a href="techpk" aria-label="Twitter"><i class="fab fa-twitter"></i></a>
<a href="techpk" aria-label="Instagram"><i class="fab fa-instagram"></i></a>
</div>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js"></script>
<script>
// PASTE YOUR PREVIOUS JAVASCRIPT HERE
// (The JavaScript from the "responsive" version should work fine)
const stickerElement = document.getElementById('mySticker');
const stickerImageElement = document.getElementById('stickerImage');
const customFieldsContainer = stickerElement.querySelector('.custom-fields-container');
// Input fields for default content
const nameInput = document.getElementById("nameInput");
const classInput = document.getElementById("classInput");
const subjectInput = document.getElementById("subjectInput");
const rollNoInput = document.getElementById("rollNoInput");
const imageInput = document.getElementById("imageInput");
// Styling controls
const stickerColorCtrl = document.getElementById("stickerColorInput");
const fontColorCtrl = document.getElementById("fontColorInput");
const fontSizeCtrl = document.getElementById("fontSizeInput");
let currentImageScale = 1;
// Adjusted default image state to ensure 'right' is defined for calculations
const defaultImageState = { top: '20px', right: '20px', left: '', scale: 1, transform: 'translate(0px, 0px) scale(1)' };
function updateStickerContent() {
stickerElement.querySelector('.nameText').textContent = nameInput.value || "Your Name";
stickerElement.querySelector('.classText').textContent = classInput.value || "Your Class";
stickerElement.querySelector('.subjectText').textContent = subjectInput.value || "Your Subject";
stickerElement.querySelector('.rollNoText').textContent = rollNoInput.value || "00";
}
function updateStickerImage() {
const file = imageInput.files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(e) {
stickerImageElement.src = e.target.result;
stickerImageElement.style.display = 'block';
resetImage();
}
reader.readAsDataURL(file);
} else {
stickerImageElement.src = "";
stickerImageElement.style.display = 'none';
}
}
function addCustomFieldToSticker() {
const fieldLabel = prompt("Enter label for the new field (e.g., School Name):");
if (!fieldLabel) return;
const fieldValue = prompt(`Enter value for "${fieldLabel}":`);
if (fieldValue === null) return;
const fieldItem = document.createElement('p');
fieldItem.classList.add('custom-field-item');
fieldItem.innerHTML = `<strong>${fieldLabel} :</strong> <span class="custom-field-value">${fieldValue}</span>`;
const currentFontSize = fontSizeCtrl.value + 'px';
const currentFontColor = fontColorCtrl.value;
fieldItem.style.fontSize = currentFontSize;
const textElementsInField = fieldItem.querySelectorAll('strong, span');
textElementsInField.forEach(el => el.style.color = currentFontColor);
const firstStyledElement = stickerElement.querySelector('.form-section p span') || stickerElement.querySelector('.form-section p strong');
if (firstStyledElement) {
if(window.getComputedStyle(firstStyledElement).fontWeight === 'bold' || parseInt(window.getComputedStyle(firstStyledElement).fontWeight) >= 700){
textElementsInField.forEach(el => el.style.fontWeight = 'bold');
}
if(window.getComputedStyle(firstStyledElement).fontStyle === 'italic'){
textElementsInField.forEach(el => el.style.fontStyle = 'italic');
}
// Apply underline only to the value span if the template has it
const templateValueSpan = stickerElement.querySelector('.form-section p span');
if (templateValueSpan && window.getComputedStyle(templateValueSpan).textDecoration.includes('underline')) {
fieldItem.querySelector('span.custom-field-value').style.textDecoration = 'underline';
}
}
customFieldsContainer.appendChild(fieldItem);
}
function removeLastCustomFieldFromSticker() {
const fields = customFieldsContainer.querySelectorAll('.custom-field-item');
if (fields.length > 0) {
customFieldsContainer.removeChild(fields[fields.length - 1]);
} else {
alert("No custom fields to remove.");
}
}
function changeStickerBgColor() {
stickerElement.style.backgroundColor = stickerColorCtrl.value;
}
function changeFontColor() {
const color = fontColorCtrl.value;
stickerElement.querySelectorAll('.form-section p strong, .form-section p span, .custom-field-item strong, .custom-field-item span').forEach(el => {
el.style.color = color;
});
}
function changeFontSize() {
const size = fontSizeCtrl.value + 'px';
stickerElement.querySelectorAll('.form-section p, .custom-field-item').forEach(el => {
el.style.fontSize = size;
});
}
function toggleStyleForElements(selector, styleProperty, styleValue, defaultValue) {
stickerElement.querySelectorAll(selector).forEach(el => {
const currentStyle = window.getComputedStyle(el)[styleProperty];
if (currentStyle === styleValue || (styleProperty === 'fontWeight' && (currentStyle === 'bold' || parseInt(currentStyle) >= 700 ))) {
el.style[styleProperty] = defaultValue;
} else {
el.style[styleProperty] = styleValue;
}
});
}
function toggleBold() {
toggleStyleForElements('.form-section p strong, .form-section p span, .custom-field-item strong, .custom-field-item span', 'fontWeight', 'bold', 'normal');
}
function toggleItalic() {
toggleStyleForElements('.form-section p strong, .form-section p span, .custom-field-item strong, .custom-field-item span', 'fontStyle', 'italic', 'normal');
}
function toggleUnderline() {
toggleStyleForElements('.form-section p span, .custom-field-item span.custom-field-value', 'textDecoration', 'underline', 'none');
}
let isImageDragging = false;
let imgDragInitialX, imgDragInitialY, imgCurrentTranslateX = 0, imgCurrentTranslateY = 0;
stickerImageElement.addEventListener('mousedown', (e) => {
e.preventDefault();
isImageDragging = true;
stickerImageElement.style.cursor = 'grabbing';
const transform = window.getComputedStyle(stickerImageElement).transform;
imgCurrentTranslateX = 0; // Reset before checking
imgCurrentTranslateY = 0;
if (transform && transform !== 'none') {
const matrix = transform.match(/matrix.*\((.+)\)/);
if (matrix) {
const values = matrix[1].split(', ');
imgCurrentTranslateX = parseFloat(values[4]) || 0;
imgCurrentTranslateY = parseFloat(values[5]) || 0;
}
}
imgDragInitialX = e.clientX - imgCurrentTranslateX;
imgDragInitialY = e.clientY - imgCurrentTranslateY;
document.addEventListener('mousemove', moveImageHandler);
document.addEventListener('mouseup', upImageHandler);
});
function moveImageHandler(moveEvent) {
if (!isImageDragging) return;
moveEvent.preventDefault();
let newTranslateX = moveEvent.clientX - imgDragInitialX;
let newTranslateY = moveEvent.clientY - imgDragInitialY;
imgCurrentTranslateX = newTranslateX;
imgCurrentTranslateY = newTranslateY;
if (window.innerWidth >= 769) { // Corresponds to @media (min-width: 769px)
const scaledWidth = stickerImageElement.offsetWidth * currentImageScale;
const scaledHeight = stickerImageElement.offsetHeight * currentImageScale;
const stickerWidth = stickerElement.clientWidth;
const stickerHeight = stickerElement.clientHeight;
// Get original position from CSS (top/right)
const originalRight = parseFloat(defaultImageState.right); // e.g. 20
const originalTop = parseFloat(defaultImageState.top); // e.g. 20
// Max X translation (to the left) is when the image's right edge hits the sticker's left edge
// Its current X position is stickerWidth - originalRight - (scaledWidth/2 if centered) + imgCurrentTranslateX
// We want this >= 0
// So, imgCurrentTranslateX >= -(stickerWidth - originalRight - scaledWidth)
// Simplified boundary for absolute positioning from top-right
const maxLeftMove = -(stickerWidth - originalRight - scaledWidth + originalRight); // moves left edge to sticker left edge
const maxRightMove = originalRight; // moves right edge to sticker right edge (translate 0 from originalRight)
const maxUpMove = -originalTop;
const maxDownMove = stickerHeight - originalTop - scaledHeight;
imgCurrentTranslateX = Math.max(maxLeftMove + 10, Math.min(imgCurrentTranslateX, maxRightMove - 10)); // Add some padding
imgCurrentTranslateY = Math.max(maxUpMove + 10, Math.min(imgCurrentTranslateY, maxDownMove -10 ));
}
stickerImageElement.style.transform = `translate(${imgCurrentTranslateX}px, ${imgCurrentTranslateY}px) scale(${currentImageScale})`;
}
function upImageHandler() {
isImageDragging = false;
stickerImageElement.style.cursor = 'grab';
document.removeEventListener('mousemove', moveImageHandler);
document.removeEventListener('mouseup', upImageHandler);
}
function adjustImageScale(factor) {
currentImageScale += factor;
currentImageScale = Math.max(0.2, Math.min(currentImageScale, 3));
stickerImageElement.style.transform = `translate(${imgCurrentTranslateX}px, ${imgCurrentTranslateY}px) scale(${currentImageScale})`;
}
function resetImage() {
currentImageScale = defaultImageState.scale;
imgCurrentTranslateX = 0;
imgCurrentTranslateY = 0;
stickerImageElement.style.transform = defaultImageState.transform;
if (window.innerWidth < 769) { // Corresponds to @media (max-width: 768px) and default
stickerImageElement.style.position = 'relative';
stickerImageElement.style.top = '';
stickerImageElement.style.right = '';
stickerImageElement.style.left = '';
stickerImageElement.style.alignSelf = 'center';
stickerImageElement.style.marginTop = '10px';
} else {
stickerImageElement.style.position = 'absolute';
stickerImageElement.style.top = defaultImageState.top;
stickerImageElement.style.right = defaultImageState.right;
stickerImageElement.style.left = defaultImageState.left;
stickerImageElement.style.alignSelf = 'auto';
stickerImageElement.style.marginTop = '0';
}
}
function downloadSticker() {
html2canvas(stickerElement, {
scale: 2,
useCORS: true,
backgroundColor: null
}).then(canvas => {
const link = document.createElement("a");
link.download = `StickerSpark-design.png`;
link.href = canvas.toDataURL("image/png");
link.click();
}).catch(err => {
console.error("Error generating canvas:", err);
});
}
updateStickerContent();
changeStickerBgColor();
changeFontColor();
changeFontSize();
resetImage();
window.addEventListener('resize', resetImage);
</script>
</body>
</html>
0 Comments
If you have any question you can ask me feelfree.