├── README.md ├── firebase.js ├── index.html ├── script.js └── styles.css /README.md: -------------------------------------------------------------------------------- 1 | 7 | 13 | 14 | 15 | 16 | # 💬 Messaging App 17 | ### A simple messaging app using Firebase Authentication and Cloud Firestore. 18 | 19 | ▶️ Live Preview 20 | 21 | You can create your personal account using a username and a password, chat in various groups through text and gifs, supports pre-programmed bots and many more fun stuff! 22 | 23 | Technologies used in this web app are Firebase Firestore for database to store users messages and information, jQuery and other basic web technologies - HTML, CSS and JavaScript. 24 | 25 | ![Messaging App Preview](https://res.cloudinary.com/dpj9ddsjf/image/upload/v1617839394/scr2_qqhgsg.png) 26 | ![Messaging App Preview](https://res.cloudinary.com/dpj9ddsjf/image/upload/v1617839394/scr3_z8hzdt.png) 27 | 28 | ## ⚙️ Setup 29 | 30 | Set up your firebase configurations in the `firebase.js` file. 31 | 32 | ```javascript 33 | var config = { 34 | apiKey: "", 35 | authDomain: '', 36 | databaseURL: '', 37 | storageBucket: '', 38 | messagingSenderId: '' 39 | } 40 | ``` 41 | 42 | Next step is to just create groups in the database. 43 | 44 | ## 💻 Author 45 | 46 | - [Utsav Prasad](https://codeninja02.netlify.app/) 47 | 48 | ## 🔗 Social Links 49 | 50 | - [Instagram](https://www.instagram.com/codeninja02/) 51 | - [Twitter](https://twitter.com/codeninja02/) 52 | - [Website](https://codeninja02.netlify.app/) 53 | 54 | 55 | -------------------------------------------------------------------------------- /firebase.js: -------------------------------------------------------------------------------- 1 | firebase.initializeApp({ 2 | apiKey: "<>", 3 | authDomain: "<>", 4 | projectId: "<>", 5 | storageBucket: "<>", 6 | messagingSenderId: "<>", 7 | appId: "<>", 8 | measurementId: "<>" 9 | }); 10 | const db = firebase.firestore(); 11 | 12 | db.settings({ timestampsInSnapshots: true }); 13 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Messaging App 7 | 8 | 9 | 10 | 11 | 15 | 16 | 17 | 18 |
19 | 20 |
21 | 22 | 105 | 106 | 168 | 169 |
170 | 171 |
172 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Temporibus, nulla. 173 |
174 | 175 |
176 | 177 |
178 |
179 | Messages 180 |
181 |
182 | 183 |
184 |
185 | 186 |
187 | 188 | 196 | 197 |
198 | 199 | 207 | 208 |
209 |
210 | 211 |
212 |
213 | 214 |
215 |
216 | 217 |
218 | 219 | 220 | 222 | 223 | 224 | 225 | 226 | 227 |
228 | 229 | 249 | 250 |
251 | 252 |
253 | 254 |
255 | 256 |
257 | 258 |
259 | 260 |
261 | 262 |
263 | 264 |
265 | 266 |
267 |
268 | 269 |
270 |
271 | Messages 272 |
273 |
274 | 275 |
276 |
277 | 279 | 280 | 281 | 282 |
283 |
284 | No messages found 285 |
286 |
287 | 288 |
289 | 290 | 306 | 307 | 319 | 320 | 348 | 349 |
350 | 351 |
352 |
353 |
354 | 355 |
356 |
357 | 358 |
359 |
360 | 361 |
362 |
363 | 364 |
365 |
366 | 367 |
368 |
369 | 370 |
371 |
372 | 373 |
374 |
375 | 376 |
377 |
378 | 379 |
380 |
381 | 382 |
383 |
384 | 385 |
386 |
387 | 388 |
389 |
6px
390 |
391 |
392 | 393 |
394 |
395 | 396 |
397 | 398 |
399 | 400 |
401 | 402 |
403 |
404 | 405 |
406 |
407 | 409 | 410 | 411 | 412 |
413 |
414 |
415 | 416 |
417 | 418 |
419 | 420 | 421 |
422 |
423 |
424 |
425 | 426 |
427 |
428 | Heading 429 |
430 |
431 |
432 | Description 433 |
434 |
435 | Close 436 |
437 |
438 |
439 | 440 | 441 |
442 |
443 |
444 | Hello World 445 |
446 |
447 | 448 |
449 |
450 |
451 | 452 |
453 |
454 |
455 | Hello World 456 |
457 |
458 | 459 |
460 |
461 |
462 | 463 | 464 |
465 | 466 |
467 | 469 | 470 | 471 | 472 |
473 | 474 |
475 | 476 | 544 | 545 | 546 | 547 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | -------------------------------------------------------------------------------- /script.js: -------------------------------------------------------------------------------- 1 | // checkboxes' status 2 | 3 | var ch1 = false; 4 | var ch2 = false; 5 | var ch3 = false; 6 | var ch4 = false; 7 | 8 | var unsubscribe; 9 | 10 | // Input Management 11 | 12 | var max_chars = 20; 13 | 14 | var groups_array_name = [ 15 | "General Discussion", 16 | "Web Development", 17 | "Code & Ask", 18 | "Challenges", 19 | "Off Topic General", 20 | "Anime", 21 | "Music", 22 | "Maths & Science", 23 | "Javascript", 24 | "Python" 25 | ]; 26 | 27 | var stickers_array = [ 28 | "https://steamuserimages-a.akamaihd.net/ugc/948455238665292615/A916B1B7B504F4745BC230BE36AA5C19164998FA/", 29 | "https://i.pinimg.com/originals/0b/9d/b5/0b9db507469a0a92401c742a216a5fc8.gif", 30 | "https://i.gifer.com/4eXL.gif", 31 | "https://media.discordapp.net/attachments/785173137854955521/797442888078196746/caa2.gif", 32 | "https://media.tenor.com/images/760ee8f212d72613a2e23ab2954893bd/tenor.gif", 33 | "https://images-ext-1.discordapp.net/external/8AV1OzrAVOgGCNf-7D-Vvs1TrVEPOcKzmj3RPcVx-B8/https/media.discordapp.net/attachments/361066413923893249/792508564232732722/aqua.gif", 34 | "https://media.tenor.com/images/bf139869d81cd9b73144d6b941ebb733/tenor.gif", 35 | "https://64.media.tumblr.com/8ec8fc212104efc693b15c915d78da17/3e951e5af26c5a39-35/s540x810/f71eb68df86ce794dbb4de93a7d4593d86ce44d6.gifv", 36 | "https://i.pinimg.com/originals/25/e0/45/25e0450a39f1c01fef9cac41a2da14bb.gif", 37 | "https://media.tenor.com/images/acc4116372dcc4b342cb1a00ae657151/tenor.gif", 38 | "https://media.tenor.com/images/00a6ecf0b9c158c3ed27425cc94a2392/tenor.gif", 39 | "https://media3.giphy.com/media/fxe8v45NNXFd4jdaNI/giphy.gif", 40 | ]; 41 | var color_array = ["#8B80F9", "#C19875", "#294C60", "#ffa363", "#f24856", "#ffa046", "#02948d", "#6290C8", "#7f39c9", "#00d6a1", "#7B8CDE", "#cd7cc9", "#3E92CC", "#0fbd76"]; 42 | 43 | $('#emailSignUp1').on('keydown', function (event) { 44 | // var regex = new RegExp("^[a-zA-Z0-9]+$"); 45 | // var key = String.fromCharCode(!event.charCode ? event.which : event.charCode); 46 | // if (!regex.test(key)) { 47 | // event.preventDefault(); 48 | // return false; 49 | // } 50 | }); 51 | 52 | $('#emailSignUp1').on('focusout', function () { 53 | 54 | if($("#emailSignUp1").val().trim().toLowerCase().length !== 0){ 55 | $(".username__s_1_L").css({display: "block", filter: "opacity(1)"}); 56 | $(".username__tick_1").css({display: "none", filter: "opacity(0)"}); 57 | $(".username__s_1").css({display: "none", filter: "opacity(0)"}); 58 | $(".username__s_2").css({display: "none", filter: "opacity(0)"}); 59 | 60 | let docRef = db.collection("users624024").doc( $('#emailSignUp1').val().trim().toLowerCase() ); 61 | docRef.get().then(function(doc) { 62 | $(".username__s_1_L").css({display: "none", filter: "opacity(0)"}); 63 | if (doc.exists) { 64 | $(".username__s_1").css({display: "block", filter: "opacity(1)"}); 65 | $(".username__s_2").css({display: "block", filter: "opacity(1)"}); 66 | } else { 67 | $(".username__tick_1").css({display: "block", filter: "opacity(1)"}); 68 | } 69 | }).catch(function(error) { 70 | // console.log("Error getting document:", error); 71 | }); 72 | 73 | } 74 | 75 | }); 76 | 77 | $('#passwordSignUp1').on('keydown', function (event) { 78 | // var regex = new RegExp("^[a-zA-Z0-9]+$"); 79 | // var key = String.fromCharCode(!event.charCode ? event.which : event.charCode); 80 | // if (!regex.test(key)) { 81 | // event.preventDefault(); 82 | // return false; 83 | // } 84 | }); 85 | 86 | $('#emailLogIn2').on('keydown', function (event) { 87 | // var regex = new RegExp("^[a-zA-Z0-9]+$"); 88 | // var key = String.fromCharCode(!event.charCode ? event.which : event.charCode); 89 | // if (!regex.test(key)) { 90 | // event.preventDefault(); 91 | // return false; 92 | // } 93 | }); 94 | 95 | $('#passwordLogIn2').on('keydown', function (event) { 96 | // var regex = new RegExp("^[a-zA-Z0-9]+$"); 97 | // var key = String.fromCharCode(!event.charCode ? event.which : event.charCode); 98 | // if (!regex.test(key)) { 99 | // event.preventDefault(); 100 | // return false; 101 | // } 102 | }); 103 | 104 | function limitKeypress(event, value, maxLength) { 105 | if (value != undefined && value.toString().length >= maxLength) { 106 | event.preventDefault(); 107 | } 108 | } 109 | 110 | function initializeScreen(){ 111 | $(".groups-container").css({display: "block"}); 112 | $(".groups-filter-container").css({display: "none"}); 113 | setTimeout(function(){ 114 | $("#splashScreen").css({filter: "opacity(0)"}); 115 | $(".section__1").css({transform: "translateX(" + 0 + "px"}); 116 | }, 800) 117 | setTimeout(function(){ 118 | $("#splashScreen").css({display: "none"}); 119 | }, 1000); 120 | } 121 | 122 | initializeScreen(); 123 | 124 | $("#ch1").on("click", function(){ 125 | if(ch1 == false){ 126 | $("#ch1").css({backgroundColor: "white"}); 127 | ch1 = true; 128 | } else { 129 | $("#ch1").css({backgroundColor: "transparent"}); 130 | ch1 = false; 131 | } 132 | }); 133 | 134 | $("#ch2").on("click", function(){ 135 | if(ch2 == false){ 136 | $("#ch2").css({backgroundColor: "white"}); 137 | ch2 = true; 138 | } else { 139 | $("#ch2").css({backgroundColor: "transparent"}); 140 | ch2 = false; 141 | } 142 | }); 143 | 144 | $("#ch3").on("click", function(){ 145 | if(ch3 == false){ 146 | $("#ch3").css({backgroundColor: "white"}); 147 | ch3 = true; 148 | } else { 149 | $("#ch3").css({backgroundColor: "transparent"}); 150 | ch3 = false; 151 | } 152 | }); 153 | 154 | 155 | $("#ch4").on("click", function(){ 156 | if(ch4 == false){ 157 | $("#ch4").css({backgroundColor: "white"}); 158 | ch4 = true; 159 | } else { 160 | $("#ch4").css({backgroundColor: "transparent"}); 161 | ch4 = false; 162 | } 163 | }); 164 | 165 | $("#goToLogin").on("click", function(){ 166 | $(".signup").addClass("hidden-si-lo-1"); 167 | $(".login").addClass("hidden-si-lo-1"); 168 | setTimeout(function(){ 169 | $(".signup").css({display: "none"}); 170 | $(".login").css({display: "flex"}); 171 | $(".login").removeClass("hidden-si-lo-1"); 172 | }, 400); 173 | }); 174 | 175 | $("#goToSignUp").on("click", function(){ 176 | $(".login").addClass("hidden-si-lo-1"); 177 | $(".signup").addClass("hidden-si-lo-1"); 178 | setTimeout(function(){ 179 | $(".login").css({display: "none"}); 180 | $(".signup").css({display: "flex"}); 181 | $(".signup").removeClass("hidden-si-lo-1"); 182 | }, 400); 183 | }); 184 | 185 | function showAlert(head, desc){ 186 | $(".alert-heading").text(head) 187 | $(".alert-description").text(desc) 188 | $(".alert").css({display: "flex", opacity: 0}); 189 | setTimeout(function(){ 190 | $(".alert").css({display: "flex", opacity: 1}); 191 | $(".alert-container").css({transform: "scale(1)", filter: "opacity(1)"}); 192 | }, 20) 193 | } 194 | 195 | function closeAlert(){ 196 | $(".alert-container").css({transform: "scale(0.9)", filter: "opacity(0)"}); 197 | setTimeout(function(){ 198 | $(".alert").css({opacity: 0}); 199 | }, 100); 200 | setTimeout(function(){ 201 | $(".alert").css({display: "none"}); 202 | }, 10) 203 | } 204 | 205 | $(".alert-button").on("click", function(){ 206 | closeAlert(); 207 | }); 208 | 209 | $("#tooltipContainer").on("click", function(){ 210 | $(".tooltip").css({filter: "opacity(0)", transform: "translateY(10px)"}); 211 | setTimeout(function(){ 212 | $("#tooltipContainer").css({display: "none"}); 213 | }, 200) 214 | }); 215 | 216 | $("#tooltipContainer2").on("click", function(){ 217 | $(".tooltip2").css({filter: "opacity(0)", transform: "translateY(10px)"}); 218 | setTimeout(function(){ 219 | $("#tooltipContainer2").css({display: "none"}); 220 | }, 200) 221 | }) 222 | 223 | function showTooltip(msg, offset, height){ 224 | $("#tooltipText").text(msg); 225 | $("#tooltipContainer").css({top: offset - height}) 226 | $("#tooltipContainer").css({display: "block"}); 227 | setTimeout(function(){ 228 | $(".tooltip").css({filter: "opacity(1)", transform: "translateY(0px)"}); 229 | }, 200); 230 | setTimeout(function(){ 231 | $(".tooltip").css({filter: "opacity(0)", transform: "translateY(10px)"}); 232 | }, 2000); 233 | setTimeout(function(){ 234 | $("#tooltipContainer").css({display: "none"}); 235 | }, 2200); 236 | } 237 | 238 | function showTooltip2(msg){ 239 | $("#tooltipText2").text(msg); 240 | $("#tooltipContainer2").css({display: "block"}); 241 | setTimeout(function(){ 242 | $(".tooltip2").css({filter: "opacity(1)", transform: "translateY(0px)"}); 243 | }, 200); 244 | setTimeout(function(){ 245 | $(".tooltip2").css({filter: "opacity(0)", transform: "translateY(10px)"}); 246 | }, 2000) 247 | setTimeout(function(){ 248 | $("#tooltipContainer2").css({display: "none"}); 249 | }, 2200) 250 | } 251 | 252 | function showToast(msg){ 253 | $(".bottom-toast-1").text(msg); 254 | $(".bottom-toast-1").addClass("bottom-toast-1-open"); 255 | setTimeout(function(){ 256 | $(".bottom-toast-1").removeClass("bottom-toast-1-open"); 257 | }, 2400); 258 | } 259 | 260 | // Signup / Login ---- 261 | 262 | var userVal; 263 | var userColor; 264 | var userUID; 265 | 266 | // Signup 267 | 268 | const checker = value => 269 | !profanityChecker.some(element => value.includes(element)); 270 | 271 | $("#signUpBtn1").on("click", function(){ 272 | 273 | let profanityCheck = checker($("#emailSignUp1").val().toLowerCase()); 274 | userVal = undefined; 275 | 276 | if( $("#emailSignUp1").val().length == 0 ){ 277 | showTooltip("Your username cannot be empty", $("#emailSignUp1").offset().top, $("#emailSignUp1").outerHeight()); 278 | } else { 279 | if( $("#passwordSignUp1").val().length == 0 ){ 280 | showTooltip("Your password cannot be empty", $("#passwordSignUp1").offset().top, $("#passwordSignUp1").outerHeight()); 281 | } else { 282 | 283 | if( !profanityCheck ){ 284 | showTooltip("You can't use this username", $("#emailSignUp1").offset().top, $("#emailSignUp1").outerHeight()); 285 | } else { 286 | 287 | if( ch1 == false ){ 288 | showTooltip("You can't proceed without accepting our terms and conditions", $("#ch1C").offset().top, 68); 289 | } else { 290 | if( ch2 == false ){ 291 | showTooltip("You can't proceed without accepting our conditions", $("#ch2C").offset().top, 68); 292 | } else { 293 | 294 | $("input").prop('disabled', true); 295 | $(".section__1").css({pointerEvents: "none"}); 296 | $("#signUpText1").css({transform: "translateY(-32px)", filter: "opacity(0)"}); 297 | setTimeout(function(){ 298 | $("#signUpText1").css({display: "none"}); 299 | $(".signUpLoader1").css({display: "block"}); 300 | }, 200); 301 | setTimeout(function(){ 302 | $(".signUpLoader1").css({transform: "translateY(0px)", filter: "opacity(1)"}); 303 | }, 220); 304 | 305 | firebase.auth().createUserWithEmailAndPassword($("#emailSignUp1").val().trim().toLowerCase() + "@user.com", $("#passwordSignUp1").val().trim()) 306 | .then((user) => { 307 | 308 | userUID = user.user.uid; 309 | userColor = Math.floor(Math.random() * (color_array.length - 0 + 1)) + 0; 310 | userVal = { 311 | name: $("#emailSignUp1").val().trim().toLowerCase(), 312 | status: "normal", 313 | color: userColor 314 | }; 315 | 316 | db.collection("users624024").doc($("#emailSignUp1").val().trim().toLowerCase()).set({ 317 | name: $("#emailSignUp1").val().trim().toLowerCase(), 318 | status: "normal", 319 | color: userColor 320 | }) 321 | .then(function() { 322 | $(".signUpLoader1").css({transform: "translateY(32px)", filter: "opacity(0)"}); 323 | setTimeout(function(){ 324 | $(".signUpLoader1").css({display: "none"}); 325 | $("#signUpText1").css({display: "block"}); 326 | }, 200); 327 | setTimeout(function(){ 328 | $("#signUpText1").css({transform: "translateY(0px)", filter: "opacity(1)"}); 329 | }, 220); 330 | setTimeout(function(){ 331 | $(".section__1").css({filter: "brightness(0.8)"}); 332 | $(".signup").css({transform: "scale(0.9)"}); 333 | $(".login").css({transform: "scale(0.9)"}); 334 | $("#superbody2").css({transform: "translateX(0px)"}); 335 | $(".title-bar-t").css({transform: "translateX(0px)"}); 336 | }, 400); 337 | setTimeout(function(){ 338 | $("input").prop('disabled', false); 339 | $(".section__1").css({pointerEvents: "auto"}); 340 | }, 600); 341 | showMessages(); 342 | 343 | }) 344 | .catch(function(error) { 345 | let errorCode = error.code; 346 | let errorMessage = error.message; 347 | showToast("There was an error while creating your account"); 348 | $(".signUpLoader1").css({transform: "translateY(32px)", filter: "opacity(0)"}); 349 | setTimeout(function(){ 350 | $(".signUpLoader1").css({display: "none"}); 351 | $("#signUpText1").css({display: "block"}); 352 | }, 200); 353 | setTimeout(function(){ 354 | $("#signUpText1").css({transform: "translateY(0px)", filter: "opacity(1)"}); 355 | }, 220); 356 | $("input").prop('disabled', false); 357 | $(".section__1").css({pointerEvents: "auto"}); 358 | }); 359 | }) 360 | .catch((error) => { 361 | let errorCode = error.code; 362 | let errorMessage = error.message; 363 | showToast("There was an error while creating your account"); 364 | $(".signUpLoader1").css({transform: "translateY(32px)", filter: "opacity(0)"}); 365 | setTimeout(function(){ 366 | $(".signUpLoader1").css({display: "none"}); 367 | $("#signUpText1").css({display: "block"}); 368 | }, 200); 369 | setTimeout(function(){ 370 | $("#signUpText1").css({transform: "translateY(0px)", filter: "opacity(1)"}); 371 | }, 220); 372 | $("input").prop('disabled', false); 373 | $(".section__1").css({pointerEvents: "auto"}); 374 | }); 375 | 376 | } 377 | } 378 | 379 | } 380 | 381 | } 382 | } 383 | 384 | }); 385 | 386 | // Login 387 | 388 | $("#signUpBtn2").on("click", function(){ 389 | 390 | if( $("#emailLogIn2").val().length == 0 ){ 391 | showTooltip("Your username cannot be empty", $("#emailLogIn2").offset().top, $("#emailLogIn2").outerHeight()); 392 | } else { 393 | if( $("#passwordLogIn2").val().length == 0 ){ 394 | showTooltip("Your password cannot be empty", $("#passwordLogIn2").offset().top, $("#passwordLogIn2").outerHeight()); 395 | } else { 396 | if( ch3 == false ){ 397 | showTooltip("You can't proceed without accepting our terms and conditions", $("#ch3C").offset().top, 68); 398 | } else { 399 | if( ch4 == false ){ 400 | showTooltip("You can't proceed without accepting our conditions", $("#ch4C").offset().top, 68); 401 | } else { 402 | 403 | $("input").prop('disabled', true); 404 | $(".section__1").css({pointerEvents: "none"}); 405 | $("#signUpText2").css({transform: "translateY(-32px)", filter: "opacity(0)"}); 406 | setTimeout(function(){ 407 | $("#signUpText2").css({display: "none"}); 408 | $(".signUpLoader2").css({display: "block"}); 409 | }, 200); 410 | setTimeout(function(){ 411 | $(".signUpLoader2").css({transform: "translateY(0px)", filter: "opacity(1)"}); 412 | }, 220); 413 | 414 | firebase.auth().signInWithEmailAndPassword($("#emailLogIn2").val().trim().toLowerCase() + "@user.com", $("#passwordLogIn2").val()) 415 | .then((user) => { 416 | 417 | let docRef = db.collection("users624024").doc($("#emailLogIn2").val().trim().toLowerCase()); 418 | 419 | docRef.get().then(function(doc) { 420 | if (doc.exists) { 421 | 422 | userUID = user.user.uid; 423 | userVal = doc.data(); 424 | $(".signUpLoader2").css({transform: "translateY(32px)", filter: "opacity(0)"}); 425 | setTimeout(function(){ 426 | $(".signUpLoader2").css({display: "none"}); 427 | $("#signUpText2").css({display: "block"}); 428 | }, 200); 429 | setTimeout(function(){ 430 | $("#signUpText2").css({transform: "translateY(0px)", filter: "opacity(1)"}); 431 | }, 220); 432 | setTimeout(function(){ 433 | $(".section__1").css({filter: "brightness(0.8)"}); 434 | $(".signup").css({transform: "scale(0.9)"}); 435 | $(".login").css({transform: "scale(0.9)"}); 436 | $("#superbody2").css({transform: "translateX(0px)"}); 437 | $(".title-bar-t").css({transform: "translateX(0px)"}); 438 | }, 400); 439 | setTimeout(function(){ 440 | $("input").prop('disabled', false); 441 | $(".section__1").css({pointerEvents: "auto"}); 442 | }, 600); 443 | showMessages(); 444 | } else { 445 | // No such document 446 | } 447 | }).catch(function(error) { 448 | showToast("There was an error while logging into your account"); 449 | $(".signUpLoader2").css({transform: "translateY(32px)", filter: "opacity(0)"}); 450 | setTimeout(function(){ 451 | $(".signUpLoader2").css({display: "none"}); 452 | $("#signUpText2").css({display: "block"}); 453 | }, 200); 454 | setTimeout(function(){ 455 | $("#signUpText2").css({transform: "translateY(0px)", filter: "opacity(1)"}); 456 | }, 220); 457 | $("input").prop('disabled', false); 458 | $(".section__1").css({pointerEvents: "auto"}); 459 | }); 460 | 461 | }) 462 | .catch((error) => { 463 | let errorCode = error.code; 464 | let errorMessage = error.message; 465 | showToast("There was an error while logging into your account"); 466 | $(".signUpLoader2").css({transform: "translateY(32px)", filter: "opacity(0)"}); 467 | setTimeout(function(){ 468 | $(".signUpLoader2").css({display: "none"}); 469 | $("#signUpText2").css({display: "block"}); 470 | }, 200); 471 | setTimeout(function(){ 472 | $("#signUpText2").css({transform: "translateY(0px)", filter: "opacity(1)"}); 473 | }, 220); 474 | $("input").prop('disabled', false); 475 | $(".section__1").css({pointerEvents: "auto"}); 476 | }); 477 | 478 | } 479 | } 480 | } 481 | } 482 | 483 | }); 484 | 485 | $("#searchInput").on("focus", function(){ 486 | $(".search-bar-1").css({background: "white", border: "2px solid #48a9ff"}); 487 | // $("#superbody2").css({background: "#fcfcfc"}); 488 | // $(".title-bar-t").css({background: "#fcfcfc"}); 489 | }); 490 | 491 | $("#searchInput").on("focusout", function(){ 492 | $(".search-bar-1").css({background: "#eff5ff", border: "2px solid transparent"}); 493 | // $("#superbody2").css({background: "white"}); 494 | // $(".title-bar-t").css({background: "white"}); 495 | }); 496 | 497 | var DEBUG = false; 498 | if(!DEBUG){ 499 | if(!window.console) window.console = {}; 500 | var methods = ["log", "debug", "warn", "info"]; 501 | for(var i=0;i 10) ? (lastSender).substring(0, 10) + '...' : lastSender; 542 | lastMessage = ((lastMessage).length > 10) ? (lastMessage).substring(0, 10) + '...' : lastMessage; 543 | lastSender = lastSender.replace(//g,""); 545 | lastSender = lastSender.replace(/\/>/g,""); 546 | lastMessage = lastMessage.replace(//g,""); 548 | lastMessage = lastMessage.replace(/\/>/g,""); 549 | let el = 550 | ` 551 |
552 |
553 |
554 | icon 555 |
556 |
557 |
558 |
559 | ${groups_array_name[i]} 560 |
561 |
562 | ${"" + lastSender + ": " + "" + lastMessage} 563 |
564 |
565 |
566 |
567 | ${reRData[i].data.timestamp.toDate().toLocaleTimeString('en-US').split(":")[0] + ":" + reRData[i].data.timestamp.toDate().toLocaleTimeString('en-US').split(":")[1]} 568 |
569 |
570 |
571 | `; 572 | $(".groups-container").append(el); 573 | $("#" + reRData[i].id).on("click", function(){ 574 | if(unsubscribe !== undefined){ 575 | unsubscribe(); 576 | } 577 | showChatScreen(reRData[i].id, groups_array_name[i]); 578 | }); 579 | } 580 | $(".group:last-child").addClass("group2"); 581 | } 582 | 583 | function setFilterGroups(arg){ 584 | $(".groups-filter-container").html(""); 585 | for(let i = 0; i < arg.length; i++){ 586 | let lastSender = checker(arg[i].data.lastSender) ? arg[i].data.lastSender : "***"; 587 | lastSender = ((lastSender).length > 10) ? (lastSender).substring(0, 10) + '...' : lastSender; 588 | let lastMessage = checker(arg[i].data.lastMessage) ? arg[i].data.lastMessage : "***"; 589 | lastMessage = ((lastMessage).length > 10) ? (lastMessage).substring(0, 10) + '...' : lastMessage; 590 | lastSender = lastSender.replace(//g,""); 592 | lastSender = lastSender.replace(/\/>/g,""); 593 | lastMessage = lastMessage.replace(//g,""); 595 | lastMessage = lastMessage.replace(/\/>/g,""); 596 | let el = 597 | ` 598 |
599 |
600 |
601 | icon 602 |
603 |
604 |
605 |
606 | ${arg[i].data.name} 607 |
608 |
609 | ${"" + lastSender + ": " + "" + lastMessage} 610 |
611 |
612 |
613 |
614 | ${arg[i].data.timestamp.toDate().toLocaleTimeString('en-US').split(":")[0] + ":" + arg[i].data.timestamp.toDate().toLocaleTimeString('en-US').split(":")[1]} 615 |
616 |
617 |
618 | `; 619 | $(".groups-filter-container").append(el); 620 | $("." + arg[i].id).on("click", function(){ 621 | if(unsubscribe !== undefined){ 622 | unsubscribe(); 623 | } 624 | showChatScreen(arg[i].id, groups_array_name[i]); 625 | }); 626 | } 627 | } 628 | 629 | function showMessages(){ 630 | 631 | $("#messagesLoaderContainer").css({display: "flex"}); 632 | setTimeout(function(){ 633 | $("#messagesLoaderContainer").css({filter: "opacity(1)"}); 634 | }, 20); 635 | 636 | db 637 | .collection("_rooms728346_") 638 | .orderBy("serial", "desc") 639 | .onSnapshot((snapshot) => { 640 | 641 | $("#messagesLoaderContainer").css({filter: "opacity(0)"}); 642 | setTimeout(function(){ 643 | $("#messagesLoaderContainer").css({display: "none"}); 644 | }, 200); 645 | setTimeout(function(){ 646 | $(".groups-container").css({display: "block", filter: "opacity(1)"}); 647 | }, 220); 648 | setTimeout(function(){ 649 | $(".groups-container").css({filter: "opacity(1)"}); 650 | }, 240); 651 | 652 | reRData = snapshot.docs.map((doc) => ({ 653 | id: doc.id, 654 | data: doc.data(), 655 | })); 656 | 657 | try { 658 | setGroups( 659 | snapshot.docs.map((doc) => ({ 660 | id: doc.id, 661 | data: doc.data(), 662 | })) 663 | ); 664 | } catch (err) { 665 | 666 | } 667 | 668 | }); 669 | 670 | } 671 | 672 | $("#logoutBtn1").on("click", function(){ 673 | firebase.auth().signOut().then(() => { 674 | 675 | $(".section__1").css({filter: "brightness(1)"}); 676 | $(".signup").css({transform: "scale(1)"}); 677 | $(".login").css({transform: "scale(1)"}); 678 | $("#superbody2").css({transform: "translateX(" + window.innerWidth + "px"}); 679 | $(".title-bar-t").css({transform: "translateX(100vw)"}); 680 | 681 | $("input").prop('disabled', false); 682 | $(".section__1").css({pointerEvents: "auto"}); 683 | 684 | }).catch((error) => { 685 | showToast("There was an error") 686 | }); 687 | }); 688 | 689 | function filterByValue(array, value) { 690 | let s = value; 691 | let values = array; 692 | // return array.filter((data) => JSON.stringify(data).toLowerCase().indexOf(value.toLowerCase()) !== -1); 693 | let re = RegExp(`.*${s.toLowerCase().split("").join(".*")}.*`); 694 | return values.filter((v) => v.data.name.toLowerCase().match(re)); 695 | } 696 | 697 | $("#searchInput").on("focus", function(){ 698 | $(".groups-container").css({display: "none"}); 699 | $(".groups-filter-container").css({display: "block"}); 700 | }); 701 | 702 | $("#searchInput").on("focusout", function(){ 703 | if(this.value.length == 0){ 704 | $(".groups-container").css({display: "block"}); 705 | $(".groups-filter-container").css({display: "none"}); 706 | } else { 707 | $(".groups-container").css({display: "none"}); 708 | $(".groups-filter-container").css({display: "block"}); 709 | } 710 | }); 711 | 712 | $("#searchInput").keydown(function(event){ 713 | if(event.keyCode == 8){ 714 | $("#searchInput").val(""); 715 | return false; 716 | } 717 | }); 718 | 719 | $("#searchInput").on("keydown", function(e){ 720 | 721 | setTimeout(function(){ 722 | if( $("#searchInput").val().length !== 0 ){ 723 | // try { 724 | setFilterGroups(filterByValue(reRData, $("#searchInput").val())); 725 | // } catch (err) {} 726 | } else { 727 | try { 728 | setFilterGroups([]); 729 | } catch (err) {} 730 | } 731 | }, 0); 732 | 733 | }); 734 | 735 | $("#goBackToGroupScr").on("click", function(){ 736 | $(".superbody-2").css({filter: "brightness(1)"}); 737 | $(".section__2").css({transform: "scale(1)"}); 738 | $("#superbody3").css({transition: "0.2s"}) 739 | setTimeout(function(){ 740 | $("#superbody3").css({transform: "translateX(100vw)"}); 741 | }, 0) 742 | 743 | $(".title-bar-t").css({filter: "brightness(1)"}); 744 | $(".title-name-t").css({transform: "scale(1)"}); 745 | $(".title-logout-t").css({transform: "scale(1)"}); 746 | 747 | if($("#superbody2").scrollTop() == 0){ 748 | // $(".superbody-2").css("box-shadow", "inset 0px 0px 0px transparent"); 749 | } else { 750 | // $(".superbody-2").css("box-shadow", "rgb(240 248 255) 0px 2px 4px inset"); 751 | } 752 | }); 753 | 754 | $("#superbody2").scroll(function () { 755 | 756 | if($(this).scrollTop() == 0){ 757 | $(".superbody-2").css("box-shadow", "inset 0px 0px 0px transparent"); 758 | } else { 759 | $(".superbody-2").css("box-shadow", "rgb(240 248 255) 0px 2px 4px inset"); 760 | } 761 | 762 | }); 763 | 764 | document.getElementById("messageInput").addEventListener("input", function(){ 765 | if(this.value.length == 0){ 766 | $(".message-btn-container").css({color: "#88898a"}); 767 | } else { 768 | $(".message-btn-container").css({color: "#3165ff"}); 769 | } 770 | }); 771 | 772 | // $("#messageInput").on("keydown", function(){ 773 | 774 | // if(this.value.length == 0){ 775 | // $(".message-btn-container").css({color: "#88898a"}); 776 | // } else { 777 | // $(".message-btn-container").css({color: "#0040ff"}); 778 | // } 779 | 780 | // }); 781 | 782 | var chatScreenValue; 783 | var chatMsgsVal; 784 | var chatScreenID; 785 | var tCVal; 786 | 787 | function showChats(){ 788 | 789 | $("#chatAreaContainer").html(""); 790 | 791 | for(let i = 0; i < chatScreenValue.length; i++){ 792 | 793 | if(chatScreenValue[i].data.uid == userUID){ 794 | if( 795 | chatScreenValue[i].data.message.includes("[sticker]") && 796 | chatScreenValue[i].data.message.length == 20 && 797 | (typeof(parseInt(chatScreenValue[i].data.message.substring(9, 11))) == "number") && 798 | parseInt(chatScreenValue[i].data.message.substring(9, 11)) >= 0 && 799 | parseInt(chatScreenValue[i].data.message.substring(9, 11)) <= 12) 800 | { 801 | let el = 802 | ` 803 |
804 |
805 |
806 |
807 | 808 |
809 |
810 |
811 | ${chatScreenValue[i].data.timestamp.toDate().toLocaleTimeString('en-US').split(":")[0] + ":" + chatScreenValue[i].data.timestamp.toDate().toLocaleTimeString('en-US').split(":")[1]} 812 |
813 |
814 |
815 | `; 816 | $("#chatAreaContainer").append(el); 817 | } else { 818 | let msg = chatScreenValue[i].data.message; 819 | msg = msg.replace(//g,""); 821 | msg = msg.replace(/\/>/g,""); 822 | let el = 823 | ` 824 |
825 |
826 |
827 | ${msg} 828 |
829 |
830 | ${chatScreenValue[i].data.timestamp.toDate().toLocaleTimeString('en-US').split(":")[0] + ":" + chatScreenValue[i].data.timestamp.toDate().toLocaleTimeString('en-US').split(":")[1]} 831 |
832 |
833 |
834 | `; 835 | $("#chatAreaContainer").append(el); 836 | } 837 | } else { 838 | if( 839 | chatScreenValue[i].data.message.includes("[sticker]") && 840 | chatScreenValue[i].data.message.length == 20 && 841 | (typeof(parseInt(chatScreenValue[i].data.message.substring(9, 11))) == "number") && 842 | parseInt(chatScreenValue[i].data.message.substring(9, 11)) >= 0 && 843 | parseInt(chatScreenValue[i].data.message.substring(9, 11)) <= 12 844 | ){ 845 | 846 | let color = (chatScreenValue[i].data.uid == "5mjMJm4YLCSFYrqUfUD2jcSGEde2") ? "background: url(https://res.cloudinary.com/dpj9ddsjf/image/upload/v1610832281/coffee60_y9lnpm.png); background-size: cover; background-repeat: no-repeat; background-position: center; color: transparent; filter: sepia(0.2);" : "background: " + color_array[chatScreenValue[i].data.color]; 847 | 848 | let el = 849 | ` 850 |
851 |
852 | ${chatScreenValue[i].data.name.substring(0, 1).toUpperCase()} 853 |
854 |
855 |
856 | 857 | ${chatScreenValue[i].data.name} 858 | 859 |
860 |
861 | 862 |
863 |
864 | ${chatScreenValue[i].data.timestamp.toDate().toLocaleTimeString('en-US').split(":")[0] + ":" + chatScreenValue[i].data.timestamp.toDate().toLocaleTimeString('en-US').split(":")[1]} 865 |
866 |
867 |
868 | `; 869 | $("#chatAreaContainer").append(el); 870 | 871 | } else { 872 | // box-shadow: 0px 0px 8px 2px rgb(255 209 51 / 29%); 873 | let status = false; 874 | status = (chatScreenValue[i].data.status == "normal") ? 875 | false : status; 876 | status = (chatScreenValue[i].data.status == "pro") ? 877 | "PRO" : status; 878 | status = (chatScreenValue[i].data.status == "aimu") ? 879 | "AIMU" : status; 880 | status = (chatScreenValue[i].data.status == "member") ? 881 | "MEMBER" : status; 882 | status = (chatScreenValue[i].data.status == "bot" || chatScreenValue[i].data.uid == "8KP1hhhRZrSRQN8TieNxpVND3z12") ? 883 | "BOT" : status; 884 | status = (chatScreenValue[i].data.status == "creator" || chatScreenValue[i].data.uid == "5mjMJm4YLCSFYrqUfUD2jcSGEde2") ? 885 | "CREATOR" : status; 886 | let statusStyle = chatScreenValue[i].data.status == "normal" ? "display: none" : "display: block"; 887 | 888 | // let color = color_array[chatScreenValue[i].data.color]; 889 | 890 | let color = (chatScreenValue[i].data.uid == "5mjMJm4YLCSFYrqUfUD2jcSGEde2") ? 891 | "background: url(https://res.cloudinary.com/dpj9ddsjf/image/upload/v1610832281/coffee60_y9lnpm.png); background-size: cover; background-repeat: no-repeat; background-position: center; color: transparent; filter: sepia(0.2);" 892 | : (chatScreenValue[i].data.uid == "7gYhh228NlbSemddKuwGddczBZ03") ? "background: url(https://pbs.twimg.com/profile_images/1328121638680997894/pGQDvYl-_400x400.jpg); background-size: cover; background-repeat: no-repeat; background-position: center; color: transparent; filter: sepia(0.2);border: 2px solid #4f8bcf;" : 893 | "background: " + color_array[chatScreenValue[i].data.color]; 894 | 895 | let msg = chatScreenValue[i].data.message; 896 | msg = checker(msg) ? msg : "***"; 897 | msg = msg.replace(//g,""); 899 | msg = msg.replace(/\/>/g,""); 900 | 901 | let el = 902 | ` 903 |
904 |
905 | ${chatScreenValue[i].data.name.substring(0, 1).toUpperCase()} 906 |
907 |
908 |
909 | ${chatScreenValue[i].data.name} 910 | ${status} 911 |
912 |
913 | ${msg} 914 |
915 |
916 | ${chatScreenValue[i].data.timestamp.toDate().toLocaleTimeString('en-US').split(":")[0] + ":" + chatScreenValue[i].data.timestamp.toDate().toLocaleTimeString('en-US').split(":")[1]} 917 |
918 |
919 |
920 | `; 921 | $("#chatAreaContainer").append(el); 922 | } 923 | } 924 | 925 | if(true){ 926 | $("#chatAreaContainer").animate({ scrollTop: $("#chatAreaContainer")[0].scrollHeight}, 0); 927 | } 928 | 929 | } 930 | 931 | } 932 | 933 | function showChatScreen(id, name){ 934 | 935 | $("#chatAreaContainer").html(""); 936 | chatScreenID = id; 937 | 938 | $(".title-name-2").text(name); 939 | 940 | $(".superbody-2").css({filter: "brightness(0.8)"}); 941 | $(".section__2").css({transform: "scale(0.96)"}); 942 | $("#superbody3").css({transform: "translateX(0px)"}); 943 | setTimeout(function(){ 944 | $("#superbody3").css({transition: "0s"}); 945 | }, 200) 946 | 947 | $(".title-bar-t").css({filter: "brightness(0.8)"}); 948 | $(".title-name-t").css({transform: "scale(0.96)"}); 949 | $(".title-logout-t").css({transform: "scale(0.96)"}); 950 | 951 | // $(".superbody-2").css("box-shadow", "inset 0px 0px 0px transparent"); 952 | 953 | $(".chat-aupc-loader").css({display: "block"}); 954 | $(".chat-aupc-text").css({display: "none"}); 955 | 956 | unsubscribe = db.collection("_rooms728346_") 957 | .doc(id) 958 | .collection("messages") 959 | .orderBy("timestamp", "asc") 960 | .onSnapshot((snapshot) => { 961 | 962 | chatScreenValue = snapshot.docs.map((doc) => doc.data()); 963 | 964 | if(chatScreenValue.length == 0){ 965 | $(".chat-aupc-loader").css({display: "none"}); 966 | $(".chat-aupc-text").css({display: "block"}); 967 | } else { 968 | 969 | $(".chat-aupc-loader").css({display: "none"}); 970 | $(".chat-aupc-text").css({display: "none"}); 971 | chatScreenValue = snapshot.docs.map((doc) => ({ 972 | id: doc.id, 973 | data: doc.data(), 974 | })); 975 | try { 976 | showChats(); 977 | } catch (err) { 978 | 979 | } 980 | 981 | } 982 | 983 | if(chatScreenValue.length > 20){ 984 | db.collection("_rooms728346_").doc(id).collection("messages").doc(chatScreenValue[0].id).delete().then(function() { 985 | // console.log("Document successfully deleted!"); 986 | }).catch(function(error) { 987 | // console.error("Error removing document: ", error); 988 | }); 989 | } 990 | 991 | }); 992 | 993 | } 994 | 995 | function skyraCheck(msg, username){ 996 | 997 | if((msg.toLowerCase().trim() == "s!help")){ 998 | alert("Hey " + userVal.name + "! I am Skyra.\n\nHere are the commands which you can use with me:\n\n• s!toss Tosses a coin\n\n• s!dice Rolls a dice\n\n• s!height Tells your screen's height\n\n• s!width Tells your screen's width\n\n• s!joke Tells a random joke\n\n• s!weather Tells the weather of your city\n\n• s!temp Tells the temperature of your city\n\n• s!simp Can tell anyone's simpness :>"); 999 | } 1000 | 1001 | if(msg.includes("s!")){ 1002 | if(msg == "s!toss"){ 1003 | let randomInt = Math.round(Math.random()); 1004 | let output = (randomInt == 0) ? "Heads" : "Tails"; 1005 | db.collection("_rooms728346_") 1006 | .doc(chatScreenID) 1007 | .collection("messages") 1008 | .add({ 1009 | message: output, 1010 | name: "skyra", 1011 | color: 0, 1012 | status: "bot", 1013 | timestamp: firebase.firestore.FieldValue.serverTimestamp(), 1014 | uid: "7gYhh228NlbSemddKuwGddczBZ03" 1015 | }).then(() => { 1016 | 1017 | }); 1018 | } else if(msg.toLowerCase().trim() == "s!dice"){ 1019 | let randomInt = Math.floor(Math.random() * 6) + 1; 1020 | let output = `${username} rolled the dice and got ${randomInt}`; 1021 | db.collection("_rooms728346_") 1022 | .doc(chatScreenID) 1023 | .collection("messages") 1024 | .add({ 1025 | message: output, 1026 | name: "skyra", 1027 | color: 0, 1028 | status: "bot", 1029 | timestamp: firebase.firestore.FieldValue.serverTimestamp(), 1030 | uid: "7gYhh228NlbSemddKuwGddczBZ03" 1031 | }).then(() => { 1032 | 1033 | }); 1034 | } else if(msg.toLowerCase().trim() == "s!height"){ 1035 | let height = $(window).height(); 1036 | let output = `Your screen's document height is ${height}px`; 1037 | db.collection("_rooms728346_") 1038 | .doc(chatScreenID) 1039 | .collection("messages") 1040 | .add({ 1041 | message: output, 1042 | name: "skyra", 1043 | color: 0, 1044 | status: "bot", 1045 | timestamp: firebase.firestore.FieldValue.serverTimestamp(), 1046 | uid: "7gYhh228NlbSemddKuwGddczBZ03" 1047 | }).then(() => { 1048 | 1049 | }); 1050 | } else if(msg.toLowerCase().trim() == "s!width"){ 1051 | let width = $(window).width(); 1052 | let output = `Your screen's document width is ${width}px`; 1053 | db.collection("_rooms728346_") 1054 | .doc(chatScreenID) 1055 | .collection("messages") 1056 | .add({ 1057 | message: output, 1058 | name: "skyra", 1059 | color: 0, 1060 | status: "bot", 1061 | timestamp: firebase.firestore.FieldValue.serverTimestamp(), 1062 | uid: "7gYhh228NlbSemddKuwGddczBZ03" 1063 | }).then(() => { 1064 | 1065 | }); 1066 | } else if(msg.toLowerCase().trim() == "s!joke"){ 1067 | 1068 | $.getJSON("https://official-joke-api.appspot.com/jokes/programming/random", function(data) { 1069 | 1070 | let output; 1071 | let punchline = data[0].punchline; 1072 | let setup = data[0].setup; 1073 | output = `${setup}... ${punchline}`; 1074 | db.collection("_rooms728346_") 1075 | .doc(chatScreenID) 1076 | .collection("messages") 1077 | .add({ 1078 | message: output, 1079 | name: "skyra", 1080 | color: 0, 1081 | status: "bot", 1082 | timestamp: firebase.firestore.FieldValue.serverTimestamp(), 1083 | uid: "7gYhh228NlbSemddKuwGddczBZ03" 1084 | }).then(() => { 1085 | 1086 | }); 1087 | 1088 | }); 1089 | 1090 | } else if(msg.toLowerCase().includes("s!simp")){ 1091 | 1092 | if(msg.toLowerCase().trim().replace("s!simp", "") == ""){ 1093 | let randomInt = (username == "programmer" || username == "utsav") ? 0 : Math.floor(Math.random() * 100) + 1; 1094 | let output = `${username} is ${randomInt}% simp!`; 1095 | db.collection("_rooms728346_") 1096 | .doc(chatScreenID) 1097 | .collection("messages") 1098 | .add({ 1099 | message: output, 1100 | name: "skyra", 1101 | color: 0, 1102 | status: "bot", 1103 | timestamp: firebase.firestore.FieldValue.serverTimestamp(), 1104 | uid: "7gYhh228NlbSemddKuwGddczBZ03" 1105 | }).then(() => { 1106 | 1107 | }); 1108 | } else { 1109 | let nameOfSimp = msg.toLowerCase().trim().replace("s!simp", "").trim().toLowerCase(); 1110 | let randomInt = (nameOfSimp == "programmer" || nameOfSimp == "utsav") ? 0 : Math.floor(Math.random() * 100) + 1; 1111 | let output = `${nameOfSimp} is ${randomInt}% simp!`; 1112 | db.collection("_rooms728346_") 1113 | .doc(chatScreenID) 1114 | .collection("messages") 1115 | .add({ 1116 | message: output, 1117 | name: "skyra", 1118 | color: 0, 1119 | status: "bot", 1120 | timestamp: firebase.firestore.FieldValue.serverTimestamp(), 1121 | uid: "7gYhh228NlbSemddKuwGddczBZ03" 1122 | }).then(() => { 1123 | 1124 | }); 1125 | } 1126 | 1127 | } else if(msg.toLowerCase().includes("s!weather")){ 1128 | 1129 | if(msg.toLowerCase().trim().replace("s!weather", "") == ""){ 1130 | 1131 | let output = `Hey ${username}, you forgot to enter the city. Here's an example: s!weather `; 1132 | db.collection("_rooms728346_") 1133 | .doc(chatScreenID) 1134 | .collection("messages") 1135 | .add({ 1136 | message: output, 1137 | name: "skyra", 1138 | color: 0, 1139 | status: "bot", 1140 | timestamp: firebase.firestore.FieldValue.serverTimestamp(), 1141 | uid: "7gYhh228NlbSemddKuwGddczBZ03" 1142 | }).then(() => { 1143 | 1144 | }); 1145 | 1146 | } else { 1147 | 1148 | let cityName = msg.toLowerCase().trim().replace("s!weather", "").trim().toLowerCase(); 1149 | try { 1150 | $.getJSON("https://api.openweathermap.org/data/2.5/weather?q=" + cityName + "&units=imperial&appid=018970dba0bb4f2438f8c13e49e5a1fb", function(data) { 1151 | let weather = data.weather[0].main; 1152 | let cityNameIN = msg.toLowerCase().trim().replace("s!weather", "").trim().toLowerCase(); 1153 | let output = `Today is ${(weather.toLowerCase() == "clouds" ? "Cloudy" : weather)} in ${cityNameIN}`; 1154 | db.collection("_rooms728346_") 1155 | .doc(chatScreenID) 1156 | .collection("messages") 1157 | .add({ 1158 | message: output, 1159 | name: "skyra", 1160 | color: 0, 1161 | status: "bot", 1162 | timestamp: firebase.firestore.FieldValue.serverTimestamp(), 1163 | uid: "7gYhh228NlbSemddKuwGddczBZ03" 1164 | }).then(() => { 1165 | 1166 | }); 1167 | }); 1168 | } catch (err) { 1169 | 1170 | } 1171 | 1172 | } 1173 | 1174 | } else if(msg.toLowerCase().includes("s!temp")){ 1175 | 1176 | if(msg.toLowerCase().trim().replace("s!temp", "") == ""){ 1177 | 1178 | let output = `Hey ${username}, you forgot to enter the city. Here's an example: s!temp `; 1179 | db.collection("_rooms728346_") 1180 | .doc(chatScreenID) 1181 | .collection("messages") 1182 | .add({ 1183 | message: output, 1184 | name: "skyra", 1185 | color: 0, 1186 | status: "bot", 1187 | timestamp: firebase.firestore.FieldValue.serverTimestamp(), 1188 | uid: "7gYhh228NlbSemddKuwGddczBZ03" 1189 | }).then(() => { 1190 | 1191 | }); 1192 | 1193 | } else { 1194 | 1195 | let cityName = msg.toLowerCase().trim().replace("s!temp", "").trim().toLowerCase(); 1196 | try { 1197 | $.getJSON("https://api.openweathermap.org/data/2.5/weather?q=" + cityName + "&units=imperial&appid=018970dba0bb4f2438f8c13e49e5a1fb", function(data) { 1198 | let weather = Math.floor(data.main.temp); 1199 | let cityNameIN = msg.toLowerCase().trim().replace("s!temp", "").trim().toLowerCase(); 1200 | let output = `Today's temperature in ${cityNameIN} is ${weather}°F`; 1201 | db.collection("_rooms728346_") 1202 | .doc(chatScreenID) 1203 | .collection("messages") 1204 | .add({ 1205 | message: output, 1206 | name: "skyra", 1207 | color: 0, 1208 | status: "bot", 1209 | timestamp: firebase.firestore.FieldValue.serverTimestamp(), 1210 | uid: "7gYhh228NlbSemddKuwGddczBZ03" 1211 | }).then(() => { 1212 | 1213 | }); 1214 | }); 1215 | } catch (err) { 1216 | 1217 | } 1218 | 1219 | } 1220 | 1221 | } 1222 | } 1223 | 1224 | } 1225 | 1226 | $("#messageBtnContainer").on("click", function(){ 1227 | 1228 | $("#messageInput").focus(); 1229 | if( $("#messageInput").val().length !== 0 ){ 1230 | let profanityCheck = checker($("#messageInput").val().toLowerCase()); 1231 | if($("#messageInput").val().trim() == "hello"){ 1232 | profanityCheck = true; 1233 | } 1234 | if(!profanityCheck) { 1235 | showTooltip2("You can't send this message. Reason: Profanity"); 1236 | } else { 1237 | $("#messageBtnContainer").css({display: "none"}); 1238 | $("#messageBBLoading4").css({display: "flex"}); 1239 | $("body").css({pointerEvents: "none"}); 1240 | let senderSim; 1241 | let msgToSend; 1242 | if((userVal.name).length > 16) { 1243 | senderSim = (userVal.name).substring(0, 14) + "..." 1244 | } else { 1245 | senderSim = userVal.name; 1246 | } 1247 | if($("#messageInput").val().trim().length > 62){ 1248 | msgToSend = $("#messageInput").val().trim().substring(0, 60); 1249 | } else { 1250 | msgToSend = $("#messageInput").val().trim(); 1251 | } 1252 | 1253 | msgToSend = msgToSend.replace(//g,""); 1255 | msgToSend = msgToSend.replace(/\/>/g,""); 1256 | 1257 | db.collection("_rooms728346_") 1258 | .doc(chatScreenID) 1259 | .collection("messages") 1260 | .add({ 1261 | message: msgToSend, 1262 | name: senderSim, 1263 | color: userVal.color, 1264 | status: userVal.status, 1265 | timestamp: firebase.firestore.FieldValue.serverTimestamp(), 1266 | uid: userUID 1267 | }).then(() => { 1268 | $("#messageInput").val(""); 1269 | $("body").css({pointerEvents: "auto"}); 1270 | $("#messageBtnContainer").css({color: "#88898a"}); 1271 | $("#messageBtnContainer").css({display: "flex"}); 1272 | $("#messageBBLoading4").css({display: "none"}); 1273 | $("#messageInput").focus(); 1274 | skyraCheck(msgToSend, senderSim); 1275 | let roomsDocRef = db.collection("_rooms728346_").doc(chatScreenID); 1276 | return roomsDocRef.update({ 1277 | lastMessage: msgToSend, 1278 | lastSender: senderSim, 1279 | timestamp: firebase.firestore.FieldValue.serverTimestamp() 1280 | }) 1281 | .then(function() { 1282 | 1283 | }) 1284 | .catch(function(err) { 1285 | 1286 | }); 1287 | }); 1288 | } 1289 | } 1290 | 1291 | }); 1292 | 1293 | var _originalSize = $(window).width() + $(window).height() 1294 | $(window).resize(function(){ 1295 | 1296 | if($(window).width() + $(window).height() != _originalSize){ 1297 | // Keyboard Visible 1298 | $("#chatAreaContainer").animate({ scrollTop: $("#chatAreaContainer")[0].scrollHeight}, 0); 1299 | }else{ 1300 | // Keyboard Not Visible 1301 | } 1302 | 1303 | }); 1304 | 1305 | // Stickers 1306 | 1307 | $("#stickerOpenBtn").on("click", function(){ 1308 | $("#messageInput").focus(); 1309 | if($(".sticker-opts-c-2").css("filter") == "opacity(0)"){ 1310 | $("#stickerOptsContainer").css({display: "block"}); 1311 | setTimeout(function(){ 1312 | $(".sticker-opts-c-2").css({transform: "translateY(0px)", filter: "opacity(1)"}) 1313 | $(".sticker-ni-1").css({color: "rgb(49, 101, 255)"}); 1314 | }, 0); 1315 | } else { 1316 | $(".sticker-opts-c-2").css({transform: "translateY(10px)", filter: "opacity(0)"}) 1317 | $(".sticker-ni-1").css({color: "rgb(136 137 138)"}); 1318 | setTimeout(function(){ 1319 | $("#stickerOptsContainer").css({display: "none"}); 1320 | }, 200); 1321 | } 1322 | 1323 | }); 1324 | 1325 | $(".sticker").on("click", function(){ 1326 | 1327 | $("#messageInput").focus(); 1328 | 1329 | let senderSim; 1330 | let id1 = (this.id).replace("sticker", ""); 1331 | let id2 = (this.id).replace("sticker", "").length == 1 ? "0" + id1 : id1; 1332 | let msgToSend = "[sticker]" + id2 + "[sticker]"; 1333 | if((userVal.name).length > 16) { 1334 | senderSim = (userVal.name).substring(0, 14) + "..." 1335 | } else { 1336 | senderSim = userVal.name; 1337 | } 1338 | 1339 | $("#messageBtnContainer").css({display: "none"}); 1340 | $("#messageBBLoading4").css({display: "flex"}); 1341 | $("body").css({pointerEvents: "none"}); 1342 | 1343 | db.collection("_rooms728346_") 1344 | .doc(chatScreenID) 1345 | .collection("messages") 1346 | .add({ 1347 | message: msgToSend, 1348 | name: senderSim, 1349 | color: userVal.color, 1350 | status: userVal.status, 1351 | timestamp: firebase.firestore.FieldValue.serverTimestamp(), 1352 | uid: userUID 1353 | }).then(() => { 1354 | $("body").css({pointerEvents: "auto"}); 1355 | $("#messageBtnContainer").css({color: "#88898a"}); 1356 | $("#messageBtnContainer").css({display: "flex"}); 1357 | $("#messageBBLoading4").css({display: "none"}); 1358 | $("#messageInput").focus(); 1359 | $(".sticker-opts-c-2").css({transform: "translateY(10px)", filter: "opacity(0)"}) 1360 | $(".sticker-ni-1").css({color: "rgb(136 137 138)"}); 1361 | setTimeout(function(){ 1362 | $("#stickerOptsContainer").css({display: "none"}); 1363 | }, 200); 1364 | let roomsDocRef = db.collection("_rooms728346_").doc(chatScreenID); 1365 | return roomsDocRef.update({ 1366 | lastMessage: "[sticker]", 1367 | lastSender: senderSim, 1368 | timestamp: firebase.firestore.FieldValue.serverTimestamp() 1369 | }) 1370 | .then(function() { 1371 | 1372 | }) 1373 | .catch(function(err) { 1374 | }); 1375 | }); 1376 | 1377 | }); 1378 | -------------------------------------------------------------------------------- /styles.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap'); 2 | /* font-family: 'Roboto', sans-serif; */ 3 | @import url('https://fonts.googleapis.com/css2?family=Rubik&display=swap'); 4 | /* font-family: 'Rubik', sans-serif; */ 5 | 6 | /* ---- */ 7 | /* filter: blur(1px) brightness(1.5) hue-rotate(45deg) opacity(0); */ 8 | /* ---- */ 9 | 10 | *{ 11 | padding: 0; 12 | margin: 0; 13 | -webkit-tap-highlight-color: rgba(0,0,0,0); 14 | box-sizing: border-box; 15 | /* transition: 0.2s; */ 16 | -webkit-user-select: none; /* Safari */ 17 | -moz-user-select: none; /* Firefox */ 18 | -ms-user-select: none; /* IE10+/Edge */ 19 | user-select: none; /* Standard */ 20 | } 21 | 22 | body{ 23 | padding: 0; 24 | margin: 0; 25 | overflow: hidden; 26 | background: #efefef; 27 | display: flex; 28 | justify-content: center; 29 | align-items: center; 30 | height: 100vh; 31 | } 32 | 33 | textarea{ 34 | resize: none; 35 | } 36 | 37 | input:focus, 38 | select:focus, 39 | textarea:focus, 40 | button:focus { 41 | outline: none; 42 | } 43 | 44 | ::-moz-selection { 45 | background: rgb(2 201 240 / 20%); 46 | } 47 | 48 | ::selection { 49 | background: rgb(2 201 240 / 10%); 50 | } 51 | 52 | *::-webkit-scrollbar { 53 | display: none; 54 | } 55 | 56 | @font-face { 57 | font-family: HelveticaNormal; 58 | src: url("https://res.cloudinary.com/dpj9ddsjf/raw/upload/v1617019182/Helvetica_uv44sq.ttf"); 59 | } 60 | 61 | a{ 62 | text-decoration: none; 63 | } 64 | 65 | a:hover{ 66 | text-decoration: none; 67 | } 68 | 69 | input:focus, textarea:focus, select:focus{ 70 | outline: none; 71 | } 72 | 73 | .flex{ 74 | display: flex; 75 | } 76 | 77 | .hide{ 78 | display: none; 79 | } 80 | 81 | .hidden{ 82 | display: none !important; 83 | } 84 | 85 | .invisible{ 86 | transition: 1s; 87 | opacity: 0 !important; 88 | } 89 | 90 | img{ 91 | object-fit: cover; 92 | } 93 | 94 | /* Section 0 */ 95 | 96 | .superbody{ 97 | top: 0; 98 | left: 0; 99 | background: white; 100 | height: 100vh; 101 | width: 100%; 102 | overflow: hidden; 103 | /* border: 5px solid #7aadf8; */ 104 | } 105 | 106 | /* Splash Screen */ 107 | 108 | .splash__screen{ 109 | position: fixed; 110 | top: 0; 111 | left: 0; 112 | height: 100vh; 113 | width: 100%; 114 | overflow: hidden; 115 | background: white; 116 | display: flex; 117 | align-items: center; 118 | justify-content: center; 119 | transition: 0.2s; 120 | } 121 | 122 | .splash_loader{ 123 | animation-name: fadeInAnimation; 124 | animation-duration: 0.2s; 125 | animation-fill-mode: forwards; 126 | animation-timing-function: linear; 127 | } 128 | 129 | @keyframes fadeInAnimation{ 130 | 131 | from { 132 | opacity: 0; 133 | } 134 | 135 | to { 136 | opacity: 1; 137 | } 138 | 139 | } 140 | 141 | /* Section 1 */ 142 | 143 | .e--input-1::-webkit-input-placeholder { 144 | color: #afcfff; 145 | } 146 | 147 | .e--input-1:-ms-input-placeholder { 148 | color: #afcfff; 149 | } 150 | 151 | .e--input-1::placeholder { 152 | color: #afcfff; 153 | } 154 | 155 | .e--password-1::-webkit-input-placeholder { 156 | color: #afcfff; 157 | } 158 | 159 | .e--password-1:-ms-input-placeholder { 160 | color: #afcfff; 161 | } 162 | 163 | .e--password-1::placeholder { 164 | color: #afcfff; 165 | } 166 | 167 | .section__1{ 168 | background: linear-gradient(0deg, #387bdc, #6097ec); 169 | transition: 0.4s; 170 | } 171 | 172 | .signup{ 173 | display: flex; 174 | flex-direction: column; 175 | margin-left: 10px; 176 | height: 100vh; 177 | justify-content: center; 178 | transition: 0.4s; 179 | } 180 | 181 | .login{ 182 | display: flex; 183 | flex-direction: column; 184 | margin-left: 10px; 185 | height: 100vh; 186 | justify-content: center; 187 | transition: 0.4s; 188 | } 189 | 190 | .heading-1{ 191 | font-family: 'Rubik', sans-serif; 192 | font-size: 26px; 193 | font-weight: bold; 194 | margin-bottom: 10%; 195 | color: #f8fcfd; 196 | } 197 | 198 | .email-input-1{ 199 | font-family: 'Roboto', sans-serif; 200 | font-size: 14px; 201 | color: #ceefff; 202 | display: flex; 203 | align-items: center; 204 | min-height: 20px; 205 | max-height: 20px; 206 | } 207 | 208 | .e--input-1{ 209 | background: #5e95e5; 210 | border: 0px solid; 211 | outline: none; 212 | padding: 8px; 213 | margin-top: 10px; 214 | border-radius: 4px; 215 | padding-left: 10px; 216 | width: calc(100% - 20px); 217 | font-size: 16px; 218 | font-family: 'Rubik', sans-serif; 219 | padding-top: 10px; 220 | padding-bottom: 10px; 221 | color: white; 222 | } 223 | 224 | .password-input-1{ 225 | font-family: 'Roboto', sans-serif; 226 | font-size: 14px; 227 | color: #ceefff; 228 | margin-top: 10px; 229 | } 230 | 231 | .e--password-1{ 232 | background: #5e95e5; 233 | border: 0px solid; 234 | outline: none; 235 | padding: 8px; 236 | margin-top: 10px; 237 | border-radius: 4px; 238 | padding-left: 10px; 239 | width: calc(100% - 20px); 240 | font-size: 16px; 241 | font-family: 'Rubik', sans-serif; 242 | padding-top: 10px; 243 | padding-bottom: 10px; 244 | color: white; 245 | } 246 | 247 | .signup-btn{ 248 | background: rgb(255 255 255 / 15%); 249 | width: 160px; 250 | display: flex; 251 | align-items: center; 252 | justify-content: center; 253 | padding-top: 10px; 254 | padding-bottom: 10px; 255 | margin-top: 10%; 256 | border-radius: 4px; 257 | font-family: 'Rubik', sans-serif; 258 | color: #f0f9ff; 259 | min-height: 40px; 260 | max-height: 40px; 261 | } 262 | 263 | .check-container-su-1{ 264 | margin-top: 20px; 265 | margin-bottom: 6px; 266 | color: #d2e4ff; 267 | font-family: 'Roboto', sans-serif; 268 | width: calc(100% - 10px); 269 | display: flex; 270 | } 271 | 272 | .check-container-su-2{ 273 | margin-top: 4px; 274 | margin-bottom: 6px; 275 | color: #d2e4ff; 276 | font-family: 'Roboto', sans-serif; 277 | width: calc(100% - 10px); 278 | display: flex; 279 | } 280 | 281 | .checkmark-disabled{ 282 | height: 16px; 283 | width: 16px; 284 | min-height: 16px; 285 | min-width: 16px; 286 | background: transparent; 287 | border: 2px solid aliceblue; 288 | color: #4181df; 289 | border-radius: 4px; 290 | display: flex; 291 | align-items: center; 292 | justify-content: center; 293 | transition: all 0.2s; 294 | } 295 | 296 | .checkmark-container-1{ 297 | margin-left: 8px; 298 | font-size: 14px; 299 | display: flex; 300 | align-items: center; 301 | justify-content: center; 302 | } 303 | 304 | .u-1{ 305 | margin-left: 4px; 306 | } 307 | 308 | .hidden-si-lo-1{ 309 | filter: opacity(0); 310 | transform: scale(0.9); 311 | } 312 | 313 | .go-to-login-container{ 314 | font-family: 'Roboto', sans-serif; 315 | font-size: 14px; 316 | color: #cbe0ff; 317 | margin-top: 40px; 318 | } 319 | 320 | #goToLogin{ 321 | color: #f8fcfd; 322 | /* text-decoration: underline; */ 323 | } 324 | 325 | .go-to-signup-container{ 326 | font-family: 'Roboto', sans-serif; 327 | font-size: 14px; 328 | color: #cbe0ff; 329 | margin-top: 40px; 330 | } 331 | 332 | #goToSignUp{ 333 | color: #f8fcfd; 334 | /* text-decoration: underline; */ 335 | } 336 | 337 | .signUpLoader1{ 338 | display: none; 339 | transform: translateY(32px); 340 | filter: opacity(0); 341 | transition: 0.2s; 342 | } 343 | 344 | .signUpLoader2{ 345 | display: none; 346 | transform: translateY(32px); 347 | filter: opacity(0); 348 | transition: 0.2s; 349 | } 350 | 351 | .bottom-toast-1{ 352 | position: fixed; 353 | bottom: 10px; 354 | left: 10px; 355 | background: #5f95e5; 356 | min-height: 40px; 357 | width: calc(100% - 20px); 358 | border-radius: 6px; 359 | box-shadow: 0px 5px 5px #4081df; 360 | display: flex; 361 | align-items: center; 362 | justify-content: center; 363 | font-size: 14px; 364 | font-family: 'Rubik', sans-serif; 365 | color: #f0f9fb; 366 | padding-left: 20px; 367 | padding-right: 20px; 368 | padding-top: 10px; 369 | padding-bottom: 10px; 370 | text-align: center; 371 | transition: 0.4s; 372 | transform: translateY(100px); 373 | } 374 | 375 | .bottom-toast-1-open{ 376 | transform: translateY(0px); 377 | } 378 | 379 | /* - usernameAddonsCont -> */ 380 | 381 | .username__s_1{ 382 | font-size: 6px; 383 | margin-left: 6px; 384 | margin-right: 6px; 385 | transition: 0.2s; 386 | display: none; 387 | filter: opacity(0); 388 | } 389 | 390 | .username__tick_1{ 391 | font-size: 16px; 392 | transition: 0.2s; 393 | margin-left: 6px; 394 | display: none; 395 | filter: opacity(0); 396 | } 397 | 398 | .username__s_1_L{ 399 | font-size: 6px; 400 | margin-left: 6px; 401 | margin-right: 6px; 402 | transition: 0.2s; 403 | display: none; 404 | filter: opacity(0); 405 | } 406 | 407 | .username__s_2{ 408 | font-size: 12px; 409 | transition: 0.2s; 410 | display: none; 411 | filter: opacity(0); 412 | } 413 | 414 | #usernameAddonsCont{ 415 | display: flex; 416 | align-items: center; 417 | justify-content: center; 418 | transition: 0.4s; 419 | } 420 | 421 | #signUpBtn1{ 422 | overflow: hidden; 423 | } 424 | 425 | #signUpBtn2{ 426 | overflow: hidden; 427 | } 428 | 429 | #signUpText1{ 430 | transition: 0.2s; 431 | } 432 | 433 | #signUpText2{ 434 | transition: 0.2s; 435 | } 436 | 437 | /* Alert */ 438 | 439 | .alert{ 440 | position: fixed; 441 | top: 0; 442 | left: 0; 443 | height: 100vh; 444 | width: 100%; 445 | background: rgb(255 255 255 / 0.2); 446 | display: flex; 447 | align-items: center; 448 | justify-content: center; 449 | transition: 0.1s; 450 | 451 | display: none; 452 | opacity: 0; 453 | } 454 | 455 | .alert-container{ 456 | max-width: 380px; 457 | width: 90%; 458 | background: #fff; 459 | display: flex; 460 | align-items: center; 461 | justify-content: center; 462 | flex-direction: column; 463 | border-radius: 10px; 464 | box-shadow: 2px 2px 8px 2px rgb(0 0 0 / .1); 465 | overflow: hidden; 466 | transition: 0.1s; 467 | transform: scale(0.9); 468 | filter: opacity(0); 469 | } 470 | 471 | .alert-heading-c{ 472 | display: flex; 473 | } 474 | 475 | .alert-heading-icon{ 476 | margin-top: 40px; 477 | margin-right: 10px; 478 | font-size: 20px; 479 | color: #3c6dd9; 480 | margin-bottom: -2px; 481 | } 482 | 483 | .alert-heading{ 484 | color: #4580dc; 485 | font-family: 'Rubik', sans-serif; 486 | margin-top: 40px; 487 | font-size: 18px; 488 | font-weight: bold; 489 | /* width: 80%; */ 490 | text-align: center; 491 | display: flex; 492 | align-items: center; 493 | justify-content: center; 494 | } 495 | 496 | .alert-description{ 497 | max-height: 250px; 498 | overflow-y: scroll; 499 | font-family: 'Rubik', sans-serif; 500 | padding-top: 10px; 501 | padding-bottom: 2px; 502 | font-size: 16px; 503 | padding-right: 10px; 504 | width: 80%; 505 | text-align: center; 506 | color: #636979; 507 | margin-bottom: 20px; 508 | } 509 | 510 | .alert-button{ 511 | font-family: Rubik,sans-serif; 512 | padding-bottom: 16px; 513 | font-size: 16px; 514 | padding-top: 16px; 515 | margin-top: 10px; 516 | width: 100%; 517 | text-align: center; 518 | color: #3c6dd9; 519 | border-top: 1px solid #d6e6ff; 520 | background: #fff; 521 | transition: .1s; 522 | font-weight: bold; 523 | text-transform: uppercase; 524 | } 525 | 526 | /* ToolTip */ 527 | 528 | #tooltipContainer{ 529 | position: fixed; 530 | top: 0; 531 | left: 5%; 532 | width: 90%; 533 | top: 400px; 534 | display: none; 535 | } 536 | 537 | .tooltip{ 538 | filter: opacity(0); 539 | transition: 0.2s; 540 | box-shadow: 1px 3px 20px rgb(29 92 183 / 60%); 541 | 542 | transform: translateY(10px); 543 | } 544 | 545 | .tooltip-text{ 546 | background: aliceblue; 547 | color: #3f80df; 548 | font-family: Rubik,sans-serif; 549 | display: flex; 550 | align-items: center; 551 | justify-content: center; 552 | border-radius: 4px; 553 | font-size: 14px; 554 | padding-top: 8px; 555 | padding-bottom: 8px; 556 | padding-left: 8px; 557 | padding-right: 8px; 558 | text-align: center; 559 | } 560 | 561 | .tooltip-d-arrow{ 562 | position: absolute; 563 | color: aliceblue; 564 | font-size: 30px; 565 | margin-top: -9px; 566 | left: calc(45%); 567 | } 568 | 569 | /* Tooltip 2 */ 570 | 571 | #tooltipContainer2{ 572 | position: fixed; 573 | left: 5%; 574 | width: 90%; 575 | display: none; 576 | bottom: 80px; 577 | } 578 | 579 | .tooltip2{ 580 | filter: opacity(0); 581 | transition: 0.2s; 582 | border-radius: 4px; 583 | 584 | transform: translateY(10px); 585 | } 586 | 587 | .tooltip-text-2{ 588 | background: white; 589 | color: #60596c; 590 | font-family: Rubik,sans-serif; 591 | display: flex; 592 | align-items: center; 593 | justify-content: center; 594 | border-radius: 4px; 595 | font-size: 14px; 596 | padding-top: 8px; 597 | padding-bottom: 8px; 598 | padding-left: 8px; 599 | padding-right: 8px; 600 | text-align: center; 601 | box-shadow: 0px 4px 20px rgb(255 255 255 / 48%); 602 | } 603 | 604 | .tooltip-d-arrow-2{ 605 | position: absolute; 606 | color: white; 607 | font-size: 30px; 608 | margin-top: -9px; 609 | left: calc(45%); 610 | } 611 | 612 | /* Section 2 */ 613 | 614 | .superbody-2{ 615 | position: fixed; 616 | top: 60px; 617 | left: 0; 618 | background: white; 619 | height: 100vh; 620 | width: 100%; 621 | transition: 0.2s; 622 | transform: translateX(100vw); 623 | 624 | overflow-y: scroll; 625 | padding-bottom: 60px; 626 | } 627 | 628 | .section__2{ 629 | background: transparent; 630 | transition: 0.2s; 631 | } 632 | 633 | .title-bar-1{ 634 | display: flex; 635 | align-items: center; 636 | font-family: Rubik ,sans-serif; 637 | background: transparent; 638 | color: #363c43; 639 | padding-left: 10px; 640 | height: 60px; 641 | width: 100vw; 642 | /* box-shadow: 0px 4px 4px rgb(56 123 220 / 14%); */ 643 | } 644 | 645 | .side-menu-icon-1{ 646 | overflow: hidden; 647 | display: flex; 648 | align-items: center; 649 | justify-content: center; 650 | font-size: 20px; 651 | border-radius: 100px; 652 | position: absolute; 653 | height: 50px; 654 | width: 50px; 655 | } 656 | 657 | .title-name-1{ 658 | font-size: 28px; 659 | font-weight: bold; 660 | flex-grow: 1; 661 | } 662 | 663 | /* Top Title Bar - 2 */ 664 | 665 | .title-bar-t{ 666 | display: flex; 667 | align-items: center; 668 | font-family: Rubik ,sans-serif; 669 | background: white; 670 | color: #363c43; 671 | padding-left: 10px; 672 | height: 60px; 673 | width: 100vw; 674 | position: fixed; 675 | top: 0; 676 | left: 0; 677 | /* box-shadow: 0px 4px 4px rgb(56 123 220 / 14%); */ 678 | transform: translateX(100vw); 679 | transition: 0.2s; 680 | } 681 | 682 | .side-menu-icon-t{ 683 | overflow: hidden; 684 | display: flex; 685 | align-items: center; 686 | justify-content: center; 687 | font-size: 20px; 688 | border-radius: 100px; 689 | position: absolute; 690 | height: 50px; 691 | width: 50px; 692 | } 693 | 694 | .title-name-t{ 695 | font-size: 28px; 696 | font-weight: bold; 697 | flex-grow: 1; 698 | transition: 0.2s; 699 | } 700 | 701 | .title-logout-t{ 702 | color: #363c43; 703 | font-size: 24px; 704 | display: flex; 705 | align-items: center; 706 | margin-right: 10px; 707 | transition: 0.2s; 708 | } 709 | 710 | .title-logout-1{ 711 | color: #363c43; 712 | font-size: 24px; 713 | display: flex; 714 | align-items: center; 715 | margin-right: 10px; 716 | transition: 0.1s; 717 | } 718 | 719 | .search-bar-1{ 720 | display: flex; 721 | width: calc(100% - 20px); 722 | align-items: center; 723 | height: 40px; 724 | margin-left: 10px; 725 | margin-right: 10px; 726 | background: #eff5ff; 727 | margin-top: 10px; 728 | margin-right: 10px; 729 | border-radius: 4px; 730 | padding-left: 10px; 731 | border: 2px solid transparent; 732 | } 733 | 734 | .search-icon-c-1{ 735 | margin-right: 10px; 736 | display: flex; 737 | align-items: center; 738 | justify-content: center; 739 | font-size: 16px; 740 | color: #488dff; 741 | } 742 | 743 | .search-input-1{ 744 | display: flex; 745 | align-items: center; 746 | font-size: 16px; 747 | color: #488dff; 748 | } 749 | 750 | #searchInput{ 751 | width: calc(100vw - 80px) !important; 752 | border: 0px solid; 753 | outline: none; 754 | height: 26px; 755 | width: 100%;; 756 | background: transparent; 757 | color: #488dff; 758 | font-family: Rubik , sans-serif; 759 | } 760 | 761 | #searchInput::-webkit-input-placeholder { 762 | color: #488dff; 763 | } 764 | 765 | #searchInput:-ms-input-placeholder { 766 | color: #488dff; 767 | } 768 | 769 | #searchInput::placeholder { 770 | color: #488dff; 771 | } 772 | 773 | .title-logout-1:active{ 774 | filter: opacity(0.4); 775 | } 776 | 777 | /* Messages */ 778 | 779 | #messagesLoaderContainer{ 780 | transition: 0.2s; 781 | display: none; 782 | filter: opacity(0); 783 | } 784 | 785 | .messages-loader{ 786 | width: 100%; 787 | display: flex; 788 | justify-content: center; 789 | transition: 0.2s; 790 | margin-top: 20px; 791 | } 792 | 793 | .groups-container{ 794 | transition: 0.2s; 795 | margin-top: 20px; 796 | display: none; 797 | filter: opacity(0); 798 | } 799 | 800 | .groups-filter-container{ 801 | transition: 0.2s; 802 | margin-top: 20px; 803 | display: none; 804 | } 805 | 806 | .group{ 807 | display: flex; 808 | position: relative; 809 | z-index: 1; 810 | padding-bottom: 4px; 811 | padding-top: 4px; 812 | margin-top: 8px; 813 | margin-bottom: 8px; 814 | transition: 0.2s; 815 | } 816 | 817 | .group:active{ 818 | /* filter: opacity(0.2); */ 819 | } 820 | 821 | .group:before{ 822 | content: ""; 823 | position: absolute; 824 | left: 15%; 825 | bottom: 0; 826 | height: 10px; 827 | width: 80%; 828 | border-radius: 2px; 829 | border-bottom: 2px solid #f9f9f9; 830 | transition: 0.4s; 831 | } 832 | 833 | .group2{ 834 | display: flex; 835 | position: relative; 836 | z-index: 1; 837 | padding-bottom: 4px; 838 | padding-top: 4px; 839 | margin-top: 8px; 840 | margin-bottom: 8px; 841 | transition: 0.2s; 842 | } 843 | 844 | .group2:active{ 845 | /* filter: opacity(0.2); */ 846 | } 847 | 848 | .group2:before{ 849 | content: ""; 850 | position: absolute; 851 | left: 15%; 852 | bottom: 0; 853 | height: 10px; 854 | width: 80%; 855 | border-radius: 2px; 856 | border-bottom: 0px solid #f9f9f9 !important; 857 | transition: 0.4s; 858 | } 859 | 860 | .group-icon-1{ 861 | margin-right: 10px; 862 | } 863 | 864 | .group-icon-image{ 865 | min-height: 52px; 866 | min-width: 52px; 867 | height: 52px; 868 | width: 52px; 869 | margin-left: 10px; 870 | background: #f5f9ff; 871 | border: 2px solid #c0d8ff; 872 | border-radius: 100px; 873 | padding: 2px; 874 | } 875 | 876 | .group-container-2{ 877 | flex-grow: 1; 878 | /* border-bottom: 2px solid #ebebec; */ 879 | } 880 | 881 | .group-title-1{ 882 | font-family: HelveticaNormal; 883 | font-size: 17px; 884 | color: #676b71; 885 | margin-top: 2px; 886 | } 887 | 888 | .group-message-1{ 889 | font-family: 'HelveticaNormal'; 890 | font-size: 13px; 891 | margin-top: 4px; 892 | color: #979798; 893 | } 894 | 895 | .group-container-3{ 896 | margin-right: 10px; 897 | font-family: 'Rubik', sans-serif; 898 | font-size: 11px; 899 | color: #595b5e; 900 | } 901 | 902 | .group-timestamp-1{ 903 | margin-top: 8px; 904 | margin-right: 8px; 905 | } 906 | 907 | /* Section 3 */ 908 | 909 | .superbody-3{ 910 | position: fixed; 911 | top: 0; 912 | left: 0; 913 | background: white; 914 | height: 100vh; 915 | width: 100%; 916 | transition: 0.2s; 917 | transform: translateX(100vw); 918 | margin-right: 10px; 919 | } 920 | 921 | .section__3{ 922 | background: transparent; 923 | transition: 0.4s; 924 | } 925 | 926 | .title-bar-2{ 927 | display: flex; 928 | align-items: center; 929 | font-family: Rubik ,sans-serif; 930 | background: white; 931 | color: #415467; 932 | padding-left: 10px; 933 | height: 50px; 934 | width: 100vw; 935 | /* border-bottom: 2px solid #f3f6fb; */ 936 | /* box-shadow: 0px 4px 4px rgb(246 246 246); */ 937 | } 938 | 939 | .side-menu-icon-2{ 940 | overflow: hidden; 941 | display: flex; 942 | align-items: center; 943 | justify-content: center; 944 | font-size: 20px; 945 | border-radius: 100px; 946 | height: 32px; 947 | width: 32px; 948 | margin-right: 6px; 949 | } 950 | 951 | .title-name-2{ 952 | font-size: 20px; 953 | font-weight: bold; 954 | flex-grow: 1; 955 | } 956 | 957 | /* Chat Screen */ 958 | 959 | .chat-area-1{ 960 | height: calc(100vh - 106px); 961 | width: calc(100% - 12px); 962 | margin-left: 6px; 963 | margin-bottom: 50px; 964 | overflow-y: scroll; 965 | background: #f3f6fb; 966 | border-radius: 6px; 967 | border-bottom: 2px solid #f2f3f5; 968 | background: linear-gradient(180deg, #f3f6fb, #f3f6fb); 969 | } 970 | 971 | .chat-input-container-1{ 972 | position: fixed; 973 | bottom: 0; 974 | left: 6px; 975 | width: calc(100% - 12px); 976 | background: #f3f6fb; 977 | height: 44px; 978 | margin-bottom: 6px; 979 | overflow: hidden; 980 | border-radius: 6px; 981 | } 982 | 983 | .cic-1{ 984 | display: flex; 985 | align-items: center; 986 | height: 44px; 987 | width: 100%; 988 | background: #f3f6fb; 989 | } 990 | 991 | .message-box-container{ 992 | flex-grow: 1; 993 | margin-left: 20px; 994 | } 995 | 996 | .message-input{ 997 | width: 100%; 998 | background: transparent; 999 | outline: none; 1000 | border: 0px solid; 1001 | font-size: 15px; 1002 | color: #5f6375; 1003 | font-family: 'Rubik', sans-serif; 1004 | } 1005 | 1006 | .message-btn-container{ 1007 | margin-right: 10px; 1008 | font-size: 20px; 1009 | display: flex; 1010 | align-items: center; 1011 | justify-content: center; 1012 | color: #88898a; 1013 | height: 40px; 1014 | width: 40px; 1015 | } 1016 | 1017 | .message-input::-webkit-input-placeholder { 1018 | color: #9094a8; 1019 | } 1020 | 1021 | .message-input:-ms-input-placeholder { 1022 | color: #9094a8; 1023 | } 1024 | 1025 | .message-input::placeholder { 1026 | color: #9094a8; 1027 | } 1028 | 1029 | .sender-chat-container{ 1030 | display: flex; 1031 | align-items: flex-end; 1032 | width: 80%; 1033 | margin-bottom: 6px; 1034 | } 1035 | 1036 | .sender-pfp-icon{ 1037 | height: 36px; 1038 | width: 36px; 1039 | display: flex; 1040 | align-items: center; 1041 | justify-content: center; 1042 | background: #F15946; 1043 | border-radius: 100px; 1044 | min-height: 40px; 1045 | min-width: 40px; 1046 | font-family: 'Rubik', sans-serif; 1047 | color: white; 1048 | font-size: 18px; 1049 | margin-left: 10px; 1050 | margin-bottom: 0px; 1051 | } 1052 | 1053 | .sender-pfp-icon-2{ 1054 | height: 36px; 1055 | width: 36px; 1056 | display: flex; 1057 | align-items: center; 1058 | justify-content: center; 1059 | background: #F15946; 1060 | border-radius: 100px; 1061 | min-height: 40px; 1062 | min-width: 40px; 1063 | font-family: 'Rubik', sans-serif; 1064 | color: white; 1065 | font-size: 18px; 1066 | margin-left: 10px; 1067 | margin-bottom: 20px; 1068 | } 1069 | 1070 | .sender-msg-container{ 1071 | margin-left: 10px; 1072 | margin-right: 10px; 1073 | font-family: 'Rubik', sans-serif; 1074 | background: white; 1075 | border-radius: 3px; 1076 | padding-top: 4px; 1077 | padding-bottom: 4px; 1078 | padding-right: 6px; 1079 | padding-left: 10px; 1080 | border-top-left-radius: 12px; 1081 | border-top-right-radius: 12px; 1082 | border-bottom-right-radius: 12px; 1083 | box-shadow: 0px 2px 2px #e9ecf0; 1084 | min-width: 60px; 1085 | } 1086 | 1087 | .sender-msg-container-2{ 1088 | margin-left: 10px; 1089 | margin-right: 10px; 1090 | font-family: 'Rubik', sans-serif; 1091 | border-radius: 3px; 1092 | border-top-left-radius: 12px; 1093 | border-top-right-radius: 12px; 1094 | border-bottom-right-radius: 12px; 1095 | position: relative; 1096 | } 1097 | 1098 | .sender-msg-container-2 .sender-time{ 1099 | display: flex; 1100 | align-items: center; 1101 | justify-content: flex-end; 1102 | position: absolute; 1103 | bottom: 24px; 1104 | right: 16px; 1105 | background: rgb(53 52 50 / 63%); 1106 | color: #e5f0ff !important; 1107 | padding-left: 6px; 1108 | padding-right: 6px; 1109 | padding: 4px; 1110 | border-radius: 5px; 1111 | position: absolute; 1112 | } 1113 | 1114 | .sender-msg-container-2 .sender-name{ 1115 | margin-bottom: -10px; 1116 | margin-bottom: -4px; 1117 | margin-left: 8px; 1118 | } 1119 | 1120 | .sender-name{ 1121 | font-size: 14px; 1122 | color: #f15946; 1123 | margin-bottom: 4px; 1124 | font-size: 12px; 1125 | display: flex; 1126 | align-items: center; 1127 | justify-content: end; 1128 | font-weight: 100; 1129 | } 1130 | 1131 | .sender-message{ 1132 | word-break: break-all; 1133 | color: #696e81; 1134 | font-size: 14px; 1135 | font-family: 'Roboto', sans-serif; 1136 | } 1137 | 1138 | .sender-time{ 1139 | font-size: 10px; 1140 | margin-top: 4px; 1141 | display: flex; 1142 | align-items: center; 1143 | justify-content: flex-end; 1144 | margin-right: 4px; 1145 | color: #9398aa; 1146 | } 1147 | 1148 | .chat-box-item:nth-of-type(1){ 1149 | margin-top: 8px; 1150 | } 1151 | 1152 | .rec-chat-container{ 1153 | display: flex; 1154 | align-items: center; 1155 | justify-content: flex-end; 1156 | margin-bottom: 6px; 1157 | } 1158 | 1159 | .rec-m-m-c-1{ 1160 | display: flex; 1161 | align-items: flex-end; 1162 | background: #2b88ff; 1163 | margin-right: 10px; 1164 | border-radius: 3px; 1165 | border-top-left-radius: 12px; 1166 | border-top-right-radius: 12px; 1167 | border-bottom-left-radius: 12px; 1168 | overflow: hidden; 1169 | padding-top: 10px; 1170 | padding-bottom: 10px; 1171 | padding-right: 10px; 1172 | padding-left: 14px; 1173 | color: #eff6ff; 1174 | font-family: 'Rubik', sans-serif; 1175 | font-size: 14px; 1176 | max-width: 72%; 1177 | box-shadow: 0px 0px 6px 2px rgb(205 218 255 / 71%); 1178 | } 1179 | 1180 | .rec-m-m-c-2{ 1181 | display: flex; 1182 | align-items: flex-end; 1183 | background: #cddaff00 !important; 1184 | border-top-left-radius: 16px; 1185 | border-top-right-radius: 16px; 1186 | border-bottom-left-radius: 16px; 1187 | color: #eff6ff; 1188 | font-family: 'Rubik', sans-serif; 1189 | font-size: 14px; 1190 | max-width: 72%; 1191 | position: relative; 1192 | flex-direction: column; 1193 | height: 180px; 1194 | width: 180px; 1195 | border-radius: 100px; 1196 | margin-bottom: 0px; 1197 | } 1198 | 1199 | .s-n--2{ 1200 | color: #a2a7b9; 1201 | border: 1px solid #c0c3d2; 1202 | background: rgb(249 249 249 / 33%); 1203 | padding: 1px; 1204 | border-radius: 100px; 1205 | padding-left: 8px; 1206 | padding-right: 8px; 1207 | font-size: 9px; 1208 | margin-left: 4px; 1209 | } 1210 | 1211 | .rec-time{ 1212 | font-size: 9px; 1213 | color: #b6d3f9; 1214 | margin-left: 8px; 1215 | font-family: 'HelveticaNormal'; 1216 | } 1217 | 1218 | .rec-time-2{ 1219 | font-size: 9px; 1220 | margin-left: 8px; 1221 | font-family: 'HelveticaNormal'; 1222 | position: absolute; 1223 | bottom: 20px; 1224 | right: 20px; 1225 | background: rgb(53 52 50 / 63%); 1226 | padding: 4px; 1227 | border-radius: 5px; 1228 | color: #e5f0ff !important; 1229 | padding-left: 6px; 1230 | padding-right: 6px; 1231 | } 1232 | 1233 | .chat-a-up-c{ 1234 | background: transparent; 1235 | position: fixed; 1236 | top: 60px; 1237 | left: 10px; 1238 | width: calc(100% - 20px); 1239 | display: flex; 1240 | align-items: center; 1241 | justify-content: center; 1242 | } 1243 | 1244 | .chat-aupc-text{ 1245 | font-size: 14px; 1246 | font-family: 'Rubik', sans-serif; 1247 | background: #fbfdff; 1248 | padding: 2px; 1249 | padding-left: 20px; 1250 | padding-right: 20px; 1251 | border-radius: 4px; 1252 | color: #605467; 1253 | } 1254 | 1255 | .s-n--1{ 1256 | margin-right: 2px; 1257 | } 1258 | 1259 | .load{ 1260 | /* margin-right: 20px; */ 1261 | font-size: 20px; 1262 | display: flex; 1263 | align-items: center; 1264 | justify-content: center; 1265 | animation: rotating 0.5s linear infinite; 1266 | } 1267 | 1268 | .messageBBLoading4{ 1269 | height: 40px; 1270 | width: 40px; 1271 | margin-right: 10px; 1272 | font-size: 20px; 1273 | display: flex; 1274 | align-items: center; 1275 | justify-content: center; 1276 | display: none; 1277 | animation: rotating 0.5s linear infinite; 1278 | } 1279 | 1280 | @keyframes rotating { 1281 | from{ 1282 | transform: rotate(0deg); 1283 | } 1284 | to{ 1285 | transform: rotate(360deg); 1286 | } 1287 | } 1288 | 1289 | #stickerOptsContainer{ 1290 | display: none; 1291 | } 1292 | 1293 | .sticker-ni-1{ 1294 | margin-left: 10px; 1295 | font-size: 20px; 1296 | display: flex; 1297 | align-items: center; 1298 | justify-content: center; 1299 | color: rgb(136 137 138); 1300 | height: 40px; 1301 | width: 40px; 1302 | } 1303 | 1304 | .sticker-opts-container{ 1305 | position: fixed; 1306 | bottom: 54px; 1307 | left: 10px; 1308 | width: calc(100% - 20px); 1309 | } 1310 | 1311 | .sticker{ 1312 | /* background: #e2e4ea; */ 1313 | height: 110px; 1314 | width: 110px; 1315 | display: flex; 1316 | align-items: center; 1317 | justify-content: center; 1318 | border-radius: 6px; 1319 | margin-left: 6px; 1320 | transition: 0.2s; 1321 | padding: 4px; 1322 | } 1323 | 1324 | @keyframes stickerAnimation{ 1325 | 0%{ 1326 | filter: opacity(0); 1327 | } 1328 | 100%{ 1329 | filter: opacity(1); 1330 | } 1331 | } 1332 | 1333 | .sticker:nth-of-type(12){ 1334 | /* margin-right: 10px; */ 1335 | } 1336 | 1337 | .sticker:active{ 1338 | filter: opacity(0.4); 1339 | } 1340 | 1341 | .sticker-img{ 1342 | height: 110px; 1343 | width: 110px; 1344 | border-radius: 6px; 1345 | } 1346 | 1347 | .div-mr-6p{ 1348 | height: 4px; 1349 | width: 4px; 1350 | min-width: 4px; 1351 | max-width: 4px; 1352 | color: transparent; 1353 | margin-left: -18px; 1354 | } 1355 | 1356 | .sticker-opts-c-2{ 1357 | background: #ffffff; 1358 | height: 120px; 1359 | margin-bottom: 6px; 1360 | overflow: hidden; 1361 | overflow-x: scroll; 1362 | border-radius: 6px; 1363 | display: flex; 1364 | align-items: center; 1365 | transition: 0.2s; 1366 | transform: translateY(10px); 1367 | filter: opacity(0); 1368 | /* box-shadow: 0px 4px 20px #f3f6fb; */ 1369 | } 1370 | 1371 | /* Stickers + */ 1372 | 1373 | .sender-gif-img{ 1374 | width: 160px; 1375 | height: 160px; 1376 | border-radius: 6px; 1377 | margin-right: 10px; 1378 | margin-top: 10px; 1379 | margin-bottom: 10px; 1380 | box-shadow: 0px 0px 6px 2px rgb(205 218 255 / 47%); 1381 | border: 4px solid white; 1382 | border-radius: 10px; 1383 | overflow: hidden; 1384 | } 1385 | 1386 | .rec-msg-c{ 1387 | word-break: break-all; 1388 | } 1389 | --------------------------------------------------------------------------------