Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating structure and base coding #11

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 4 additions & 74 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,85 +1,15 @@
<script setup>
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from './components/HelloWorld.vue'
import { RouterView } from 'vue-router'
import Header from './components/Header.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>

<Header />
<RouterView />
</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;
}

nav a.router-link-exact-active {
color: var(--color-text);
}

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;
@import url('https://fonts.googleapis.com/css2?family=Bevan:ital@0;1&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

padding: 1rem 0;
margin-top: 1rem;
}
}
</style>
59 changes: 28 additions & 31 deletions frontend/src/assets/base.css
Original file line number Diff line number Diff line change
@@ -1,52 +1,49 @@
/* color palette from <https://github.com/vuejs/theme> */
:root {
--vt-c-white: #ffffff;
--vt-c-white-soft: #f8f8f8;
--vt-c-white-mute: #f2f2f2;
--miq-white: #ffffff;
--miq-white-soft: #f8f8f8;
--miq-white-mute: #f2f2f2;

--vt-c-black: #181818;
--vt-c-black-soft: #222222;
--vt-c-black-mute: #282828;
--miq-black: #000000;
--miq-black-soft: #222222;
--miq-black-mute: #282828;

--vt-c-indigo: #2c3e50;
--miq-aqua: #68DAC1;
--miq-yellow: #FFB32C;
--miq-green: #3A7D44;
--miq-red: #D62246;
--miq-blue: #00AAF8;

--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);
--miq-divider-light-1: rgba(60, 60, 60, 0.29);
--miq-divider-light-2: rgba(60, 60, 60, 0.12);
--miq-divider-dark-1: rgba(84, 84, 84, 0.65);
--miq-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);
--miq-text-light-1: var(--miq-aqua);
--miq-text-light-2: rgba(60, 60, 60, 0.66);
--miq-text-dark-1: var(--miq-black);
--miq-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-background: var(--miq-white);
--color-background-soft: var(--miq-white-soft);
--color-background-mute: var(--miq-white-mute);
--color-background-btn: var(--miq-yellow);

--color-border: var(--vt-c-divider-light-2);
--color-border-hover: var(--vt-c-divider-light-1);
--color-border: var(--miq-divider-light-2);
--color-border-hover: var(--miq-divider-light-1);

--color-heading: var(--vt-c-text-light-1);
--color-text: var(--vt-c-text-light-1);
--color-heading: var(--miq-aqua);
--color-text: var(--miq-text-dark-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);
/* Changing color here for dark mode */
}
}

Expand Down
16 changes: 12 additions & 4 deletions frontend/src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,25 @@
font-weight: normal;
}

a,
.green {
a {
text-decoration: none;
color: hsla(160, 100%, 37%, 1);
color: var(--miq-blue);
transition: 0.4s;
padding: 3px;
}

a,
p,
li,
input,
button
{
font-family: 'Montserrat', Inter, sans-serif;
}

@media (hover: hover) {
a:hover {
background-color: hsla(160, 100%, 37%, 0.2);
text-decoration: underline;
}
}

Expand Down
9 changes: 9 additions & 0 deletions frontend/src/components/Categories.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script setup>
</script>

<template>

</template>

<style scoped>
</style>
88 changes: 88 additions & 0 deletions frontend/src/components/Header.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<script setup>
import { RouterLink } from 'vue-router'
</script>

<template>
<header>
<div class="wrapper">
<span id="main-title">MasterIQ</span>
<nav>
<RouterLink to="/">Categories</RouterLink>
<RouterLink to="/quiz">Quiz</RouterLink>
<RouterLink to="/add-question">Add question</RouterLink>
<RouterLink to="/login">Login</RouterLink>
</nav>
</div>
</header>
</template>

<style scoped>
#main-title
{
font-family: 'Bevan', cursive;
font-style: italic;
color: var(--color-heading);
font-size: 2rem;
}

nav {
width: 100%;
font-size: 12px;
text-align: center;
}

nav a.router-link-exact-active {
transform: scale(1.1);
}

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;
}

header {
line-height: 1.5;
max-height: 100vh;
}

.logo {
display: block;
margin: 0 auto 2rem;
}

@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>
26 changes: 19 additions & 7 deletions frontend/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,28 @@ const router = createRouter({
routes: [
{
path: '/',
name: 'home',
name: 'Categories',
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: '/quiz',
name: 'Quiz',
component: () => import('../views/QuizView.vue')
},
{
path: '/add-question',
name: 'Add question',
component: () => import('../views/AddQuestionView.vue')
},
{
path: '/login',
name: 'Login',
component: () => import('../views/LoginView.vue')
},
{
path: '/register',
name: 'Register',
component: () => import('../views/RegisterView.vue')
}
]
})
Expand Down
15 changes: 0 additions & 15 deletions frontend/src/views/AboutView.vue

This file was deleted.

5 changes: 5 additions & 0 deletions frontend/src/views/AddQuestionView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<section class="add-question">
<h1>Add your question on this page</h1>
</section>
</template>
7 changes: 3 additions & 4 deletions frontend/src/views/HomeView.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<script setup>
import TheWelcome from '../components/TheWelcome.vue'
</script>

<template>
<main>
<TheWelcome />
</main>
<main>
<h1>This is home page with categories</h1>
</main>
</template>
5 changes: 5 additions & 0 deletions frontend/src/views/LoginView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<section class="login">
<h1>This is login page</h1>
</section>
</template>
5 changes: 5 additions & 0 deletions frontend/src/views/QuizView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<section class="quiz">
<h1>This is quiz page</h1>
</section>
</template>
5 changes: 5 additions & 0 deletions frontend/src/views/RegisterView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<section class="register">
<h1>This is register page</h1>
</section>
</template>
Loading