Let there be light

This commit is contained in:
Logan Hunt 2022-04-12 18:39:51 -06:00
commit 3a4b67eb37
18 changed files with 5685 additions and 0 deletions

20
.eslintrc.cjs Normal file
View File

@ -0,0 +1,20 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['svelte3', '@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript')
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
},
env: {
browser: true,
es2017: true,
node: true
}
};

8
.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

1
.npmrc Normal file
View File

@ -0,0 +1 @@
engine-strict=true

6
.prettierrc Normal file
View File

@ -0,0 +1,6 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100
}

40
README.md Normal file
View File

@ -0,0 +1,40 @@
# create-svelte
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
## Creating a project
If you're seeing this, you've probably already done this step. Congrats!
```bash
# create a new project in the current directory
npm init svelte@next
# create a new project in my-app
npm init svelte@next my-app
```
> Note: the `@next` is temporary
## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
## Building
To create a production version of your app:
```bash
npm run build
```
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.

5355
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

35
package.json Normal file
View File

@ -0,0 +1,35 @@
{
"name": "mistymountains-frontend",
"version": "0.0.1",
"scripts": {
"dev": "svelte-kit dev",
"build": "svelte-kit build",
"package": "svelte-kit package",
"preview": "svelte-kit preview",
"prepare": "svelte-kit sync",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
},
"devDependencies": {
"@sveltejs/adapter-auto": "next",
"@sveltejs/kit": "next",
"@typescript-eslint/eslint-plugin": "^5.10.1",
"@typescript-eslint/parser": "^5.10.1",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-svelte3": "^3.2.1",
"prettier": "^2.5.1",
"prettier-plugin-svelte": "^2.5.0",
"svelte": "^3.44.0",
"svelte-check": "^2.2.6",
"svelte-preprocess": "^4.10.1",
"tslib": "^2.3.1",
"typescript": "~4.6.2"
},
"type": "module",
"dependencies": {
"@supabase/supabase-js": "^1.33.3"
}
}

10
src/app.d.ts vendored Normal file
View File

@ -0,0 +1,10 @@
/// <reference types="@sveltejs/kit" />
// See https://kit.svelte.dev/docs/types#the-app-namespace
// for information about these interfaces
declare namespace App {
// interface Locals {}
// interface Platform {}
// interface Session {}
// interface Stuff {}
}

92
src/app.html Normal file
View File

@ -0,0 +1,92 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="description" content="" />
<link rel="icon" href="%svelte.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Misty Mountains Therapy</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Nunito Sans', sans-serif;
}
a {
text-decoration: none;
}
</style>
%svelte.head%
</head>
<body class="d-flex flex-column min-vh-100">
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<div class="container">
<a href="/" class="navbar-brand abs">
<img height="100" src="/logo.png" alt="Misty Mountains Therapy"/>
</a>
<button class="navbar-toggler ms-auto" type="button" data-bs-toggle="collapse" data-bs-target="#toggle">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse" id="toggle">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="/">Home</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/team">Our Team</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/#/service">Services</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/#/service">Approach</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="https://joni-hunt.clientsecure.me/" target="_blank">Portal</a>
</li>
</ul>
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="btn btn-success" href="/contact">Contact Us</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container mt-2">
%svelte.body%
</div>
<footer class="mt-auto bg-dark">
<div class="container mt-2 mb-2 text-white">
<div class="row justify-content-center align-items-center">
<div class="col-md-5">
<a href="mailto:jeffer@mistymountainsthreapy.com">jeffer@mistymountainsthreapy.com</a>
<br>
<span><a href="tel:15306383546">(530) 638 - 3546</a> (call or text)</span>
<hr>
<span>©Misty Mountains Therapy, 2022</span>
<br>
<span><a href="https://docs.google.com/document/d/10S_-yfiaDZnuD-0tvXTEIIyZiErVwrTj0y_0JiRT5_U/edit?usp=sharing" target="_blank">Privacy Policy</a></span>
</div>
<div class="col-md-5">
<span>534 Trejo Street, Suite 200F</span>
<br>
<span>Rexburg, ID</span>
<br>
<span>83440</span>
</div>
</div>
</div>
</footer>
</body>
</html>

8
src/lib/supabase.ts Normal file
View File

@ -0,0 +1,8 @@
import { createClient } from '@supabase/supabase-js';
export const supabase = createClient(
import.meta.env.VITE_SUPABASE_URL as string,
import.meta.env.VITE_SUPABASE_ANON_KEY as string,
);
export default supabase;

3
src/routes/index.svelte Normal file
View File

@ -0,0 +1,3 @@
<h1>
HELLO
</h1>

View File

@ -0,0 +1,20 @@
<script>
export let bio;
let showMore = false;
</script>
<main>
{#if showMore}
<p>{bio}</p>
<button on:click={() => showMore = false}>Show Less</button>
{:else}
<p>{bio.substr(0, bio.lastIndexOf(' ', 150)) + '...'}</p>
<button on:click={() => showMore = true}>Show More</button>
{/if}
</main>
<style>
p {
white-space: pre-line;
}
</style>

View File

@ -0,0 +1,26 @@
<script>
import PersonBio from './PersonBio.svelte';
export let person;
export let direction;
</script>
<main>
<div class="row">
{#if direction == 'right'}
<div class="col-sm-3">
<img class="img-fluid" src={person.image} alt={person.name} />
</div>
<div class="col-sm-9">
<PersonBio bio={person.bio} />
</div>
{:else}
<div class="col-sm-9">
<PersonBio bio={person.bio} />
</div>
<div class="col-sm-3">
<img class="img-fluid" src={person.image} alt={person.name} />
</div>
{/if}
</div>
</main>

View File

@ -0,0 +1,43 @@
<script>
import PersonCard from './PersonCard.svelte';
import { onMount } from 'svelte';
import { supabase } from '$lib/supabase';
const getPeople = async () => {
const { data, error } = await supabase.from('people').select();
if (!error) {
return data;
}
console.log(error);
return [];
}
const mapImages = (people) => {
return people.map((x) => {
const { publicURL, error } = supabase
.storage
.from('mistymountains')
.getPublicUrl(x.image);
if (!error) {
return { ...x, image: publicURL };
}
return x;
});
}
let people = [];
onMount(async () => {
people = await getPeople().then(mapImages);
});
</script>
<main>
{#if people.length}
{#each people as person, i}
<div class="row">
<PersonCard person={person} direction={i % 2 ? 'left' : 'right'} />
</div>
{/each}
{/if}
</main>

BIN
static/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

BIN
static/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

15
svelte.config.js Normal file
View File

@ -0,0 +1,15 @@
import adapter from '@sveltejs/adapter-auto';
import preprocess from 'svelte-preprocess';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: preprocess(),
kit: {
adapter: adapter()
}
};
export default config;

3
tsconfig.json Normal file
View File

@ -0,0 +1,3 @@
{
"extends": "./.svelte-kit/tsconfig.json"
}