Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-code Demo Site #8

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 10 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="./site/public/images/logo.svg" alt="Logo" style="height: 100px; display:block; margin: 0 auto;" />
<img src="./site/static/images/logo.svg" alt="Logo" style="height: 100px; display:block; margin: 0 auto;" />

# Svelte-Toasts

Expand All @@ -10,20 +10,20 @@ https://mzohaibqc.github.io/svelte-toasts/

REPL: https://svelte.dev/repl/ff34bad88213493ab878c71497c01152?version=3.35.0

## <img src="./site/public/images/dynamic-toast.gif" alt="Dynamic Toast">
## <img src="./site/static/images/dynamic-toast.gif" alt="Dynamic Toast">

#### Flat Toast

<p float="left">
<img src="./site/public/images/flat-dark.png" width="320px" alt="Light theme toasts">
<img src="./site/public/images/flat-light.png" width="320px" alt="Dark theme toasts">
<img src="./site/static/images/flat-dark.png" width="320px" alt="Light theme toasts">
<img src="./site/static/images/flat-light.png" width="320px" alt="Dark theme toasts">
</p>

#### Bootstrap Toast

<p float="left">
<img src="./site/public/images/bootstrap-dark.png" width="320px" alt="Light theme toasts">
<img src="./site/public/images/bootstrap-light.png" width="320px" alt="Dark theme toasts">
<img src="./site/static/images/bootstrap-dark.png" width="320px" alt="Light theme toasts">
<img src="./site/static/images/bootstrap-light.png" width="320px" alt="Dark theme toasts">
</p>

## Install
Expand Down Expand Up @@ -261,38 +261,22 @@ export interface ToastStore extends Writable<ToastProps[]> {
success(options: Partial<ToastProps>): ToastProps;
success(description: string): ToastProps;
success(description: string, options: Partial<ToastProps>): ToastProps;
success(
title: string,
description: string,
options?: Partial<ToastProps>
): ToastProps;
success(title: string, description: string, options?: Partial<ToastProps>): ToastProps;

info(options: Partial<ToastProps>): ToastProps;
info(description: string): ToastProps;
info(description: string, options: Partial<ToastProps>): ToastProps;
info(
title: string,
description: string,
options?: Partial<ToastProps>
): ToastProps;
info(title: string, description: string, options?: Partial<ToastProps>): ToastProps;

error(options: Partial<ToastProps>): ToastProps;
error(description: string): ToastProps;
error(description: string, options: Partial<ToastProps>): ToastProps;
error(
title: string,
description: string,
options?: Partial<ToastProps>
): ToastProps;
error(title: string, description: string, options?: Partial<ToastProps>): ToastProps;

warning(options: Partial<ToastProps>): ToastProps;
warning(description: string): ToastProps;
warning(description: string, options: Partial<ToastProps>): ToastProps;
warning(
title: string,
description: string,
options?: Partial<ToastProps>
): ToastProps;
warning(title: string, description: string, options?: Partial<ToastProps>): ToastProps;

getById(uid: number): ToastProps;
clearAll(): void;
Expand Down
10 changes: 7 additions & 3 deletions site/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/node_modules/
/public/build/

.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
1 change: 1 addition & 0 deletions site/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
103 changes: 19 additions & 84 deletions site/README.md
Original file line number Diff line number Diff line change
@@ -1,105 +1,40 @@
*Looking for a shareable component template? Go here --> [sveltejs/component-template](https://github.com/sveltejs/component-template)*
# create-svelte

---
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).

# svelte app
## Creating a project

This is a project template for [Svelte](https://svelte.dev) apps. It lives at https://github.com/sveltejs/template.

To create a new project based on this template using [degit](https://github.com/Rich-Harris/degit):

```bash
npx degit sveltejs/template svelte-app
cd svelte-app
```

*Note that you will need to have [Node.js](https://nodejs.org) installed.*


## Get started

Install the dependencies...
If you're seeing this, you've probably already done this step. Congrats!

```bash
cd svelte-app
npm install
```
# create a new project in the current directory
npm init svelte@next

...then start [Rollup](https://rollupjs.org):

```bash
npm run dev
# create a new project in my-app
npm init svelte@next my-app
```

Navigate to [localhost:5000](http://localhost:5000). You should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes.
> Note: the `@next` is temporary

By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the `sirv` commands in package.json to include the option `--host 0.0.0.0`.
## Developing

If you're using [Visual Studio Code](https://code.visualstudio.com/) we recommend installing the official extension [Svelte for VS Code](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode). If you are using other editors you may need to install a plugin in order to get syntax highlighting and intellisense.

## Building and running in production mode

To create an optimised version of the app:
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```bash
npm run build
```

You can run the newly built app with `npm run start`. This uses [sirv](https://github.com/lukeed/sirv), which is included in your package.json's `dependencies` so that the app will work when you deploy to platforms like [Heroku](https://heroku.com).


## Single-page app mode

By default, sirv will only respond to requests that match files in `public`. This is to maximise compatibility with static fileservers, allowing you to deploy your app anywhere.

If you're building a single-page app (SPA) with multiple routes, sirv needs to be able to respond to requests for *any* path. You can make it so by editing the `"start"` command in package.json:

```js
"start": "sirv public --single"
```

## Using TypeScript

This template comes with a script to set up a TypeScript development environment, you can run it immediately after cloning the template with:

```bash
node scripts/setupTypeScript.js
```

Or remove the script via:

```bash
rm scripts/setupTypeScript.js
```

## Deploying to the web

### With [Vercel](https://vercel.com)

Install `vercel` if you haven't already:
npm run dev

```bash
npm install -g vercel
# or start the server and open the app in a new browser tab
npm run dev -- --open
```

Then, from within your project folder:

```bash
cd public
vercel deploy --name my-project
```
## Building

### With [surge](https://surge.sh/)

Install `surge` if you haven't already:
To create a production version of your app:

```bash
npm install -g surge
npm run build
```

Then, from within your project folder:
You can preview the production build with `npm run preview`.

```bash
npm run build
surge public my-project.surge.sh
```
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
14 changes: 0 additions & 14 deletions site/babel.config.json

This file was deleted.

10 changes: 10 additions & 0 deletions site/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"$lib": ["src/lib"],
"$lib/*": ["src/lib/*"]
}
},
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
}
Loading