0.4.172 • Published 3 years ago
@plaidev/karte-action-utils v0.4.172
KARTE Action Utilities
KARTE の Action で使えるユーティリを提供するライブラリです。
ユーティリティは以下の構成となっています。
- Modal Utilities
Modal Utilities
KARTE の Action でモーダルを出すために使えるユーティリティ群です。
ensureModalRoot
KARTE の接客のモーダルのルート要素を生成します。
const root = ensureModalRoot(false) as HTMLElement;
createModalWindow
KARTE の接客のモーダルウィンドウを生成します。
const win = createModalWindow({
w: "320px",
minw: "90vw",
h: "auto",
maxh: "500px",
position: "center",
zIndex: 1200,
});
getPositionStyle
KARTE の接客の要素の画面内での表示位置の css style を生成します。
const el = document.createElement("div");
const s = el.style;
const pos = getPositionStyle(position);
Object.assign(s, pos);
h
JSX element を生成します。
const e = <a style="text-decoration: none" href="https://karte.io/">
<img src="https://plaid.co.jp/v2/img/logo_karte.svg" />
<p>テストです</p>
</a>
detectElementOnViewport
HTML の特定の要素が画面上に表示されたかを判定します。
const el = document.querySelector(".endcontent");
const d = detectElementOnViewport(el, {
onAppear: () => {
send("read-done", {});
},
intersection: {
root: null,
threshold: 1,
rootMargin: "0px",
}
});
0.4.172
3 years ago
0.4.171
3 years ago
0.4.169
4 years ago
0.4.170
4 years ago
0.4.164
4 years ago
0.4.163
4 years ago
0.4.168
4 years ago
0.4.167
4 years ago
0.4.166
4 years ago
0.4.165
4 years ago
0.4.160
4 years ago
0.4.162
4 years ago
0.4.161
4 years ago
0.4.159
4 years ago
0.4.158
4 years ago
0.4.157
4 years ago
0.4.156
4 years ago
0.4.153
4 years ago
0.4.155
4 years ago
0.4.154
4 years ago
0.4.152
4 years ago
0.4.146
4 years ago
0.4.121
4 years ago
0.4.117
4 years ago
0.4.112
4 years ago
0.4.83
4 years ago
0.4.76
4 years ago
0.3.87
5 years ago
0.3.57
5 years ago
0.3.27
5 years ago
0.3.4
5 years ago