Alert App
by Dhanck
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!--
<input type="file" accept="audio/*;capture=microphone">
<img src="https://beta.met.police.uk/UI/assets/dist/img/logo.png" />
-->
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="#">About</a>
<a href="#">Services</a>
<a href="#">Clients</a>
<a href="#">Contact</a>
</div>
<div class="menu">
<span class="glyphicon glyphicon-th-large" onclick="openNav()"></span>
<div id="demo" class="latlon"></div>
<span class="glyphicon glyphicon-user pull-right"></span>
</div>
<div class="urgent-btn">
<span class="glyphicon glyphicon-alert"></span>
</div>
<div class="">
<div class="friend"><span class="glyphicons glyphicons-parents"></span>Friend</div>
<div class="police"><span class="glyphicons glyphicons-police"></span>Police</div>
<div class="fire"><span class="glyphicons glyphicons-firefighters"></span>Fire</div>
<div class="ambulance"><span class="glyphicons glyphicons-ambulance"></span>Ambulance</div>
</div>
<br>
<div class="">
<div class="friend_panel" style="display:none;">Friend</div>
<div class="police_panel" style="display:none;">Police</div>
<div class="fire_panel" style="display:none;">Fire</div>
<div class="ambulance_panel" style="display:none;">Ambulance</div>
</div>
CSS
body{
background-color:#0032a0; //#dc4228 Red
}
.circle {
width: 14px;
height: 14px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
margin: 0 auto;
background-color: #999;
float:left;
margin:10px;
}
.warning {
background-color: #fb7a24;
color:#fff;
}
.ok {
background-color: #4F9E38;
color:#fff;
}
.error {
background-color: #c42033;
color:#fff;
}
.latlon {
display: block;
text-align:center;
margin-top: 15px;
color: #cacaca;
}
.menu span{
color:#fff;
font-size:14px;
cursor:pointer;
}
.urgent-btn{
text-align:center;
}
.urgent-btn span{
color:#fff;
font-size: 90px;
height: 160px;
width:160px;
border:12px solid #fff;
border-radius:50%;
text-align:center;
padding-top:12px;
}
/* The side navigation menu */
.sidenav {
height: 100%; /* 100% Full-height */
width: 0; /* 0 width - change this with JavaScript */
position: fixed; /* Stay in place */
z-index: 1; /* Stay on top */
top: 0;
left: 0;
background-color: #111; /* Black*/
overflow-x: hidden; /* Disable horizontal scroll */
padding-top: 60px; /* Place content 60px from the top */
transition: 0.5s; /* 0.5 second transition effect to slide in the sidenav */
}
/* The navigation menu links */
.sidenav a {
padding: 8px 8px 8px 32px;
text-decoration: none;
font-size: 25px;
color: #818181;
display: block;
transition: 0.3s
}
/* When you mouse over the navigation links, change their color */
.sidenav a:hover, .offcanvas a:focus{
color: #f1f1f1;
}
/* Position and style the close button (top right corner) */
.sidenav .closebtn {
position: absolute;
top: 0;
right: 25px;
font-size: 36px;
margin-left: 50px;
}
/* Style page content - use this if you want to push the page content to the right when you open the side navigation */
#main {
transition: margin-left .5s;
padding: 20px;
}
/* On smaller screens, where height is less than 450px,...
JavaScript
var x = document.getElementById("demo");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
x.innerHTML = "Latitude: " + position.coords.latitude +
" Longitude: " + position.coords.longitude;
}
getLocation();
/* Set the width of the side navigation to 250px */
function openNav() {
document.getElementById("mySidenav").style.width = "250px";
}
/* Set the width of the side navigation to 0 */
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
}
$('.friend').click(function(){
$('.friend_panel').show();
$('.police_panel, .fire_panel, .ambulance_panel').hide();
})
$('.police').click(function(){
$('.police_panel').show();
$('.friend_panel, .fire_panel, .ambulance_panel').hide();
})
$('.fire').click(function(){
$('.fire_panel').show();
$('.police_panel, .friend_panel, .ambulance_panel').hide();
})
$('.ambulance').click(function(){
$('.ambulance_panel').show();
$('.police_panel, .fire_panel, .friend_panel').hide();
})