diff --git a/cypress/e2e/example.cy.ts b/cypress/e2e/example.cy.ts deleted file mode 100644 index 7554c35d8d0ff1412457a5ae7f8649a9871cc21b..0000000000000000000000000000000000000000 --- a/cypress/e2e/example.cy.ts +++ /dev/null @@ -1,8 +0,0 @@ -// https://on.cypress.io/api - -describe('My First Test', () => { - it('visits the app root url', () => { - cy.visit('/') - cy.contains('h1', 'You did it!') - }) -}) diff --git a/cypress/e2e/navigation.cy.ts b/cypress/e2e/navigation.cy.ts new file mode 100644 index 0000000000000000000000000000000000000000..886c8cb406e848dc47ec63fde0f1c13329315639 --- /dev/null +++ b/cypress/e2e/navigation.cy.ts @@ -0,0 +1,8 @@ +// https://on.cypress.io/api + +describe('Testing site navigation', () => { + it('visits the home page', () => { + cy.visit('/') + cy.contains('nav', 'Hjem') + }) +}) diff --git a/src/App.vue b/src/App.vue index 33f1bfd678a1976d43748251cdb14cdf77e11219..55bb82c9ac7f56b397714e4c36c79718e5fede89 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,41 +1,26 @@ <script setup lang="ts"> import { RouterLink, RouterView } from 'vue-router' -import HelloWorld from './components/HelloWorld.vue' </script> <template> - <header> - <img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" /> - - <div class="wrapper"> - <HelloWorld msg="You did it!" /> - - <nav> - <RouterLink to="/">Home</RouterLink> - <RouterLink to="/about">About</RouterLink> - </nav> - </div> - </header> - - <RouterView /> + <nav> + <RouterLink to="/">Hjem</RouterLink> + <RouterLink to="/sparemaal">Sparemål</RouterLink> + <RouterLink to="/spareutfordringer">Spareutfordringer</RouterLink> + <RouterLink to="/profil">Profil</RouterLink> + </nav> + + <main> + <RouterView /> + </main> </template> <style scoped> -header { - line-height: 1.5; - max-height: 100vh; -} - -.logo { - display: block; - margin: 0 auto 2rem; -} - nav { - width: 100%; - font-size: 12px; - text-align: center; - margin-top: 2rem; + display: flex; + justify-content: center; + gap: 1rem; + margin: 1rem 0; } nav a.router-link-exact-active { @@ -45,41 +30,4 @@ nav a.router-link-exact-active { nav a.router-link-exact-active:hover { background-color: transparent; } - -nav a { - display: inline-block; - padding: 0 1rem; - border-left: 1px solid var(--color-border); -} - -nav a:first-of-type { - border: 0; -} - -@media (min-width: 1024px) { - header { - display: flex; - place-items: center; - padding-right: calc(var(--section-gap) / 2); - } - - .logo { - margin: 0 2rem 0 0; - } - - header .wrapper { - display: flex; - place-items: flex-start; - flex-wrap: wrap; - } - - nav { - text-align: left; - margin-left: -1rem; - font-size: 1rem; - - padding: 1rem 0; - margin-top: 1rem; - } -} </style> diff --git a/src/assets/base.css b/src/assets/base.css index 8710b9aeab5be4a2fa828acca9b749e0f08fd34f..490eb3b7be9f2d010f3e6267e8e8d1665d0c7c76 100644 --- a/src/assets/base.css +++ b/src/assets/base.css @@ -1,52 +1,28 @@ -/* 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; +@import url('https://fonts.googleapis.com/css2?family=Karla:wght@400;700&display=swap'); - --vt-c-indigo: #2c3e50; +:root { + --black: #363739; + --white: #ffffff; - --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); + --bright: #f7da7c; - --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); + --accent1: #f4bab9; + --accent2: #b2c79f; + --accent3: #ef9691; } -/* 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); + --color-background: var(--white); + --color-text: var(--black); + --color-button: var(--bright); + --color-link: var(--accent3); --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); + /* TODO: add dark mode colors */ } } @@ -66,19 +42,7 @@ body { 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-family: 'Karla', sans-serif; font-size: 15px; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; diff --git a/src/assets/main.css b/src/assets/main.css index 6f4694a8555028317080d527df1c6faf3d4f6340..07b944bcf27c111d3c4da73328d90a4feba2509e 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -1,21 +1,55 @@ @import './base.css'; + @tailwind base; @tailwind components; @tailwind utilities; #app { max-width: 1280px; - margin: 0 auto; + margin: 0 auto auto auto; + width: 100%; padding: 2rem; font-weight: normal; + + display: flex; + flex-direction: column; +} + +h1, +h2, +h3 { + font-weight: bold; +} + +h1 { + font-size: 2.5rem; + margin-bottom: 1rem; +} + +h2 { + font-size: 2rem; + margin-bottom: 1rem; +} + +h3 { + font-size: 1.5rem; + margin-bottom: 1rem; } -a, -.green { +button { + background-color: var(--color-button); + color: var(--color-text); + border: none; + padding: 0.2rem 1rem; + border-radius: 1rem; + cursor: pointer; + transition: 0.4s; +} + +a { text-decoration: none; - color: hsla(160, 100%, 37%, 1); + color: var(--color-link); transition: 0.4s; - padding: 3px; } @media (hover: hover) { @@ -23,16 +57,3 @@ a, background-color: hsla(160, 100%, 37%, 0.2); } } - -@media (min-width: 1024px) { - body { - display: flex; - place-items: center; - } - - #app { - display: grid; - grid-template-columns: 1fr 1fr; - padding: 0 2rem; - } -} diff --git a/src/components/FormUserDetails.vue b/src/components/FormUserDetails.vue new file mode 100644 index 0000000000000000000000000000000000000000..b70ab1a5bc31acbde19fabe9ab1114a76535850a --- /dev/null +++ b/src/components/FormUserDetails.vue @@ -0,0 +1,7 @@ +<script lang="ts" setup></script> + +<template> + <h3>Logg inn</h3> +</template> + +<style scoped></style> diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index 8e543a5c2c6dbf9c5fdc3773070696b230524f46..0000000000000000000000000000000000000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,42 +0,0 @@ -<script setup lang="ts"> -defineProps<{ - msg: string -}>() -</script> - -<template> - <div class="greetings"> - <h1 class="green">{{ msg }}</h1> - <h2 class="font-bold underline">Welcome to your Vite + Vue 3 project!</h2> - <h3> - You’ve successfully created a project with - <a href="https://vitejs.dev/" target="_blank" rel="noopener">Vite</a> + - <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue 3</a>. What's next? - </h3> - </div> -</template> - -<style scoped> -h1 { - font-weight: 500; - font-size: 2.6rem; - position: relative; - top: -10px; -} - -h3 { - font-size: 1.2rem; -} - -.greetings h1, -.greetings h3 { - text-align: center; -} - -@media (min-width: 1024px) { - .greetings h1, - .greetings h3 { - text-align: left; - } -} -</style> diff --git a/src/components/TheWelcome.vue b/src/components/TheWelcome.vue deleted file mode 100644 index 84c3146b9e591d2d61ba0d5e4a48181f5dbe61e2..0000000000000000000000000000000000000000 --- a/src/components/TheWelcome.vue +++ /dev/null @@ -1,91 +0,0 @@ -<script setup lang="ts"> -import WelcomeItem from './WelcomeItem.vue' -import DocumentationIcon from './icons/IconDocumentation.vue' -import ToolingIcon from './icons/IconTooling.vue' -import EcosystemIcon from './icons/IconEcosystem.vue' -import CommunityIcon from './icons/IconCommunity.vue' -import SupportIcon from './icons/IconSupport.vue' -</script> - -<template> - <WelcomeItem> - <template #icon> - <DocumentationIcon /> - </template> - <template #heading>Documentation</template> - - Vue’s - <a href="https://vuejs.org/" target="_blank" rel="noopener">official documentation</a> - provides you with all information you need to get started. - </WelcomeItem> - - <WelcomeItem> - <template #icon> - <ToolingIcon /> - </template> - <template #heading>Tooling</template> - - This project is served and bundled with - <a href="https://vitejs.dev/guide/features.html" target="_blank" rel="noopener">Vite</a>. - The recommended IDE setup is - <a href="https://code.visualstudio.com/" target="_blank" rel="noopener">VSCode</a> + - <a href="https://github.com/johnsoncodehk/volar" target="_blank" rel="noopener">Volar</a>. - If you need to test your components and web pages, check out - <a href="https://www.cypress.io/" target="_blank" rel="noopener">Cypress</a> and - <a href="https://on.cypress.io/component" target="_blank" rel="noopener" - >Cypress Component Testing</a - >. - - <br /> - - More instructions are available in <code>README.md</code>. - </WelcomeItem> - - <WelcomeItem> - <template #icon> - <EcosystemIcon /> - </template> - <template #heading>Ecosystem</template> - - Get official tools and libraries for your project: - <a href="https://pinia.vuejs.org/" target="_blank" rel="noopener">Pinia</a>, - <a href="https://router.vuejs.org/" target="_blank" rel="noopener">Vue Router</a>, - <a href="https://test-utils.vuejs.org/" target="_blank" rel="noopener">Vue Test Utils</a>, - and - <a href="https://github.com/vuejs/devtools" target="_blank" rel="noopener">Vue Dev Tools</a - >. If you need more resources, we suggest paying - <a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener" - >Awesome Vue</a - > - a visit. - </WelcomeItem> - - <WelcomeItem> - <template #icon> - <CommunityIcon /> - </template> - <template #heading>Community</template> - - Got stuck? Ask your question on - <a href="https://chat.vuejs.org" target="_blank" rel="noopener">Vue Land</a>, our official - Discord server, or - <a href="https://stackoverflow.com/questions/tagged/vue.js" target="_blank" rel="noopener" - >StackOverflow</a - >. You should also subscribe to - <a href="https://news.vuejs.org" target="_blank" rel="noopener">our mailing list</a> and - follow the official - <a href="https://twitter.com/vuejs" target="_blank" rel="noopener">@vuejs</a> - twitter account for latest news in the Vue world. - </WelcomeItem> - - <WelcomeItem> - <template #icon> - <SupportIcon /> - </template> - <template #heading>Support Vue</template> - - As an independent project, Vue relies on community backing for its sustainability. You can - help us by - <a href="https://vuejs.org/sponsor/" target="_blank" rel="noopener">becoming a sponsor</a>. - </WelcomeItem> -</template> diff --git a/src/components/WelcomeItem.vue b/src/components/WelcomeItem.vue deleted file mode 100644 index 8325ed136eac64f62d07f396930a2fa9fc6a15be..0000000000000000000000000000000000000000 --- a/src/components/WelcomeItem.vue +++ /dev/null @@ -1,87 +0,0 @@ -<template> - <div class="item"> - <i> - <slot name="icon"></slot> - </i> - <div class="details"> - <h3> - <slot name="heading"></slot> - </h3> - <slot></slot> - </div> - </div> -</template> - -<style scoped> -.item { - margin-top: 2rem; - display: flex; - position: relative; -} - -.details { - flex: 1; - margin-left: 1rem; -} - -i { - display: flex; - place-items: center; - place-content: center; - width: 32px; - height: 32px; - - color: var(--color-text); -} - -h3 { - font-size: 1.2rem; - font-weight: 500; - margin-bottom: 0.4rem; - color: var(--color-heading); -} - -@media (min-width: 1024px) { - .item { - margin-top: 0; - padding: 0.4rem 0 1rem calc(var(--section-gap) / 2); - } - - i { - top: calc(50% - 25px); - left: -26px; - position: absolute; - border: 1px solid var(--color-border); - background: var(--color-background); - border-radius: 8px; - width: 50px; - height: 50px; - } - - .item:before { - content: ' '; - border-left: 1px solid var(--color-border); - position: absolute; - left: 0; - bottom: calc(50% + 25px); - height: calc(50% - 25px); - } - - .item:after { - content: ' '; - border-left: 1px solid var(--color-border); - position: absolute; - left: 0; - top: calc(50% + 25px); - height: calc(50% - 25px); - } - - .item:first-of-type:before { - display: none; - } - - .item:last-of-type:after { - display: none; - } -} -</style> diff --git a/src/components/__tests__/FormUserDetailsTest.spec.ts b/src/components/__tests__/FormUserDetailsTest.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..25787361be0df8745287ffd67f67de47aa887c08 --- /dev/null +++ b/src/components/__tests__/FormUserDetailsTest.spec.ts @@ -0,0 +1,11 @@ +import { describe, expect, it } from 'vitest' + +import { mount } from '@vue/test-utils' +import FormUserDetails from '../FormUserDetails.vue' + +describe('FormUserDetails', () => { + it('renders properly', () => { + const wrapper = mount(FormUserDetails) + expect(wrapper.text()).toContain('Logg inn') + }) +}) diff --git a/src/components/__tests__/HelloWorld.spec.ts b/src/components/__tests__/HelloWorld.spec.ts deleted file mode 100644 index bc865f03f07413893c6331cc332247576b092526..0000000000000000000000000000000000000000 --- a/src/components/__tests__/HelloWorld.spec.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { describe, it, expect } from 'vitest' - -import { mount } from '@vue/test-utils' -import HelloWorld from '../HelloWorld.vue' - -describe('HelloWorld', () => { - it('renders properly', () => { - const wrapper = mount(HelloWorld, { props: { msg: 'Hello Vitest' } }) - expect(wrapper.text()).toContain('Hello Vitest') - }) -}) diff --git a/src/router/index.ts b/src/router/index.ts index 655843cb68ac1f7aed6c333c62f9b4657da6d9ef..c7a05f60d3ad46d0cb2fd122454207ac2a550a30 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -10,12 +10,30 @@ const router = createRouter({ component: HomeView }, { - path: '/about', - name: 'about', - // route level code-splitting - // this generates a separate chunk (About.[hash].js) for this route - // which is lazy-loaded when the route is visited. - component: () => import('../views/AboutView.vue') + path: '/login', + name: 'login', + component: () => import('../views/LoginView.vue') + }, + { + path: '/profil', + name: 'profile', + component: () => import('../views/ProfileView.vue') + }, + { + path: '/sparemaal', + name: 'goals', + component: () => import('../views/GoalView.vue') + + }, + { + path: '/spareutfordringer', + name: 'challenges', + component: () => import('../views/ChallengeView.vue') + }, + { + path: '/:pathMatch(.*)*', + name: 'not-found', + component: () => import('../views/NotFoundView.vue') } ] }) diff --git a/src/stores/counter.ts b/src/stores/counter.ts deleted file mode 100644 index 5cdda009a5449a1423b51eb25007a4fb12a82b9b..0000000000000000000000000000000000000000 --- a/src/stores/counter.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ref, computed } from 'vue' -import { defineStore } from 'pinia' - -export const useCounterStore = defineStore('counter', () => { - const count = ref(0) - const doubleCount = computed(() => count.value * 2) - function increment() { - count.value++ - } - - return { count, doubleCount, increment } -}) diff --git a/src/views/AboutView.vue b/src/views/AboutView.vue deleted file mode 100644 index f470365d8ba7815af68c71a41ace7937383b4a70..0000000000000000000000000000000000000000 --- a/src/views/AboutView.vue +++ /dev/null @@ -1,15 +0,0 @@ -<template> - <div class="about"> - <h1>This is an about page</h1> - </div> -</template> - -<style> -@media (min-width: 1024px) { - .about { - min-height: 100vh; - display: flex; - align-items: center; - } -} -</style> diff --git a/src/views/ChallengeView.vue b/src/views/ChallengeView.vue new file mode 100644 index 0000000000000000000000000000000000000000..ac4bacc7c3265e9e2add7c4a8d3ec46a1d3c617a --- /dev/null +++ b/src/views/ChallengeView.vue @@ -0,0 +1,11 @@ +<script setup lang="ts"> + +</script> + +<template> + <h1>Spareutfordringer</h1> +</template> + +<style scoped> + +</style> \ No newline at end of file diff --git a/src/views/GoalView.vue b/src/views/GoalView.vue new file mode 100644 index 0000000000000000000000000000000000000000..c68c92fbe557f7a57b947d80e744c9edcc51eca1 --- /dev/null +++ b/src/views/GoalView.vue @@ -0,0 +1,11 @@ +<script setup lang="ts"> + +</script> + +<template> + <h1>Sparemål</h1> +</template> + +<style scoped> + +</style> \ No newline at end of file diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index c3b238e54376195f5846bf62160937ade7b6ab90..5e3249d34a08312be3f33f40e637191aa7b01888 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -1,9 +1,17 @@ <script setup lang="ts"> -import TheWelcome from '../components/TheWelcome.vue' </script> <template> - <main> - <TheWelcome /> - </main> + <h1>Heading 1</h1> + <h2>Heading 2</h2> + <h3>Heading 3</h3> + + <p>Paragraph</p> + + <button>Button</button> + <br> + <a href="#">Link</a> + <div>Div</div> + <section>Section</section> + <article>Article</article> </template> diff --git a/src/views/LoginView.vue b/src/views/LoginView.vue new file mode 100644 index 0000000000000000000000000000000000000000..43e41eec5fb68242bedb64e249f83fa74cd003ef --- /dev/null +++ b/src/views/LoginView.vue @@ -0,0 +1,11 @@ +<script setup lang="ts"> + +</script> + +<template> + <h1>Logg inn</h1> +</template> + +<style scoped> + +</style> \ No newline at end of file diff --git a/src/views/NotFoundView.vue b/src/views/NotFoundView.vue new file mode 100644 index 0000000000000000000000000000000000000000..619e71e12e235f6cede9cec37636d816f633b798 --- /dev/null +++ b/src/views/NotFoundView.vue @@ -0,0 +1,12 @@ +<script setup lang="ts"> + +</script> + +<template> + <h1>404 - Siden finnes ikke</h1> + <p>Denne siden finnes ikke. Gå tilbake til <RouterLink to="/">hjem</RouterLink>.</p> +</template> + +<style scoped> + +</style> \ No newline at end of file diff --git a/src/views/ProfileView.vue b/src/views/ProfileView.vue new file mode 100644 index 0000000000000000000000000000000000000000..b877bfe1cfefcc69fd7415ce1cd61a10425de791 --- /dev/null +++ b/src/views/ProfileView.vue @@ -0,0 +1,11 @@ +<script setup lang="ts"> + +</script> + +<template> + <h1>Din profil</h1> +</template> + +<style scoped> + +</style> \ No newline at end of file