development #3

Merged
luke-else merged 53 commits from development into main 2025-02-01 13:00:04 +00:00
4 changed files with 27 additions and 7 deletions
Showing only changes of commit b2b56480b8 - Show all commits

10
rollup.config.js Normal file
View File

@ -0,0 +1,10 @@
import json from '@rollup/plugin-json';
export default {
input: 'src/index.js',
output: {
dir: 'output',
format: 'cjs'
},
plugins: [json()]
};

5
src/lib/data.ts Normal file
View File

@ -0,0 +1,5 @@
export async function getJson(path: string) {
let response = await fetch(path);
let users = await response.json();
return users;
}

View File

@ -1,5 +1,5 @@
<script>
import * as info from '../static/json/me.json';
import { getJson } from "$lib/data"
</script>
<style>
@ -50,10 +50,16 @@
</style>
<div class="card">
{#await getJson('/json/me.json')}
<h1>Loading...</h1>
{:then info}
<h1>{info.name}</h1>
<div class="flex-container">
<img class="profile" src={info.profile_photo} alt="{info.name}'s Profile Photo">
<p class="about">{info.about}</p>
</div>
{:catch error}
<h1>{error.message}</h1>
{/await}
</div>

View File

@ -1,5 +1,4 @@
<script>
import json from '@rollup/plugin-json'
</script>
<style>