Libraryless. Click here for Pure Java version (2983L/20K).
1 | // Hussain Mill's design |
2 | sclass NewChatBotDesign { |
3 | bool loadJQuery = true; |
4 | |
5 | S headStuff() { |
6 | ret hStylesheetSnippet(#1028274) + mls_unindent([[ |
7 | <!-- Fonts --> |
8 | <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css"> |
9 | <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap" rel="stylesheet"> |
10 | ]]); |
11 | } |
12 | |
13 | S demoBodyStuff() { |
14 | ret mls_unindent([[ |
15 | <div class="chatbot"> |
16 | <div class="chat-box"> |
17 | <div class="chat"> |
18 | <div class="chat_header"> |
19 | <h2>Chatbot</h2> |
20 | </div> |
21 | <div id="chat_converse" class="chat_conversion chat_converse"> |
22 | <span class="chat_msg_item chat_msg_item_admin"> |
23 | <div class="chat_avatar"> |
24 | <img src="http://res.cloudinary.com/dqvwa7vpe/image/upload/v1496415051/avatar_ma6vug.jpg"/> |
25 | </div> |
26 | Hey there! Any question? |
27 | </span> |
28 | <span class="chat_msg_item chat_msg_item_user">Hello!</span> |
29 | <span class="status">20m ago</span> |
30 | <span class="chat_msg_item chat_msg_item_admin"> |
31 | <div class="chat_avatar"> |
32 | <img src="http://res.cloudinary.com/dqvwa7vpe/image/upload/v1496415051/avatar_ma6vug.jpg"/> |
33 | </div>Hey! Would you like to talk sales, support, or anyone? |
34 | </span> |
35 | <span class="chat_msg_item chat_msg_item_user"> |
36 | Lorem Ipsum is simply dummy text of the printing and typesetting industry. |
37 | </span> |
38 | <span class="status2">Just now.</span> |
39 | </div> |
40 | <div id="wave"> |
41 | <h4>User is typing</h4> |
42 | <span class="dot"></span> |
43 | <span class="dot"></span> |
44 | <span class="dot"></span> |
45 | </div> |
46 | <div class="chat-bottom"> |
47 | <a class="camera-icon"><i class="fas fa-camera"></i></a> |
48 | <a class="send-icon"><i class="fas fa-paper-plane"></i></a> |
49 | <input type="text" name="chat_message" placeholder="Send a message" class="chat_field chat_message" /> |
50 | </div> |
51 | </div> |
52 | <a class="chat-icon"><i class="fas fa-comment-dots"></i></a> |
53 | </div> |
54 | </div> |
55 | <!-- Chatbot Ends --> |
56 | |
57 | ]]) + stringIf(loadJQuery, [[ |
58 | <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>]]) + mls_unindent([[ |
59 | |
60 | <script type="text/javascript"> |
61 | hideChat(0); |
62 | |
63 | $('.chat-icon').click(function() { |
64 | toggleFab(); |
65 | }); |
66 | |
67 | //Toggle chat and links |
68 | function toggleFab() { |
69 | $('.chat-icon i').toggleClass('fa-comment-dots'); |
70 | $('.chat-icon i').toggleClass('fa-times'); |
71 | $('.chat-icon i').toggleClass('is-active'); |
72 | $('.chat-icon i').toggleClass('is-visible'); |
73 | $('.chat-icon').toggleClass('is-float'); |
74 | $('.chat').toggleClass('is-visible'); |
75 | $('.fab').toggleClass('is-visible'); |
76 | |
77 | } |
78 | |
79 | function hideChat(hide) { |
80 | switch (hide) { |
81 | case 1: |
82 | $('#chat_converse').css('display', 'block'); |
83 | break; |
84 | } |
85 | } |
86 | |
87 | // Text Animation |
88 | $("#wave").hide(); |
89 | $(".chat_field.chat_message").focus(function() { |
90 | $('#wave').show('slow'); |
91 | //return false; |
92 | }); |
93 | |
94 | $('.chat_field.chat_message').blur(function() { |
95 | if( !$(this).val() ) { |
96 | $('#wave').hide('slow'); |
97 | } |
98 | }); |
99 | </script> |
100 | ]]); |
101 | } |
102 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1028275 |
Snippet name: | NewChatBotDesign |
Eternal ID of this version: | #1028275/4 |
Text MD5: | 68c8105660f1173dbb36ca03e6722213 |
Transpilation MD5: | d8ed73fdbc24f9764776af4c8efffd81 |
Author: | stefan |
Category: | javax / html |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-06-05 18:37:46 |
Source code size: | 4283 bytes / 102 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 263 / 563 |
Version history: | 3 change(s) |
Referenced in: | [show references] |