feat: add global layout

This commit is contained in:
Kazhnuz 2023-02-03 22:21:16 +01:00
parent 2e07fe2831
commit 047fa027fa
6 changed files with 52 additions and 237 deletions

View file

@ -1,21 +1,13 @@
<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router';
import HelloWorld from './components/HelloWorld.vue';
import { RouterLink, RouterView } from "vue-router";
import TopBar from "./components/layout/TopBar.vue";
import SideBar from "./components/layout/SideBar.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 />
<TopBar id="topbar" />
<div id="wrapper">
<SideBar />
<div id="page"><RouterView /></div>
</div>
</template>

View file

@ -23,6 +23,8 @@ onMounted(() => {
</script>
<template>
<div v-html="htmlContent"></div>
<slot></slot>
<main id="content" class="pt-1">
<div v-html="htmlContent"></div>
<slot></slot>
</main>
</template>

View file

@ -0,0 +1,12 @@
<template>
<aside id="sidebar" class="bg-dark fg-light menu">
<h1 class="title-5 fg-light">Navigation</h1>
<ul>
<li>
<router-link to="/jdr/core" class="menu-item"
>Règles de base</router-link
>
</li>
</ul>
</aside>
</template>

View file

@ -0,0 +1,10 @@
<template>
<header class="bg-primary" id="topbar">
<div class="menu toolbar container fg-light d-block d-flex-sm">
<ul>
<li><router-link to="/" class="menu-item">Home</router-link></li>
<li><router-link to="/about" class="menu-item">About</router-link></li>
</ul>
</div>
</header>
</template>

View file

@ -2,7 +2,7 @@
* Styles that are custom to this particular theme
**/
//@import 'custom/global';
@import 'custom/global';
//@import 'custom/previews';
//@import 'custom/featured';
//@import 'custom/article';

View file

@ -1,229 +1,28 @@
/* --- 03. GLOBAL STYLING --- */
/*
* Les styles "globaux" touchant toute la page.
*
*/
@mixin li-no-margin() {
li {
margin: 0;
}
#topbar {
position:fixed;
width:100%;
}
@mixin container-big() {
padding-left: $lineheight;
padding-right: $lineheight;
max-width: $container-size;
margin:auto;
}
.no-pills {
list-style:none;
}
.align {
&-center {text-align: center;}
&-left {text-align: left;}
&-right {text-align: right;}
}
/* ------------------ HEADERS ------------------- */
#page-header {
background: $color-primary;
margin-bottom:1.5rem;
font-size: 0.8rem;
.fa {
font-size: 1rem;
}
}
header h1 {
border-style:none !important;
font-weight: $fontweight_hyper;
font-size:5.4rem;
font-style:oblique;
padding:1.5rem;
line-height: 1rem;
max-width: $container-size;
margin: auto;
text-align:center;
img {
max-width: 800px;
height: auto;
margin-top:0rem;
width: 100%;
}
a, a:visited, a:hover {
background-color:transparent;
}
}
.osd {
background-color:rgba(0,0,0,0.3);
}
.navbar {
border-left: 0;
border-right: 0;
padding: 0.75rem;
color: $color-font-light;
a {
color: $color-font-light;
}
@include li-no-margin();
}
.categories {
font-weight:800;
font-size:0.8rem;
}
.dropdown-menu {
box-shadow: $narrow-shadow, $inset-shadow;
}
/* ------------------ CONTAINERS ------------------- */
.container-big {
@include container-big();
}
.container-blog {
@include container-big();
display: grid;
grid-template-columns: 1fr;
grid-template-rows: auto;
row-gap: $lineheight;
column-gap: 3rem;
grid-template-areas:
"main"
"side";
@include lg() {
grid-template-columns: auto 360px;
grid-template-areas: "main side";
}
}
.fullwidth {
grid-column: span 2;
}
.sidebar {
grid-area: side;
}
ul.tag-list {
#wrapper {
padding-top:3rem;
display:flex;
padding-bottom:0;
overflow: hidden;
height:auto;
flex-wrap: wrap;
height:100vh;
}
li {
list-style: none;
margin:3px;
#sidebar {
padding-top:1rem;
width:18rem;
h1 {
text-align:center;
padding-bottom:.5rem;
}
}
.container-preview {
@include container-big();
display: grid;
grid-template-columns: 1fr;
grid-template-rows: auto;
row-gap: $lineheight;
column-gap: 3rem;
grid-template-areas:
"main"
"side";
@include lg() {
grid-template-columns: 360px auto;
grid-template-areas: "side main";
}
#page {
flex-grow:1;
}
.container-onecolumn {
max-width:1280px;
margin: auto;
padding-bottom: $lineheight;
}
.container-personnage {
@include container-big();
display: grid;
grid-template-columns: repeat(6, 1fr);
grid-template-rows: auto;
row-gap: 3rem;
column-gap: 3rem;
grid-template-areas:
"nomp nomp nomp nomp nomp nomp"
"info info info info meta meta"
"goss goss look look look look"
"aime aime aime dete dete dete"
"hist hist hist hist hist hist";
.card {
margin:0;
}
h1 {
padding:0;
}
}
.personnage {
&-nomp {grid-area: nomp;}
&-info {grid-area: info;}
&-meta {grid-area: meta;}
&-goss {grid-area: goss;}
&-look {grid-area: look;}
&-aime {grid-area: aime;}
&-dete {grid-area: dete;}
&-hist {grid-area: hist;}
}
/* ------------------ PAGE ------------------- */
#wrapper {
background-color: $color-background;
}
/* ------------------ FOOTER ------------------- */
$color-footer-back: get-color("dark");
$color-footer-text: get-color("light");
body {
// On colorise le background de la page complete de la même
// couleur que le fond du footer.
background-color: $color-footer-back;
}
footer {
color: $color-footer-text;
padding-bottom:1.5rem;
.columns {
font-size:0.8rem;
a,
a:visited {
&:hover,
&:active,
&:visited {
color: $color-footer-text;
}
}
}
}
.home-toast {
#content {
max-width:800px;
width:100%;
margin:auto;
}