Kdkdhdhfdk's picture
Fait le de manière à se que je puisse modélisé moi même avec des fonctionnalités comme dans le vrai solidwork comme le brossage,les cotations ect.....
76a620b verified
Raw History Blame Contribute Delete
785 Bytes
class TooltipElement extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
position: absolute;
background: rgba(0,0,0,0.7);
color: white;
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
pointer-events: none;
z-index: 100;
transform: translate(10px, 10px);
display: none;
}
</style>
<slot></slot>
`;
}
show(x, y, text) {
this.style.display = 'block';
this.style.left = `${x}px`;
this.style.top = `${y}px`;
this.textContent = text;
}
hide() {
this.style.display = 'none';
}
}
customElements.define('tool-tip', TooltipElement);