Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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

              
                <div class="container">
   <header>
      <h1>Demo Widget TorinoMeteo</h1>
      <h2>Default widget</h2>
   </header>
   <p>Modifica il valore delle variabili definite nella tab CSS per personalizzare il widget.<br />Preleva poi il CSS compilato (tab CSS, freccia in alto a destra) per utilizzarlo sul tuo sito (rimuovi gli stili di sola presentazione).</p>
   </p>
   <p>Modifica gli attributi del tag <code>tmrealtime</code> per cambiare le icone o sostituirle con delle scritte.</p>
   <div class="widget-container">
      <tmrealtime
         lastMeasureLabel="<i class='wi wi-time-1'></i>"
         temperatureLabel="<i class='wi wi-thermometer'></i>"
         rhLabel="<i class='wi wi-humidity'></i>"
         pressureLabel="<i class='wi wi-barometer'></i>"
         windLabel="<i class='wi wi-strong-wind'></i>"
         rainRateLabel="<i class='wi wi-raindrops'></i>"
         rainLabel="<i class='wi wi-umbrella'></i>"
         station="san-maurizio-canavese"
      />
   </div>
</div>
              
            
!

CSS

              
                // settings versione 1
$logo-bg: #2e3338;
$title-bg: #04325f; // colore titolo (Torino Regio Parco)
$title-color: #fff; // sfondo titolo
$date-bg: #04325f; // sfondo data ultima rilevazione
$date-color: #ffff00; // colore data
$date-border-color: #333;
$body-bg: #fafafa; // sfondo dati
$body-color: #000; // colore dati
$icons-color: #666; // colore icone
$temp-cold-color: #3333aa; // colore temperature [-273.15, 10)
$temp-warm-color: #ff9900; // colore temperature [10, 20)
$temp-hot-color: #ff0000;  // colore temperature [20, ∞)

/* // rimuovi il commento per la seconda versione
// settings versione 2
$title-bg: #fff; // colore titolo (Torino Regio Parco)
$title-color: #cc0000; // sfondo titolo
$date-bg: #ffaaaa; // sfondo data ultima rilevazione
$date-color: #cc0000; // colore data
$date-border-color: #fff;
$body-bg: #fff; // sfondo dati
$body-color: #666; // colore dati
$icons-color: #cc0000; // colore icone
$temp-cold-color: #3333aa; // colore temperature [-273.15, 10)
$temp-warm-color: #ff9900; // colore temperature [10, 20)
$temp-hot-color: #ff0000;
*/

// widget container
.widget-container {
  display: inline-block;
  margin: 3rem auto;
  text-align: left;
  width: 400px;
  max-width: 100%;
}

// tm-widgets
.tm-realtime-widget {
  font-family: 'Titillium Web';
  font-size: 1.1rem;
  width: 100%;
  background: $body-bg;
  color: $body-color;
}

.tm-realtime-widget header > div {
  background: $logo-bg !important;
  padding: 8px;
  text-align: center;
}

.tm-realtime-widget header > div img {
  max-height: 50px;
}

.tm-realtime-widget h1 {
  background: $title-bg;
  text-align: center;
  font-size: 1.2rem;
  margin: 0;
  padding: 8px;
  color: $title-color;
}

.tm-realtime-last-measure {
  text-align: center;
  background: $date-bg;
  border-top: 1px solid $date-border-color;
  color: $date-color;
}

.tm-realtime-data {
  display: table;
  width: 100%;
}
.tm-realtime-data .wi {
   color: $icons-color;
}
.tm-realtime-data > div {
  display: table-row;
}
.tm-realtime-data .tm-realtime-label {
  display: table-cell;
  text-align: right;
  min-width: 35%;
  padding: 8px;
}
.tm-realtime-value {
  display: table-cell;
  padding: 8px;
}

.tm-realtime-temperature .tm-realtime-value {
  font-size: 1.2rem;
  font-weight: bold;
}

.tm-temp-cold {
  color: $temp-cold-color;
}
.tm-temp-warm {
  color: $temp-warm-color;
}
.tm-temp-hot {
  color: $temp-hot-color;
}

span[class^="direction-"]::before {
  content: '\f0b1';
  font-family: 'weathericons';
  display: inline-block;
  margin-right: 5px;
}

.direction-up-right::before {
  transform: rotate(45deg);
}

.direction-right::before {
  transform: rotate(90deg);
}

.direction-down-right::before {
  transform: rotate(135deg);
}

.direction-down::before {
  transform: rotate(180deg);
}

.direction-down-left::before {
  transform: rotate(225deg);
}

.direction-left::before {
   transform: rotate(270deg);
}

.direction-up-left::before {
   transform: rotate(315deg);
}

// presentational
body {
   margin: 0;
   padding: 0;
   font-family: 'Ubuntu', sans-serif;
   text-align: center;
   
   .container {
      margin: auto;
      max-width: 800px;
   }
   
   > header {
      background-color: #fafafa;
      color: #444;
      padding: 16px;
      text-align: center;
   
      .logo {
         height: 50px;
      }
   
      h1 {
         font-size: 1.4rem;
      }
   }
}



              
            
!

JS

              
                
              
            
!
999px

Console