Most things are working in the template now.
This commit is contained in:
25
src/app.html
25
src/app.html
@@ -1,12 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" class="dark">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover" data-theme="modern">
|
||||
<div style="display: contents" class="h-full overflow-hidden">%sveltekit.body%</div>
|
||||
</body>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover" data-theme="modern">
|
||||
<div style="display: contents" class="h-full overflow-hidden">%sveltekit.body%</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
68
src/lib/ae_stores.ts
Normal file
68
src/lib/ae_stores.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
import { readable, writable } from 'svelte/store';
|
||||
|
||||
type key_val = {
|
||||
[key: string]: any; // variable key
|
||||
// name: string;
|
||||
};
|
||||
|
||||
// *** BEGIN *** Longer-term app data. This should be stored to local storage.
|
||||
export let ae_app_local_data_struct: key_val = {
|
||||
'ver': '0.0.1',
|
||||
'name': 'Aether App Template',
|
||||
'theme': 'light',
|
||||
'account_id': '_XY7DXtc9MY', // OSIT Demo _XY7DXtc9MY
|
||||
'site_domain': 'https://dev-demo.oneskyit.com',
|
||||
'ds': {},
|
||||
'hub': {
|
||||
'ds': {},
|
||||
},
|
||||
}
|
||||
console.log(`Aether Config - App Local Storage Data:`, ae_app_local_data_struct);
|
||||
export let ae_loc = writable(ae_app_local_data_struct);
|
||||
|
||||
|
||||
// *** BEGIN *** Temporary app data. This should be stored to session storage.
|
||||
export let ae_app_session_data_struct: key_val = {
|
||||
'ver': '0.0.1',
|
||||
// 'name': 'Aether App Template',
|
||||
// 'theme': 'light',
|
||||
'account_id': ae_app_local_data_struct.account_id,
|
||||
// 'obj': {},
|
||||
}
|
||||
console.log(`Aether Config - App Session Storage Data:`, ae_app_session_data_struct);
|
||||
export let ae_sess = writable(ae_app_session_data_struct);
|
||||
|
||||
|
||||
// *** BEGIN *** Temporary API data. This should be stored to session storage.
|
||||
export let ae_api_data_struct: key_val = {
|
||||
'ver': '0.0.2',
|
||||
'base_url': 'https://dev-api.oneskyit.com',
|
||||
'base_url_bak': 'https://dev-api.oneskyit.com',
|
||||
'api_secret_key': 'dFP6J9DVj9hUgIMn-fNIqg', // 'YOUR_API_SECRET_KEY',
|
||||
'api_secret_key_bak': 'dFP6J9DVj9hUgIMn-fNIqg', // 'YOUR_API_SECRET_KEY',
|
||||
'api_crud_super_key': 'zp5PtX4zUsI', // 'YOUR_SUPER_KEY' 'zp5PtX4zUsI'
|
||||
'headers': {},
|
||||
'account_id': ae_app_local_data_struct.account_id,
|
||||
}
|
||||
|
||||
let ae_api_headers: key_val = {};
|
||||
ae_api_headers['Access-Control-Allow-Origin'] = '*';
|
||||
ae_api_headers['content-type'] = 'application/json';
|
||||
ae_api_headers['x-aether-api-key'] = ae_api_data_struct.api_secret_key;
|
||||
ae_api_headers['x-aether-api-token'] = 'fake-temp-token';
|
||||
ae_api_headers['x-aether-api-expire-on'] = '';
|
||||
ae_api_headers['x-account-id'] = ae_app_local_data_struct.account_id;
|
||||
ae_api_data_struct['headers'] = ae_api_headers;
|
||||
|
||||
console.log(`Aether Config - API Data:`, ae_api_data_struct);
|
||||
export let ae_api = writable(ae_api_data_struct);
|
||||
|
||||
|
||||
/* *** BEGIN *** Initialize slct_trigger and slct variables */
|
||||
// Updated 2024-02-15
|
||||
export let slct_trigger: any = writable(null);
|
||||
console.log(`Aether Config - Selected Trigger:`, slct_trigger);
|
||||
|
||||
let slct_obj_template: key_val = { 'sponsorship_id': null, 'sponsorship_obj': {}, 'post_id': null, 'post_obj': {}, 'post_obj_li': [], 'post_comment_id': null, 'post_comment_obj': {}, 'post_comment_obj_li': [] };
|
||||
console.log(`Aether Config - Selected Objects:`, slct_obj_template);
|
||||
export let slct = writable(slct_obj_template);
|
||||
1380
src/lib/api.js
Normal file
1380
src/lib/api.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,64 +1,163 @@
|
||||
<script lang="ts">
|
||||
import '../app.postcss';
|
||||
import { AppShell, AppBar } from '@skeletonlabs/skeleton';
|
||||
import '../app.postcss';
|
||||
import { AppShell, AppBar } from '@skeletonlabs/skeleton';
|
||||
|
||||
// Highlight JS
|
||||
import hljs from 'highlight.js/lib/core';
|
||||
import 'highlight.js/styles/github-dark.css';
|
||||
import { storeHighlightJs } from '@skeletonlabs/skeleton';
|
||||
import xml from 'highlight.js/lib/languages/xml'; // for HTML
|
||||
import css from 'highlight.js/lib/languages/css';
|
||||
import javascript from 'highlight.js/lib/languages/javascript';
|
||||
import typescript from 'highlight.js/lib/languages/typescript';
|
||||
// Highlight JS
|
||||
import hljs from 'highlight.js/lib/core';
|
||||
import 'highlight.js/styles/github-dark.css';
|
||||
import type { Writable } from 'svelte/store';
|
||||
import { get } from 'svelte/store';
|
||||
import { localStorageStore, storeHighlightJs } from '@skeletonlabs/skeleton';
|
||||
import xml from 'highlight.js/lib/languages/xml'; // for HTML
|
||||
import css from 'highlight.js/lib/languages/css';
|
||||
import javascript from 'highlight.js/lib/languages/javascript';
|
||||
import typescript from 'highlight.js/lib/languages/typescript';
|
||||
|
||||
hljs.registerLanguage('xml', xml); // for HTML
|
||||
hljs.registerLanguage('css', css);
|
||||
hljs.registerLanguage('javascript', javascript);
|
||||
hljs.registerLanguage('typescript', typescript);
|
||||
storeHighlightJs.set(hljs);
|
||||
hljs.registerLanguage('xml', xml); // for HTML
|
||||
hljs.registerLanguage('css', css);
|
||||
hljs.registerLanguage('javascript', javascript);
|
||||
hljs.registerLanguage('typescript', typescript);
|
||||
storeHighlightJs.set(hljs);
|
||||
|
||||
// Floating UI for Popups
|
||||
import { computePosition, autoUpdate, flip, shift, offset, arrow } from '@floating-ui/dom';
|
||||
import { storePopup } from '@skeletonlabs/skeleton';
|
||||
storePopup.set({ computePosition, autoUpdate, flip, shift, offset, arrow });
|
||||
|
||||
type key_val = {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
import { api } from '$lib/api';
|
||||
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
|
||||
console.log(api);
|
||||
console.log($ae_loc, $ae_sess, $ae_api);
|
||||
|
||||
|
||||
// const ae_loc_test_store: Writable<string> = localStorageStore('ae_loc_test', {'test': 'This is a test'});
|
||||
// // Subscribe to the store
|
||||
// ae_loc_test_store.subscribe(() => {});
|
||||
|
||||
// // Update the value
|
||||
// ae_loc_test_store.update(() => {});
|
||||
|
||||
// // Set the value
|
||||
// ae_loc_test_store.set(() => {});
|
||||
|
||||
// // // Read the value
|
||||
// get(ae_loc_test_store);
|
||||
|
||||
// // // Read value with automatic subscription
|
||||
// $ae_loc_test_store
|
||||
|
||||
let data_store_obj_get_promises: key_val = {};
|
||||
let get_ds_hub_site_header_promise = handle_get_data_store_obj_w_code({code: 'hub_site_header'});
|
||||
let get_ds_hub_site_footer_promise = handle_get_data_store_obj_w_code({code: 'hub_site_footer'});
|
||||
|
||||
|
||||
async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
|
||||
console.log('*** handle_get_data_store_obj_w_code() ***');
|
||||
|
||||
// let get_item_result = window.localStorage.getItem(code);
|
||||
// localStorage.getItem(code);
|
||||
|
||||
// if ($ae_loc_test_store) {
|
||||
// $ae_loc.hub.ds[code] = $ae_loc_test_store;
|
||||
// } else {
|
||||
// console.log('Get local storage item miss.');
|
||||
// }
|
||||
|
||||
data_store_obj_get_promises[code] = api.get_data_store_obj_w_code({
|
||||
api_cfg: $ae_api,
|
||||
data_store_code: code,
|
||||
data_type: data_type,
|
||||
log_lvl: 2
|
||||
})
|
||||
.then(function (get_data_store_result) {
|
||||
if (get_data_store_result) {
|
||||
|
||||
if (data_type == 'text') {
|
||||
// console.log(get_data_store_result.text);
|
||||
$ae_loc.hub.ds[code] = get_data_store_result.text;
|
||||
} else if (data_type == 'json') {
|
||||
// console.log(get_data_store_result.json);
|
||||
$ae_loc.hub.ds[code] = get_data_store_result.json;
|
||||
}
|
||||
|
||||
// console.log(`Code: ${$ae_loc.hub.ds[code]}`);
|
||||
// console.log(`Code:`, $ae_loc.hub.ds[code]);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
}
|
||||
|
||||
// Floating UI for Popups
|
||||
import { computePosition, autoUpdate, flip, shift, offset, arrow } from '@floating-ui/dom';
|
||||
import { storePopup } from '@skeletonlabs/skeleton';
|
||||
storePopup.set({ computePosition, autoUpdate, flip, shift, offset, arrow });
|
||||
</script>
|
||||
|
||||
|
||||
<!-- App Shell -->
|
||||
<AppShell>
|
||||
<svelte:fragment slot="header">
|
||||
<!-- App Bar -->
|
||||
<AppBar>
|
||||
<svelte:fragment slot="lead">
|
||||
<strong class="text-xl uppercase">Skeleton</strong>
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="trail">
|
||||
<a
|
||||
class="btn btn-sm variant-ghost-surface"
|
||||
href="https://discord.gg/EXqV7W8MtY"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Discord
|
||||
</a>
|
||||
<a
|
||||
class="btn btn-sm variant-ghost-surface"
|
||||
href="https://twitter.com/SkeletonUI"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Twitter
|
||||
</a>
|
||||
<a
|
||||
class="btn btn-sm variant-ghost-surface"
|
||||
href="https://github.com/skeletonlabs/skeleton"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
GitHub
|
||||
</a>
|
||||
</svelte:fragment>
|
||||
</AppBar>
|
||||
</svelte:fragment>
|
||||
<!-- Page Route Content -->
|
||||
<slot />
|
||||
<svelte:fragment slot="header">
|
||||
<!-- App Bar -->
|
||||
<AppBar gridColumns="grid-cols-3" slotDefault="place-self-center" slotTrail="place-content-end">
|
||||
<svelte:fragment slot="lead">
|
||||
<a href="/">
|
||||
Æ Home
|
||||
</a>
|
||||
</svelte:fragment>
|
||||
OSIT's Aether App
|
||||
<svelte:fragment slot="trail">
|
||||
<a
|
||||
class="btn btn-sm variant-ghost-surface"
|
||||
href="example">Example Page</a>
|
||||
|
||||
<a
|
||||
class="btn btn-sm variant-ghost-surface"
|
||||
href="example">Example Page</a>
|
||||
</svelte:fragment>
|
||||
</AppBar>
|
||||
|
||||
<!-- <AppBar>
|
||||
<svelte:fragment slot="lead">
|
||||
<strong class="text-xl uppercase">Skeleton</strong>
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="trail">
|
||||
<a
|
||||
class="btn btn-sm variant-ghost-surface"
|
||||
href="https://discord.gg/EXqV7W8MtY"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Discord
|
||||
</a>
|
||||
<a
|
||||
class="btn btn-sm variant-ghost-surface"
|
||||
href="https://twitter.com/SkeletonUI"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Twitter
|
||||
</a>
|
||||
<a
|
||||
class="btn btn-sm variant-ghost-surface"
|
||||
href="https://github.com/skeletonlabs/skeleton"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
GitHub
|
||||
</a>
|
||||
</svelte:fragment>
|
||||
</AppBar> -->
|
||||
</svelte:fragment>
|
||||
<!-- Page Route Content -->
|
||||
<slot />
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
<div class="flex justify-between space-x-2">
|
||||
{@html $ae_loc.hub.ds['hub_site_footer']}
|
||||
</div>
|
||||
</svelte:fragment>
|
||||
|
||||
</AppShell>
|
||||
|
||||
|
||||
@@ -1,23 +1,15 @@
|
||||
<!-- YOU CAN DELETE EVERYTHING IN THIS PAGE -->
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
onMount(() => {
|
||||
console.log('Mounted +layout.svelte');
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="container h-full mx-auto flex justify-center items-center">
|
||||
<div class="space-y-10 text-center flex flex-col items-center">
|
||||
<h2 class="h2">Welcome to Skeleton.</h2>
|
||||
<!-- Animated Logo -->
|
||||
<figure>
|
||||
<section class="img-bg" />
|
||||
<svg
|
||||
class="fill-token -scale-x-[100%]"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 200 200"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M98.77 50.95c25.1 0 46.54 8.7 61.86 23a41.34 41.34 0 0 0 5.19-1.93c4.35-2.02 10.06-6.17 17.13-12.43-1.15 10.91-2.38 18.93-3.7 24.04-.7 2.75-1.8 6.08-3.3 10a80.04 80.04 0 0 1 8.42 23.33c6.04 30.3-4.3 43.7-28.33 51.18.18.9.32 1.87.42 2.9.86 8.87-3.62 23.19-9 23.19-3.54 0-5.84-4.93-8.3-12.13-.78 8.34-4.58 17.9-8.98 17.9-4.73 0-7.25-8.84-10.93-20.13a214 214 0 0 1-.64 2.93l-.16.71-.16.71-.17.71c-1.84 7.58-4.46 15.07-8.5 15.07-5.06 0-2.29-15.9-10.8-22.63-43.14 2.36-79.43-13.6-79.43-59.62 0-8.48 2-16.76 5.69-24.45a93.72 93.72 0 0 1-1.77-3.68c-2.87-6.32-6.3-15.88-10.31-28.7 10.26 7.66 18.12 12.22 23.6 13.68.5.14 1.02.26 1.57.36 14.36-14.44 35.88-24.01 60.6-24.01Zm-9.99 62.3c-14.57 0-26.39 11.45-26.39 25.58 0 14.14 11.82 25.6 26.39 25.6s26.39-11.46 26.39-25.6c0-13.99-11.58-25.35-25.95-25.58Zm37.45 31.95c-4.4 0-6.73 9.4-6.73 13.62 0 3.3 1.1 5.12 2.9 5.45 4.39.4 3.05-5.97 5.23-5.97 1.06 0 2.2 1.35 3.34 2.73l.34.42c1.25 1.52 2.5 2.93 3.64 2.49 2.7-1.61 1.67-5.12.74-7.88-3.3-6.96-5.05-10.86-9.46-10.86Zm-36.85-28.45c12.57 0 22.76 9.78 22.76 21.85 0 12.07-10.2 21.85-22.76 21.85-.77 0-1.53-.04-2.29-.11 11.5-1.1 20.46-10.42 20.46-21.74 0-11.32-8.97-20.63-20.46-21.74.76-.07 1.52-.1 2.3-.1Zm65.54-5c-10.04 0-18.18 10.06-18.18 22.47 0 12.4 8.14 22.47 18.18 22.47s18.18-10.06 18.18-22.47c0-12.41-8.14-22.48-18.18-22.48Zm.6 3.62c8.38 0 15.16 8.4 15.16 18.74 0 10.35-6.78 18.74-15.16 18.74-.77 0-1.54-.07-2.28-.21 7.3-1.36 12.89-9.14 12.89-18.53 0-9.4-5.6-17.17-12.89-18.53.74-.14 1.5-.2 2.28-.2Zm3.34-72.27.12.07c.58.38.75 1.16.37 1.74l-2.99 4.6c-.35.55-1.05.73-1.61.44l-.12-.07a1.26 1.26 0 0 1-.37-1.74l2.98-4.6a1.26 1.26 0 0 1 1.62-.44ZM39.66 42l.08.1 2.76 3.93a1.26 1.26 0 0 1-2.06 1.45l-2.76-3.94A1.26 1.26 0 0 1 39.66 42Zm63.28-42 2.85 24.13 10.62-11.94.28 29.72-2.1-.47a77.8 77.8 0 0 0-16.72-2.04c-4.96 0-9.61.67-13.96 2l-2.34.73L83.5 4.96l9.72 18.37L102.94 0Zm-1.87 13.39-7.5 17.96-7.3-13.8-1.03 19.93.22-.06a51.56 51.56 0 0 1 12.1-1.45h.31c4.58 0 9.58.54 15 1.61l.35.07-.15-16.54-9.79 11-2.21-18.72Zm38.86 19.23c.67.2 1.05.89.86 1.56l-.38 1.32c-.17.62-.8 1-1.42.89l-.13-.03a1.26 1.26 0 0 1-.86-1.56l.38-1.32c.19-.66.88-1.05 1.55-.86ZM63.95 31.1l.05.12.7 2.17a1.26 1.26 0 0 1-2.34.9l-.04-.12-.71-2.17a1.26 1.26 0 0 1 2.34-.9Z"
|
||||
/>
|
||||
</svg>
|
||||
</figure>
|
||||
<!-- / -->
|
||||
<h1 class="h1">One Sky IT's new Aether App Template</h1>
|
||||
<h2 class="h2">Using Svelte, SvelteKit, Tailwind, Skeleton</h2>
|
||||
|
||||
<div class="flex justify-center space-x-2">
|
||||
<a
|
||||
class="btn variant-filled"
|
||||
@@ -37,35 +29,35 @@
|
||||
</div>
|
||||
|
||||
<style lang="postcss">
|
||||
figure {
|
||||
@apply flex relative flex-col;
|
||||
/* figure {
|
||||
@apply flex relative flex-col;
|
||||
}
|
||||
figure svg,
|
||||
.img-bg {
|
||||
@apply w-64 h-64 md:w-80 md:h-80;
|
||||
}
|
||||
.img-bg {
|
||||
@apply absolute z-[-1] rounded-full blur-[50px] transition-all;
|
||||
animation: pulse 5s cubic-bezier(0, 0, 0, 0.5) infinite,
|
||||
glow 5s linear infinite;
|
||||
}
|
||||
@keyframes glow {
|
||||
0% {
|
||||
@apply bg-primary-400/50;
|
||||
}
|
||||
figure svg,
|
||||
.img-bg {
|
||||
@apply w-64 h-64 md:w-80 md:h-80;
|
||||
33% {
|
||||
@apply bg-secondary-400/50;
|
||||
}
|
||||
.img-bg {
|
||||
@apply absolute z-[-1] rounded-full blur-[50px] transition-all;
|
||||
animation: pulse 5s cubic-bezier(0, 0, 0, 0.5) infinite,
|
||||
glow 5s linear infinite;
|
||||
66% {
|
||||
@apply bg-tertiary-400/50;
|
||||
}
|
||||
@keyframes glow {
|
||||
0% {
|
||||
@apply bg-primary-400/50;
|
||||
}
|
||||
33% {
|
||||
@apply bg-secondary-400/50;
|
||||
}
|
||||
66% {
|
||||
@apply bg-tertiary-400/50;
|
||||
}
|
||||
100% {
|
||||
@apply bg-primary-400/50;
|
||||
}
|
||||
100% {
|
||||
@apply bg-primary-400/50;
|
||||
}
|
||||
@keyframes pulse {
|
||||
50% {
|
||||
transform: scale(1.5);
|
||||
}
|
||||
}
|
||||
@keyframes pulse {
|
||||
50% {
|
||||
transform: scale(1.5);
|
||||
}
|
||||
} */
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user