Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Separe app header & footer and refactror login & signup pages

Smaug67390194060d5eb5
diff --git a/frontend/components/AppFooter.vue b/frontend/components/AppFooter.vue
new file mode 100644
index 00000000..a47bece1
--- /dev/null
+++ b/frontend/components/AppFooter.vue
@@ -0,0 +1,22 @@
+<template>
+ <footer>
+ <Logo />
+ <p class="p2">Developed and designed by Smaug with ❀️</p>
+ </footer>
+</template>
+
+<style scoped lang="scss">
+footer {
+ padding: 1rem;
+ display: flex;
+ justify-content: space-between;
+ margin: 0 30px;
+}
+
+@media (max-width: 768px) {
+ footer {
+ margin: 0;
+ padding: 0;
+ }
+}
+</style>
diff --git a/frontend/components/AppHeader.vue b/frontend/components/AppHeader.vue
new file mode 100644
index 00000000..d5042d1c
--- /dev/null
+++ b/frontend/components/AppHeader.vue
@@ -0,0 +1,38 @@
+<template>
+ <nav>
+ <NuxtLink to="/login" class="login">Login</NuxtLink>
+ <NuxtLink to="/signup" class="sign-up">Sign up</NuxtLink>
+ </nav>
+</template>
+
+<style scoped lang="scss">
+nav {
+ display: flex;
+ justify-content: flex-end;
+ a {
+ padding: 4px 15px;
+ margin: 0 8px;
+ border-radius: 25px;
+ }
+}
+
+.sign-up {
+ background: var(--bg-color);
+ border: 1px solid var(--border-color);
+
+ &:hover {
+ outline: 2px solid var(--border-color);
+ outline-offset: 2px;
+ }
+}
+
+.login {
+ background: var(--font-color);
+ color: var(--bg-color);
+
+ &:hover {
+ outline: 2px solid var(--font-color);
+ outline-offset: 2px;
+ }
+}
+</style>
diff --git a/frontend/components/Logo.vue b/frontend/components/Logo.vue
index 6bf79c60..3ddf4e92 100644
--- a/frontend/components/Logo.vue
+++ b/frontend/components/Logo.vue
@@ -5,7 +5,7 @@ const colorMode = useColorMode();
<template>
<div style="display: flex; align-items: center; column-gap: 0.5rem">
<img style="width: 50px" :src="`/Alexandrie-${colorMode.value}.svg`" alt="Alexandrie" />
- <p style="font-weight: 600; font-family: Poppins">Alexandrie</p>
+ <NuxtLink to="/" style="font-weight: 600; font-family: Poppins">Alexandrie</NuxtLink>
</div>
</template>
<style scoped>
diff --git a/frontend/pages/index.vue b/frontend/pages/index.vue
index e647f680..be56fef8 100644
--- a/frontend/pages/index.vue
+++ b/frontend/pages/index.vue
@@ -1,42 +1,32 @@
<template>
- <div class="container">
- <nav>
- <div class="actions">
- <NuxtLink to="/login" class="login">Login</NuxtLink>
- <NuxtLink to="/signup" class="sign-up">Sign up</NuxtLink>
- </div>
- </nav>
- <main>
- <div class="content-wrapper">
- <div class="intro">
- <div class="intro-text">
- <h1>
- Your Ideas, Documents & Plans. <br />
- Alexandrie
- </h1>
- <h3>Centralize Your Notes. Enhance Your Productivity.</h3>
- </div>
- <div class="btns-block">
- <NuxtLink to="/dashboard" class="get-started">Get started</NuxtLink>
- <NuxtLink to="https://github.com/Smaug6739/Alexandrie" target="_blank" class="github">Github</NuxtLink>
- </div>
+ <main>
+ <AppHeader />
+ <div class="content-wrapper">
+ <div class="intro">
+ <div class="intro-text">
+ <h1>
+ Your Ideas, Documents & Plans. <br />
+ Alexandrie
+ </h1>
+ <h3>Centralize Your Notes. Enhance Your Productivity.</h3>
</div>
- <div class="images">
- <img :src="`/main-${colorMode.value}.webp`" alt="Documents Image" />
+ <div class="btns-block">
+ <NuxtLink to="/dashboard" class="get-started">Get started</NuxtLink>
+ <NuxtLink to="https://github.com/Smaug6739/Alexandrie" target="_blank" class="github">Github</NuxtLink>
</div>
</div>
- <h2 style="text-align: center; border: none">Try editor online</h2>
- <div class="editor"><MarkdownEditor :doc="doc" :options="{ showPreview: !isMobile(), toolbar: 'minimal' }" /></div>
- <h2 style="text-align: center; border: none">Organize your documents</h2>
- <div class="demo">
- <img src="/home.webp" alt="home" />
+ <div class="images">
+ <img :src="`/main-${colorMode.value}.webp`" alt="Documents Image" />
</div>
- </main>
- <footer>
- <Logo />
- <p class="p2">Developed and designed by Smaug with ❀️</p>
- </footer>
- </div>
+ </div>
+ <h2 style="text-align: center; border: none">Try editor online</h2>
+ <div class="editor"><MarkdownEditor :doc="doc" :options="{ showPreview: !isMobile(), toolbar: 'minimal' }" /></div>
+ <h2 style="text-align: center; border: none">Organize your documents</h2>
+ <div class="demo">
+ <img src="/home.webp" alt="home" />
+ </div>
+ <AppFooter />
+ </main>
</template>
<script setup lang="ts">
@@ -44,140 +34,28 @@ const colorMode = useColorMode();
import MarkdownEditor from '~/components/MarkdownEditor/MarkdownEditor.vue';
const doc = ref({
- content_markdown: `# Welcome to Alexandrie ! πŸš€
-## Formatting options
-
-Lorem **ipsum dolor** *sit amet*, consectetur _adipiscing elit_. ==But not sad.==
-
-### Different content blocks
-
-:::blue Blue
-A blue block
-:::
-:::red Red
-A red block
-:::
-:::green Green
-A green block
-:::
-:::grey Grey
-A grey block
-:::
-:::yellow Yellow
-A yellow block
-:::
-:::turquoise Turquoise
-A turquoise block
-:::
-:::details Details
-A details block
-:::
-
-
-:::no-print
-This content will not be printed
-:::
-
-:::center
-This content is centered
-:::
-
-:::definition Red Info
-Block of content (ex: definition)
-:::
-
-:::property Blue Info
-Block of content (ex: property)
-:::
-
-:::theorem Turquoise Info
-Block of content (ex: theorem)
-:::
-
-:::info-u Info without background
-Block of content (ex: info, tip, note)
-:::
-
-:::warning Warning Info
-Block of content (ex: warning)
-:::
-
-### Bullet and Numbered Lists:
-
-- Bullet 1
-- Bullet 2
- - Sub-bullet 2-1
-
-1. Item 1
-1. Item 2
-
-### Markdown Tables
-
-| Column 1 | Column 2 | Column 3 |
-|:----------|:----------|:---------|
-|Item 1 | Item 2 | Item 3 |
-
-### Other formats
-
-$\\text{This is a math block: } f(x) = ax^2+bx+c$
-
-\`\`\`javascript
-const hello = "Hello world";
-\`\`\`
-
-> Note: This content is a quote
->> Nested quote
-
-## Shortcuts
-
-- **Ctrl + S**: Save
-- **Ctrl + P**: Toggle preview
-- **Ctrl + Q**: Switch to document
-- **Ctrl + B**: Bold formatting
-- **Ctrl + I**: Italic formatting
-- **Ctrl + U**: Underline formatting
-- **Ctrl + K**: Insert link
-- **Ctrl + M**: Insert image
-
-## Snippets
-
-- **!m**: Insert a math block (LaTeX)
-- **!def**: Insert a definition block
-- **!thm**: Insert a theorem block
-- **!center**: Center the content
-- **!red**: Insert a red block
-- **!green**: Insert a green block
-- **!blue**: Insert a blue block
-- **!yellow**: Insert a yellow block
-- **!details**: Insert a details block
-`,
+ content_markdown: `# Welcome to Alexandrie ! πŸš€\n## Formatting options\n\nLorem **ipsum dolor** *sit amet*, consectetur _adipiscing elit_. ==But not sad.== \n\n### Different content blocks\n\n:::blue Blue\nA blue block\n:::\n:::red Red\nA red block\n:::\n:::green Green\nA green block\n:::\n:::grey Grey\nA grey block\n:::\n:::yellow Yellow\nA yellow block\n:::\n:::turquoise Turquoise\nA turquoise block\n:::\n:::details Details\nA details block\n:::\n\n\n:::no-print\nThis content will not be printed\n:::\n\n:::center\nThis content is centered\n:::\n\n:::definition Red Info\nBlock of content (ex: definition)\n:::\n\n:::property Blue Info\nBlock of content (ex: property)\n:::\n\n:::theorem Turquoise Info\nBlock of content (ex: theorem)\n:::\n\n:::info-u Info without background\nBlock of content (ex: info, tip, note)\n:::\n\n:::warning Warning Info\nBlock of content (ex: warning)\n:::\n\n### Bullet and Numbered Lists:\n\n- Bullet 1\n- Bullet 2\n - Sub-bullet 2-1\n\n1. Item 1\n1. Item 2\n\n### Markdown Tables\n\n| Column 1 | Column 2 | Column 3 |\n|:----------|:----------|:---------|\n|Item 1 | Item 2 | Item 3 |\n\n### Other formats\n\n$\\text{This is a math block: } f(x) = ax^2+bx+c$\n\n\`\`\`javascript\nconst hello = "Hello world";\n\`\`\`\n\n> Note: This content is a quote\n>> Nested quote\n\n## Shortcuts\n\n- **Ctrl + S**: Save\n- **Ctrl + P**: Toggle preview\n- **Ctrl + Q**: Switch to document\n- **Ctrl + B**: Bold formatting\n- **Ctrl + I**: Italic formatting\n- **Ctrl + U**: Underline formatting\n- **Ctrl + K**: Insert link\n- **Ctrl + M**: Insert image\n\n## Snippets\n\n- **!m**: Insert a math block (LaTeX)\n- **!def**: Insert a definition block\n- **!thm**: Insert a theorem block\n- **!center**: Center the content\n- **!red**: Insert a red block\n- **!green**: Insert a green block\n- **!blue**: Insert a blue block\n- **!yellow**: Insert a yellow block\n- **!details**: Insert a details block\n`,
});
</script>
<style scoped lang="scss">
-.container {
+main {
+ flex-grow: 1;
+ padding-top: 1.5rem;
width: 95%;
margin: 0 auto;
}
-nav {
- width: fit-content;
- justify-content: space-between;
- font-weight: 500;
- margin: 15px 0 0 auto;
-}
h2 {
font-size: 1.8rem;
font-weight: 700;
margin: 0;
}
-.actions {
- a {
- padding: 4px 15px;
- margin: 0 8px;
- border-radius: 25px;
- }
+.editor {
+ max-width: 1200px;
+ height: 700px;
+ margin: 0 auto;
}
.demo {
width: 100%;
@@ -190,35 +68,6 @@ h2 {
margin: 25px auto;
}
}
-.editor {
- max-width: 1200px;
- height: 700px;
- margin: 0 auto;
-}
-.sign-up {
- background: var(--bg-color);
- border: 1px solid var(--border-color);
-
- &:hover {
- outline: 2px solid var(--border-color);
- outline-offset: 2px;
- }
-}
-
-.login {
- background: var(--font-color);
- color: var(--bg-color);
-
- &:hover {
- outline: 2px solid var(--font-color);
- outline-offset: 2px;
- }
-}
-
-main {
- flex-grow: 1;
- padding-top: 1.5rem;
-}
.content-wrapper {
display: flex;
@@ -288,13 +137,6 @@ main {
width: 800px;
}
-footer {
- padding: 1rem;
- display: flex;
- justify-content: space-between;
- margin: 0 30px;
-}
-
@media (max-width: 768px) {
.intro h1 {
font-size: 2.5rem;
@@ -303,9 +145,5 @@ footer {
.intro h3 {
font-size: 1rem;
}
- footer {
- margin: 0;
- padding: 0;
- }
}
</style>
diff --git a/frontend/pages/login.vue b/frontend/pages/login.vue
index ea3ff4d7..2344861b 100644
--- a/frontend/pages/login.vue
+++ b/frontend/pages/login.vue
@@ -1,7 +1,8 @@
<template>
<div class="container">
+ <AppHeader />
<form @submit.prevent="login" class="body">
- <p class="signup-link">Need an account? <NuxtLink to="/signup">Sign up</NuxtLink></p>
+ <NuxtLink to="/signup" class="signup-link">Need an account? Sign up</NuxtLink>
<div class="form-group">
<label for="username">Username</label>
<input type="username" id="username" v-model="username" :class="{ 'is-invalid': errors.username }" />
@@ -19,6 +20,7 @@
<p v-if="errors.general" class="invalid-feedback">{{ errors.general }}</p>
<p class="forgot-password-link">Forgot your password? <a href="mailto:[email protected]">Click here</a></p>
</form>
+ <AppFooter />
</div>
</template>
<script setup lang="ts">
@@ -52,17 +54,21 @@ async function connect(username: string, password: string) {
</script>
<style scoped lang="scss">
.container {
+ height: 100%;
display: flex;
flex-direction: column;
- align-items: center;
- height: 100%;
- justify-content: center;
+ justify-content: space-between;
+ flex-grow: 1;
+ padding-top: 1.5rem;
+ width: 95%;
+ margin: 0 auto;
}
.body {
display: flex;
flex-direction: column;
align-items: center;
+ margin: 0 auto;
width: 100%;
max-width: 620px;
padding: 3rem;
diff --git a/frontend/pages/signup.vue b/frontend/pages/signup.vue
index 2a9d7a23..49bedf40 100644
--- a/frontend/pages/signup.vue
+++ b/frontend/pages/signup.vue
@@ -1,7 +1,8 @@
<template>
<div class="container">
+ <AppHeader />
<form @submit.prevent="register" class="body">
- <p class="login-link">Already have an account? <a href="/login">Log in</a></p>
+ <a href="/login" class="login-link">Already have an account? Log in</a>
<div class="form-group">
<label for="username">Username</label>
<input type="text" id="username" v-model="username" :class="{ 'is-invalid': errors.username }" />
@@ -31,6 +32,7 @@
<button type="submit" class="btn">Sign Up</button>
<p v-if="errors.general" class="invalid-feedback">{{ errors.general }}</p>
</form>
+ <AppFooter />
</div>
</template>
@@ -106,11 +108,14 @@ async function createAccount(username: string, email: string, password: string)
<style scoped lang="scss">
.container {
+ height: 100%;
display: flex;
flex-direction: column;
- align-items: center;
- height: 100%;
- justify-content: center;
+ justify-content: space-between;
+ flex-grow: 1;
+ padding-top: 1.5rem;
+ width: 95%;
+ margin: 0 auto;
}
.body {
@@ -122,6 +127,7 @@ async function createAccount(username: string, email: string, password: string)
padding: 3rem;
background-color: var(--bg-contrast);
border-radius: 15px;
+ margin: 0 auto;
}
.form-group {