FireBase Demo
How do I make an firebase demo?
What is a firebase demo? How do you make a firebase demo? This script and codes were developed by Robert on 04 September 2022, Sunday.
FireBase Demo - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>FireBase Demo</title> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'>
<link rel='stylesheet prefetch' href='http://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.3/animate.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <html>
<head>
</head>
<body> <div class="container"> <div class="topBar"> <ul> <li class="corners" id="add"> <img src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTO2mXv6Imc6Mtqzj9T8L9_-bGqwH4jhQ3GreN9yXXlI2IMa7VneA" width="24px" alt="" /> </li> <li id="msg"> <input type='text' id='nameInput' placeholder='Enter UserName'> </li> <li class="corners ends" id="status"> <div class="light"></div> </li> </ul> </div> <div class="msgContainer"> <div id="messagesDiv"></div> </div> <div class="controlBar"> <ul> <li class="corners" id="add"> <img src="https://cdn4.iconfinder.com/data/icons/ionicons/512/icon-person-add-512.png" width="24px" alt="" /> </li> <li id="msg"> <input type='text' id='messageInput' placeholder='Message'> </li> <li class="corners ends" id="send"> <a href="#" onclick="addMsg();">Send</a> </li> </ul> </div> </div>
</body>
</html> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://cdn.firebase.com/js/client/2.2.1/firebase.js'></script> <script src="js/index.js"></script>
</body>
</html>
FireBase Demo - Script Codes CSS Codes
@import url(https://fonts.googleapis.com/css?family=Lato);
html, body { width: 100%; height: 98%; background-image: url("http://cu.t-ads.org/wp-content/uploads/2015/02/effective-communication.jpg"); background-repeat:no-repeat; background-size: cover;
/* background-attachment: fixed; */ background-color: darkgray;
}
body { font-family: 'Lato', sans-serif;
}
ul { padding: 0px; margin: 0px;
}
li { list-style: none; float: left;
}
li:not(.ends) { border-right: 1px solid rgba(0,0,0,.05);
}
input { border: none; width: 320px; margin-left: 10px; height: 30px; font-size: .85em;
}
input:focus{ outline: none;
}
.container { width: 450px; height: 450px; margin-top: 20px;
/*position: relative; top: 50%; left:50%; transform: translate(-50%, -50%); */ border-radius: 10px; background: rgba(0,0,0,.05); padding: 0px; border: 1px solid rgba(0,0,0,.05); overflow: hidden;
}
.topBar, .controlBar {
/* position: fixed; bottom: 0px;*/ background: white; border-top-radius: 10px; height: 40px; padding: 5px;
}
.light { border-radius: 50%; background: lightgray; width: 10px; height: 10px; margin: 5px auto;
}
.lightOn { background: green;
}
.corners { width: 50px; font-size: 1.5em; text-align: center; color: darkgray;
}
.ends { margin-left: 5px; margin-top: 5px; font-size: 1em;
}
.msgContainer { height: 370px; padding: 10px; background: rgba(0,0,0,.8); color: white;
}
FireBase Demo - Script Codes JS Codes
var myDataRef = new Firebase('https://wnmpre3jtnc.firebaseio-demo.com/');
$('#messageInput').keypress(function(e) { if (e.keyCode == 13) { addMsg(); }
});
$('#nameInput').on('blur', function(){ console.log("Name: " + $(this).val().length); if($(this).val().length > 0){ $('.light').css({background: 'lime', border: '1px solid darkgray'}); }
});
function addMsg(e){ var name = $('#nameInput').val(); var text = $('#messageInput').val(); if(name.length > 0){ myDataRef.push({ name: name, text: text }); // ---------------------------- $('#messageInput').val(''); } else { $('#nameInput').focus(); }
}
function displayChatMessage(name, text) { $('<div/>').text(text).prepend($('<em/>').text(name + ': ')).appendTo($('#messagesDiv')); $('#messagesDiv')[0].scrollTop = $('#messagesDiv')[0].scrollHeight;
};
myDataRef.on('child_added', function(snapshot) { var message = snapshot.val(); displayChatMessage(message.name, message.text);
});
Developer | Robert |
Username | AgentRR007 |
Uploaded | September 04, 2022 |
Rating | 3 |
Size | 3,081 Kb |
Views | 20,240 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
CountDown | 4,688 Kb |
Online - Offline Simulator | 2,407 Kb |
RegExp in Angular Tester | 3,618 Kb |
Spanish X-mas Word Game | 6,137 Kb |
Interface Animation | 3,829 Kb |
UI Challenge - Budget Selector | 3,547 Kb |
Angular Alarm | 5,760 Kb |
UI Challenge - Menu Expander | 2,387 Kb |
Angular Template | 2,104 Kb |
Santa, my house is over here... | 2,419 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
UI Challenge - Budget Selector | AgentRR007 | 3,547 Kb |
A Pen by Alex Edwards | Exards | 8,218 Kb |
Donald Trump - The New Yorker | Agbales | 2,502 Kb |
Loading animation - freedom purchase | Rocbear | 2,567 Kb |
GLSL Hills | Ykob | 6,991 Kb |
Welcome | Nakome | 6,076 Kb |
Search field | Jamesbarnett | 2,100 Kb |
Flexbox playground | Enxaneta | 5,418 Kb |
Day 11 - Calendar Card | Arnellebalane | 6,984 Kb |
Simple Flat Menu | Jeplaa | 2,467 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!