XMWAI 0.3.0__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of XMWAI might be problematic. Click here for more details.

Files changed (122) hide show
  1. xmwai-0.3.2/MANIFEST.in +5 -0
  2. {xmwai-0.3.0/XMWAI.egg-info → xmwai-0.3.2}/PKG-INFO +3 -1
  3. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/__init__.py +2 -1
  4. xmwai-0.3.2/XMWAI/static/burger.js +165 -0
  5. xmwai-0.3.2/XMWAI/static/images/BottomBun.png +0 -0
  6. xmwai-0.3.2/XMWAI/static/images/TopBun.png +0 -0
  7. xmwai-0.3.2/XMWAI/static/images/beef.png +0 -0
  8. xmwai-0.3.2/XMWAI/static/images/bg.png +0 -0
  9. xmwai-0.3.2/XMWAI/static/images/cheese.png +0 -0
  10. xmwai-0.3.2/XMWAI/static/images/lettuce.png +0 -0
  11. xmwai-0.3.2/XMWAI/static/images/sauce.png +0 -0
  12. xmwai-0.3.2/XMWAI/static/images/tomato.png +0 -0
  13. xmwai-0.3.2/XMWAI/templates/burger.html +134 -0
  14. xmwai-0.3.2/XMWAI/templates/nutrition_pie.html +186 -0
  15. xmwai-0.3.2/XMWAI/templates//345/210/233/346/204/217/350/217/234/350/260/261.html +60 -0
  16. xmwai-0.3.2/XMWAI/web_core.py +282 -0
  17. xmwai-0.3.2/XMWAI/xmw_photo/bg.jpeg +0 -0
  18. {xmwai-0.3.0 → xmwai-0.3.2/XMWAI.egg-info}/PKG-INFO +3 -1
  19. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI.egg-info/SOURCES.txt +15 -2
  20. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI.egg-info/requires.txt +2 -0
  21. {xmwai-0.3.0 → xmwai-0.3.2}/setup.py +18 -5
  22. xmwai-0.3.0/MANIFEST.in +0 -2
  23. xmwai-0.3.0/XMWAI/cookbook_core.py +0 -148
  24. {xmwai-0.3.0 → xmwai-0.3.2}/LICENSE.txt +0 -0
  25. {xmwai-0.3.0 → xmwai-0.3.2}/README.md +0 -0
  26. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/bomb_core.py +0 -0
  27. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/core.py +0 -0
  28. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/file/__init__.py +0 -0
  29. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/file/idiom.json +0 -0
  30. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/0.gif +0 -0
  31. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/1.gif +0 -0
  32. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/10.gif +0 -0
  33. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/11.gif +0 -0
  34. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/12.gif +0 -0
  35. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/13.gif +0 -0
  36. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/14.gif +0 -0
  37. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/15.gif +0 -0
  38. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/16.gif +0 -0
  39. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/17.gif +0 -0
  40. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/18.gif +0 -0
  41. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/19.gif +0 -0
  42. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/2.gif +0 -0
  43. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/20.gif +0 -0
  44. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/21.gif +0 -0
  45. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/22.gif +0 -0
  46. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/23.gif +0 -0
  47. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/24.gif +0 -0
  48. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/25.gif +0 -0
  49. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/26.gif +0 -0
  50. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/27.gif +0 -0
  51. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/28.gif +0 -0
  52. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/29.gif +0 -0
  53. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/3.gif +0 -0
  54. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/30.gif +0 -0
  55. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/31.gif +0 -0
  56. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/32.gif +0 -0
  57. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/33.gif +0 -0
  58. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/34.gif +0 -0
  59. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/35.gif +0 -0
  60. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/36.gif +0 -0
  61. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/37.gif +0 -0
  62. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/38.gif +0 -0
  63. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/39.gif +0 -0
  64. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/4.gif +0 -0
  65. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/40.gif +0 -0
  66. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/41.gif +0 -0
  67. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/42.gif +0 -0
  68. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/43.gif +0 -0
  69. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/44.gif +0 -0
  70. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/45.gif +0 -0
  71. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/46.gif +0 -0
  72. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/47.gif +0 -0
  73. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/48.gif +0 -0
  74. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/49.gif +0 -0
  75. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/5.gif +0 -0
  76. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/50.gif +0 -0
  77. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/51.gif +0 -0
  78. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/52.gif +0 -0
  79. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/53.gif +0 -0
  80. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/54.gif +0 -0
  81. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/55.gif +0 -0
  82. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/56.gif +0 -0
  83. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/57.gif +0 -0
  84. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/58.gif +0 -0
  85. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/59.gif +0 -0
  86. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/6.gif +0 -0
  87. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/60.gif +0 -0
  88. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/61.gif +0 -0
  89. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/62.gif +0 -0
  90. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/63.gif +0 -0
  91. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/64.gif +0 -0
  92. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/65.gif +0 -0
  93. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/66.gif +0 -0
  94. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/67.gif +0 -0
  95. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/68.gif +0 -0
  96. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/69.gif +0 -0
  97. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/7.gif +0 -0
  98. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/70.gif +0 -0
  99. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/71.gif +0 -0
  100. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/72.gif +0 -0
  101. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/73.gif +0 -0
  102. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/74.gif +0 -0
  103. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/75.gif +0 -0
  104. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/76.gif +0 -0
  105. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/77.gif +0 -0
  106. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/78.gif +0 -0
  107. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/79.gif +0 -0
  108. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/8.gif +0 -0
  109. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/80.gif +0 -0
  110. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/81.gif +0 -0
  111. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/82.gif +0 -0
  112. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/83.gif +0 -0
  113. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/84.gif +0 -0
  114. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/85.gif +0 -0
  115. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/9.gif +0 -0
  116. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/gif/__init__.py +0 -0
  117. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/idiom_core.py +0 -0
  118. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/magic_core.py +0 -0
  119. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI/trial_class.py +0 -0
  120. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI.egg-info/dependency_links.txt +0 -0
  121. {xmwai-0.3.0 → xmwai-0.3.2}/XMWAI.egg-info/top_level.txt +0 -0
  122. {xmwai-0.3.0 → xmwai-0.3.2}/setup.cfg +0 -0
@@ -0,0 +1,5 @@
1
+ recursive-include XMWAI/gif *
2
+ recursive-include XMWAI/file *.json
3
+ recursive-include XMWAI/templates *.html
4
+ recursive-include XMWAI/static *.js *.css *.png *.jpg *.gif
5
+ recursive-include XMWAI/xmw_photo *.png *.jpg *.gif *.jpeg
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: XMWAI
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Small code King AI related library
5
5
  Home-page: https://github.com/Tonykai88/XMWAI.git
6
6
  Author: pydevelopment
@@ -15,6 +15,8 @@ Requires-Dist: requests>=2.32.3
15
15
  Requires-Dist: Pillow>=11.1.0
16
16
  Requires-Dist: opencv-python>=3.4.18.65
17
17
  Requires-Dist: numpy>=1.26.0
18
+ Requires-Dist: flask>=3.1.0
19
+ Requires-Dist: pyecharts>=2.0.8
18
20
  Dynamic: author
19
21
  Dynamic: author-email
20
22
  Dynamic: classifier
@@ -3,8 +3,9 @@ from .magic_core import birthday # 从子模块导入函数到顶层
3
3
  from .bomb_core import bomb # 从子模块导入函数到顶层
4
4
  from .idiom_core import idiom, searchIdiom, get_json_path # 从子模块导入函数到顶层
5
5
  from .trial_class import make, get_file_content_as_base64, save_pic, detect_windows_scale, get_file_content_as_base64_2, cartoon # 从子模块导入函数到顶层
6
+ from .web_core import burger, cookbook # 从子模块导入函数到顶层
6
7
 
7
8
  __all__ = ["story", "photo", "reply", "poem", 'birthday', 'bomb',
8
9
  "idiom", "searchIdiom", "get_json_path", "crack",
9
10
  "make", "get_file_content_as_base64", "save_pic", "detect_windows_scale",
10
- "get_file_content_as_base64_2", "cartoon"] # 可选:明确导出的内容
11
+ "get_file_content_as_base64_2", "cartoon", "burger", "cookbook"] # 可选:明确导出的内容
@@ -0,0 +1,165 @@
1
+ // 等待所有图片加载完成后设置样式
2
+ function setIngredientStyles() {
3
+ const ingredients = document.querySelectorAll(".ingredient");
4
+ console.log("ingredients", ingredients);
5
+
6
+ // 检查所有图片是否都已加载
7
+ const imagePromises = Array.from(ingredients).map((img) => {
8
+ return new Promise((resolve) => {
9
+ if (img.complete) {
10
+ resolve(img);
11
+ } else {
12
+ img.onload = () => resolve(img);
13
+ img.onerror = () => resolve(img); // 即使加载失败也继续
14
+ }
15
+ });
16
+ });
17
+
18
+ // 等待所有图片加载完成
19
+ Promise.all(imagePromises).then(() => {
20
+ let totalTopValue = 0;
21
+ const ingredientsLen = ingredients.length;
22
+
23
+ ingredients.forEach((img, index) => {
24
+ const ingredientType = img.getAttribute("data-ingredient");
25
+ const ingredientIndex = parseInt(img.getAttribute("data-index"));
26
+ img.style.zIndex = ingredientsLen - ingredientIndex;
27
+
28
+ // 获取当前图片高度
29
+ const imgHeight = img.offsetHeight || img.naturalHeight || 60; // 备用默认高度
30
+ let offsetY = 10;
31
+
32
+ // 基础定位:从下往上堆叠
33
+ if (ingredientType === "TopBun") {
34
+ img.style.top = 0;
35
+ totalTopValue = imgHeight;
36
+ } else {
37
+ //判断上一个食材是什么
38
+ const prevIngredient = ingredients[index - 1];
39
+ const prevIngredientType =
40
+ prevIngredient.getAttribute("data-ingredient");
41
+ //获取上一个食材的高度
42
+ const prevIngredientHeight =
43
+ prevIngredient.offsetHeight || prevIngredient.naturalHeight || 60;
44
+
45
+ //上一个食材是否是辅料
46
+ const isAuxiliary = ["cheese", "lettuce", "sauce"].includes(
47
+ prevIngredientType
48
+ );
49
+
50
+ if (isAuxiliary) {
51
+ //百分比
52
+ const percentage = prevIngredientType === "cheese" ? 0.95 : 0.7;
53
+ img.style.top =
54
+ totalTopValue - prevIngredientHeight * percentage + "px";
55
+ totalTopValue =
56
+ totalTopValue - prevIngredientHeight * percentage + imgHeight;
57
+ } else {
58
+ img.style.top = totalTopValue - offsetY + "px";
59
+ totalTopValue += imgHeight - offsetY;
60
+ }
61
+ }
62
+
63
+ console.log(
64
+ "ingredientType",
65
+ ingredientType,
66
+ "totalTopValue",
67
+ totalTopValue,
68
+ "offsetY",
69
+ offsetY,
70
+ "imgHeight",
71
+ imgHeight
72
+ );
73
+ });
74
+
75
+ // 滑动条逻辑处理
76
+ setupBurgerSlider(totalTopValue);
77
+ });
78
+ }
79
+
80
+ // 滑动条设置和控制函数
81
+ function setupBurgerSlider(burgerTotalHeight) {
82
+ const view = document.querySelector(".view");
83
+ const burger = document.querySelector(".burger");
84
+ const sliderContainer = document.getElementById("sliderContainer");
85
+ const slider = document.getElementById("burgerSlider");
86
+
87
+ if (!view || !burger || !sliderContainer || !slider) {
88
+ console.error("找不到必要的DOM元素");
89
+ return;
90
+ }
91
+
92
+ // 获取view的可视高度
93
+ const viewHeight = view.offsetHeight;
94
+
95
+ console.log("汉堡总高度:", burgerTotalHeight, "可视区域高度:", viewHeight);
96
+
97
+ // 判断是否需要显示滑动条
98
+ if (burgerTotalHeight > viewHeight) {
99
+ // 显示滑动条
100
+ sliderContainer.style.display = "flex";
101
+
102
+ // 计算可滑动的最大值
103
+ const maxScrollValue = burgerTotalHeight - viewHeight;
104
+
105
+ // 设置滑动条的最大值
106
+ slider.max = maxScrollValue;
107
+ slider.value = 0; // 初始值为0,滑动条在顶部(未选中状态)
108
+
109
+ // 初始化burger位置(显示汉堡底部)
110
+ burger.style.bottom = maxScrollValue + "px";
111
+
112
+ // 滑动条事件监听
113
+ slider.addEventListener("input", function () {
114
+ const scrollValue = parseFloat(this.value);
115
+ // 滑动条向下拖动时汉堡向下移动
116
+ const bottomValue = maxScrollValue - scrollValue;
117
+ burger.style.bottom = bottomValue + "px";
118
+ console.log("滑动值:", scrollValue, "实际bottom值:", bottomValue);
119
+ });
120
+
121
+ console.log("滑动条已激活,最大滑动值:", maxScrollValue);
122
+ } else {
123
+ // 隐藏滑动条
124
+ sliderContainer.style.display = "none";
125
+ burger.style.bottom = "0px";
126
+ console.log("汉堡高度适合,无需滑动条");
127
+ }
128
+ }
129
+
130
+ // 响应式处理 - 窗口大小改变时重新计算
131
+ function handleResize() {
132
+ console.log("窗口大小改变,重新计算滑动条状态");
133
+ // 重新执行样式设置
134
+ setIngredientStyles();
135
+ }
136
+
137
+ // 防抖函数
138
+ function debounce(func, wait) {
139
+ let timeout;
140
+ return function executedFunction(...args) {
141
+ const later = () => {
142
+ clearTimeout(timeout);
143
+ func(...args);
144
+ };
145
+ clearTimeout(timeout);
146
+ timeout = setTimeout(later, wait);
147
+ };
148
+ }
149
+
150
+ // 页面加载完成后执行样式设置
151
+ document.addEventListener("DOMContentLoaded", setIngredientStyles);
152
+
153
+ // 可选:添加点击事件显示食材信息
154
+ document.addEventListener("DOMContentLoaded", function () {
155
+ document.querySelectorAll(".ingredient").forEach((img) => {
156
+ img.addEventListener("click", function () {
157
+ const ingredient = this.getAttribute("data-ingredient");
158
+ const index = this.getAttribute("data-index");
159
+ console.log(`点击了第${parseInt(index) + 1}层: ${ingredient}`);
160
+ });
161
+ });
162
+ });
163
+
164
+ // 窗口大小改变时重新计算(使用防抖)
165
+ window.addEventListener("resize", debounce(handleResize, 300));
Binary file
Binary file
@@ -0,0 +1,134 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <title>我的超级汉堡</title>
6
+ <style>
7
+ body {
8
+ background-image: url("{{ url_for('static', filename='images/bg.png') }}");
9
+ background-size: cover;
10
+ background-position: center;
11
+ background-repeat: no-repeat;
12
+ background-attachment: fixed;
13
+ overflow: hidden;
14
+ text-align: center;
15
+ font-family: Arial, sans-serif;
16
+ width: 100vw;
17
+ height: 100vh;
18
+ margin: 0;
19
+ padding: 0;
20
+ display: flex;
21
+ flex-direction: column;
22
+ box-sizing: border-box;
23
+ padding-bottom: 50px;
24
+ }
25
+ .view {
26
+ flex: 1;
27
+ position: relative;
28
+ overflow: hidden;
29
+ }
30
+ .burger {
31
+ position: relative;
32
+ width: 300px;
33
+ margin-left: auto;
34
+ margin-right: auto;
35
+ }
36
+ .ingredient {
37
+ width: 300px;
38
+ display: block;
39
+ position: absolute;
40
+ }
41
+
42
+ /* 滑动条容器样式 */
43
+ .slider-container {
44
+ position: fixed;
45
+ right: 20px;
46
+ top: 50%;
47
+ transform: translateY(-50%) scale(1.5);
48
+ height: 60vh;
49
+ width: 30px;
50
+ z-index: 1000;
51
+ display: flex;
52
+ align-items: center;
53
+ justify-content: center;
54
+ }
55
+
56
+ /* 竖向滑动条样式 */
57
+ .burger-slider {
58
+ -webkit-appearance: slider-vertical; /* WebKit */
59
+ width: 20px;
60
+ height: 100%;
61
+ background: rgba(255, 255, 255, 0.8);
62
+ border-radius: 10px;
63
+ outline: none;
64
+ cursor: pointer;
65
+ }
66
+
67
+ /* Firefox 滑动条样式 */
68
+ .burger-slider::-moz-range-track {
69
+ width: 20px;
70
+ height: 100%;
71
+ background: rgba(255, 255, 255, 0.8);
72
+ border-radius: 10px;
73
+ border: none;
74
+ }
75
+
76
+ .burger-slider::-moz-range-thumb {
77
+ width: 20px;
78
+ height: 40px;
79
+ background: #007bff;
80
+ border-radius: 10px;
81
+ border: none;
82
+ cursor: pointer;
83
+ }
84
+
85
+ /* WebKit 滑动条样式 */
86
+ .burger-slider::-webkit-slider-track {
87
+ width: 20px;
88
+ height: 100%;
89
+ background: rgba(255, 255, 255, 0.8);
90
+ border-radius: 10px;
91
+ }
92
+
93
+ .burger-slider::-webkit-slider-thumb {
94
+ -webkit-appearance: none;
95
+ width: 20px;
96
+ height: 40px;
97
+ background: #007bff;
98
+ border-radius: 10px;
99
+ cursor: pointer;
100
+ }
101
+ </style>
102
+ </head>
103
+ <body>
104
+ <h1>🎉 你的超级汉堡来了!</h1>
105
+ <div class="view">
106
+ <div class="burger">
107
+ {% for ingredient in ingredients %}
108
+ <img
109
+ class="ingredient"
110
+ src="{{ url_for('static', filename='images/' + ingredient + '.png') }}"
111
+ alt="{{ ingredient }}"
112
+ data-index="{{ loop.index0 }}"
113
+ data-ingredient="{{ ingredient }}"
114
+ />
115
+ {% endfor %}
116
+ </div>
117
+ </div>
118
+
119
+ <!-- 竖向滑动条 -->
120
+ <div class="slider-container" id="sliderContainer" style="display: none">
121
+ <input
122
+ type="range"
123
+ id="burgerSlider"
124
+ class="burger-slider"
125
+ min="0"
126
+ max="100"
127
+ value="0"
128
+ orient="vertical"
129
+ />
130
+ </div>
131
+
132
+ <script src="{{ url_for('static', filename='burger.js') }}"></script>
133
+ </body>
134
+ </html>
@@ -0,0 +1,186 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Awesome-pyecharts</title>
6
+ <script type="text/javascript" src="https://assets.pyecharts.org/assets/v5/echarts.min.js"></script>
7
+
8
+ </head>
9
+ <body >
10
+ <div id="445b48e3071c494088a3b3494b4d73f3" class="chart-container" style="width:1100px; height:500px; "></div>
11
+ <script>
12
+ var chart_445b48e3071c494088a3b3494b4d73f3 = echarts.init(
13
+ document.getElementById('445b48e3071c494088a3b3494b4d73f3'), 'white', {renderer: 'canvas'});
14
+ var option_445b48e3071c494088a3b3494b4d73f3 = {
15
+ "animation": true,
16
+ "animationThreshold": 2000,
17
+ "animationDuration": 1000,
18
+ "animationEasing": "cubicOut",
19
+ "animationDelay": 0,
20
+ "animationDurationUpdate": 300,
21
+ "animationEasingUpdate": "cubicOut",
22
+ "animationDelayUpdate": 0,
23
+ "aria": {
24
+ "enabled": false
25
+ },
26
+ "color": [
27
+ "#5470c6",
28
+ "#91cc75",
29
+ "#fac858",
30
+ "#ee6666",
31
+ "#73c0de",
32
+ "#3ba272",
33
+ "#fc8452",
34
+ "#9a60b4",
35
+ "#ea7ccc"
36
+ ],
37
+ "series": [
38
+ {
39
+ "type": "pie",
40
+ "colorBy": "data",
41
+ "legendHoverLink": true,
42
+ "selectedMode": false,
43
+ "selectedOffset": 10,
44
+ "clockwise": true,
45
+ "startAngle": 90,
46
+ "minAngle": 0,
47
+ "minShowLabelAngle": 0,
48
+ "avoidLabelOverlap": true,
49
+ "stillShowZeroSum": true,
50
+ "percentPrecision": 2,
51
+ "showEmptyCircle": true,
52
+ "emptyCircleStyle": {
53
+ "color": "lightgray",
54
+ "borderColor": "#000",
55
+ "borderWidth": 0,
56
+ "borderType": "solid",
57
+ "borderDashOffset": 0,
58
+ "borderCap": "butt",
59
+ "borderJoin": "bevel",
60
+ "borderMiterLimit": 10,
61
+ "opacity": 1
62
+ },
63
+ "data": [
64
+ {
65
+ "name": "\u86cb\u767d\u8d28",
66
+ "value": 28.5
67
+ },
68
+ {
69
+ "name": "\u8102\u80aa",
70
+ "value": 18.2
71
+ },
72
+ {
73
+ "name": "\u78b3\u6c34\u5316\u5408\u7269",
74
+ "value": 42.3
75
+ },
76
+ {
77
+ "name": "\u7ef4\u751f\u7d20",
78
+ "value": 6.0
79
+ },
80
+ {
81
+ "name": "\u77ff\u7269\u8d28",
82
+ "value": 3.2
83
+ }
84
+ ],
85
+ "radius": [
86
+ "0%",
87
+ "75%"
88
+ ],
89
+ "center": [
90
+ "50%",
91
+ "50%"
92
+ ],
93
+ "label": {
94
+ "show": true,
95
+ "margin": 8,
96
+ "formatter": "{b}: {c}"
97
+ },
98
+ "labelLine": {
99
+ "show": true,
100
+ "showAbove": false,
101
+ "length": 15,
102
+ "length2": 15,
103
+ "smooth": false,
104
+ "minTurnAngle": 90,
105
+ "maxSurfaceAngle": 90
106
+ },
107
+ "rippleEffect": {
108
+ "show": true,
109
+ "brushType": "stroke",
110
+ "scale": 2.5,
111
+ "period": 4
112
+ }
113
+ }
114
+ ],
115
+ "legend": [
116
+ {
117
+ "data": [
118
+ "\u86cb\u767d\u8d28",
119
+ "\u8102\u80aa",
120
+ "\u78b3\u6c34\u5316\u5408\u7269",
121
+ "\u7ef4\u751f\u7d20",
122
+ "\u77ff\u7269\u8d28"
123
+ ],
124
+ "selected": {},
125
+ "show": true,
126
+ "padding": 5,
127
+ "itemGap": 10,
128
+ "itemWidth": 25,
129
+ "itemHeight": 14,
130
+ "backgroundColor": "transparent",
131
+ "borderColor": "#ccc",
132
+ "borderWidth": 1,
133
+ "borderRadius": 0,
134
+ "pageButtonItemGap": 5,
135
+ "pageButtonPosition": "end",
136
+ "pageFormatter": "{current}/{total}",
137
+ "pageIconColor": "#2f4554",
138
+ "pageIconInactiveColor": "#aaa",
139
+ "pageIconSize": 15,
140
+ "animationDurationUpdate": 800,
141
+ "selector": false,
142
+ "selectorPosition": "auto",
143
+ "selectorItemGap": 7,
144
+ "selectorButtonGap": 10
145
+ }
146
+ ],
147
+ "tooltip": {
148
+ "show": true,
149
+ "trigger": "item",
150
+ "triggerOn": "mousemove|click",
151
+ "axisPointer": {
152
+ "type": "line"
153
+ },
154
+ "showContent": true,
155
+ "alwaysShowContent": false,
156
+ "showDelay": 0,
157
+ "hideDelay": 100,
158
+ "enterable": false,
159
+ "confine": false,
160
+ "appendToBody": false,
161
+ "transitionDuration": 0.4,
162
+ "textStyle": {
163
+ "fontSize": 14
164
+ },
165
+ "borderWidth": 0,
166
+ "padding": 5,
167
+ "order": "seriesAsc"
168
+ },
169
+ "title": [
170
+ {
171
+ "show": true,
172
+ "text": "\u8425\u517b\u4ef7\u503c\u5206\u5e03",
173
+ "target": "blank",
174
+ "subtarget": "blank",
175
+ "padding": 5,
176
+ "itemGap": 10,
177
+ "textAlign": "auto",
178
+ "textVerticalAlign": "auto",
179
+ "triggerEvent": false
180
+ }
181
+ ]
182
+ };
183
+ chart_445b48e3071c494088a3b3494b4d73f3.setOption(option_445b48e3071c494088a3b3494b4d73f3);
184
+ </script>
185
+ </body>
186
+ </html>
@@ -0,0 +1,60 @@
1
+
2
+ <!DOCTYPE html>
3
+ <html lang="zh">
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <title>创意菜谱</title>
7
+ <style>
8
+ html, body { margin:0; padding:0; width:100%; height:100%; overflow-x:hidden; }
9
+ body { font-family:"微软雅黑",sans-serif; background:#2c2c2c url('bg.jpeg') no-repeat center center fixed; background-size:cover; color:#333; }
10
+ .container { max-width:1200px; margin:30px auto; background:rgba(255,248,220,0.95); border-radius:15px; padding:30px; box-shadow:0 0 20px rgba(0,0,0,0.2); }
11
+ .banner { width:100%; height:220px; background:url('bg.jpeg') center/cover no-repeat; border-radius:15px 15px 0 0; display:flex; align-items:center; justify-content:center; }
12
+ .banner h1 { color:#fff; font-size:28px; text-shadow:1px 1px 3px #666; }
13
+ p { font-size:18px; margin:8px 0; }
14
+ .step-card { background:#fff0b3; margin:10px 0; border-radius:12px; overflow:hidden; opacity:0; transform:translateY(20px) scale(0.98); animation:fadeInUp 0.6s forwards; }
15
+ .step-title { font-weight:bold; padding:10px 15px; cursor:pointer; background:#ffb347; color:#fff; border-bottom:1px solid #ffd27f; }
16
+ .step-content { padding:10px 15px; display:block; font-size:16px; opacity:0; max-height:0; overflow:hidden; transition: opacity 0.4s ease, max-height 0.4s ease; }
17
+ .step-card.hover .step-content { opacity:1; max-height:800px; }
18
+ iframe { width:100%; height:500px; border:none; margin-top:20px; }
19
+ @keyframes fadeInUp { to { opacity:1; transform:translateY(0) scale(1); } }
20
+ </style>
21
+ </head>
22
+ <body>
23
+ <div class="container">
24
+ <div class="banner"><h1>🍽 羊肉炸香蕉</h1></div>
25
+ <p>🍖 <strong>主菜:</strong>羊肉</p>
26
+ <p>🥗 <strong>配菜:</strong>🍌 香蕉</p>
27
+ <p>👩‍🍳 <strong>做法:</strong>🍟 炸</p>
28
+
29
+ <div class="step-card" style="animation-delay:0.2s;">
30
+ <div class="step-title">Step 1 📝 食材搭配的营养价值</div>
31
+ <div class="step-content">根据食材搭配生成的营养价值饼图如下 ⬇️</div>
32
+ </div>
33
+
34
+ <div class="step-card" style="animation-delay:0.4s;">
35
+ <div class="step-title">Step 2 📝 创意灵感</div>
36
+ <div class="step-content">这道创意菜灵感来源于食材的碰撞实验,将传统咸香风味的羊肉与热带水果的清甜进行融合,通过高温油🍟 炸形成外酥里嫩的口感反差。🍌 香蕉经过🍟 炸制后会产生焦糖化反应,其绵密质地与羊肉的纤维感形成层次对比,搭配特制香料粉激发出东南亚风情的味觉体验,突破常规肉类与水果的搭配边界。</div>
37
+ </div>
38
+
39
+ <div class="step-card" style="animation-delay:0.6000000000000001s;">
40
+ <div class="step-title">Step 3 📝 食材清单</div>
41
+ <div class="step-content">主料:羊腿肉300克(🔪 切1.5cm立方块)<br>配菜:成熟🍌 香蕉2根(🔪 切1cm厚片)<br>裹粉:🌽 玉米淀粉50克、🍗 🥚 鸡蛋1个、🍞 面包糠80克<br>调味料:辣椒粉3克、孜然粉5克、蒜粉2克、盐4克、黑胡椒碎2克<br>辅料:食用油500毫升(实耗约80毫升)<br>装饰:新鲜薄荷叶5片、柠檬角2个</div>
42
+ </div>
43
+
44
+ <div class="step-card" style="animation-delay:0.8s;">
45
+ <div class="step-title">Step 4 📝 制作步骤</div>
46
+ <div class="step-content">1 预处理:羊肉块用2克盐、1克黑胡椒、蒜粉🫙 腌制15分钟;🍌 香蕉片裹薄层🌽 玉米淀粉备用<br>2 调制裹粉:🍗 🥚 鸡蛋打散与剩余🌽 玉米淀粉混合成蛋糊,🍞 面包糠与辣椒粉、孜然粉、2克盐、1克黑胡椒混合<br>3 双阶段🍟 炸制:<br>- 羊肉块先蘸蛋糊再裹香料🍞 面包糠,160℃油温初🍟 炸3分钟定型<br>- 🍌 香蕉片直接裹香料🍞 面包糠,180℃油温速🍟 炸1分钟至金黄<br>4 复🍟 炸提脆:羊肉块200℃高温复🍟 炸1分钟至外壳酥脆<br>5 装盘艺术:羊肉与🍌 香蕉片间隔堆叠,撒剩余香料粉,配薄荷叶与柠檬角</div>
47
+ </div>
48
+
49
+ <iframe src="nutrition_pie.html"></iframe>
50
+ </div>
51
+ <script>
52
+ const steps = document.querySelectorAll('.step-card');
53
+ steps.forEach(card => {
54
+ card.addEventListener('mouseenter', () => { card.classList.add('hover'); });
55
+ card.addEventListener('mouseleave', () => { card.classList.remove('hover'); });
56
+ });
57
+ </script>
58
+ </body>
59
+ </html>
60
+