Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

Save Automatically?

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

              
                <! -- template by: https://tailwindcomponents.com/component/weather-ui-component -->
	<div class="min-h-screen flex items-center justify-center bg-gray-50">
		<div class="flex flex-col bg-white rounded p-4 w-full max-w-xs shadow-2xl" x-data="temp()" x-init="init()">
			<div class="font-bold text-xl" x-text="`${temp.name}`">n/a</div>
			<div class="mt-6 text-6xl self-center inline-flex items-center justify-center rounded-lg text-indigo-400">
				<img :src="`https://openweathermap.org/img/w/${temp.weather[0].icon}.png`" class="" alt="">
			</div>
			<div class="flex flex-row items-center justify-center mt-6">
				<div class="font-medium text-5xl" x-text="`${parseInt(temp.main.temp)}°C`">n/a</div>
				<div class="flex flex-col items-center ml-6">
					<div x-text="`${temp.weather[0].main}`">n/a</div>
					<div class="mt-1">
						<span class="text-sm"><i class="far fa-long-arrow-up"></i></span>
						<span class="text-sm font-light text-gray-500" x-text="`${parseInt(temp.main.temp_max)}°C (max)`">n/a</span>
					</div>
					<div>
						<span class="text-sm"><i class="far fa-long-arrow-down"></i></span>
						<span class="text-sm font-light text-gray-500" x-text="`${parseInt(temp.main.temp_min)}°C (min)`">n/a</span>
					</div>
				</div>
			</div>
			<div class="flex flex-row justify-between mt-6">
				<div class="flex flex-col items-center">
					<div class="font-medium text-sm">Wind</div>
					<div class="text-sm text-gray-500" x-text="`${temp.wind.speed}k/h`">n/a</div>
				</div>
				<div class="flex flex-col items-center">
					<div class="font-medium text-sm">Humidity</div>
					<div class="text-sm text-gray-500" x-text="`${temp.main.humidity}%`">n/a</div>
				</div>
				<div class="flex flex-col items-center">
					<div class="font-medium text-sm">Feels like</div>
					<div class="text-sm text-gray-500" x-text="`${parseInt(temp.main.feels_like)}°C`">n/a</div>
				</div>
			</div>
		</div>
	</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                function temp() {
	return {
		temp: {},
		init() {
			fetch(
				"https://api.openweathermap.org/data/2.5/weather?q=Montevideo,UY&appid=<api_key>&units=metric"
			)
				.then((response) => response.json())
				.then((response) => {
					this.temp = response;
				});
		}
	};
}

              
            
!
999px

Console