hayun-vite 0.11.2 → 0.13.0

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.
@@ -1,84 +0,0 @@
1
- // import { svgNS } from "../../globalinfo.js";
2
- const svgNS = "http://www.w3.org/2000/svg";
3
-
4
- // پهنا و ارتفاع ظرف را پیدا کن و آنرا شطرنجی کن
5
- export default function drawGrid(container) {
6
- const viewBox = container.getAttribute("viewBox");
7
- const w = container.getAttribute("width");
8
- const h = container.getAttribute("height");
9
- const svg = document.createElementNS(svgNS, "svg");
10
- svg.setAttribute("viewBox", viewBox);
11
- // svg.setAttribute("width", 210);
12
- // svg.setAttribute("height", 297);
13
-
14
- // مربع احاطه‌کننده کل جدول برای راهنمای توسعه
15
- let rect = document.createElementNS(svgNS, "rect");
16
- rect.setAttribute("x", 0);
17
- rect.setAttribute("y", 0);
18
- rect.setAttribute("width", 210);
19
- rect.setAttribute("height", 297);
20
- rect.setAttribute("style", "fill: transparent; stroke-width: 1;");
21
- svg.appendChild(rect);
22
-
23
- let line,
24
- x,
25
- y = 0;
26
- // رسم خطوط افقی با فاصله واحد ویوباکس
27
- for (y = 1; y <= 296; y++) {
28
- line = document.createElementNS(svgNS, "line");
29
- line.setAttribute("x1", 1);
30
- line.setAttribute("y1", y);
31
- line.setAttribute("x2", 209);
32
- line.setAttribute("y2", y);
33
- line.setAttribute(
34
- "style",
35
- "stroke: black; stroke-width: 0.1; stroke-opacity: 0.5; stroke-dasharray: 0.1;"
36
- );
37
- line.setAttribute("class", "gridLines");
38
- svg.appendChild(line);
39
- }
40
-
41
- // رسم خطوط عمودی با فاصله واحد ویوباکس
42
- for (x = 1; x <= 209; x++) {
43
- line = document.createElementNS(svgNS, "line");
44
- line.setAttribute("x1", x);
45
- line.setAttribute("y1", 1);
46
- line.setAttribute("x2", x);
47
- line.setAttribute("y2", 296);
48
- line.setAttribute(
49
- "style",
50
- "stroke: black; stroke-width: 0.1; stroke-opacity: 0.5; stroke-dasharray: 0.1;"
51
- );
52
- line.setAttribute("class", "gridLines");
53
-
54
- svg.appendChild(line);
55
- }
56
- // رسم خط میانی افقی
57
- line = document.createElementNS(svgNS, "line");
58
- line.setAttribute("x1", 1);
59
- line.setAttribute("y1", 297/2);
60
- line.setAttribute("x2", 209);
61
- line.setAttribute("y2", 297/2);
62
- line.setAttribute(
63
- "style",
64
- "stroke: black; stroke-width: 0.2; stroke-opacity: 0.8;"
65
- );
66
- line.setAttribute("class", "gridLines");
67
-
68
- svg.appendChild(line);
69
-
70
- // رسم خط میانی عمودی
71
- line = document.createElementNS(svgNS, "line");
72
- line.setAttribute("x1", 105);
73
- line.setAttribute("y1", 1);
74
- line.setAttribute("x2", 105);
75
- line.setAttribute("y2", 296);
76
- line.setAttribute(
77
- "style",
78
- "stroke: black; stroke-width: 0.2; stroke-opacity: 0.8;"
79
- );
80
- line.setAttribute("class", "gridLines");
81
-
82
- svg.appendChild(line);
83
- container.appendChild(svg);
84
- }
@@ -1,9 +0,0 @@
1
- export default function hideGrid() {
2
-
3
- let gridLines = document.getElementsByClassName("gridLines");
4
-
5
- for (const line of gridLines) {
6
- line.style = "stroke: transparent; fill: transparent;"
7
- }
8
-
9
- }
@@ -1,18 +0,0 @@
1
- const svgNS = "http://www.w3.org/2000/svg";
2
-
3
- export default function putCell(
4
- {
5
- container, x, y, dx = 0, dy= 0 , width, height, rx,
6
- style = "fill: transparent; stroke: black; stroke-width: 0.2;",
7
- }) {
8
- let rect = document.createElementNS(svgNS, "rect");
9
- rect.setAttribute("x", x - width / 2 + dx);
10
- rect.setAttribute("y", y - height / 2 + dy);
11
- rect.setAttribute("rx", rx);
12
-
13
- rect.setAttribute("width", width);
14
- rect.setAttribute("height", height);
15
- rect.setAttribute("style", style);
16
- container.appendChild(rect);
17
-
18
- }