mirror of
https://github.com/avinal/avinal.github.io.git
synced 2026-07-04 07:40:09 +05:30
b14eadbd6e
Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
56 lines
1.4 KiB
JavaScript
56 lines
1.4 KiB
JavaScript
customElements.define(
|
|
"cal-com",
|
|
class extends HTMLElement {
|
|
constructor() {
|
|
super();
|
|
}
|
|
|
|
connectedCallback() {
|
|
(function (C, A, L) {
|
|
let p = function (a, ar) {
|
|
a.q.push(ar);
|
|
};
|
|
let d = C.document;
|
|
C.Cal =
|
|
C.Cal ||
|
|
function () {
|
|
let cal = C.Cal;
|
|
let ar = arguments;
|
|
if (!cal.loaded) {
|
|
cal.ns = {};
|
|
cal.q = cal.q || [];
|
|
d.head.appendChild(d.createElement("script")).src = A;
|
|
cal.loaded = true;
|
|
}
|
|
if (ar[0] === L) {
|
|
const api = function () {
|
|
p(api, arguments);
|
|
};
|
|
const namespace = ar[1];
|
|
api.q = api.q || [];
|
|
typeof namespace === "string"
|
|
? (cal.ns[namespace] = api) && p(api, ar)
|
|
: p(cal, ar);
|
|
return;
|
|
}
|
|
p(cal, ar);
|
|
};
|
|
})(window, "https://app.cal.com/embed/embed.js", "init");
|
|
Cal("init", { origin: "https://app.cal.com" });
|
|
|
|
Cal("inline", {
|
|
elementOrSelector: "#calcom-widget",
|
|
calLink: "avinal",
|
|
});
|
|
Cal("ui", {
|
|
theme: "dark",
|
|
styles: {
|
|
branding: { brandColor: "#009fb1" },
|
|
},
|
|
hideEventTypeDetails: false,
|
|
});
|
|
console.log("These errors are not produced by the Elm app :)");
|
|
}
|
|
}
|
|
);
|