diff --git a/js b/js deleted file mode 100644 index 8b13789..0000000 --- a/js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/package.json b/package.json index 7dbc2ad..0af5f74 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "", "main": "server.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "echo \"No tests configured\"", "start": "node server.js" }, "keywords": [], diff --git a/public/js b/public/js deleted file mode 100644 index 8b13789..0000000 --- a/public/js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/public/test-geometric.html b/public/test-geometric.html deleted file mode 100644 index 954d70a..0000000 --- a/public/test-geometric.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - - 几何动画预设测试 - - - -
-

几何动画预设测试

- -
-
-

预设预览

-
- -
-
- -
-

控制面板

- -
- - -
- -
- - -
- - - - -
-

使用说明

-

1. 选择预设类型

-

2. 调整对齐方式

-

3. 点击"加载预设"按钮

-

4. 预设将显示在左侧预览区域

-
-
-
- -

可用预设列表

-
- -
-
- - - - \ No newline at end of file diff --git a/public/test-simple.html b/public/test-simple.html deleted file mode 100644 index aa331d2..0000000 --- a/public/test-simple.html +++ /dev/null @@ -1,453 +0,0 @@ - - - - - 几何动画预设 - 简单测试 - - - -
- -
- -
- - - -
- -
就绪
- - - -`; - - function loadGeometricPreset() { - const container = document.getElementById('widgetContainer'); - container.innerHTML = ''; - - const iframe = document.createElement('iframe'); - iframe.style.width = '100%'; - iframe.style.height = '100%'; - iframe.style.border = 'none'; - iframe.sandbox = 'allow-scripts allow-same-origin'; - - container.appendChild(iframe); - currentIframe = iframe; - - const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; - iframeDoc.open(); - iframeDoc.write(geometricPresetHTML); - iframeDoc.close(); - - document.getElementById('status').textContent = '几何动画预设已加载'; - document.getElementById('status').style.color = '#00ff88'; - } - - function reloadPreset() { - if (currentIframe) { - const iframeDoc = currentIframe.contentDocument || currentIframe.contentWindow.document; - iframeDoc.open(); - iframeDoc.write(geometricPresetHTML); - iframeDoc.close(); - - document.getElementById('status').textContent = '预设已重新加载'; - document.getElementById('status').style.color = '#00bfff'; - } - } - - function toggleAnimation() { - if (!currentIframe) return; - - const iframeDoc = currentIframe.contentDocument || currentIframe.contentWindow.document; - const shapes = iframeDoc.querySelectorAll('.geo-shape'); - - animationPaused = !animationPaused; - - shapes.forEach(shape => { - if (animationPaused) { - shape.style.animationPlayState = 'paused'; - } else { - shape.style.animationPlayState = 'running'; - } - }); - - const statusText = animationPaused ? '动画已暂停' : '动画已继续'; - document.getElementById('status').textContent = statusText; - document.getElementById('status').style.color = animationPaused ? '#ff69b4' : '#00ff88'; - } - - // 页面加载时自动加载预设 - window.onload = function() { - setTimeout(loadGeometricPreset, 500); - }; - - - \ No newline at end of file diff --git a/public/verify-preset.html b/public/verify-preset.html deleted file mode 100644 index f537567..0000000 --- a/public/verify-preset.html +++ /dev/null @@ -1,598 +0,0 @@ - - - - - 验证几何动画预设集成 - - - -
-

几何动画预设集成验证

- -
- 正在检查服务器状态... -
- -
- 正在检查预设集成... -
- -
- - - -
- -
- -
- - -
- - - -`; - - // 检查服务器状态 - async function checkServer() { - const statusDiv = document.getElementById('serverStatus'); - statusDiv.className = 'status info'; - statusDiv.textContent = '正在检查服务器状态...'; - - try { - const response = await fetch('/health'); - if (response.ok) { - statusDiv.className = 'status success'; - statusDiv.textContent = '✅ 服务器运行正常'; - - // 检查预设 - checkPresetIntegration(); - } else { - statusDiv.className = 'status error'; - statusDiv.textContent = '❌ 服务器响应异常'; - } - } catch (error) { - statusDiv.className = 'status error'; - statusDiv.textContent = '❌ 无法连接到服务器'; - console.error('服务器检查失败:', error); - } - } - - // 检查预设集成 - async function checkPresetIntegration() { - const statusDiv = document.getElementById('presetStatus'); - statusDiv.className = 'status info'; - statusDiv.textContent = '正在检查预设集成...'; - - try { - const response = await fetch('/api/presets'); - if (response.ok) { - const presets = await response.json(); - const geometricPreset = presets.find(p => p.name === '几何动画预设'); - - if (geometricPreset) { - statusDiv.className = 'status success'; - statusDiv.textContent = `✅ 几何动画预设已成功集成 (第${presets.indexOf(geometricPreset) + 1}个预设)`; - } else { - statusDiv.className = 'status error'; - statusDiv.textContent = '❌ 未找到几何动画预设'; - } - } else { - statusDiv.className = 'status error'; - statusDiv.textContent = '❌ 无法获取预设列表'; - } - } catch (error) { - statusDiv.className = 'status error'; - statusDiv.textContent = '❌ 检查预设集成失败'; - console.error('预设检查失败:', error); - } - } - - // 加载预设到预览框 - function loadPreset() { - const previewFrame = document.getElementById('previewFrame'); - previewFrame.innerHTML = ''; - - const iframe = document.createElement('iframe'); - iframe.style.width = '100%'; - iframe.style.height = '100%'; - iframe.style.border = 'none'; - iframe.sandbox = 'allow-scripts allow-same-origin'; - - previewFrame.appendChild(iframe); - - const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; - iframeDoc.open(); - iframeDoc.write(geometricPresetHTML); - iframeDoc.close(); - - // 更新状态 - const statusDiv = document.getElementById('presetStatus'); - statusDiv.className = 'status success'; - statusDiv.textContent = '✅ 几何动画预设已加载到预览框'; - } - - // 显示预设信息 - function showPresetInfo() { - const presetInfo = document.getElementById('presetInfo'); - const presetDetails = document.getElementById('presetDetails'); - - const presetData = { - name: '几何动画预设', - description: '动态几何图形动画,包含多种形状的浮动效果', - kind: 'geometric', - align: 'right', - features: [ - '动态几何图形动画', - '多种形状浮动效果', - '渐变色彩方案', - '3D变换动画', - '实时交互效果', - '响应式设计' - ], - shapes: ['圆形', '方形', '三角形'], - colors: ['粉色渐变', '蓝色渐变', '绿色渐变', '黄色渐变', '紫色渐变'], - animations: ['浮动动画', '旋转动画', '脉冲效果', '3D变换'] - }; - - // 生成详情HTML - let detailsHTML = ''; - - detailsHTML += ` -
-
预设名称
-
${presetData.name}
-
-
-
预设类型
-
${presetData.kind}
-
-
-
对齐方式
-
${presetData.align}
-
-
-
几何形状
-
${presetData.shapes.join(', ')}
-
-
-
颜色方案
-
${presetData.colors.join(', ')}
-
-
-
动画效果
-
${presetData.animations.join(', ')}
-
- `; - - presetDetails.innerHTML = detailsHTML; - presetInfo.style.display = 'block'; - - // 滚动到详情区域 - presetInfo.scrollIntoView({ behavior: 'smooth' }); - } - - // 页面加载时自动检查 - window.onload = function() { - checkServer(); - }; - - - \ No newline at end of file diff --git a/public/widget.html b/public/widget.html index 9ccf4a0..9c4377c 100644 --- a/public/widget.html +++ b/public/widget.html @@ -137,9 +137,7 @@ function fillPlaceholders(html, contentData) { if (!html || !contentData) return html || ''; return html.replace(/\{\{(\w+)\}\}/g, (match, key) => { - return Object.prototype.hasOwnProperty.call(contentData, key) - ? String(contentData[key]) - : match; + return key in contentData ? String(contentData[key]) : match; }); }