Elffuss BraidHub

kikocis/lancedb public

main · 2.6 KiBRawPermalink
1// Creates an SVG robot icon (from Lucide)
2function robotSVG() {
3 var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4 svg.setAttribute("width", "24");
5 svg.setAttribute("height", "24");
6 svg.setAttribute("viewBox", "0 0 24 24");
7 svg.setAttribute("fill", "none");
8 svg.setAttribute("stroke", "currentColor");
9 svg.setAttribute("stroke-width", "2");
10 svg.setAttribute("stroke-linecap", "round");
11 svg.setAttribute("stroke-linejoin", "round");
12 svg.setAttribute("class", "lucide lucide-bot-message-square");
13
14 var path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
15 path1.setAttribute("d", "M12 6V2H8");
16 svg.appendChild(path1);
17
18 var path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
19 path2.setAttribute("d", "m8 18-4 4V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2Z");
20 svg.appendChild(path2);
21
22 var path3 = document.createElementNS("http://www.w3.org/2000/svg", "path");
23 path3.setAttribute("d", "M2 12h2");
24 svg.appendChild(path3);
25
26 var path4 = document.createElementNS("http://www.w3.org/2000/svg", "path");
27 path4.setAttribute("d", "M9 11v2");
28 svg.appendChild(path4);
29
30 var path5 = document.createElementNS("http://www.w3.org/2000/svg", "path");
31 path5.setAttribute("d", "M15 11v2");
32 svg.appendChild(path5);
33
34 var path6 = document.createElementNS("http://www.w3.org/2000/svg", "path");
35 path6.setAttribute("d", "M20 12h2");
36 svg.appendChild(path6);
37
38 return svg
39}
40
41// Creates the Fluidic Chatbot buttom
42function fluidicButton() {
43 var btn = document.createElement("a");
44 btn.href = "https://asklancedb.com";
45 btn.target = "_blank";
46 btn.style.position = "fixed";
47 btn.style.fontWeight = "bold";
48 btn.style.fontSize = ".8rem";
49 btn.style.right = "10px";
50 btn.style.bottom = "10px";
51 btn.style.width = "80px";
52 btn.style.height = "80px";
53 btn.style.background = "linear-gradient(135deg, #7C5EFF 0%, #625eff 100%)";
54 btn.style.color = "white";
55 btn.style.borderRadius = "5px";
56 btn.style.display = "flex";
57 btn.style.flexDirection = "column";
58 btn.style.justifyContent = "center";
59 btn.style.alignItems = "center";
60 btn.style.zIndex = "1000";
61 btn.style.opacity = "0";
62 btn.style.boxShadow = "0 0 0 rgba(0, 0, 0, 0)";
63 btn.style.transition = "opacity 0.2s ease-in, box-shadow 0.2s ease-in";
64
65 setTimeout(function() {
66 btn.style.opacity = "1";
67 btn.style.boxShadow = "0 0 .2rem #0000001a,0 .2rem .4rem #0003"
68 }, 0);
69
70 return btn
71}
72
73document.addEventListener("DOMContentLoaded", function() {
74 var btn = fluidicButton()
75 btn.appendChild(robotSVG());
76 var text = document.createTextNode("Ask AI");
77 btn.appendChild(text);
78 document.body.appendChild(btn);
79});