mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-17 05:47:34 +08:00
Svg links implementation WIP
This commit is contained in:
@@ -432,4 +432,27 @@ ueb-link {
|
||||
display : block;
|
||||
position : absolute;
|
||||
border : 2px solid red;
|
||||
}
|
||||
|
||||
ueb-link svg {
|
||||
width : 100%;
|
||||
height : 100%;
|
||||
transform : scale(
|
||||
/* x */
|
||||
clamp(-1, calc(var(--ueb-to-x) - var(--ueb-from-x)), 1),
|
||||
/* y */
|
||||
clamp(-1, calc(var(--ueb-to-y) - var(--ueb-from-y)), 1));
|
||||
overflow : visible;
|
||||
}
|
||||
|
||||
ueb-link svg path {
|
||||
--value : clamp(0, calc(), 1);
|
||||
/* Taylor expansion of arcsin around 0 */
|
||||
--asin-term1 : var(--value);
|
||||
--asin-term2 : calc(1 / 6 * var(--value) * var(--value) * var(--value));
|
||||
--asin-term3 : calc(3 / 40 * var(--value) * var(--value) * var(--value) * var(--value) * var(--value));
|
||||
--asin-term4 : calc(5 / 112 * var(--value) * var(--value) * var(--value) * var(--value) * var(--value) * var(--value) * var(--value));
|
||||
--asin : calc(var(--asin-term1) + var(--asin-term2) + var(--asin-term3) + var(--asin-term4));
|
||||
transform : skewX(calc(1rad * var(--asin)));
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user