Browse Source

✨ feat(demo): 创建Juris计数器演示页面

- 添加基本HTML结构和响应式布局
- 实现点击计数功能和视觉反馈效果
- 引入Juris框架并初始化计数器应用
- 添加悬停和点击动画效果提升用户体验
yourname 3 months ago
parent
commit
debb273699
1 changed files with 59 additions and 0 deletions
  1. 59 0
      index.html

+ 59 - 0
index.html

@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Juris 计数器 Demo</title>
+    <style>
+        body {
+            font-family: Arial, sans-serif;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            min-height: 100vh;
+            margin: 0;
+            background-color: #f5f5f5;
+        }
+        #app {
+            text-align: center;
+        }
+        .counter {
+            font-size: 3rem;
+            font-weight: bold;
+            color: #333;
+            cursor: pointer;
+            padding: 20px;
+            border: 2px solid #ddd;
+            border-radius: 10px;
+            background-color: white;
+            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
+            transition: all 0.2s ease;
+        }
+        .counter:hover {
+            background-color: #f0f0f0;
+            transform: translateY(-2px);
+        }
+        .counter:active {
+            transform: translateY(0);
+        }
+    </style>
+</head>
+<body>
+    <div id="app"></div>
+
+    <script src="https://unpkg.com/juris"></script>
+    <script>
+        const app = new Juris({
+            states: { count: 0 },
+            layout: {
+                div: {
+                    className: 'counter',
+                    text: () => `点击次数: ${app.getState('count', 0)}`,
+                    onclick: () => app.setState('count', app.getState('count', 0) + 1)
+                }
+            }
+        });
+        app.render('#app');
+    </script>
+</body>
+</html>