diff --git a/assets/styles/layout.scss b/assets/styles/layout.scss index 9c4228b..19f5e1b 100644 --- a/assets/styles/layout.scss +++ b/assets/styles/layout.scss @@ -1,16 +1,3 @@ -body { - // fill screen - margin: 0; - min-height: 100vh; - overflow-x: clip; - - // center everything - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; -} - .row { display: flex; flex-direction: row; } .col { display: flex; flex-direction: column; } .wrap { display: flex; flex-wrap: wrap; } diff --git a/assets/styles/structure.scss b/assets/styles/structure.scss new file mode 100644 index 0000000..6f79590 --- /dev/null +++ b/assets/styles/structure.scss @@ -0,0 +1,29 @@ +body { margin: 0 } + +// by default keep page at the top of the screen +:root { --header-height: 0px } +// offset page giving room for header when it's present +:root:has(header + #page) { --header-height: 3rem } + +#page { + position: fixed; + top: var(--header-height); + width: 100vw; + max-width: 100vw; + // fill vertically exactly to remaining screen size (since we + --root-size: calc(100vh - var(--header-height)); + max-height: var(--root-size); + min-height: var(--root-size); + // center contents + display: flex; + flex-direction: column; + & > * { align-self: center; margin: auto; } +} + +// only show scrollbar when needed & make header hide stuff under it +body { overflow-y: overlay; } +#page { + overflow: scroll; + overflow-x: hidden; + overflow-y: overlay; +} diff --git a/components/Header.vue b/components/Header.vue new file mode 100644 index 0000000..8115c84 --- /dev/null +++ b/components/Header.vue @@ -0,0 +1,49 @@ + + + + + diff --git a/components/Links.vue b/components/Links.vue new file mode 100644 index 0000000..dc11388 --- /dev/null +++ b/components/Links.vue @@ -0,0 +1,60 @@ + + + diff --git a/layouts/default.vue b/layouts/default.vue index ba4672f..86c45f6 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -1,3 +1,7 @@ diff --git a/layouts/home.vue b/layouts/home.vue new file mode 100644 index 0000000..dbe1b75 --- /dev/null +++ b/layouts/home.vue @@ -0,0 +1,5 @@ + diff --git a/nuxt.config.ts b/nuxt.config.ts index 8fdfb2f..cec4685 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -4,9 +4,12 @@ export default defineNuxtConfig({ typescript: { strict: true, typeCheck: true, shim: false }, modules: ['nuxt-lodash', 'nuxt-icon', '@nuxt/content'], - css: ['~/assets/styles/layout.scss', '~/assets/styles/misc.scss', '~/assets/styles/font.scss', '~/assets/styles/components.scss'], + css: ['~/assets/styles/layout.scss', '~/assets/styles/misc.scss', '~/assets/styles/font.scss', '~/assets/styles/components.scss', '~/assets/styles/structure.scss'], app: { + // no useless root nuxt div + rootTag: 'body', + head: { htmlAttrs: { lang: 'en' }, title: 'F53', diff --git a/pages/index.vue b/pages/index.vue index c605fcc..468a6a9 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1,3 +1,7 @@ + +