This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
// --------------------------------------------------------- | |
// Global Imports | |
// --------------------------------------------------------- | |
import Fa from 'svelte-fa/src/fa.svelte' | |
import { faPlus } from '@fortawesome/free-solid-svg-icons'; | |
// --------------------------------------------------------- | |
// Type Imports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
// --------------------------------------------------------- | |
// Global Imports | |
// --------------------------------------------------------- | |
import Modal from '@/components/Modal.svelte' | |
import { createEventDispatcher } from 'svelte'; | |
// --------------------------------------------------------- | |
// Props | |
// --------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
// --------------------------------------------------------- | |
// Global Imports | |
// --------------------------------------------------------- | |
import moment from 'moment' | |
import { createEventDispatcher, onMount } from 'svelte'; | |
import Modal from '@/components/Modal.svelte' | |
import { formatDate } from '@/libs/utils' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
// --------------------------------------------------------- | |
// Global Imports | |
// --------------------------------------------------------- | |
import Fa from 'svelte-fa/src/fa.svelte' | |
import { faTimes } from '@fortawesome/free-solid-svg-icons'; | |
import { createEventDispatcher } from 'svelte'; | |
// --------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import moment from 'moment' | |
/** | |
* Format a date into a humanized time sentence if it's in the same | |
* day or otherwise display a date in the YYYY/MM/DD format | |
* | |
* @param {String} dateString | |
* @returns {String} | |
*/ | |
export const formatDate = (dateString: string): string => { | |
const date = moment(dateString, 'YYYYMMDDHHmmss') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
// --------------------------------------------------------- | |
// Imports | |
// --------------------------------------------------------- | |
import Fa from 'svelte-fa/src/fa.svelte' | |
import { faStar } from '@fortawesome/free-solid-svg-icons'; | |
import { createEventDispatcher } from 'svelte'; | |
import { formatDate } from '@/libs/utils' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
import logo from '@/assets/svelte.png' | |
</script> | |
<header class="global-header"> | |
<div class="app-name"> | |
<img src={logo} alt="Svelte Logo" class="logo"/> | |
<div class="title">Notes App</div> | |
</div> | |
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
import Home from '@/pages/Home.svelte' | |
import Header from '@/components/Header.svelte' | |
</script> | |
<Header /> | |
<Home /> | |
<style lang="scss"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": "@tsconfig/svelte/tsconfig.json", | |
"compilerOptions": { | |
"target": "esnext", | |
"module": "esnext", | |
"moduleResolution": "node", | |
"resolveJsonModule": true, | |
"baseUrl": ".", | |
/** | |
* Typechecking JS in `.svelte` and `.js` files by default. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineConfig } from 'vite' | |
import { svelte } from '@sveltejs/vite-plugin-svelte' | |
import path from 'path'; | |
// https://vitejs.dev/config/ | |
export default defineConfig({ | |
plugins: [svelte()], | |
resolve: { | |
alias: { | |
'@': path.resolve('/src'), |
NewerOlder