Yqnn / svg-path-editor

Online editor to create and manipulate SVG paths
https://yqnn.github.io/svg-path-editor/
Apache License 2.0
4.04k stars 326 forks source link

Shareable Path Urls #86

Closed pedropsi closed 1 year ago

pedropsi commented 1 year ago

Hi Yann, a suggestion - it would be nice to have shareable urls. While this could of course be extended to all parameters, having just the path would already be extremely useful for collaborating more easily.

So opening an url like this: https://yqnn.github.io/svg-path-editor?path=M 13 0 L 13 1 L 13 2 C 14 5 12 12 8 14 C 6 12 2 12 0 16 C -3 22 5 28 10 23 C 12 21 12 16 9 15 C 12 13 15 8 15 3 C 16 4 20 9 19 14 C 16 13 13 15 13 18 C 13 27 25 27 25 18 C 25 15 22 13 20 14 C 21 9 18 3 15 1 C 15 1 15 0 15 0 C 15 0 14 0 13 0 Z

... would automatically load the path (in this case, it's a cherry).

At the same time, editing the path would automatically update the url (always kept in sync).

If you feel this feature aligns with your goals for the SVG Path Editor, I wouldn't mind trying to make a pull request at some point or simply provide some tips for your own implementation

Yqnn commented 1 year ago

That's already supported: use the 'share' button on top right.

With your example: https://yqnn.github.io/svg-path-editor/#P=M_13_0_L_13_1_L_13_2_C_14_5_12_12_8_14_C_6_12_2_12_0_16_C_-3_22_5_28_10_23_C_12_21_12_16_9_15_C_12_13_15_8_15_3_C_16_4_20_9_19_14_C_16_13_13_15_13_18_C_13_27_25_27_25_18_C_25_15_22_13_20_14_C_21_9_18_3_15_1_C_15_1_15_0_15_0_C_15_0_14_0_13_0_Z