mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-16 02:10:38 +08:00
Links implementation WIP
This commit is contained in:
@@ -26,6 +26,7 @@ export default class LinkTemplate extends Template {
|
||||
*/
|
||||
apply(link) {
|
||||
super.apply(link)
|
||||
link.classList.add("ueb-positioned")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,5 +47,8 @@ export default class LinkTemplate extends Template {
|
||||
applyDestinationLocation(link, finalPosition) {
|
||||
link.style.setProperty("--ueb-to-x", sanitizeText(finalPosition[0]))
|
||||
link.style.setProperty("--ueb-to-y", sanitizeText(finalPosition[1]))
|
||||
const height = Math.abs(link.style.getPropertyValue("--ueb-from-y") - finalPosition[1])
|
||||
let skew = Math.atan(height / (finalPosition[0] - link.style.getPropertyValue("--ueb-from-x"))) - Math.PI / 2
|
||||
link.style.setProperty("--ueb-link-skew", skew)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ export default class SelectorTemplate extends Template {
|
||||
*/
|
||||
apply(selector) {
|
||||
super.apply(selector)
|
||||
selector.classList.add("ueb-positioned")
|
||||
this.applyFinishSelecting(selector)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user