在线奖状生成器

专业的证书制作工具,支持自定义文字、字体、颜色等,轻松制作精美奖状证书

编辑奖状内容

宋体
小魏体
黄油体
马善体

文本属性

24px

当前选中:

证书背景
💡 提示: 点击添加文本后,可以拖动调整位置,拖动右下角调整大小

为什么选择我们的奖状生成器?

简单易用,功能强大,满足您的各种证书制作需求

自定义程度高

支持自定义文字、字体、大小、颜色、位置等多种属性

响应式设计

完美适配手机、平板、电脑等各种设备,随时随地制作证书

一键下载打印

制作完成后可一键下载高清图片或直接打印,便捷高效

`); CommonUtils.hideLoading(); } catch (error) { console.error('打印失败:', error); CommonUtils.hideLoading(); CommonUtils.showAlert('打印失败,请重试', 'error'); } } // 事件监听器 $addTextBtn.on('click', function() { addTextElement($textInput.val()); }); $textInput.on('keypress', function(e) { if (e.which === 13) { addTextElement($(this).val()); } }); $deleteElementBtn.on('click', deleteElement); $resetBtn.on('click', resetAll); $downloadBtn.on('click', downloadCertificate); $printBtn.on('click', printCertificate); $fontSizeInput.on('input', function() { $fontSizeDisplay.text($(this).val()); updateElementStyle(); }); $fontColorInput.on('input', updateElementStyle); $fontWeightInput.on('change', updateElementStyle); $textAlignInput.on('change', updateElementStyle); // 字体选择 $('.font-preview').on('click', function() { $('.font-preview').removeClass('active'); $(this).addClass('active'); currentFont = $(this).data('font'); updateElementStyle(); }); // 预设文本 $('.preset-btn').on('click', function() { const text = $(this).data('text'); $textInput.val(text); addTextElement(text); }); // 拖拽功能 $certificateCanvas.on('mousedown', '.draggable', function(e) { e.preventDefault(); selectElement(this); isDragging = true; const rect = this.getBoundingClientRect(); offsetX = e.clientX - rect.left; offsetY = e.clientY - rect.top; }); $certificateCanvas.on('mousedown', '.resizable-handle', function(e) { e.preventDefault(); e.stopPropagation(); isResizing = true; const rect = selectedElement.getBoundingClientRect(); offsetX = e.clientX; offsetY = e.clientY; $(selectedElement).data('width', rect.width); }); $(document).on('mousemove', function(e) { if (!selectedElement) return; if (isDragging) { const canvasRect = $certificateCanvas[0].getBoundingClientRect(); const x = e.clientX - canvasRect.left - offsetX; const y = e.clientY - canvasRect.top - offsetY; $(selectedElement).css({ left: x + 'px', top: y + 'px', transform: 'none' }); } else if (isResizing) { const deltaX = e.clientX - offsetX; const newWidth = parseInt($(selectedElement).data('width')) + deltaX; if (newWidth > 50) { $(selectedElement).css('width', newWidth + 'px'); } } }); $(document).on('mouseup', function() { isDragging = false; isResizing = false; }); // 初始化 CommonUtils.showAlert('欢迎使用在线奖状生成器!'); });