diff --git a/css/stylesheet.css b/css/stylesheet.css index 7122ff1..7b740c1 100644 --- a/css/stylesheet.css +++ b/css/stylesheet.css @@ -1,9 +1,9 @@ body { - background: #eee; + background: rgb(243, 238, 238); font-family: Roboto, "Helvetica Neue", sans-serif; } -h2 { +#title { color: #7c795d; font-family: 'Source Sans Pro', sans-serif; font-size: 32px; @@ -56,3 +56,17 @@ h2 { #out * { margin-top: 10px; } + +#myButton1 { + background-color: rgb(0, 5, 0); /* Green */ + border: none; + color: white; + padding: 15px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + margin: 4px 2px; + cursor: pointer; + border-radius: 50%; + } diff --git a/index.html b/index.html index 9b9e62d..8c5e23a 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,9 @@ Geolocator for FOSSASIA -

Geo locator to faciliate easy integration of location data

+ +

Geo locator to faciliate easy integration of location data

+



diff --git a/js/main.js b/js/main.js index 3720e3f..cdbf323 100644 --- a/js/main.js +++ b/js/main.js @@ -1,12 +1,13 @@ let output = document.getElementById("output"); let out = document.getElementById("out") +let flag = 1 + const geolocation = () => { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(rit, fileit); document.getElementById("button").value = "Get my geolocation again"; document.getElementById("button").onclick = "window.location.reload();"; // reloads and executes the geolocation(); - } - else { + } else { output.innerHTML = "Geolocation is not supported by this browser"; output.style.display = "inherit"; } @@ -47,4 +48,22 @@ const fileit = (error) => { output.innerHTML = "Unknown Error please try again"; break; } -} \ No newline at end of file +} + +const changeBodyBg = () => { + const background = flag? 'black' : '#eee'; + const title = flag?'white': '#7c795d'; + const btn_value = flag? 'Light': 'Dark'; + const btn_back = flag? 'white' : 'black'; + const btn_clr = flag? 'black': 'white'; + + + document.body.style.background = background; + document.getElementById("title").style.color = title; + + const btn = document.getElementById("myButton1"); + btn.value = btn_value; + btn.style.background = btn_back; + btn.style.color = btn_clr; + flag=flag? 0:1; +}