Skip to content

Commit

Permalink
Merge pull request #15 from HE-Arc/sp-13-header-with-naviguation
Browse files Browse the repository at this point in the history
Creating header with base structure
  • Loading branch information
Krucksy authored Mar 8, 2024
2 parents 2c71450 + 103eb81 commit 91c257c
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 71 deletions.
24 changes: 7 additions & 17 deletions frontend/src/assets/main.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
@import './base.css';

#app {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
font-weight: normal;
}

a {
text-decoration: none;
color: var(--miq-blue);
Expand Down Expand Up @@ -41,21 +34,18 @@ label
background-color: var(--color-background-btn-hover);
}

.container
{
max-width: 1100px;
margin: 0 auto;
padding: 0 1rem;
}

@media (hover: hover) {
a:hover {
text-decoration: underline;
}
}

@media (min-width: 1024px) {
body {
display: flex;
place-items: center;
}

#app {
display: grid;
grid-template-columns: 1fr 1fr;
padding: 0 2rem;
}
}
100 changes: 51 additions & 49 deletions frontend/src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import { RouterLink } from 'vue-router'
<template>
<header>
<div class="wrapper">
<span id="main-title">MasterIQ</span>
<RouterLink id="main-title" to="/">MasterIQ</RouterLink>
<nav>
<RouterLink to="/">Categories</RouterLink>
<RouterLink to="/quiz">Quiz</RouterLink>
<RouterLink to="/add-question">Add question</RouterLink>
<RouterLink to="/login">Login</RouterLink>
Expand All @@ -16,73 +15,76 @@ import { RouterLink } from 'vue-router'
</header>
</template>

<style scoped>
#main-title
<style scoped style="scss">
header {
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.25);
line-height: 1.5;
}
.wrapper
{
display: flex;
flex-direction: column;
padding: 1.3rem 0;
}
#main-title {
font-family: 'Bevan', cursive;
font-style: italic;
color: var(--color-heading);
font-size: 2rem;
font-size: 2.2rem;
text-align: center;
margin-bottom: .5rem;
&:hover {
text-decoration: none;
cursor: pointer;
}
}
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);
}
a {
display: inline-block;
padding: 1rem;
font-size: .75rem;
nav a:first-of-type {
border: 0;
}
header {
line-height: 1.5;
max-height: 100vh;
}
.logo {
display: block;
margin: 0 auto 2rem;
&.router-link-exact-active {
transform: scale(1.1);
font-weight: bold;
}
}
}
@media (min-width: 1024px) {
#main-title
{
margin-bottom: 0;
}
.wrapper {
flex-direction: row;
max-width: 1100px;
margin: 0 auto;
padding: 1rem;
}
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
nav
{
margin-top: 0;
padding: 0;
text-align: right;
a
{
font-size: .9rem;
}
}
}
.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>
2 changes: 1 addition & 1 deletion frontend/src/views/AddQuestionView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<section class="add-question">
<section class="add-question container">
<h1>Add your question on this page</h1>
</section>
</template>
2 changes: 1 addition & 1 deletion frontend/src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
</script>

<template>
<main>
<main class="container">
<h1>This is home page with categories</h1>
<button class="btn">Random question</button>
</main>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/LoginView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const submitForm = () => {
</script>
<template>
<section class="login">
<section class="login container">
<h1>This is login page</h1>
<form @submit.prevent="submitForm">
{{ username }} <!-- TODO debug purpose remove this line -->
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/QuizView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<section class="quiz">
<section class="quiz container">
<h1>This is quiz page</h1>
</section>
</template>
2 changes: 1 addition & 1 deletion frontend/src/views/RegisterView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<section class="register">
<section class="register container">
<h1>This is register page</h1>
</section>
</template>

0 comments on commit 91c257c

Please sign in to comment.