|
1 | 1 | import React from "react";
|
2 | 2 | import {Pattern} from "./Background";
|
3 | 3 |
|
4 |
| -export function patternGrid(color: string | undefined, sizeMul: number): Pattern { |
| 4 | +export function patternGrid(color: string | undefined, strokeWidthMul: number, sizeMul: number): Pattern { |
5 | 5 | if (color == null) color = "#E4E4EA"
|
6 |
| - return [<rect key="pattern" x="0" y="0" width="100%" height="100%" fill="none" stroke={color} strokeWidth="3"/>, 20, 20 * sizeMul] |
| 6 | + return [<rect key="pattern" x="0" y="0" width="100%" height="100%" fill="none" stroke={color} strokeWidth={3 * strokeWidthMul}/>, 20, 20 * sizeMul] |
7 | 7 | }
|
8 | 8 |
|
9 |
| -export function patternLines(color: string | undefined, sizeMul: number): Pattern { |
| 9 | +export function patternLines(color: string | undefined, strokeWidthMul: number, sizeMul: number): Pattern { |
10 | 10 | if (color == null) color = "#DFDFE8"
|
11 | 11 | return [<>
|
12 |
| - <line x1="49" y1="51" x2="51" y2="49" strokeWidth="1" fill="none" stroke={color}/> |
13 |
| - <line x1="44" y1="51" x2="51" y2="44" strokeWidth="1" fill="none" stroke={color}/> |
14 |
| - <line x1="39" y1="51" x2="51" y2="39" strokeWidth="1" fill="none" stroke={color}/> |
15 |
| - <line x1="34" y1="51" x2="51" y2="34" strokeWidth="1" fill="none" stroke={color}/> |
16 |
| - <line x1="29" y1="51" x2="51" y2="29" strokeWidth="1" fill="none" stroke={color}/> |
17 |
| - <line x1="24" y1="51" x2="51" y2="24" strokeWidth="1" fill="none" stroke={color}/> |
18 |
| - <line x1="19" y1="51" x2="51" y2="19" strokeWidth="1" fill="none" stroke={color}/> |
19 |
| - <line x1="14" y1="51" x2="51" y2="14" strokeWidth="1" fill="none" stroke={color}/> |
20 |
| - <line x1="09" y1="51" x2="51" y2="09" strokeWidth="1" fill="none" stroke={color}/> |
21 |
| - <line x1="04" y1="51" x2="51" y2="04" strokeWidth="1" fill="none" stroke={color}/> |
| 12 | + <line x1="49" y1="51" x2="51" y2="49" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 13 | + <line x1="44" y1="51" x2="51" y2="44" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 14 | + <line x1="39" y1="51" x2="51" y2="39" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 15 | + <line x1="34" y1="51" x2="51" y2="34" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 16 | + <line x1="29" y1="51" x2="51" y2="29" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 17 | + <line x1="24" y1="51" x2="51" y2="24" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 18 | + <line x1="19" y1="51" x2="51" y2="19" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 19 | + <line x1="14" y1="51" x2="51" y2="14" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 20 | + <line x1="09" y1="51" x2="51" y2="09" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 21 | + <line x1="04" y1="51" x2="51" y2="04" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
22 | 22 |
|
23 |
| - <line x1="-1" y1="51" x2="51" y2="-1" strokeWidth="1" fill="none" stroke={color}/> |
| 23 | + <line x1="-1" y1="51" x2="51" y2="-1" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
24 | 24 |
|
25 |
| - <line x1="-1" y1="46" x2="46" y2="-1" strokeWidth="1" fill="none" stroke={color}/> |
26 |
| - <line x1="-1" y1="41" x2="41" y2="-1" strokeWidth="1" fill="none" stroke={color}/> |
27 |
| - <line x1="-1" y1="36" x2="36" y2="-1" strokeWidth="1" fill="none" stroke={color}/> |
28 |
| - <line x1="-1" y1="31" x2="31" y2="-1" strokeWidth="1" fill="none" stroke={color}/> |
29 |
| - <line x1="-1" y1="26" x2="26" y2="-1" strokeWidth="1" fill="none" stroke={color}/> |
30 |
| - <line x1="-1" y1="21" x2="21" y2="-1" strokeWidth="1" fill="none" stroke={color}/> |
31 |
| - <line x1="-1" y1="16" x2="16" y2="-1" strokeWidth="1" fill="none" stroke={color}/> |
32 |
| - <line x1="-1" y1="11" x2="11" y2="-1" strokeWidth="1" fill="none" stroke={color}/> |
33 |
| - <line x1="-1" y1="06" x2="06" y2="-1" strokeWidth="1" fill="none" stroke={color}/> |
34 |
| - <line x1="-1" y1="01" x2="01" y2="-1" strokeWidth="1" fill="none" stroke={color}/> |
| 25 | + <line x1="-1" y1="46" x2="46" y2="-1" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 26 | + <line x1="-1" y1="41" x2="41" y2="-1" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 27 | + <line x1="-1" y1="36" x2="36" y2="-1" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 28 | + <line x1="-1" y1="31" x2="31" y2="-1" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 29 | + <line x1="-1" y1="26" x2="26" y2="-1" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 30 | + <line x1="-1" y1="21" x2="21" y2="-1" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 31 | + <line x1="-1" y1="16" x2="16" y2="-1" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 32 | + <line x1="-1" y1="11" x2="11" y2="-1" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 33 | + <line x1="-1" y1="06" x2="06" y2="-1" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
| 34 | + <line x1="-1" y1="01" x2="01" y2="-1" strokeWidth={strokeWidthMul} fill="none" stroke={color}/> |
35 | 35 | </>, 50, 80 * sizeMul]
|
36 | 36 | }
|
37 | 37 |
|
38 |
| -export function patternDots(color: string | undefined, sizeMul: number): Pattern { |
| 38 | +export function patternDots(color: string | undefined, strokeWidthMul: number, sizeMul: number): Pattern { |
39 | 39 | if (color == null) color = "#E8E8EF"
|
40 | 40 | return [<React.Fragment key="pattern">
|
41 |
| - <circle cx="05" cy="05" r="2" fill={color} stroke="none"/> |
42 |
| - <circle cx="15" cy="05" r="2" fill={color} stroke="none"/> |
43 |
| - <circle cx="25" cy="05" r="2" fill={color} stroke="none"/> |
44 |
| - <circle cx="35" cy="05" r="2" fill={color} stroke="none"/> |
45 |
| - <circle cx="45" cy="05" r="2" fill={color} stroke="none"/> |
| 41 | + <circle cx="05" cy="05" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 42 | + <circle cx="15" cy="05" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 43 | + <circle cx="25" cy="05" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 44 | + <circle cx="35" cy="05" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 45 | + <circle cx="45" cy="05" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
46 | 46 |
|
47 |
| - <circle cx="05" cy="15" r="2" fill={color} stroke="none"/> |
48 |
| - <circle cx="15" cy="15" r="2" fill={color} stroke="none"/> |
49 |
| - <circle cx="25" cy="15" r="2" fill={color} stroke="none"/> |
50 |
| - <circle cx="35" cy="15" r="2" fill={color} stroke="none"/> |
51 |
| - <circle cx="45" cy="15" r="2" fill={color} stroke="none"/> |
| 47 | + <circle cx="05" cy="15" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 48 | + <circle cx="15" cy="15" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 49 | + <circle cx="25" cy="15" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 50 | + <circle cx="35" cy="15" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 51 | + <circle cx="45" cy="15" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
52 | 52 |
|
53 |
| - <circle cx="05" cy="25" r="2" fill={color} stroke="none"/> |
54 |
| - <circle cx="15" cy="25" r="2" fill={color} stroke="none"/> |
55 |
| - <circle cx="25" cy="25" r="2" fill={color} stroke="none"/> |
56 |
| - <circle cx="35" cy="25" r="2" fill={color} stroke="none"/> |
57 |
| - <circle cx="45" cy="25" r="2" fill={color} stroke="none"/> |
| 53 | + <circle cx="05" cy="25" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 54 | + <circle cx="15" cy="25" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 55 | + <circle cx="25" cy="25" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 56 | + <circle cx="35" cy="25" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 57 | + <circle cx="45" cy="25" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
58 | 58 |
|
59 |
| - <circle cx="05" cy="35" r="2" fill={color} stroke="none"/> |
60 |
| - <circle cx="15" cy="35" r="2" fill={color} stroke="none"/> |
61 |
| - <circle cx="25" cy="35" r="2" fill={color} stroke="none"/> |
62 |
| - <circle cx="35" cy="35" r="2" fill={color} stroke="none"/> |
63 |
| - <circle cx="45" cy="35" r="2" fill={color} stroke="none"/> |
| 59 | + <circle cx="05" cy="35" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 60 | + <circle cx="15" cy="35" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 61 | + <circle cx="25" cy="35" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 62 | + <circle cx="35" cy="35" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 63 | + <circle cx="45" cy="35" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
64 | 64 |
|
65 |
| - <circle cx="05" cy="45" r="2" fill={color} stroke="none"/> |
66 |
| - <circle cx="15" cy="45" r="2" fill={color} stroke="none"/> |
67 |
| - <circle cx="25" cy="45" r="2" fill={color} stroke="none"/> |
68 |
| - <circle cx="35" cy="45" r="2" fill={color} stroke="none"/> |
69 |
| - <circle cx="45" cy="45" r="2" fill={color} stroke="none"/> |
| 65 | + <circle cx="05" cy="45" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 66 | + <circle cx="15" cy="45" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 67 | + <circle cx="25" cy="45" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 68 | + <circle cx="35" cy="45" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
| 69 | + <circle cx="45" cy="45" r={strokeWidthMul * 2} fill={color} stroke="none"/> |
70 | 70 | </React.Fragment>, 50, 50 * sizeMul]
|
71 | 71 | }
|
0 commit comments