experiments

All kinds of coding experiments
Log | Files | Refs | Submodules

App.svelte (511B)


      1 <script>
      2 	import api from './api'
      3 	export let greeting;
      4 	let fullGreeting;
      5 	api.getGreeting(greeting, "World").then(fg => fullGreeting = fg);
      6 </script>
      7 
      8 <main>
      9 	<h1 style="display: {fullGreeting ? 'block' : 'none'};">{fullGreeting}!</h1>
     10 </main>
     11 
     12 <style>
     13 	main {
     14 		text-align: center;
     15 		padding: 1em;
     16 		max-width: 240px;
     17 		margin: 0 auto;
     18 	}
     19 
     20 	h1 {
     21 		color: #ff3e00;
     22 		text-transform: uppercase;
     23 		font-size: 4em;
     24 		font-weight: 100;
     25 	}
     26 
     27 	@media (min-width: 640px) {
     28 		main {
     29 			max-width: none;
     30 		}
     31 	}
     32 </style>