can we use border and border image at the same time?

can we use border and border image at the same time?
81 Replies
Chooβ™šπ•‚π•šπ•Ÿπ•˜
No, but you can use outline or box shadow as substitutes for the extra border. You could also create a before or after that has its own border.
curator
curatorOPβ€’15mo ago
yeah i am using after, can you share any resource to convert svg path converter
Chooβ™šπ•‚π•šπ•Ÿπ•˜
I don't understand the question. You want to convert an SVG to a path that can be used in something like a clip path? You don't need any converter for that. You can just copy and paste the part of the SVG code that specifies the path.
curator
curatorOPβ€’15mo ago
so basically i am using this svg for clipping my div:
<svg className={styles.svg}>
<clipPath id="my-clip-path" clipPathUnits="objectBoundingBox"><path d="M0.586,0 C0.555,0.001,0.457,0.002,0.368,0.003 L0.207,0.005 L0.151,0.003 C0.091,0.001,0.049,0.001,0.033,0.002 C0.028,0.002,0.019,0.004,0.015,0.005 L0.007,0.008 L0.006,0.203 C0.005,0.311,0.003,0.444,0.002,0.498 C-0.001,0.626,-0.001,0.854,0.002,0.906 C0.006,0.965,0.01,0.987,0.018,0.991 C0.022,0.993,0.042,0.995,0.065,0.997 C0.118,0.999,0.206,0.998,0.408,0.994 C0.47,0.993,0.545,0.992,0.574,0.992 C0.626,0.992,0.631,0.992,0.684,0.994 C0.776,0.999,0.802,1,0.862,1 C0.909,1,0.92,1,0.934,0.999 C0.954,0.997,0.97,0.994,0.976,0.991 C0.986,0.985,0.991,0.955,0.997,0.866 C1,0.8,1,0.114,0.997,0.075 C0.992,0.035,0.987,0.016,0.98,0.009 C0.977,0.005,0.975,0.005,0.966,0.003 C0.944,0.001,0.918,0,0.779,0 C0.704,0,0.617,0,0.586,0"></path></clipPath>
</svg>
<svg className={styles.svg}>
<clipPath id="my-clip-path" clipPathUnits="objectBoundingBox"><path d="M0.586,0 C0.555,0.001,0.457,0.002,0.368,0.003 L0.207,0.005 L0.151,0.003 C0.091,0.001,0.049,0.001,0.033,0.002 C0.028,0.002,0.019,0.004,0.015,0.005 L0.007,0.008 L0.006,0.203 C0.005,0.311,0.003,0.444,0.002,0.498 C-0.001,0.626,-0.001,0.854,0.002,0.906 C0.006,0.965,0.01,0.987,0.018,0.991 C0.022,0.993,0.042,0.995,0.065,0.997 C0.118,0.999,0.206,0.998,0.408,0.994 C0.47,0.993,0.545,0.992,0.574,0.992 C0.626,0.992,0.631,0.992,0.684,0.994 C0.776,0.999,0.802,1,0.862,1 C0.909,1,0.92,1,0.934,0.999 C0.954,0.997,0.97,0.994,0.976,0.991 C0.986,0.985,0.991,0.955,0.997,0.866 C1,0.8,1,0.114,0.997,0.075 C0.992,0.035,0.987,0.016,0.98,0.009 C0.977,0.005,0.975,0.005,0.966,0.003 C0.944,0.001,0.918,0,0.779,0 C0.704,0,0.617,0,0.586,0"></path></clipPath>
</svg>
and for the border image of the ::after i am using the svg i am having:
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="428.000000pt" height="1298.000000pt" viewBox="0 0 428.000000 1298.000000"
preserveAspectRatio="xMidYMid meet">

<g transform="translate(0.000000,1298.000000) scale(0.100000,-0.100000)"
fill="#0149A8" stroke="none">
<path d="M2505 12960 c-132 -5 -549 -21 -927 -36 l-687 -27 -239 27 c-254 29
-432 35 -501 16 -23 -6 -58 -26 -77 -43 l-35 -32 -5 -2530 c-2 -1391 -9 -3113
-14 -3825 -13 -1655 -13 -4601 0 -5275 14 -772 31 -1049 65 -1102 19 -28 103
-59 201 -73 226 -32 599 -24 1459 31 264 17 583 32 710 32 220 2 240 0 465
-35 394 -62 502 -72 760 -73 197 0 247 3 307 19 82 20 150 61 175 103 44 75
65 461 90 1618 19 851 19 9740 0 10235 -19 526 -39 771 -70 865 -15 45 -21 51
-62 66 -94 35 -203 41 -795 44 -319 2 -688 -1 -820 -5z m1197 -20 c226 -10
389 -29 429 -50 24 -14 36 -61 54 -210 20 -176 33 -448 45 -930 15 -632 17
-8689 2 -9585 -22 -1321 -46 -1874 -85 -1993 -16 -49 -74 -87 -172 -113 -68
-19 -108 -22 -270 -22 -209 0 -357 14 -725 69 -129 19 -282 39 -340 43 -126
10 -400 0 -925 -34 -644 -40 -842 -48 -1124 -42 -413 9 -490 31 -504 142 -14
105 -27 388 -39 840 -15 588 -15 4084 1 5890 6 699 11 2312 11 3585 0 2041 2
2318 15 2337 8 12 36 30 62 40 68 26 259 23 483 -7 208 -28 346 -29 870 -6
1171 51 1797 63 2212 46z"/>
</g>
</svg>
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="428.000000pt" height="1298.000000pt" viewBox="0 0 428.000000 1298.000000"
preserveAspectRatio="xMidYMid meet">

<g transform="translate(0.000000,1298.000000) scale(0.100000,-0.100000)"
fill="#0149A8" stroke="none">
<path d="M2505 12960 c-132 -5 -549 -21 -927 -36 l-687 -27 -239 27 c-254 29
-432 35 -501 16 -23 -6 -58 -26 -77 -43 l-35 -32 -5 -2530 c-2 -1391 -9 -3113
-14 -3825 -13 -1655 -13 -4601 0 -5275 14 -772 31 -1049 65 -1102 19 -28 103
-59 201 -73 226 -32 599 -24 1459 31 264 17 583 32 710 32 220 2 240 0 465
-35 394 -62 502 -72 760 -73 197 0 247 3 307 19 82 20 150 61 175 103 44 75
65 461 90 1618 19 851 19 9740 0 10235 -19 526 -39 771 -70 865 -15 45 -21 51
-62 66 -94 35 -203 41 -795 44 -319 2 -688 -1 -820 -5z m1197 -20 c226 -10
389 -29 429 -50 24 -14 36 -61 54 -210 20 -176 33 -448 45 -930 15 -632 17
-8689 2 -9585 -22 -1321 -46 -1874 -85 -1993 -16 -49 -74 -87 -172 -113 -68
-19 -108 -22 -270 -22 -209 0 -357 14 -725 69 -129 19 -282 39 -340 43 -126
10 -400 0 -925 -34 -644 -40 -842 -48 -1124 -42 -413 9 -490 31 -504 142 -14
105 -27 388 -39 840 -15 588 -15 4084 1 5890 6 699 11 2312 11 3585 0 2041 2
2318 15 2337 8 12 36 30 62 40 68 26 259 23 483 -7 208 -28 346 -29 870 -6
1171 51 1797 63 2212 46z"/>
</g>
</svg>
so bascially i want to convert the the clipping svg's path same as the image i am using for the after
Chooβ™šπ•‚π•šπ•Ÿπ•˜
Just use the string value of d in the path element.
curator
curatorOPβ€’15mo ago
No description
curator
curatorOPβ€’15mo ago
this is what i am currently its not working actually
Chooβ™šπ•‚π•šπ•Ÿπ•˜
I think you asked about this several weeks ago and I shared a codepen with proof that it works but you never looked at it.
Chooβ™šπ•‚π•šπ•Ÿπ•˜
I explained before that the only issue was the scale. Your SVG path is much larger than you need and there is no automated way to scale that path wihin CSS, so you had to do the math on it.
curator
curatorOPβ€’15mo ago
yeah i did try this, but the height is giving me the issue
curator
curatorOPβ€’15mo ago
No description
Chooβ™šπ•‚π•šπ•Ÿπ•˜
I know. That's because you have a scale transform in your SVG that makes the path the right size. That can't be done with the CSS.
curator
curatorOPβ€’15mo ago
also i think it is clipping the internal div instead of just the border of the div
Chooβ™šπ•‚π•šπ•Ÿπ•˜
The math is simple. You have a 0.1 scale, so you only need to divide all values by 10.
curator
curatorOPβ€’15mo ago
what can be done?
Chooβ™šπ•‚π•šπ•Ÿπ•˜
Simple math, but tedious. Divide all numbers in the path by 10.
curator
curatorOPβ€’15mo ago
any resource for it? πŸ˜… or shall i just use some js
Chooβ™šπ•‚π•šπ•Ÿπ•˜
I was suggesting to do it by hand, but you could write a program if you want.
curator
curatorOPβ€’15mo ago
by hand is a lot of hassle, will write a function
curator
curatorOPβ€’15mo ago
No description
curator
curatorOPβ€’15mo ago
as i assumed its clipping the internal div too is there any way to check if the clipping is done right?
Chooβ™šπ•‚π•šπ•Ÿπ•˜
Apply it to a div that is filled with a solid color. It is clipping the inside. The codepen that I shared used a div filled with a solid color but the interior is white. The SVG should not have a hole in it. It should fully cover the portion of the area that you want to keep when clipping.
curator
curatorOPβ€’15mo ago
yep it is clipping internally i have child divs inside of it, maybe they are causing the issue?
Chooβ™šπ•‚π•šπ•Ÿπ•˜
You have to fill the shape in the software that you used to create the SVG. No. The problem is your path. The SVG is not a solid shape. It's an outline of a shape.
curator
curatorOPβ€’15mo ago
got it from figma also where would i add the fill? as we r just using the path on the clip-path
Chooβ™šπ•‚π•šπ•Ÿπ•˜
I was referring to filling it in vector graphics software, not in the CSS code.
curator
curatorOPβ€’15mo ago
man this svg thing is a mess
Chooβ™šπ•‚π•šπ•Ÿπ•˜
There is an easier solution that I just realized. In the path code, the letter M appears twice. Delete everything starting with the second M. That part is code that cuts out the inside. Starting with "m1197"
curator
curatorOPβ€’15mo ago
kk i worked
curator
curatorOPβ€’15mo ago
No description
curator
curatorOPβ€’15mo ago
now the thing is the shape is not perfect and after adding the ::after for the border, its the same as it was before:
curator
curatorOPβ€’15mo ago
No description
curator
curatorOPβ€’15mo ago
tried changing the original svg same the clipping svg, and it got me this:
curator
curatorOPβ€’15mo ago
No description
curator
curatorOPβ€’15mo ago
No description
curator
curatorOPβ€’15mo ago
is there any way just to clip these remainig edges? it will work for me
Chooβ™šπ•‚π•šπ•Ÿπ•˜
Are you sure that your math is correct? Maybe there is a rounding problem. If the numbers matched correctly, this shouldn't happen.
curator
curatorOPβ€’15mo ago
yeah it should be right
clip-path: path("M250.5 1296 c-13.2 -0.5 -54.9 -2.1 -92.7 -3.6 l-68.7 -2.7 -23.9 2.7 c-25.4 2.9 -43.2 3.5 -50.1 1.6 -2.3 -0.6 -5.8 -2.6 -7.7 -4.3 l-3.5 -3.2 -0.5 -253 c-0.2 -139.1 -0.9 -311.3 -1.4 -382.5 -1.3 -165.5 -1.3 -460.1 0 -527.5 1.4 -77.2 3.1 -104.9 6.5 -110.2 1.9 -2.8 10.3 -5.9 20.1 -7.3 22.6 -3.2 59.9 -2.4 145.9 3.1 26.4 1.7 58.3 3.2 71 3.2 22 0.2 24 0 46.5 -3.5 39.4 -6.2 50.2 -7.2 76 -7.3 19.7 0 24.7 0.3 30.7 1.9 8.2 2 15 6.1 17.5 10.3 4.4 7.5 6.5 46.1 9 161.8 1.9 85.1 1.9 974 0 1023.5 -1.9 52.6 -3.9 77.1 -7 86.5 -1.5 4.5 -2.1 5.1 -6.2 6.6 -9.4 3.5 -20.3 4.1 -79.5 4.4 -31.9 0.2 -68.8 -0.1 -82 -0.5z 119.7 -2 c22.6 -1 38.9 -2.9 42.9 -5 2.4 -1.4 3.6 -6.1 5.4 -21 -20 -17.6 -33 -44.8 -45 -93 -15 -63.2 -1.7 -868.9 0.2 -958.5 -2.2 -132.1 -4.6 -187.4 -8.5 -199.3 -1.6 -4.9 -7.4 -8.7 -17.2 -11.3 -6.8 -1.9 -10.8 -2.2 -27 -2.2 -20.9 0 -35.7 1.4 -72.5 6.9 -12.9 1.9 -28.2 3.9 -34 -4.3 -12.6 1 -40 0 -92.5 -3.4 -64.4 -4 -84.2 -4.8 -112.4 -4.2 -41.3 0.9 -49 3.1 -50.4 14.2 -1.4 10.5 -2.7 38.8 -3.9 84 -1.5 58.8 -1.5 408.4 0.1 589 0.6 69.9 1.1 231.2 1.1 358.5 0 204.1 0.2 231.8 1.5 233.7 0.8 1.2 3.6 3 6.2 4 6.8 2.6 25.9 2.3 48.3 -0.7 20.8 -2.8 34.6 -2.9 87 -0.6 117.1 5.1 179.7 6.3 221.2 4.6z");
clip-path: path("M250.5 1296 c-13.2 -0.5 -54.9 -2.1 -92.7 -3.6 l-68.7 -2.7 -23.9 2.7 c-25.4 2.9 -43.2 3.5 -50.1 1.6 -2.3 -0.6 -5.8 -2.6 -7.7 -4.3 l-3.5 -3.2 -0.5 -253 c-0.2 -139.1 -0.9 -311.3 -1.4 -382.5 -1.3 -165.5 -1.3 -460.1 0 -527.5 1.4 -77.2 3.1 -104.9 6.5 -110.2 1.9 -2.8 10.3 -5.9 20.1 -7.3 22.6 -3.2 59.9 -2.4 145.9 3.1 26.4 1.7 58.3 3.2 71 3.2 22 0.2 24 0 46.5 -3.5 39.4 -6.2 50.2 -7.2 76 -7.3 19.7 0 24.7 0.3 30.7 1.9 8.2 2 15 6.1 17.5 10.3 4.4 7.5 6.5 46.1 9 161.8 1.9 85.1 1.9 974 0 1023.5 -1.9 52.6 -3.9 77.1 -7 86.5 -1.5 4.5 -2.1 5.1 -6.2 6.6 -9.4 3.5 -20.3 4.1 -79.5 4.4 -31.9 0.2 -68.8 -0.1 -82 -0.5z 119.7 -2 c22.6 -1 38.9 -2.9 42.9 -5 2.4 -1.4 3.6 -6.1 5.4 -21 -20 -17.6 -33 -44.8 -45 -93 -15 -63.2 -1.7 -868.9 0.2 -958.5 -2.2 -132.1 -4.6 -187.4 -8.5 -199.3 -1.6 -4.9 -7.4 -8.7 -17.2 -11.3 -6.8 -1.9 -10.8 -2.2 -27 -2.2 -20.9 0 -35.7 1.4 -72.5 6.9 -12.9 1.9 -28.2 3.9 -34 -4.3 -12.6 1 -40 0 -92.5 -3.4 -64.4 -4 -84.2 -4.8 -112.4 -4.2 -41.3 0.9 -49 3.1 -50.4 14.2 -1.4 10.5 -2.7 38.8 -3.9 84 -1.5 58.8 -1.5 408.4 0.1 589 0.6 69.9 1.1 231.2 1.1 358.5 0 204.1 0.2 231.8 1.5 233.7 0.8 1.2 3.6 3 6.2 4 6.8 2.6 25.9 2.3 48.3 -0.7 20.8 -2.8 34.6 -2.9 87 -0.6 117.1 5.1 179.7 6.3 221.2 4.6z");
yeah tried 2 time, same result
Chooβ™šπ•‚π•šπ•Ÿπ•˜
I went back up and looked at your earlier comment when you presented this code. You have two different paths. One for the clipping and one for the border. You have to use the same path except for the removal of the cutout code in the clip path. Are you sure that your two paths are the same? They actually look totally different. You would scale the border slightly, but that should be done with an SVG scale to guarantee that they match.
curator
curatorOPβ€’15mo ago
okay so this is the clip path:
clip-path: path("M250.5 1296 c-13.2 -0.5 -54.9 -2.1 -92.7 -3.6 l-68.7 -2.7 -23.9 2.7 c-25.4 2.9 -43.2 3.5 -50.1 1.6 -2.3 -0.6 -5.8 -2.6 -7.7 -4.3 l-3.5 -3.2 -0.5 -253 c-0.2 -139.1 -0.9 -311.3 -1.4 -382.5 -1.3 -165.5 -1.3 -460.1 0 -527.5 1.4 -77.2 3.1 -104.9 6.5 -110.2 1.9 -2.8 10.3 -5.9 20.1 -7.3 22.6 -3.2 59.9 -2.4 145.9 3.1 26.4 1.7 58.3 3.2 71 3.2 22 0.2 24 0 46.5 -3.5 39.4 -6.2 50.2 -7.2 76 -7.3 19.7 0 24.7 0.3 30.7 1.9 8.2 2 15 6.1 17.5 10.3 4.4 7.5 6.5 46.1 9 161.8 1.9 85.1 1.9 974 0 1023.5 -1.9 52.6 -3.9 77.1 -7 86.5 -1.5 4.5 -2.1 5.1 -6.2 6.6 -9.4 3.5 -20.3 4.1 -79.5 4.4 -31.9 0.2 -68.8 -0.1 -82 -0.5z 119.7 -2 c22.6 -1 38.9 -2.9 42.9 -5 2.4 -1.4 3.6 -6.1 5.4 -21 -20 -17.6 -33 -44.8 -45 -93 -15 -63.2 -1.7 -868.9 0.2 -958.5 -2.2 -132.1 -4.6 -187.4 -8.5 -199.3 -1.6 -4.9 -7.4 -8.7 -17.2 -11.3 -6.8 -1.9 -10.8 -2.2 -27 -2.2 -20.9 0 -35.7 1.4 -72.5 6.9 -12.9 1.9 -28.2 3.9 -34 -4.3 -12.6 1 -40 0 -92.5 -3.4 -64.4 -4 -84.2 -4.8 -112.4 -4.2 -41.3 0.9 -49 3.1 -50.4 14.2 -1.4 10.5 -2.7 38.8 -3.9 84 -1.5 58.8 -1.5 408.4 0.1 589 0.6 69.9 1.1 231.2 1.1 358.5 0 204.1 0.2 231.8 1.5 233.7 0.8 1.2 3.6 3 6.2 4 6.8 2.6 25.9 2.3 48.3 -0.7 20.8 -2.8 34.6 -2.9 87 -0.6 117.1 5.1 179.7 6.3 221.2 4.6");
clip-path: path("M250.5 1296 c-13.2 -0.5 -54.9 -2.1 -92.7 -3.6 l-68.7 -2.7 -23.9 2.7 c-25.4 2.9 -43.2 3.5 -50.1 1.6 -2.3 -0.6 -5.8 -2.6 -7.7 -4.3 l-3.5 -3.2 -0.5 -253 c-0.2 -139.1 -0.9 -311.3 -1.4 -382.5 -1.3 -165.5 -1.3 -460.1 0 -527.5 1.4 -77.2 3.1 -104.9 6.5 -110.2 1.9 -2.8 10.3 -5.9 20.1 -7.3 22.6 -3.2 59.9 -2.4 145.9 3.1 26.4 1.7 58.3 3.2 71 3.2 22 0.2 24 0 46.5 -3.5 39.4 -6.2 50.2 -7.2 76 -7.3 19.7 0 24.7 0.3 30.7 1.9 8.2 2 15 6.1 17.5 10.3 4.4 7.5 6.5 46.1 9 161.8 1.9 85.1 1.9 974 0 1023.5 -1.9 52.6 -3.9 77.1 -7 86.5 -1.5 4.5 -2.1 5.1 -6.2 6.6 -9.4 3.5 -20.3 4.1 -79.5 4.4 -31.9 0.2 -68.8 -0.1 -82 -0.5z 119.7 -2 c22.6 -1 38.9 -2.9 42.9 -5 2.4 -1.4 3.6 -6.1 5.4 -21 -20 -17.6 -33 -44.8 -45 -93 -15 -63.2 -1.7 -868.9 0.2 -958.5 -2.2 -132.1 -4.6 -187.4 -8.5 -199.3 -1.6 -4.9 -7.4 -8.7 -17.2 -11.3 -6.8 -1.9 -10.8 -2.2 -27 -2.2 -20.9 0 -35.7 1.4 -72.5 6.9 -12.9 1.9 -28.2 3.9 -34 -4.3 -12.6 1 -40 0 -92.5 -3.4 -64.4 -4 -84.2 -4.8 -112.4 -4.2 -41.3 0.9 -49 3.1 -50.4 14.2 -1.4 10.5 -2.7 38.8 -3.9 84 -1.5 58.8 -1.5 408.4 0.1 589 0.6 69.9 1.1 231.2 1.1 358.5 0 204.1 0.2 231.8 1.5 233.7 0.8 1.2 3.6 3 6.2 4 6.8 2.6 25.9 2.3 48.3 -0.7 20.8 -2.8 34.6 -2.9 87 -0.6 117.1 5.1 179.7 6.3 221.2 4.6");
and this is the border image svg:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="428.000000pt" height="1298.000000pt" viewBox="0 0 428.000000 1298.000000"
preserveAspectRatio="xMidYMid meet">

<g transform="translate(0.000000,1298.000000) scale(0.100000,-0.100000)"
fill="#0149A8" stroke="none">
<path d="M2505 12960 c-132 -5 -549 -21 -927 -36 l-687 -27 -239 27 c-254 29
-432 35 -501 16 -23 -6 -58 -26 -77 -43 l-35 -32 -5 -2530 c-2 -1391 -9 -3113
-14 -3825 -13 -1655 -13 -4601 0 -5275 14 -772 31 -1049 65 -1102 19 -28 103
-59 201 -73 226 -32 599 -24 1459 31 264 17 583 32 710 32 220 2 240 0 465
-35 394 -62 502 -72 760 -73 197 0 247 3 307 19 82 20 150 61 175 103 44 75
65 461 90 1618 19 851 19 9740 0 10235 -19 526 -39 771 -70 865 -15 45 -21 51
-62 66 -94 35 -203 41 -795 44 -319 2 -688 -1 -820 -5z m1197 -20 c226 -10
389 -29 429 -50 24 -14 36 -61 54 -210 20 -176 33 -448 45 -930 15 -632 17
-8689 2 -9585 -22 -1321 -46 -1874 -85 -1993 -16 -49 -74 -87 -172 -113 -68
-19 -108 -22 -270 -22 -209 0 -357 14 -725 69 -129 19 -282 39 -340 43 -126
10 -400 0 -925 -34 -644 -40 -842 -48 -1124 -42 -413 9 -490 31 -504 142 -14
105 -27 388 -39 840 -15 588 -15 4084 1 5890 6 699 11 2312 11 3585 0 2041 2
2318 15 2337 8 12 36 30 62 40 68 26 259 23 483 -7 208 -28 346 -29 870 -6
1171 51 1797 63 2212 46z"/>
</g>
</svg>
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="428.000000pt" height="1298.000000pt" viewBox="0 0 428.000000 1298.000000"
preserveAspectRatio="xMidYMid meet">

<g transform="translate(0.000000,1298.000000) scale(0.100000,-0.100000)"
fill="#0149A8" stroke="none">
<path d="M2505 12960 c-132 -5 -549 -21 -927 -36 l-687 -27 -239 27 c-254 29
-432 35 -501 16 -23 -6 -58 -26 -77 -43 l-35 -32 -5 -2530 c-2 -1391 -9 -3113
-14 -3825 -13 -1655 -13 -4601 0 -5275 14 -772 31 -1049 65 -1102 19 -28 103
-59 201 -73 226 -32 599 -24 1459 31 264 17 583 32 710 32 220 2 240 0 465
-35 394 -62 502 -72 760 -73 197 0 247 3 307 19 82 20 150 61 175 103 44 75
65 461 90 1618 19 851 19 9740 0 10235 -19 526 -39 771 -70 865 -15 45 -21 51
-62 66 -94 35 -203 41 -795 44 -319 2 -688 -1 -820 -5z m1197 -20 c226 -10
389 -29 429 -50 24 -14 36 -61 54 -210 20 -176 33 -448 45 -930 15 -632 17
-8689 2 -9585 -22 -1321 -46 -1874 -85 -1993 -16 -49 -74 -87 -172 -113 -68
-19 -108 -22 -270 -22 -209 0 -357 14 -725 69 -129 19 -282 39 -340 43 -126
10 -400 0 -925 -34 -644 -40 -842 -48 -1124 -42 -413 9 -490 31 -504 142 -14
105 -27 388 -39 840 -15 588 -15 4084 1 5890 6 699 11 2312 11 3585 0 2041 2
2318 15 2337 8 12 36 30 62 40 68 26 259 23 483 -7 208 -28 346 -29 870 -6
1171 51 1797 63 2212 46z"/>
</g>
</svg>
yep their paths are different, but when i try to make both's path same the border image disappears
Chooβ™šπ•‚π•šπ•Ÿπ•˜
You have to scale the SVG slightly smaller.
curator
curatorOPβ€’15mo ago
for the clipped one or the image?
Chooβ™šπ•‚π•šπ•Ÿπ•˜
The border has to be scaled slightly smaller to stay within the boundaries of the clipping. But scale it using SVG scale code. You have "scale(0.100000,-0.100000)", so it would be something like "scale(0.096,-0.096)" or some other number like that. I don't know the actual number that would work.
curator
curatorOPβ€’15mo ago
okay let me play with it, this caused chaos btw scale(0.096,-0.096)
Chooβ™šπ•‚π•šπ•Ÿπ•˜
What kind of chaos?
curator
curatorOPβ€’15mo ago
No description
Chooβ™šπ•‚π•šπ•Ÿπ•˜
It looks like you might need to fix some z-indexes.
curator
curatorOPβ€’15mo ago
how can i add the clipped path path to the image path?
Chooβ™šπ•‚π•šπ•Ÿπ•˜
What??? I am not sure what you are asking.
curator
curatorOPβ€’15mo ago
this path add to this svg path
Chooβ™šπ•‚π•šπ•Ÿπ•˜
Add or substitute?
curator
curatorOPβ€’15mo ago
more of replace
Chooβ™šπ•‚π•šπ•Ÿπ•˜
They use the same language. Just replace the d value in the SVG path.
curator
curatorOPβ€’15mo ago
yeah but then the image shrinking like this: like this
Chooβ™šπ•‚π•šπ•Ÿπ•˜
That's because you still have the scale code. It shouldn't be 0.1 anymore or 0.096. That was based on the old coordinates before you divided everything by 10. The new scale factor would be something like 0.96 instead of 0.096.
curator
curatorOPβ€’15mo ago
No description
Chooβ™šπ•‚π•šπ•Ÿπ•˜
I forgot that the code for the hole was removed. The SVG still needs a hole.
curator
curatorOPβ€’15mo ago
what does that mean? oo yeah u said earlier
Chooβ™šπ•‚π•šπ•Ÿπ•˜
The clip-path had a hole that had to be removed. But the border needs a hole.
curator
curatorOPβ€’15mo ago
how to do that?
Chooβ™šπ•‚π•šπ•Ÿπ•˜
You already removed the hole. What you need is to restore it in the SVG. You had an earlier version that had the hole. Before I asked you to remove everything starting with the second M.
curator
curatorOPβ€’15mo ago
u mean add the m back?
Chooβ™šπ•‚π•šπ•Ÿπ•˜
Yes, but only for the border. Do not add it back to the clip path.
curator
curatorOPβ€’15mo ago
No description
Chooβ™šπ•‚π•šπ•Ÿπ•˜
That doesn't look like you restored the hole. If it had the hole, then the bottom right would be much thinner.
curator
curatorOPβ€’15mo ago
this is the update code:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="428.000000pt" height="1298.000000pt" viewBox="0 0 428.000000 1298.000000"
preserveAspectRatio="xMidYMid meet">

<g transform="translate(0.000000,1298.000000) scale(0.96,-0.96)"
fill="#0149A8" stroke="none">
<path d="M250.5 1296 c-13.2 -0.5 -54.9 -2.1 -92.7 -3.6 l-68.7 -2.7 -23.9 2.7 c-25.4 2.9 -43.2 3.5 -50.1 1.6 -2.3 -0.6 -5.8 -2.6 -7.7 -4.3 l-3.5 -3.2 -0.5 -253 c-0.2 -139.1 -0.9 -311.3 -1.4 -382.5 -1.3 -165.5 -1.3 -460.1 0 -527.5 1.4 -77.2 3.1 -104.9 6.5 -110.2 1.9 -2.8 10.3 -5.9 20.1 -7.3 22.6 -3.2 59.9 -2.4 145.9 3.1 26.4 1.7 58.3 3.2 71 3.2 22 0.2 24 0 46.5 -3.5 39.4 -6.2 50.2 -7.2 76 -7.3 19.7 0 24.7 0.3 30.7 1.9 8.2 2 15 6.1 17.5 10.3 4.4 7.5 6.5 46.1 9 161.8 1.9 85.1 1.9 974 0 1023.5 -1.9 52.6 -3.9 77.1 -7 86.5 -1.5 4.5 -2.1 5.1 -6.2 6.6 -9.4 3.5 -20.3 4.1 -79.5 4.4 -31.9 0.2 -68.8 -0.1 -82 -0.5z m119.7 -2 c22.6 -1 38.9 -2.9 42.9 -5 2.4 -1.4 3.6 -6.1 5.4 -21 -20 -17.6 -33 -44.8 -45 -93 -15 -63.2 -1.7 -868.9 0.2 -958.5 -2.2 -132.1 -4.6 -187.4 -8.5 -199.3 -1.6 -4.9 -7.4 -8.7 -17.2 -11.3 -6.8 -1.9 -10.8 -2.2 -27 -2.2 -20.9 0 -35.7 1.4 -72.5 6.9 -12.9 1.9 -28.2 3.9 -34 -4.3 -12.6 1 -40 0 -92.5 -3.4 -64.4 -4 -84.2 -4.8 -112.4 -4.2 -41.3 0.9 -49 3.1 -50.4 14.2 -1.4 10.5 -2.7 38.8 -3.9 84 -1.5 58.8 -1.5 408.4 0.1 589 0.6 69.9 1.1 231.2 1.1 358.5 0 204.1 0.2 231.8 1.5 233.7 0.8 1.2 3.6 3 6.2 4 6.8 2.6 25.9 2.3 48.3 -0.7 20.8 -2.8 34.6 -2.9 87 -0.6 117.1 5.1 179.7 6.3 221.2 4.6z"/>
</g>
</svg>
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="428.000000pt" height="1298.000000pt" viewBox="0 0 428.000000 1298.000000"
preserveAspectRatio="xMidYMid meet">

<g transform="translate(0.000000,1298.000000) scale(0.96,-0.96)"
fill="#0149A8" stroke="none">
<path d="M250.5 1296 c-13.2 -0.5 -54.9 -2.1 -92.7 -3.6 l-68.7 -2.7 -23.9 2.7 c-25.4 2.9 -43.2 3.5 -50.1 1.6 -2.3 -0.6 -5.8 -2.6 -7.7 -4.3 l-3.5 -3.2 -0.5 -253 c-0.2 -139.1 -0.9 -311.3 -1.4 -382.5 -1.3 -165.5 -1.3 -460.1 0 -527.5 1.4 -77.2 3.1 -104.9 6.5 -110.2 1.9 -2.8 10.3 -5.9 20.1 -7.3 22.6 -3.2 59.9 -2.4 145.9 3.1 26.4 1.7 58.3 3.2 71 3.2 22 0.2 24 0 46.5 -3.5 39.4 -6.2 50.2 -7.2 76 -7.3 19.7 0 24.7 0.3 30.7 1.9 8.2 2 15 6.1 17.5 10.3 4.4 7.5 6.5 46.1 9 161.8 1.9 85.1 1.9 974 0 1023.5 -1.9 52.6 -3.9 77.1 -7 86.5 -1.5 4.5 -2.1 5.1 -6.2 6.6 -9.4 3.5 -20.3 4.1 -79.5 4.4 -31.9 0.2 -68.8 -0.1 -82 -0.5z m119.7 -2 c22.6 -1 38.9 -2.9 42.9 -5 2.4 -1.4 3.6 -6.1 5.4 -21 -20 -17.6 -33 -44.8 -45 -93 -15 -63.2 -1.7 -868.9 0.2 -958.5 -2.2 -132.1 -4.6 -187.4 -8.5 -199.3 -1.6 -4.9 -7.4 -8.7 -17.2 -11.3 -6.8 -1.9 -10.8 -2.2 -27 -2.2 -20.9 0 -35.7 1.4 -72.5 6.9 -12.9 1.9 -28.2 3.9 -34 -4.3 -12.6 1 -40 0 -92.5 -3.4 -64.4 -4 -84.2 -4.8 -112.4 -4.2 -41.3 0.9 -49 3.1 -50.4 14.2 -1.4 10.5 -2.7 38.8 -3.9 84 -1.5 58.8 -1.5 408.4 0.1 589 0.6 69.9 1.1 231.2 1.1 358.5 0 204.1 0.2 231.8 1.5 233.7 0.8 1.2 3.6 3 6.2 4 6.8 2.6 25.9 2.3 48.3 -0.7 20.8 -2.8 34.6 -2.9 87 -0.6 117.1 5.1 179.7 6.3 221.2 4.6z"/>
</g>
</svg>
added m here m119.7
Chooβ™šπ•‚π•šπ•Ÿπ•˜
Something is wrong with some of the numbers. I did a copy and paste of this code and the image has a very thick right side.
curator
curatorOPβ€’15mo ago
what can be the solution? any short way to just hide the visible spots in just like it has here?
Chooβ™šπ•‚π•šπ•Ÿπ•˜
Whatever math you did wasn't right. This is the image that your SVG produces.
No description
curator
curatorOPβ€’15mo ago
cause this is quite complex can you help me fix that?
Chooβ™šπ•‚π•šπ•Ÿπ•˜
You said you would write a program to do the math for you. Show me the code for that.
curator
curatorOPβ€’15mo ago
let me check if that window is still open or not nah, closed that chrome window wait let me write it again const somefn = () => { const originalPath = "M2505 12960 c-132 -5 -549 -21 -927 -36 l-687 -27 -239 27 c-254 29 -432 35 -501 16 -23 -6 -58 -26 -77 -43 l-35 -32 -5 -2530 c-2 -1391 -9 -3113 -14 -3825 -13 -1655 -13 -4601 0 -5275 14 -772 31 -1049 65 -1102 19 -28 103 -59 201 -73 226 -32 599 -24 1459 31 264 17 583 32 710 32 220 2 240 0 465 -35 394 -62 502 -72 760 -73 197 0 247 3 307 19 82 20 150 61 175 103 44 75 65 461 90 1618 19 851 19 9740 0 10235 -19 526 -39 771 -70 865 -15 45 -21 51 -62 66 -94 35 -203 41 -795 44 -319 2 -688 -1 -820 -5z m1197 -20 c226 -10 389 -29 429 -50 24 -14 36 -61 54 -210 20 -176 33 -448 45 -930 15 -632 17 -8689 2 -9585 -22 -1321 -46 -1874 -85 -1993 -16 -49 -74 -87 -172 -113 -68 -19 -108 -22 -270 -22 -209 0 -357 14 -725 69 -129 19 -282 39 -340 43 -126 10 -400 0 -925 -34 -644 -40 -842 -48 -1124 -42 -413 9 -490 31 -504 142 -14 105 -27 388 -39 840 -15 588 -15 4084 1 5890 6 699 11 2312 11 3585 0 2041 2 2318 15 2337 8 12 36 30 62 40 68 26 259 23 483 -7 208 -28 346 -29 870 -6 1171 51 1797 63 2212 46z"; const pathCommands = originalPath.split(/[A-Za-z]/).filter(Boolean); const dividedPathCommands = pathCommands.map(command => { const values = command.split(/\s+/).filter(Boolean); return values.map(value => parseFloat(value) / 10).join(' '); }); const updatedPath = M${dividedPathCommands.join(' ')}; console.log(updatedPath); }
Chooβ™šπ•‚π•šπ•Ÿπ•˜
An SVG path doesn't only have numbers. There are some important letters like "l","c",and"z", which are lost in your conversion. The initial string split is causing them to be lost.
curator
curatorOPβ€’15mo ago
man this is taking a lot of time, also not sure if it will work or not, its already 3 30 am here, but really apprentice your help, really thank, will try tomorrow to just hide the visible portions if there any way to do that please do let me know bye gn
Chooβ™šπ•‚π•šπ•Ÿπ•˜
I noticed that the SVG has a negative scale on the y axis. This makes it upside down, so you will need to fix that via a CSS rotation on the X axis. The clip path doesn't include the SVG scaling code, so it isn't upside down. This is a major source of the mismatch between the shapes.
curator
curatorOPβ€’15mo ago
how can i do that? also gm
Chooβ™šπ•‚π•šπ•Ÿπ•˜
Apply this to the CSS of the border image.
transform: rotateX(180deg);
transform: rotateX(180deg);
But you will also need to translate on the Y axis. There are some complications with the SVG file that won't flip neatly on its center. It will end up in a lower position than before the flip. I just realized an easier way. Change the scale to both positive numbers and remove the translate in the SVG code. No CSS rotation or translation needed if you do this.
Chooβ™šπ•‚π•šπ•Ÿπ•˜
I got it working with the following transform in the SVG:
transform="scale(0.745,0.745)"
transform="scale(0.745,0.745)"
No flipping in the CSS required and I deleted the translate from the SVG code.
No description
Chooβ™šπ•‚π•šπ•Ÿπ•˜
Note that the scale is substantially less than my initial estimate of 0.96, because the viewbox of the SVG is smaller than the actual image coordinates. The real dimensions of the SVG are 571x1731, but the viewbox is set to 428x1298, and I had set the dimensions of the div to match the viewbox.
curator
curatorOPβ€’15mo ago
wait ill try it sometime and will let u know
Want results from more Discord servers?
Add your server