Initial commit

main
JBierenbroodspot 1 year ago
commit bf49fdca68

@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

@ -0,0 +1,30 @@
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
env: {
browser: true,
es2017: true,
node: true
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
]
};

10
.gitignore vendored

@ -0,0 +1,10 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

@ -0,0 +1,2 @@
engine-strict=true
resolution-mode=highest

@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

@ -0,0 +1,10 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 80,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }],
"svelteStrictMode": true
}

@ -0,0 +1,7 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
}
}

@ -0,0 +1,38 @@
# 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 create svelte@latest
# create a new project in my-app
npm create svelte@latest 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://kit.svelte.dev/docs/adapters) for your target environment.

3246
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,35 @@
{
"name": "cv-page",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"test": "playwright test",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write ."
},
"devDependencies": {
"@playwright/test": "^1.28.1",
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-static": "^2.0.2",
"@sveltejs/kit": "^1.20.4",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte": "^2.30.0",
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.10.1",
"sass": "^1.63.6",
"svelte": "^4.0.0",
"svelte-check": "^3.4.3",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^4.3.6"
},
"type": "module"
}

@ -0,0 +1,12 @@
import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
webServer: {
command: 'npm run build && npm run preview',
port: 4173
},
testDir: 'tests',
testMatch: /(.+\.)?(test|spec)\.[jt]s/
};
export default config;

12
src/app.d.ts vendored

@ -0,0 +1,12 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface Platform {}
}
}
export {};

@ -0,0 +1,12 @@
<!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" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

@ -0,0 +1,6 @@
@use './variables.scss' as vars;
body {
background-color: vars.$bg-color-main;
color: vars.$text-color-main;
}

@ -0,0 +1,8 @@
@use 'sass:color';
$bg-color-main: #0c1a31;
$bg-color-main-d10: color.scale($bg-color-main, $lightness: -10%);
$bg-color-main-d20: color.scale($bg-color-main, $lightness: -20%);
$bg-color-main-d30: color.scale($bg-color-main, $lightness: -30%);
$text-color-main: silver;

@ -0,0 +1,4 @@
import '$lib/styles/variables.scss';
import '$lib/styles/app.scss';
export const prerender = true;

@ -0,0 +1,28 @@
<script lang="ts">
import type { SkillList, InfoArticleList } from './+page';
import InfoComponent from './info.component.svelte';
import NameComponent from './name.component.svelte';
import SkillAreaComponent from './skill_area.component.svelte';
const skills: SkillList = [];
const infoArticles: InfoArticleList = [
{ title: 'Title', bodyText: 'Lorem ipsum ...' },
{ title: 'Title 2', bodyText: 'Lorem ipsum ...' }
];
</script>
<section id="mainContent">
<NameComponent />
<InfoComponent infoArticles="{infoArticles}" />
<SkillAreaComponent />
</section>
<style lang="scss">
#mainContent {
display: grid;
grid-template:
'a b' 1fr
'c b' 2fr / 1fr 3fr;
}
</style>

@ -0,0 +1,16 @@
const proficiency: readonly number[] = [...Array(10).keys()] as const;
export type Proficiency = (typeof proficiency)[number];
export interface Skill {
name: string;
proficiency: Proficiency;
}
export type SkillList = Skill[];
export type InfoArticle = {
title: string;
bodyText: string;
};
export type InfoArticleList = InfoArticle[];

@ -0,0 +1,48 @@
<script lang="ts">
export let title: string;
export let bodyText: string;
</script>
<article>
<h2>
<span>{title}</span>
</h2>
<p>{bodyText}</p>
</article>
<style lang="scss">
@use '$lib/styles/variables.scss' as vars;
$border-width: 1px;
$title-line-height: var(--padding);
article {
border-top: $border-width;
box-sizing: border-box;
position: relative;
& > h2 {
text-align: center;
vertical-align: middle;
line-height: $title-line-height;
margin: 0;
& > span {
background-color: vars.$bg-color-main-d20;
padding: 0 16px;
position: relative;
z-index: 2;
}
&::after {
content: '';
border-top: 1px solid silver;
position: absolute;
right: calc((($title-line-height - $border-width) / 2) * -1);
left: calc((($title-line-height - $border-width) / 2) * -1);
top: calc((($title-line-height - $border-width) / 2));
z-index: 1;
}
}
}
</style>

@ -0,0 +1,60 @@
<script lang="ts">
import InfoArticleComponent from './info.article.component.svelte';
import { infoBodyPadding } from './info.component';
import type { InfoArticleList } from './+page';
export let infoArticles: InfoArticleList;
let hasTopBorder: string = infoArticles === undefined ? '' : 'no-top';
</script>
<div id="infoBody" class="{hasTopBorder}" style="--padding: {infoBodyPadding};">
{#each infoArticles as { title, bodyText }, _}
<InfoArticleComponent title="{title}" bodyText="{bodyText}" />
{/each}
</div>
<style lang="scss">
@use '$lib/styles/variables.scss' as vars;
$outer-width: 100%;
$outer-height: 100%;
$border-width: 1px;
$grid-area: b;
$padding: var(--padding);
$edge-to-border: calc(($padding - $border-width) / 2);
$bg-color: vars.$bg-color-main-d20;
#infoBody {
position: relative;
width: $outer-width;
height: $outer-height;
box-sizing: border-box;
padding: $padding;
grid-area: $grid-area;
background-color: $bg-color;
&.no-top {
padding-top: 0;
&::before {
border-top: hidden;
}
}
&::before {
content: '';
position: absolute;
top: $edge-to-border;
left: $edge-to-border;
right: $edge-to-border;
bottom: $edge-to-border;
border: $border-width solid vars.$text-color-main;
}
}
</style>

@ -0,0 +1 @@
export const infoBodyPadding: string = '56px' as const;

@ -0,0 +1,12 @@
<div id="nameArea">
<h1 id="title">[FirstName LastName]</h1>
<h2 id="subTitle">[Does Things]</h2>
</div>
<style lang="scss">
$grid-area: a;
#nameArea {
grid-area: $grid-area;
}
</style>

@ -0,0 +1,54 @@
<script lang="ts">
export let proficiency: number;
export let skillName: string;
const proficiencyMax: number = 5 as const;
const proficiencyEmpty: number = proficiencyMax - proficiency;
const proficiencyFull: number = proficiencyMax - proficiencyEmpty;
</script>
<div id="skill">
<p id="skillName">
{skillName}
</p>
<div id="proficiencyBar">
{#each Array(proficiencyFull) as _}
<div class="proficiency proficiency--full"></div>
{/each}
{#each Array(proficiencyEmpty) as _}
<div class="proficiency proficiency--empty"></div>
{/each}
</div>
</div>
<style lang="scss">
@use '$lib/styles/variables.scss' as vars;
$bubble-color-full: vars.$text-color-main;
$border-width: 1px;
$bubble-width: 24px;
$bubble-height: 24px;
$bubble-radius: 50%;
$bubble-gap: 8px;
#proficiencyBar {
display: flex;
flex-direction: row;
gap: $bubble-gap;
}
.proficiency {
box-sizing: border-box;
border-radius: $bubble-radius;
width: $bubble-width;
height: $bubble-height;
&--empty {
border: $border-width solid $bubble-color-full;
}
&--full {
background-color: $bubble-color-full;
}
}
</style>

@ -0,0 +1,24 @@
<script lang="ts">
import type { SkillList } from './+page';
import SkillComponent from './skill.component.svelte';
let skills: SkillList = [{ name: 'Placeholder Skill', proficiency: 3 }];
</script>
<section id="skillArea">
<h2 id="title">Skills</h2>
{#each skills as skill}
<SkillComponent
skillName="{skill.name}"
proficiency="{skill.proficiency}"
/>
{/each}
</section>
<style lang="scss">
$grid-area: c;
#skillArea {
grid-area: $grid-area;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -0,0 +1,24 @@
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/kit/vite';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter({
pages: 'build',
assets: 'build',
fallback: undefined,
precompress: false,
strict: true
})
}
};
export default config;

@ -0,0 +1,6 @@
import { expect, test } from '@playwright/test';
test('index page has expected h1', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('heading', { name: 'Welcome to SvelteKit' })).toBeVisible();
});

@ -0,0 +1,17 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
//
// 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
}

@ -0,0 +1,6 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()]
});
Loading…
Cancel
Save