Initial commit

This commit is contained in:
Sebin Nyshkim 2023-01-12 20:15:47 +01:00
commit ee229b60c7
29 changed files with 8074 additions and 0 deletions

15
.eslintrc.cjs Normal file
View file

@ -0,0 +1,15 @@
/* eslint-env node */
require("@rushstack/eslint-patch/modern-module-resolution");
module.exports = {
root: true,
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/eslint-config-typescript",
"@vue/eslint-config-prettier",
],
parserOptions: {
ecmaVersion: "latest",
},
};

28
.gitignore vendored Normal file
View file

@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
dist-ssr
coverage
*.local
/cypress/videos/
/cypress/screenshots/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

1
.prettierrc.json Normal file
View file

@ -0,0 +1 @@
{}

3
.vscode/extensions.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
}

46
README.md Normal file
View file

@ -0,0 +1,46 @@
# character-select
This template should help get you started developing with Vue 3 in Vite.
## Recommended IDE Setup
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
## Type Support for `.vue` Imports in TS
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
1. Disable the built-in TypeScript Extension
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
## Customize configuration
See [Vite Configuration Reference](https://vitejs.dev/config/).
## Project Setup
```sh
npm install
```
### Compile and Hot-Reload for Development
```sh
npm run dev
```
### Type-Check, Compile and Minify for Production
```sh
npm run build
```
### Lint with [ESLint](https://eslint.org/)
```sh
npm run lint
```

11
env.d.ts vendored Normal file
View file

@ -0,0 +1,11 @@
/// <reference types="vite/client" />
declare module "*&imagetools" {
/**
* actual types
* - code https://github.com/JonasKruckenberg/imagetools/blob/main/packages/core/src/output-formats.ts
* - docs https://github.com/JonasKruckenberg/imagetools/blob/main/docs/guide/getting-started.md#metadata
*/
const out;
export default out;
}

11
index.html Normal file
View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<title>Character Select</title>
<script type="module" src="/src/main.ts"></script>
</head>
<body></body>
</html>

7439
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

34
package.json Normal file
View file

@ -0,0 +1,34 @@
{
"name": "character-select",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite --host",
"build": "run-p type-check build-only",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
},
"dependencies": {
"vue": "^3.2.45"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.1.4",
"@types/node": "^18.11.12",
"@vitejs/plugin-vue": "^4.0.0",
"@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^11.0.0",
"@vue/tsconfig": "^0.1.3",
"eslint": "^8.22.0",
"eslint-plugin-vue": "^9.3.0",
"normalize.css": "^8.0.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"sass": "^1.57.1",
"typescript": "~4.7.4",
"vite": "^4.0.0",
"vite-imagetools": "^4.0.14",
"vue-tsc": "^1.0.12"
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

106
src/App.vue Normal file
View file

@ -0,0 +1,106 @@
<script setup lang="ts">
import CharacterList from "@/components/CharacterList.vue";
import CharacterItem from "@/components/CharacterItem.vue";
</script>
<template>
<main>
<CharacterList>
<CharacterItem class="viktor" href="/viktor/">
<template #image>
<img src="@/assets/viktor-portrait.png" alt="Viktor Portrait" />
</template>
<template #name>Viktor Kraastav</template>
</CharacterItem>
<CharacterItem class="sebin" href="/sebin/">
<template #image>
<img src="@/assets/sebin-portrait.png" alt="Sebin Portrait" />
</template>
<template #name>Sebin Nyshkim</template>
</CharacterItem>
<CharacterItem class="jarek" href="/jarek/">
<template #image>
<img src="@/assets/jarek-portrait.png" alt="Jarek Portrait" />
</template>
<template #name>Jarek Vakhtang</template>
</CharacterItem>
</CharacterList>
</main>
</template>
<style lang="scss">
.sebin,
.viktor,
.jarek {
&:before,
&:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
transition: all 0.2s ease-in-out;
filter: saturate(0%);
z-index: -1;
}
&:hover {
&:before,
&:after {
filter: saturate(100%);
}
}
}
.sebin {
font-family: "Exo", sans-serif;
&:before {
background-image: radial-gradient(
circle at bottom right,
#800f0f 5%,
transparent 50%
),
radial-gradient(circle at top left, #195673 5%, #170821 100%);
}
&:after {
background-image: url(@/assets/subtle-prism.svg);
mix-blend-mode: multiply;
}
}
.viktor {
font-family: "Secular One", serif;
&:before {
background-color: #e7c7b1;
}
a {
color: #493428;
}
img {
background-color: #2d4c5a;
}
}
.jarek {
font-family: "Rubik Dirt", sans-serif;
&:before {
background-color: #6b682f;
}
}
</style>

Binary file not shown.

View file

@ -0,0 +1,10 @@
/* exo-black-italic-latin */
@font-face {
font-family: Exo;
font-style: italic;
font-weight: 900;
src: local("Exo Black Italic"), local("Exo-BlackItalic"), url(exo-black-italic-latin.woff2) format("woff2");
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+2215;
font-display: swap;
}

View file

@ -0,0 +1,10 @@
/* rubik-dirt-regular-latin */
@font-face {
font-family: Rubik Dirt;
font-style: normal;
font-weight: 400;
src: local("Rubik Dirt Regular"), local("RubikDirt-Regular"), url(rubik-dirt-regular-latin.woff2) format("woff2");
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+2215;
font-display: swap;
}

View file

@ -0,0 +1,10 @@
/* secularone-regular-latin */
@font-face {
font-family: Secular One;
font-style: normal;
font-weight: 400;
src: local("SecularOne-Regular"), url(secularone-regular-latin.woff2) format("woff2");
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+2215;
font-display: swap;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 KiB

View file

@ -0,0 +1,78 @@
<svg xmlns='http://www.w3.org/2000/svg' width='100%'>
<defs>
<pattern patternUnits='userSpaceOnUse' id='b' width='540' height='450' x='0' y='0' viewBox='0 0 1080 900'>
<g fill-opacity='0.1'>
<polygon fill='#444' points='90 150 0 300 180 300'/>
<polygon points='90 150 180 0 0 0'/>
<polygon fill='#AAA' points='270 150 360 0 180 0'/>
<polygon fill='#DDD' points='450 150 360 300 540 300'/>
<polygon fill='#999' points='450 150 540 0 360 0'/>
<polygon points='630 150 540 300 720 300'/>
<polygon fill='#DDD' points='630 150 720 0 540 0'/>
<polygon fill='#444' points='810 150 720 300 900 300'/>
<polygon fill='#FFF' points='810 150 900 0 720 0'/>
<polygon fill='#DDD' points='990 150 900 300 1080 300'/>
<polygon fill='#444' points='990 150 1080 0 900 0'/>
<polygon fill='#DDD' points='90 450 0 600 180 600'/>
<polygon points='90 450 180 300 0 300'/>
<polygon fill='#666' points='270 450 180 600 360 600'/>
<polygon fill='#AAA' points='270 450 360 300 180 300'/>
<polygon fill='#DDD' points='450 450 360 600 540 600'/>
<polygon fill='#999' points='450 450 540 300 360 300'/>
<polygon fill='#999' points='630 450 540 600 720 600'/>
<polygon fill='#FFF' points='630 450 720 300 540 300'/>
<polygon points='810 450 720 600 900 600'/>
<polygon fill='#DDD' points='810 450 900 300 720 300'/>
<polygon fill='#AAA' points='990 450 900 600 1080 600'/>
<polygon fill='#444' points='990 450 1080 300 900 300'/>
<polygon fill='#222' points='90 750 0 900 180 900'/>
<polygon points='270 750 180 900 360 900'/>
<polygon fill='#DDD' points='270 750 360 600 180 600'/>
<polygon points='450 750 540 600 360 600'/>
<polygon points='630 750 540 900 720 900'/>
<polygon fill='#444' points='630 750 720 600 540 600'/>
<polygon fill='#AAA' points='810 750 720 900 900 900'/>
<polygon fill='#666' points='810 750 900 600 720 600'/>
<polygon fill='#999' points='990 750 900 900 1080 900'/>
<polygon fill='#999' points='180 0 90 150 270 150'/>
<polygon fill='#444' points='360 0 270 150 450 150'/>
<polygon fill='#FFF' points='540 0 450 150 630 150'/>
<polygon points='900 0 810 150 990 150'/>
<polygon fill='#222' points='0 300 -90 450 90 450'/>
<polygon fill='#FFF' points='0 300 90 150 -90 150'/>
<polygon fill='#FFF' points='180 300 90 450 270 450'/>
<polygon fill='#666' points='180 300 270 150 90 150'/>
<polygon fill='#222' points='360 300 270 450 450 450'/>
<polygon fill='#FFF' points='360 300 450 150 270 150'/>
<polygon fill='#444' points='540 300 450 450 630 450'/>
<polygon fill='#222' points='540 300 630 150 450 150'/>
<polygon fill='#AAA' points='720 300 630 450 810 450'/>
<polygon fill='#666' points='720 300 810 150 630 150'/>
<polygon fill='#FFF' points='900 300 810 450 990 450'/>
<polygon fill='#999' points='900 300 990 150 810 150'/>
<polygon points='0 600 -90 750 90 750'/>
<polygon fill='#666' points='0 600 90 450 -90 450'/>
<polygon fill='#AAA' points='180 600 90 750 270 750'/>
<polygon fill='#444' points='180 600 270 450 90 450'/>
<polygon fill='#444' points='360 600 270 750 450 750'/>
<polygon fill='#999' points='360 600 450 450 270 450'/>
<polygon fill='#666' points='540 600 630 450 450 450'/>
<polygon fill='#222' points='720 600 630 750 810 750'/>
<polygon fill='#FFF' points='900 600 810 750 990 750'/>
<polygon fill='#222' points='900 600 990 450 810 450'/>
<polygon fill='#DDD' points='0 900 90 750 -90 750'/>
<polygon fill='#444' points='180 900 270 750 90 750'/>
<polygon fill='#FFF' points='360 900 450 750 270 750'/>
<polygon fill='#AAA' points='540 900 630 750 450 750'/>
<polygon fill='#FFF' points='720 900 810 750 630 750'/>
<polygon fill='#222' points='900 900 990 750 810 750'/>
<polygon fill='#222' points='1080 300 990 450 1170 450'/>
<polygon fill='#FFF' points='1080 300 1170 150 990 150'/>
<polygon points='1080 600 990 750 1170 750'/>
<polygon fill='#666' points='1080 600 1170 450 990 450'/>
<polygon fill='#DDD' points='1080 900 1170 750 990 750'/>
</g>
</pattern>
</defs>
<rect x='0' y='0' fill='url(#b)' width='100%' height='100%'/>
</svg>

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

View file

@ -0,0 +1,105 @@
<script setup lang="ts">
interface Props {
href: string;
}
defineProps<Props>();
</script>
<template>
<li class="character__item">
<a class="character__link" :href="href">
<span class="character__image">
<slot name="image"></slot>
</span>
<span class="character__name">
<slot name="name"></slot>
</span>
</a>
</li>
</template>
<style lang="scss">
.character {
&__item {
flex: 1 1 auto;
display: flex;
flex-flow: column nowrap;
justify-content: center;
align-items: center;
// transform: skew(25deg);
transition: all 0.2s ease-in-out;
position: relative;
&:before {
position: absolute;
content: "";
top: 0;
bottom: 0;
left: 0;
right: 0;
}
&:hover {
flex: 2 1 auto;
}
}
&__item:hover &__link {
transform: scale(1.5);
filter: saturate(100%);
}
&__link {
display: flex;
flex-flow: column nowrap;
justify-content: center;
align-items: center;
// transform: skew(-25deg);
filter: saturate(0%);
}
&__image {
flex: 0 0 auto;
img {
display: block;
width: 30vw;
height: 30vw;
max-width: 15vh;
max-height: 15vh;
margin: 0;
border: 0.25rem solid #fff;
border-radius: 100%;
padding: 0;
@media (min-width: 80em) {
width: 15vw;
height: 15vw;
max-width: 100%;
max-height: 100%;
}
}
}
&__name {
flex: 0 0 auto;
font-size: 1.75rem;
margin: 1.75rem 0 0 0;
@media (min-width: 80em) {
font-size: 2.5vw;
margin: 4vh 0 0 0;
}
}
}
</style>

View file

@ -0,0 +1,33 @@
<script setup lang="ts"></script>
<template>
<ul class="character__list">
<slot></slot>
</ul>
</template>
<style lang="scss">
.character {
&__list {
display: flex;
flex-flow: column nowrap;
justify-content: space-evenly;
position: relative;
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
list-style: none;
overflow: hidden;
@media (min-width: 80em) {
flex-flow: row nowrap;
}
}
}
</style>

7
src/main.ts Normal file
View file

@ -0,0 +1,7 @@
import { createApp } from "vue";
import App from "./App.vue";
import "normalize.css";
import "@/scss/main.scss";
createApp(App).mount("body");

74
src/scss/base.scss Normal file
View file

@ -0,0 +1,74 @@
/* color palette from <https://github.com/vuejs/theme> */
:root {
--vt-c-white: #ffffff;
--vt-c-white-soft: #f8f8f8;
--vt-c-white-mute: #f2f2f2;
--vt-c-black: #181818;
--vt-c-black-soft: #222222;
--vt-c-black-mute: #282828;
--vt-c-indigo: #2c3e50;
--vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
--vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
--vt-c-text-light-1: var(--vt-c-indigo);
--vt-c-text-light-2: rgba(60, 60, 60, 0.66);
--vt-c-text-dark-1: var(--vt-c-white);
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
}
/* semantic color variables for this project */
:root {
--color-background: var(--vt-c-white);
--color-background-soft: var(--vt-c-white-soft);
--color-background-mute: var(--vt-c-white-mute);
--color-border: var(--vt-c-divider-light-2);
--color-border-hover: var(--vt-c-divider-light-1);
--color-heading: var(--vt-c-text-light-1);
--color-text: var(--vt-c-text-light-1);
--section-gap: 160px;
}
@media (prefers-color-scheme: dark) {
:root {
--color-background: var(--vt-c-black);
--color-background-soft: var(--vt-c-black-soft);
--color-background-mute: var(--vt-c-black-mute);
--color-border: var(--vt-c-divider-dark-2);
--color-border-hover: var(--vt-c-divider-dark-1);
--color-heading: var(--vt-c-text-dark-1);
--color-text: var(--vt-c-text-dark-2);
}
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
position: relative;
font-weight: normal;
}
body {
min-height: 100vh;
color: var(--color-text);
background: var(--color-background);
transition: color 0.5s, background-color 0.5s;
line-height: 1.6;
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 15px;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

10
src/scss/main.scss Normal file
View file

@ -0,0 +1,10 @@
@import "@/scss/base.scss";
@import "@/assets/fonts/exo/exo.css";
@import "@/assets/fonts/rubik-dirt/rubik-dirt.css";
@import "@/assets/fonts/secular-one/secular-one.css";
a {
color: #fff;
text-decoration: none;
transition: all 0.2s ease-in-out;
}

8
tsconfig.config.json Normal file
View file

@ -0,0 +1,8 @@
{
"extends": "@vue/tsconfig/tsconfig.node.json",
"include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"],
"compilerOptions": {
"composite": true,
"types": ["node"]
}
}

16
tsconfig.json Normal file
View file

@ -0,0 +1,16 @@
{
"extends": "@vue/tsconfig/tsconfig.web.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"references": [
{
"path": "./tsconfig.config.json"
}
]
}

19
vite.config.ts Normal file
View file

@ -0,0 +1,19 @@
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import { imagetools } from "vite-imagetools";
import vue from "@vitejs/plugin-vue";
// https://vitejs.dev/config/
export default defineConfig({
base: '/',
plugins: [vue(), imagetools()],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
css: {
devSourcemap: true,
},
});