Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <html lang="en" >
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Angular Material style sheet -->
  <link rel="stylesheet" href="">
  <link href="" rel="stylesheet">
<body ng-app="weatherApp" ng-controller="WeatherController" data-ng-init="getLocation()">
  <!--------  Today's theme --------->
  <div layout="row" class="theme" layout-align="center center">Day 37: Local Weather App, Day38: Calendar</div>
  <!--------  Working area --------->
  <div class="working-area">
      <div ng-click="changeUnit()">
        <h2 layout="row" layout-align="center center">{{ temp }}°{{ unit }} </h2>
      <h3 layout="row" layout-align="center center">{{ condition }} </h3>
      <h3 layout="row" layout-align="center center">{{ location }}</h3>
      <h2 layout="row" layout-align="center center">{{ date | date:'EEE d-MMM'}}</h2> 
  <!--------  Footer --------->
  <div id="footer_container">
    <div layout="row" layout-align="center center"><h3>Youtube tutorial <a href="" target="_blank"> here!</a></h3></div><br>
    <div layout="row" layout-align="center center">Created by Eleftheria</div>
    <div layout="row" layout-align="center center" class="footer">

        <!-- Linkedin -->
        <a href="" target="_blank"><img src="" class="footer_image" alt="linkedin" title="linkedin"></a> ~
        <!-- Codepen -->
        <a href="" target="_blank"><img src="" class="footer_image" alt="codepen" title="codepen"></a> ~
        <!-- Youtube -->
        <a href="" target="_blank"><img src="" class="footer_image" alt="youtube" title="youtube"></a> ~
        <!-- Twitter -->
        <a href="" target="_blank"><img src="" class="footer_image" alt="twitter" title="twitter"></a> ~
        <!-- Github -->
        <a href="" target="_blank"><img src="" class="footer_image" alt="github" title="github"></a> ~ 
        <!-- Instagram -->
        <a href="" target="_blank"><img src="" class="footer_image" alt="instagram" title="instagram"></a> ~
      <!-- Website -->
        <a href="" target="_blank"><img src="" class="footer_image" alt="website" title="website"></a>




                body {
 background-image: linear-gradient(to right bottom, #dc1767, #ac3086, #6f428f, #31457f, #003e60);
  color: white !important;
  font-family: 'Pacifico', cursive; 

.theme {
  padding: 32px 0;
  font-family: 'Pacifico', cursive; 

h2 {
  color: #ac3086;
  padding: 8px;

h3 {
  color: lightcyan;
  padding: 16px;

.working-area {
  width: 350px;
  height: 300px;
  margin: 0 auto;
  background-image: linear-gradient(to right bottom, #ff7cb1, #e69ae3, #c3b7ff, #aacfff, #abe1ff);
  padding: 16px;
  border-radius: 8px;

#footer_container {
  font-family: 'Pacifico', cursive; 
.footer .footer_image {
  height: 24px;
  text-align: center;
  padding: 4px;

.footer .footer_image:hover,
#footer_container a:hover {
  background-color: lightblue;
#footer_container a:link,
#footer_container a:active{
  color: #dc1767;



                angular.module('weatherApp', ['ngMaterial', 'ngMessages'])

.controller('WeatherController', function($scope, $http, $interval) {
  $scope.unit = "c";
  $scope.condition = "Requires location tracking to load";
  $scope.currentC = 0;
  $scope.currentF = 0;
  $scope.loadedTemp = false;
  $scope.getLocation = function() {
    $scope.loadedTemp = false;
      if (navigator.geolocation) {
        const options = {
          enableHighAccuracy: false,
          timeout: 8000,
          maximumAge: 0
        navigator.geolocation.getCurrentPosition($scope.getWeather, handleErrors, options); 
      } else { 
        console.log("Geolocation is not supported by this browser.");
        $scope.condition = "Geolocation is not supported by this browser.";
  $scope.getWeather = function(position) {
    const lat = position.coords.latitude;
    const lon = position.coords.longitude;
      method : "GET",
      url : "" + lat + ", " + lon
    }).then(function success(response) {

  function setLocation(data) {
    $scope.condition = data.current.condition.text;
    $ =;
    $scope.location =;

  function setTemp(data) {
    $scope.loadedTemp = true;

  function setC(data) {
    const resultC = Math.round(data.current.temp_c,2);
    $scope.temp = resultC;
    $scope.currentC = resultC;

  function setF(data) {
    const resultF = Math.round(data.current.temp_f,2);
    $scope.temp = resultF;
    $scope.currentF = resultF;

  $scope.changeUnit = function() {
    $scope.temp = " ";
    if($scope.unit === "c") {
      $scope.unit = "f";
      $scope.temp = $scope.currentF;
    } else {
      $scope.unit = "c";
      $scope.temp = $scope.currentC;

  $interval($scope.getLocation, 20000);

  function showError(error) {
    $scope.condition = error;

  function handleErrors(error) {
    switch(error.code) {
      case error.PERMISSION_DENIED:
        showError("User denied the request for Geolocation.");
      case error.POSITION_UNAVAILABLE:
        showError("Location information is unavailable.");
      case error.TIMEOUT:
        showError("The request to get user location timed out.");
      case error.UNKNOWN_ERROR:
        showError("An unknown error occurred.");

// PLease note that the Javascript code is NOT written by me, 
//but it can be found here: