Compare commits
No commits in common. "30e4e403012ff10e814e0c072b3bb11b53dc31bd" and "e085ab198bd86ff6c999f5260fc3faa8ce7d791e" have entirely different histories.
30e4e40301
...
e085ab198b
23
.gitignore
vendored
23
.gitignore
vendored
@ -1,23 +0,0 @@
|
|||||||
node_modules
|
|
||||||
|
|
||||||
# Output
|
|
||||||
.output
|
|
||||||
.vercel
|
|
||||||
.netlify
|
|
||||||
.wrangler
|
|
||||||
/.svelte-kit
|
|
||||||
/build
|
|
||||||
|
|
||||||
# OS
|
|
||||||
.DS_Store
|
|
||||||
Thumbs.db
|
|
||||||
|
|
||||||
# Env
|
|
||||||
.env
|
|
||||||
.env.*
|
|
||||||
!.env.example
|
|
||||||
!.env.test
|
|
||||||
|
|
||||||
# Vite
|
|
||||||
vite.config.js.timestamp-*
|
|
||||||
vite.config.ts.timestamp-*
|
|
39
README.md
39
README.md
@ -1,38 +1,3 @@
|
|||||||
# sv
|
# FitLog
|
||||||
|
|
||||||
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
|
Fitness Tracker in the Browser
|
||||||
|
|
||||||
## 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
|
|
||||||
npx sv create
|
|
||||||
|
|
||||||
# create a new project in my-app
|
|
||||||
npx sv create my-app
|
|
||||||
```
|
|
||||||
|
|
||||||
## 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://svelte.dev/docs/kit/adapters) for your target environment.
|
|
61
flake.lock
generated
61
flake.lock
generated
@ -1,61 +0,0 @@
|
|||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"flake-utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1731533236,
|
|
||||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1744098102,
|
|
||||||
"narHash": "sha256-tzCdyIJj9AjysC3OuKA+tMD/kDEDAF9mICPDU7ix0JA=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": "nixpkgs"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
44
flake.nix
44
flake.nix
@ -1,44 +0,0 @@
|
|||||||
|
|
||||||
{
|
|
||||||
description = "SvelteKit Fitness Tracker - Nix Flake";
|
|
||||||
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, ... }:
|
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
|
||||||
let
|
|
||||||
pkgs = import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
nodejs = pkgs.nodejs_23; # or your preferred Node version
|
|
||||||
yarn = pkgs.yarn; # or pkgs.nodePackages.pnpm if you prefer
|
|
||||||
nodePackages = pkgs.nodePackages;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
devShells.default = pkgs.mkShell {
|
|
||||||
name = "sveltekit-dev-shell";
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
nodejs
|
|
||||||
yarn
|
|
||||||
pkgs.git
|
|
||||||
nodePackages.svelte-language-server # Added Svelte Language Server
|
|
||||||
];
|
|
||||||
|
|
||||||
shellHook = ''
|
|
||||||
echo "🚀 Welcome to the SvelteKit dev shell!"
|
|
||||||
echo "🛠️ Node: $(node -v) | Yarn: $(yarn -v)"
|
|
||||||
echo "✨ Svelte Language Server is ready!"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
1501
package-lock.json
generated
1501
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
23
package.json
23
package.json
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "fitlog",
|
|
||||||
"private": true,
|
|
||||||
"version": "0.0.1",
|
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
|
||||||
"dev": "vite dev",
|
|
||||||
"build": "vite build",
|
|
||||||
"preview": "vite preview",
|
|
||||||
"prepare": "svelte-kit sync || echo ''",
|
|
||||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
||||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@sveltejs/adapter-auto": "^4.0.0",
|
|
||||||
"@sveltejs/kit": "^2.16.0",
|
|
||||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
|
||||||
"svelte": "^5.0.0",
|
|
||||||
"svelte-check": "^4.0.0",
|
|
||||||
"typescript": "^5.0.0",
|
|
||||||
"vite": "^6.2.5"
|
|
||||||
}
|
|
||||||
}
|
|
16
src/app.d.ts
vendored
16
src/app.d.ts
vendored
@ -1,16 +0,0 @@
|
|||||||
import type { WorkoutEntry } from "$lib/types";
|
|
||||||
// See https://svelte.dev/docs/kit/types#app.d.ts
|
|
||||||
// for information about these interfaces
|
|
||||||
declare global {
|
|
||||||
namespace App {
|
|
||||||
// interface Error {}
|
|
||||||
// interface Locals {}
|
|
||||||
interface PageData {
|
|
||||||
workouts?: WorkoutEntry[];
|
|
||||||
}
|
|
||||||
// interface PageState {}
|
|
||||||
// interface Platform {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export { };
|
|
12
src/app.html
12
src/app.html
@ -1,12 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
||||||
%sveltekit.head%
|
|
||||||
</head>
|
|
||||||
<body data-sveltekit-preload-data="hover">
|
|
||||||
<div style="display: contents">%sveltekit.body%</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1 +0,0 @@
|
|||||||
// place files you want to import through the `$lib` alias in this folder.
|
|
@ -1,10 +0,0 @@
|
|||||||
import type { WorkoutEntry } from '$lib/types';
|
|
||||||
|
|
||||||
export function getWorkouts(): WorkoutEntry[] {
|
|
||||||
if (typeof localStorage === 'undefined') return [];
|
|
||||||
return JSON.parse(localStorage.getItem('workouts') || '[]');
|
|
||||||
}
|
|
||||||
|
|
||||||
export function saveWorkouts(workouts: WorkoutEntry[]) {
|
|
||||||
localStorage.setItem('workouts', JSON.stringify(workouts));
|
|
||||||
}
|
|
7
src/lib/types/index.d.ts
vendored
7
src/lib/types/index.d.ts
vendored
@ -1,7 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
export interface WorkoutEntry {
|
|
||||||
date: string;
|
|
||||||
workout_type: string;
|
|
||||||
duration_hours: number;
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
import { onMount } from "svelte";
|
|
||||||
import type { WorkoutEntry } from "$lib/types";
|
|
||||||
import { getWorkouts, saveWorkouts } from "$lib/storage";
|
|
||||||
|
|
||||||
let workouts: WorkoutEntry[] = [];
|
|
||||||
|
|
||||||
let date = "";
|
|
||||||
let workout_type = "";
|
|
||||||
let duration_hours = 0;
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
const today = new Date();
|
|
||||||
date = today.toISOString().split("T")[0];
|
|
||||||
workouts = getWorkouts();
|
|
||||||
});
|
|
||||||
|
|
||||||
function on_save() {
|
|
||||||
const workout: WorkoutEntry = {
|
|
||||||
date: date,
|
|
||||||
workout_type: workout_type,
|
|
||||||
duration_hours: duration_hours,
|
|
||||||
};
|
|
||||||
|
|
||||||
workouts = [...workouts, workout];
|
|
||||||
|
|
||||||
saveWorkouts(workouts);
|
|
||||||
workout_type = "";
|
|
||||||
duration_hours = 0;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<h1>FitLog</h1>
|
|
||||||
|
|
||||||
<input type="date" bind:value={date} placeholder="Enter date" />
|
|
||||||
<input type="text" bind:value={workout_type} placeholder="Enter workout type" />
|
|
||||||
<input
|
|
||||||
type="number"
|
|
||||||
bind:value={duration_hours}
|
|
||||||
placeholder="Enter duration in Hours"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<button on:click={on_save}>Save</button>
|
|
||||||
|
|
||||||
{#if workouts.length}
|
|
||||||
<ul>
|
|
||||||
{#each workouts as workout}
|
|
||||||
<li>
|
|
||||||
{workout.date} - {workout.workout_type} - {workout.duration_hours}
|
|
||||||
</li>
|
|
||||||
{/each}
|
|
||||||
</ul>
|
|
||||||
{/if}
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.5 KiB |
@ -1,18 +0,0 @@
|
|||||||
import adapter from '@sveltejs/adapter-auto';
|
|
||||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Config} */
|
|
||||||
const config = {
|
|
||||||
// Consult https://svelte.dev/docs/kit/integrations
|
|
||||||
// for more information about preprocessors
|
|
||||||
preprocess: vitePreprocess(),
|
|
||||||
|
|
||||||
kit: {
|
|
||||||
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
|
|
||||||
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
|
||||||
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
|
|
||||||
adapter: adapter()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./.svelte-kit/tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"allowJs": true,
|
|
||||||
"checkJs": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"sourceMap": true,
|
|
||||||
"strict": true,
|
|
||||||
"moduleResolution": "bundler"
|
|
||||||
}
|
|
||||||
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
|
|
||||||
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
|
|
||||||
//
|
|
||||||
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
|
|
||||||
// from the referenced tsconfig.json - TypeScript does not merge them in
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
import { sveltekit } from '@sveltejs/kit/vite';
|
|
||||||
import { defineConfig } from 'vite';
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
plugins: [sveltekit()]
|
|
||||||
});
|
|
Loading…
x
Reference in New Issue
Block a user