Skip to content

Commit

Permalink
deploy: cf5eab8
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchappell committed Nov 13, 2024
1 parent 1981e3f commit 676a14d
Show file tree
Hide file tree
Showing 14 changed files with 95 additions and 68 deletions.
1 change: 1 addition & 0 deletions assets/style-B5PVp83N.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion assets/style-Db7VC2rs.css

This file was deleted.

2 changes: 1 addition & 1 deletion demo.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 15 additions & 7 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,27 @@ interface SmartTooltipOptions {
triggerName: string;
}
export declare class SmartTooltip {
private readonly options;
readonly triggerName: string;
private readonly tooltip;
private activeTriggerType;
private readonly spacing;
constructor(options?: SmartTooltipOptions);
private setupEventListeners;
private readonly handleClick;
private readonly handleMouseOver;
private readonly handleMouseOut;
private readonly handleResize;
private readonly handleScroll;
private isVisible;
calculatePosition(trigger: Element): {
name: string;
x: number;
y: number;
};
fitsInViewport(x: number, y: number, width: number, height: number): boolean;
private calculatePosition;
private fitsInViewport;
private show;
private hide;
destroy(): void;
}
declare global {
interface Window {
SmartTooltip: typeof SmartTooltip;
}
}
export default SmartTooltip;
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en" xml:lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="chrome=1"><meta name="viewport" content="user-scalable=no,width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"><meta name="description" content="Language files for formeo drag and drop form editor"><meta name="theme-color" content="#232323"><title></title><script type="module" crossorigin src="/tooltip/demo.min.js"></script><link rel="stylesheet" crossorigin href="/tooltip/assets/style-Db7VC2rs.css"></head><body><div class="container"><button class="tooltip-trigger" data-tooltip="<strong>Hello!</strong><br>This is a tooltip with <em>HTML</em> content.">Hover me (center)</button> <button class="tooltip-trigger" style="align-self:flex-start" data-tooltip="This tooltip will adjust its position when near the top">Hover me (top)</button> <button class="tooltip-trigger" style="align-self:flex-end" data-tooltip="This tooltip will only show on click" data-tooltip-type="click">Click Me</button> <button class="tooltip-trigger" style="align-self:flex-end" data-tooltip="This tooltip will adjust when near the bottom">Hover me (bottom)</button></div></body></html>
<!doctype html><html lang="en" xml:lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="chrome=1"><meta name="viewport" content="user-scalable=no,width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"><meta name="description" content="Pure JS, zero dependency tooltip"><meta name="theme-color" content="#232323"><title>Tooltip</title><script type="module" crossorigin src="/tooltip/demo.min.js"></script><link rel="stylesheet" crossorigin href="/tooltip/assets/style-B5PVp83N.css"></head><body><div class="container"><button data-tooltip="<strong>Hello!</strong><br>This is a tooltip with <em>HTML</em> content.">Hover me (center)</button> <button style="align-self:flex-start" data-tooltip="This tooltip will adjust its position when near the top">Hover me (top)</button> <button style="align-self:flex-end" data-tooltip="This tooltip will only show on click" data-tooltip-type="click">Click Me</button> <button style="align-self:flex-end" data-tooltip="This tooltip will adjust when near the bottom">Hover me (bottom)</button></div></body></html>
5 changes: 3 additions & 2 deletions tooltip.cjs.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified tooltip.cjs.min.js.gz
Binary file not shown.
9 changes: 0 additions & 9 deletions tooltip.css

This file was deleted.

Loading

0 comments on commit 676a14d

Please sign in to comment.