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.

V5: New auth system, WYSIWYG, toolbar, shortcuts, new editor, classes, configs, css fixes, new sidebar ui, new composables

Smaug67391e4b2ca74214
diff --git a/frontend/components/DocumentCardHeader.vue b/frontend/components/DocumentCardHeader.vue
index 95c85b0d..e283a342 100644
--- a/frontend/components/DocumentCardHeader.vue
+++ b/frontend/components/DocumentCardHeader.vue
@@ -126,7 +126,12 @@ p {
.text {
flex: 2;
padding-right: 10px;
-
+ .category, .title {
+ font-family: Inter;
+ }
+ .title {
+ font-weight: 700;
+ }
.category {
display: flex;
align-items: baseline;
diff --git a/frontend/components/MarkdownEditor/InlineToolbar.vue b/frontend/components/MarkdownEditor/InlineToolbar.vue
new file mode 100644
index 00000000..48ed2e57
--- /dev/null
+++ b/frontend/components/MarkdownEditor/InlineToolbar.vue
@@ -0,0 +1,98 @@
+<template>
+ <div class="i_toolbar" ref="toolbar">
+ <div class="i_toolbar_swatches">
+ <button class="swatch blue" @click="exec('blue')"></button>
+ <button class="swatch green" @click="exec('green')"></button>
+ <button class="swatch red" @click="exec('red')"></button>
+ <button class="swatch yellow" @click="exec('yellow')"></button>
+ <button class="swatch pink" @click="exec('pink')"></button>
+ </div>
+ <div class="i_toolbar_buttons">
+ <button @click="exec('bold')"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M9 12L9 7.1C9 7.04477 9.04477 7 9.1 7H10.4C11.5 7 14 7.1 14 9.5C14 9.5 14 12 11 12M9 12V16.8C9 16.9105 9.08954 17 9.2 17H12.5C14 17 15 16 15 14.5C15 11.7046 11 12 11 12M9 12H11"></path></svg>
+ </button>
+ <button @click="exec('italic')"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M13.34 10C12.4223 12.7337 11 17 11 17"></path><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M14.21 7H14.2"></path></svg>
+ </button>
+ <button @click="exec('strike')"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.5 8.50001C13.5 7 10.935 6.66476 9.75315 7.79706C9.27092 8.25909 9 8.88574 9 9.53915C9 10.1926 9.27092 10.8192 9.75315 11.2812C10.9835 12.46 13.0165 11.5457 14.2468 12.7244C14.7291 13.1865 15 13.8131 15 14.4665C15 15.1199 14.7291 15.7466 14.2468 16.2086C12.8659 17.5317 10 17.5 9 16"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 12H18"/></svg>
+ </button>
+ <button @click="exec('underline')"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 7.5V11.5C9 12.2956 9.31607 13.0587 9.87868 13.6213C10.4413 14.1839 11.2044 14.5 12 14.5C12.7956 14.5 13.5587 14.1839 14.1213 13.6213C14.6839 13.0587 15 12.2956 15 11.5V7.5"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7.71429 18H16.2857"/></svg>
+ </button>
+ <button @click="exec('link')"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M7.69998 12.6L7.67896 12.62C6.53993 13.7048 6.52012 15.5155 7.63516 16.625V16.625C8.72293 17.7073 10.4799 17.7102 11.5712 16.6314L13.0263 15.193C14.0703 14.1609 14.2141 12.525 13.3662 11.3266L13.22 11.12"></path><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16.22 11.12L16.3564 10.9805C17.2895 10.0265 17.3478 8.5207 16.4914 7.49733V7.49733C15.5691 6.39509 13.9269 6.25143 12.8271 7.17675L11.3901 8.38588C10.0935 9.47674 9.95706 11.4241 11.0888 12.6852L11.12 12.72"></path></svg>
+ </button>
+ <button @click="exec('quote')"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M9.5 8L6.11524 11.8683C6.04926 11.9437 6.04926 12.0563 6.11524 12.1317L9.5 16"></path><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M15 8L18.3848 11.8683C18.4507 11.9437 18.4507 12.0563 18.3848 12.1317L15 16"></path></svg>
+ </button>
+ <button @click="exec('code')"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 17C7 17 7 15.2536 7 13.5L5.5 12L7 10.5C7 8.74644 7 7 9 7"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17C17 17 17 15.2536 17 13.5L18.5 12L17 10.5C17 8.74644 17 7 15 7"/></svg>
+ </button>
+ <button @click="exec('clear')"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M11.3536 9.31802L12.7678 7.90381C13.5488 7.12276 14.8151 7.12276 15.5962 7.90381C16.3772 8.68486 16.3772 9.95119 15.5962 10.7322L14.182 12.1464M11.3536 9.31802L7.96729 12.7043C7.40889 13.2627 7.02827 13.9739 6.8734 14.7482L6.69798 15.6253C6.55804 16.325 7.17496 16.942 7.87468 16.802L8.75176 16.6266C9.52612 16.4717 10.2373 16.0911 10.7957 15.5327L14.182 12.1464M11.3536 9.31802L14.182 12.1464"></path><line x1="15" x2="19" y1="17" y2="17" stroke="currentColor" stroke-linecap="round" stroke-width="2"></line></svg>
+ </button>
+ </div>
+ </div>
+</template>
+
+<script setup lang="ts">
+
+</script>
+
+<style scoped lang="scss">
+.i_toolbar {
+ display: none;
+ align-items: center;
+ padding: 4px 8px;
+ border-radius: 6px;
+ border: 1px solid var(--border-color);
+ background-color: var(--bg-contrast);
+ position: absolute;
+ top: 0;
+ left: 0;
+
+ button {
+ margin: 0;
+ padding: 0;
+ }
+}
+.i_toolbar_swatches {
+ display: flex;
+ gap: 5px;
+ .swatch {
+ width: 20px;
+ height: 20px;
+ border-radius: 50%;
+ &:hover {
+ outline-offset: 1px;
+ }
+ }
+ .blue {
+ background-color: var(--blue);
+ &:hover {
+ outline: 2px solid var(--blue);
+ }
+ }
+ .green {
+ background-color: var(--green);
+ &:hover {
+ outline: 2px solid var(--green);
+ }
+ }
+ .red {
+ background-color: var(--red);
+ &:hover {
+ outline: 2px solid var(--red);
+ }
+ }
+ .yellow {
+ background-color: var(--yellow);
+ &:hover {
+ outline: 2px solid var(--yellow);
+ }
+ }
+ .pink {
+ background-color: var(--pink);
+ &:hover {
+ outline: 2px solid var(--pink);
+ }
+ }
+}
+
+.i_toolbar_buttons {
+ display: flex;
+}
+</style>
\ No newline at end of file
diff --git a/frontend/components/MarkdownEditor/LazyMarkdownEditor.vue b/frontend/components/MarkdownEditor/LazyMarkdownEditor.vue
index da80a866..3dd75832 100644
--- a/frontend/components/MarkdownEditor/LazyMarkdownEditor.vue
+++ b/frontend/components/MarkdownEditor/LazyMarkdownEditor.vue
@@ -3,10 +3,12 @@
<Toolbar style="height: fit-content;" :document="document" @execute-action="(a: string) => exec(a)" />
<input placeholder="Titre" class="title" v-model="document.name" />
<input placeholder="Description" class="description" v-model="document.description" />
- <div class="markdown">
- <textarea ref="textarea" class="content markdown-input" placeholder="Écrivez votre contenu ici..."
- v-model="document.content_markdown" @scroll="syncScroll"></textarea>
- <div v-if="showPreview" class="markdown-preview document-theme" ref="markdownPreview" v-html="html_content">
+ <div class="markdown" ref="container">
+ <InlineToolbar />
+ <div contenteditable="true" ref="textarea" class="textarea content markdown-input" placeholder="Écrivez votre contenu ici..."
+ @scroll="syncScroll" @mouseup="updateContextMenu" @input="update" @blur="update" v-html="document.content_markdown">
+ </div>
+ <div v-if="showPreview" class="markdown-preview document-theme" ref="markdownPreview" v-html="document.content_html">
</div>
</div>
</div>
@@ -16,56 +18,90 @@
<script setup lang="ts">
import type { Document } from "~/store";
import Toolbar from "./LazyToolbar.vue";
-import { wrapWithTags } from "./utils";
+import MarkdownUtil from "./Utils";
import compile from "~/helpers/markdown";
+import InlineToolbar from "~/components/MarkdownEditor/InlineToolbar.vue";
const props = defineProps<{ doc?: Document }>();
const document = ref<Document | Partial<Document>>({ ...props.doc });
-const textarea = ref<HTMLTextAreaElement>();
+const textarea = ref<HTMLDivElement>();
+const container = ref<HTMLDivElement>();
+const toolbar = ref<HTMLDivElement>();
const showPreview = ref(false);
const emit = defineEmits(['save']);
-
-const html_content = computed(() => {
- document.value.content_html = compile(document.value.content_markdown, true);
- return document.value.content_html;
-});
-
+const update = () => document.value.content_html = compile(textarea.value?.innerHTML || '', true);
+onMounted(() => window.addEventListener('mouseup', updateContextMenu));
+onBeforeUnmount(() => window.removeEventListener('mouseup', updateContextMenu));
+
+function updateContextMenu(){
+ if (!textarea.value || !toolbar.value) return;
+ const selection = window.getSelection();
+ toolbar.value.style.display = 'none';
+ if (!selection || selection.rangeCount === 0 || selection.toString().length == 0) return;
+ const range = selection.getRangeAt(0);
+ if (!textarea.value.contains(range.startContainer) || !textarea.value.contains(range.endContainer)) return;
+ const containerRect = container.value?.getBoundingClientRect(); //const selectionRect = range.getBoundingClientRect();
+ const rects = range.getClientRects();
+ if (!containerRect) return;
+ const last_rect = rects[rects.length -1];
+ toolbar.value.style.top = `${last_rect.top - containerRect.top + 25}px`;
+ toolbar.value.style.left = `${last_rect.left - containerRect.left /*+ last_rect.width*/}px`;
+ toolbar.value.style.display = "flex";
+}
function exec(action: string) {
- if (!textarea.value) return;
- const selectedText = window.getSelection()?.toString() || '';
+ const util = new MarkdownUtil(textarea.value);
+ if (!textarea.value) return;
switch (action) {
- case 'bold':
- wrapWithTags(selectedText, '**', '**', textarea.value);
+ case 'blue':
+ util.inlineFormat('<blue>', '</blue>');
+ break;
+ case 'green':
+ util.inlineFormat('<green>', '</green>');
+ break;
+ case 'red':
+ util.inlineFormat('<red>', '</red>');
+ break;
+ case 'yellow':
+ util.inlineFormat('<yellow>', '</yellow>');
+ break;
+ case 'pink':
+ util.inlineFormat('<pink>', '</pink>');
+ break;
+ case 'bold':
+ util.inlineFormat('<b>', '</b>');
break;
case 'italic':
- wrapWithTags(selectedText, '*', '*', textarea.value);
+ util.inlineFormat('<em>', '</em>');
break;
case 'underline':
- wrapWithTags(selectedText, '__', '__', textarea.value);
+ util.inlineFormat('__', '__');
break;
case 'strike':
- wrapWithTags(selectedText, '~~', '~~', textarea.value);
+ util.inlineFormat('~~', '~~');
break;
case 'link':
- wrapWithTags(selectedText, '[](', ')', textarea.value);
+ util.inlineFormat('[](', ')');
break;
case 'image':
- wrapWithTags(selectedText, '![](', ')', textarea.value);
+ util.inlineFormat('![](', ')');
break;
case 'code':
- wrapWithTags(selectedText, '`', '`', textarea.value);
+ util.inlineFormat('`', '`');
break;
case 'quote':
- wrapWithTags(selectedText, '> ', '', textarea.value);
+ util.inlineFormat('> ', '');
break;
case 'list':
- wrapWithTags(selectedText, '* ', '', textarea.value);
+ util.inlineFormat('* ', '');
break;
case 'orderedList':
- wrapWithTags(selectedText, '1. ', '', textarea.value);
+ util.inlineFormat('1. ', '');
break;
+ case 'clear':
+ util.clear();
+ break;
case 'exit':
useRouter().push(document.value.id ? `/dashboard/doc/${document.value.id}` : '/dashboard')
break;
@@ -74,16 +110,18 @@ function exec(action: string) {
break;
case 'save':
if (!document) return;
+ document.value.content_markdown = textarea.value.innerHTML;
document.value.content_html = compile(document.value.content_markdown, true);
emit('save', document.value);
break;
}
- document.value.content_html = compile(document.value.content_markdown, true);
+ update();
}
const markdownPreview = ref<HTMLDivElement>();
function syncScroll() {
+ updateContextMenu() // Update the position of the context menu
if (!textarea.value || !markdownPreview.value) return;
const scrollPercentage = textarea.value.scrollTop / (textarea.value.scrollHeight - textarea.value.clientHeight);
markdownPreview.value.scrollTop = scrollPercentage * (markdownPreview.value.scrollHeight - markdownPreview.value.clientHeight);
@@ -97,6 +135,7 @@ function syncScroll() {
}
.markdown {
+ position: relative;
height: 80%;
display: flex;
}
@@ -112,11 +151,14 @@ function syncScroll() {
}
input,
-textarea {
- border: none;
- outline: none;
- background-color: var(--bg-color);
- padding-left: 0;
+.textarea {
+ border: none;
+ outline: none;
+ background-color: var(--bg-color);
+ padding-left: 0;
+}
+.textarea {
+ white-space: break-spaces;
}
.title {
diff --git a/frontend/components/MarkdownEditor/Utils.ts b/frontend/components/MarkdownEditor/Utils.ts
new file mode 100644
index 00000000..7f54f103
--- /dev/null
+++ b/frontend/components/MarkdownEditor/Utils.ts
@@ -0,0 +1,55 @@
+class MarkdownUtil {
+ private editor: HTMLDivElement;
+
+ constructor(editor: HTMLDivElement) {
+ this.editor = editor;
+ }
+ public formatText() {
+ const selection = window.getSelection();
+ if (!selection || selection.isCollapsed) return;
+ const range = selection.getRangeAt(0);
+
+ // Check if the selection is within the textarea or its descendants
+ if (!this.editor.contains(range.startContainer) || !this.editor.contains(range.endContainer)) return;
+ return range;
+ }
+ // Function to create a temporary container for the selected content
+ private createTempDiv(content: DocumentFragment) {
+ const tempDiv = document.createElement('div');
+ tempDiv.appendChild(content);
+ return tempDiv;
+ }
+ private inlineFormat(tag1: string, tag2: string) {
+ const range = this.formatText()
+ if(!range) return;
+ const tempDiv = this.createTempDiv(range.cloneContents());
+ const fragment = document.createDocumentFragment();
+ tempDiv.innerHTML = tag1 + tempDiv.innerHTML + tag2;
+ while (tempDiv.firstChild) {
+ fragment.appendChild(tempDiv.firstChild);
+ }
+ range.deleteContents();
+ range.insertNode(fragment);
+ }
+
+ public clear(){
+ const range = this.formatText()
+ if(!range) return;
+ const tempDiv = this.createTempDiv(range.cloneContents());
+ const parentElement: Element | null = range.commonAncestorContainer.nodeType === 3 ? range.commonAncestorContainer.parentElement as Element : range.commonAncestorContainer as Element;
+ if (parentElement != this.editor) {
+ const text = parentElement.textContent || '';
+ const textNode = document.createTextNode(text);
+ parentElement.replaceWith(textNode);
+ } else if(tempDiv.innerHTML != '') {
+ const text = tempDiv.textContent || '';
+ const textNode = document.createTextNode(text);
+ range.deleteContents();
+ range.insertNode(textNode);
+ }
+ }
+}
+
+
+export default MarkdownUtil;
+
diff --git a/frontend/components/MarkdownEditor/editor.ts b/frontend/components/MarkdownEditor/editor.ts
new file mode 100644
index 00000000..e69de29b
diff --git a/frontend/components/MarkdownEditor/utils.ts b/frontend/components/MarkdownEditor/utils.ts
deleted file mode 100644
index 04112d32..00000000
--- a/frontend/components/MarkdownEditor/utils.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export function wrapWithTags(text: string, tag1: string, tag2: string, textarea: HTMLTextAreaElement) {
- const startTag = `${tag1}`;
- const endTag = `${tag2}`;
-
- const startIndex = textarea.selectionStart;
- const endIndex = textarea.selectionEnd;
-
- const beforeSelected = textarea.value.substring(0, startIndex);
- const afterSelected = textarea.value.substring(endIndex, textarea.value.length);
-
- textarea.value = beforeSelected + startTag + text + endTag + afterSelected;
-}
diff --git a/frontend/components/sidebar/IconApp.vue b/frontend/components/sidebar/IconApp.vue
index 1acf899c..173734d2 100644
--- a/frontend/components/sidebar/IconApp.vue
+++ b/frontend/components/sidebar/IconApp.vue
@@ -1,6 +1,8 @@
<template>
- <svg width="25px" style="fill:var(--green)" xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960">
- <path
- d="M600-40q-33 0-56.5-23.5T520-120q0-23 11-41t29-29v-221q-18-11-29-28.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 23-11 40.5T640-411v115l160-53v-62q-18-11-29-28.5T760-480q0-33 23.5-56.5T840-560q33 0 56.5 23.5T920-480q0 23-11 40.5T880-411v119l-240 80v22q18 11 29 29t11 41q0 33-23.5 56.5T600-40ZM160-160v-560 560Zm0 0q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640H447l-80-80H160v480h280v80H160Z" />
- </svg>
-</template>
\ No newline at end of file
+ <svg xmlns="http://www.w3.org/2000/svg" width="50" viewBox="0 0 164.000000 160.000000" preserveAspectRatio="xMidYMid meet">
+ <g transform="translate(0.000000,160.000000) scale(0.100000,-0.100000)" fill="var(--font-color)" stroke="none">
+ <path d="M688 1190 c-21 -16 -243 -392 -313 -529 -35 -70 15 -151 94 -151 39 0 87 30 236 146 124 97 256 135 352 101 24 -8 41 -12 39 -8 -72 136 -246 427 -264 441 -34 27 -110 27 -144 0z"/>
+ <path d="M921 729 c-24 -4 -64 -18 -89 -30 -36 -18 -42 -24 -31 -33 8 -6 51 -38 94 -72 44 -33 90 -66 102 -72 86 -46 189 41 152 129 -23 57 -138 96 -228 78z"/>
+ </g>
+ </svg>
+</template>
diff --git a/frontend/components/sidebar/Sidebar.vue b/frontend/components/sidebar/Sidebar.vue
index 51f89119..715647ce 100644
--- a/frontend/components/sidebar/Sidebar.vue
+++ b/frontend/components/sidebar/Sidebar.vue
@@ -2,8 +2,7 @@
<Resizable>
<div class="sidebar-content">
<section class="header">
- <IconApp />
- <NuxtLink style="font-size: 19px;font-weight: 600;" to="/">Alexandrie</NuxtLink>
+ <span class="name"><IconApp /><NuxtLink style="font-size: 19px;font-weight: 600;" to="/">Alexandrie</NuxtLink></span>
<IconClose class="btn" />
</section>
<input type="text" placeholder="Search" class="search" v-model="filter" />
@@ -26,7 +25,7 @@ const categoriesStore = useCategoriesStore();
const documentsStore = useDocumentsStore();
const filter = ref<string>('');
-const isMobile = () => process.client ? window.innerWidth <= 768 : false;
+const isMobile = () => import.meta.client ? window.innerWidth <= 768 : false;
const items = computed((): Item[] => {
const navigation: Item[] = navigationItems.map((item) => ({ id: item.id, parent_id: '', title: item.title, route: item.route, icon: item.icon, type: 'navigation', data: item }))
@@ -78,7 +77,6 @@ if (isMobile()) {
<style scoped lang="scss">
.sidebar-content {
margin: 0 0 0 10px;
- background: var(--bg-color);
}
.header {
@@ -94,8 +92,11 @@ if (isMobile()) {
}
.name {
- font-size: 1.2rem;
- font-weight: 500;
+ display: flex;
+ align-items: center;
+ font-size: 1rem;
+ font-weight: 400;
+ font-family: Inter;
}
}
diff --git a/frontend/components/sidebar/SidebarItem.vue b/frontend/components/sidebar/SidebarItem.vue
index b2914576..3df441e4 100644
--- a/frontend/components/sidebar/SidebarItem.vue
+++ b/frontend/components/sidebar/SidebarItem.vue
@@ -104,14 +104,12 @@ const drop = async (event: DragEvent) => {
display: flex;
justify-content: flex-start;
align-items: center;
- min-height: 29px;
padding: 0 2.5px;
margin: 2.5px 0;
border-radius: 5px;
color: var(--font-color);
cursor: pointer;
width: 98%;
-
&:hover,
&.router-link-active {
background: var(--bg-contrast-2);
@@ -122,14 +120,9 @@ const drop = async (event: DragEvent) => {
align-items: center;
&:deep(svg) {
- fill: var(--blue);
- width: 22px;
- height: 20px;
+ width: 20px;
+ max-height: 25px;
margin-right: 5px;
-
- path {
- fill: var(--blue);
- }
}
}
}
diff --git a/frontend/components/sidebar/helpers.ts b/frontend/components/sidebar/helpers.ts
index 0b5d6ef5..f7f80aa5 100644
--- a/frontend/components/sidebar/helpers.ts
+++ b/frontend/components/sidebar/helpers.ts
@@ -20,7 +20,7 @@ export const navigationItems: DefaultItem[] = [
id: 'manage-categories',
type: 'default',
title: 'Manage categories',
- icon: '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M320-320h480v-480h-80v280l-100-60-100 60v-280H320v480Zm0 80q-33 0-56.5-23.5T240-320v-480q0-33 23.5-56.5T320-880h480q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H320ZM160-80q-33 0-56.5-23.5T80-160v-560h80v560h560v80H160Zm360-720h200-200Zm-200 0h480-480Z"/></svg>',
+ icon: '<svg style="fill:var(--blue)" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M320-320h480v-480h-80v280l-100-60-100 60v-280H320v480Zm0 80q-33 0-56.5-23.5T240-320v-480q0-33 23.5-56.5T320-880h480q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H320ZM160-80q-33 0-56.5-23.5T80-160v-560h80v560h560v80H160Zm360-720h200-200Zm-200 0h480-480Z"/></svg>',
route: '/dashboard/categories',
childrens: [],
},
@@ -28,7 +28,7 @@ export const navigationItems: DefaultItem[] = [
id: 'cdn',
type: 'default',
title: 'CDN',
- icon: '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M485-440h163q26 0 44-18t18-44q0-26-18-44.5T648-565h-2q-5-32-29-53.5T560-640q-26 0-47 13.5T481-590q-30 2-50.5 23.5T410-515q0 30 21.5 52.5T485-440ZM120-120q-33 0-56.5-23.5T40-200v-520h80v520h680v80H120Zm160-160q-33 0-56.5-23.5T200-360v-440q0-33 23.5-56.5T280-880h200l80 80h280q33 0 56.5 23.5T920-720v360q0 33-23.5 56.5T840-280H280Zm0-80h560v-360H527l-80-80H280v440Zm0 0v-440 440Z"/></svg>',
+ icon: '<svg style="fill:var(--blue)" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M485-440h163q26 0 44-18t18-44q0-26-18-44.5T648-565h-2q-5-32-29-53.5T560-640q-26 0-47 13.5T481-590q-30 2-50.5 23.5T410-515q0 30 21.5 52.5T485-440ZM120-120q-33 0-56.5-23.5T40-200v-520h80v520h680v80H120Zm160-160q-33 0-56.5-23.5T200-360v-440q0-33 23.5-56.5T280-880h200l80 80h280q33 0 56.5 23.5T920-720v360q0 33-23.5 56.5T840-280H280Zm0-80h560v-360H527l-80-80H280v440Zm0 0v-440 440Z"/></svg>',
route: '/dashboard/cdn',
childrens: [],
},
@@ -36,7 +36,7 @@ export const navigationItems: DefaultItem[] = [
id: 'backup',
type: 'default',
title: 'Backup',
- icon: '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M320-320h200v-200H320v200Zm0-280h480v-200H320v200Zm280 280h200v-200H600v200Zm-280 80q-33 0-56.5-23.5T240-320v-480q0-33 23.5-56.5T320-880h480q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H320ZM160-80q-33 0-56.5-23.5T80-160v-560h80v560h560v80H160Z"/></svg>',
+ icon: '<svg style="fill:var(--blue)" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M320-320h200v-200H320v200Zm0-280h480v-200H320v200Zm280 280h200v-200H600v200Zm-280 80q-33 0-56.5-23.5T240-320v-480q0-33 23.5-56.5T320-880h480q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H320ZM160-80q-33 0-56.5-23.5T80-160v-560h80v560h560v80H160Z"/></svg>',
route: '/dashboard/backup',
childrens: [],
},
@@ -44,7 +44,7 @@ export const navigationItems: DefaultItem[] = [
id: 'new-page',
type: 'default',
title: 'New page',
- icon: '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M440-280h80v-160h160v-80H520v-160h-80v160H280v80h160v160ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"/></svg>',
+ icon: '<svg style="fill:var(--blue)" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M440-280h80v-160h160v-80H520v-160h-80v160H280v80h160v160ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"/></svg>',
route: '/dashboard/new',
childrens: [],
},
@@ -56,7 +56,13 @@ export const icons = {
'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path style="fill:var(--yellow);" d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640H447l-80-80H160v480l96-320h684L837-217q-8 26-29.5 41.5T760-160H160Zm84-80h516l72-240H316l-72 240Zm0 0 72-240-72 240Zm-84-400v-80 80Z"/></svg>',
file: '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path style="fill:var(--pink);" d="M320-240h320v-80H320v80Zm0-160h320v-80H320v80ZM240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v480q0 33-23.5 56.5T720-80H240Zm280-520v-200H240v640h480v-440H520ZM240-800v200-200 640-640Z"/></svg>',
file_parent:
- '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path style="fill:var(--green)" d="M320-320h200v-200H320v200Zm0-280h480v-200H320v200Zm280 280h200v-200H600v200Zm-280 80q-33 0-56.5-23.5T240-320v-480q0-33 23.5-56.5T320-880h480q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H320ZM160-80q-33 0-56.5-23.5T80-160v-560h80v560h560v80H160Z"/></svg>',
+ '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" ><path style="fill:var(--green);" d="M320-320h200v-200H320v200Zm0-280h480v-200H320v200Zm280 280h200v-200H600v200Zm-280 80q-33 0-56.5-23.5T240-320v-480q0-33 23.5-56.5T320-880h480q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H320ZM160-80q-33 0-56.5-23.5T80-160v-560h80v560h560v80H160Z"/></svg>',
archive:
- '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path style="fill:var(--grey)" d="M200-120v-640q0-33 23.5-56.5T280-840h400q33 0 56.5 23.5T760-760v640L480-240 200-120Zm80-122 200-86 200 86v-518H280v518Zm0-518h400-400Z"/></svg>',
+ '<svg style="width:22px;height: 22px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none">\n' +
+ '<rect x="2.5" y="2.5" width="11" height="11" rx="1.5" fill="var(--grey-bg)" stroke="var(--grey)"/>\n' +
+ '<rect x="6" y="4" width="2" height="2" rx="0.5" fill="var(--grey)"/>\n' +
+ '<rect x="6" y="8" width="2" height="2" rx="0.5" fill="var(--grey)"/>\n' +
+ '<rect x="8" y="10" width="2" height="2" rx="0.5" fill="var(--grey)"/>\n' +
+ '<rect x="8" y="6" width="2" height="2" rx="0.5" fill="var(--grey)"/>\n' +
+ '</svg>',
};
diff --git a/frontend/middleware/authentification.global.ts b/frontend/middleware/authentification.global.ts
index 2b8a9377..3b8a1fb0 100644
--- a/frontend/middleware/authentification.global.ts
+++ b/frontend/middleware/authentification.global.ts
@@ -5,5 +5,6 @@ export default defineNuxtRouteMiddleware((to, from) => {
path: '/login',
query: { redirect: to.fullPath },
});
- } else if (to.fullPath.startsWith('/login') && user_auth?.value) return navigateTo({ path: '/dashboard' });
+ }
+ //else if (to.fullPath.startsWith('/login') && user_auth?.value) return navigateTo({ path: '/dashboard' });
});
diff --git a/frontend/pages/index.vue b/frontend/pages/index.vue
index f2683ae3..e8fc3d58 100644
--- a/frontend/pages/index.vue
+++ b/frontend/pages/index.vue
@@ -1,22 +1,29 @@
<template>
<div class="container">
+ <nav>
+ <div class="container"></div>
+ <div class="actions">
+ <NuxtLink to="/login" class="login">Login</NuxtLink>
+ <NuxtLink to="/" 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. Unified. Welcome to <span>Alexandrie</span></h1>
+ <h1>Your Ideas, Documents & Plans. Unified. <br /> Alexandrie</h1>
<h3>Alexandrie is the connected workspace where <br /> better, faster work happens</h3>
</div>
- <div class="get-started">
- <NuxtLink to="/dashboard">Get started</NuxtLink>
+ <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>
<div class="images">
- <div class="img-container none">
- <img :src="`/documents-${colorMode.value}.png`" alt="Documents Image" />
- </div>
+
<div class="img-container">
- <img :src="`/reading-${colorMode.value}.png`" alt="Reading Image" />
+ <img :src="`/main-${colorMode.value}.webp`" alt="Documents Image" />
</div>
</div>
</div>
@@ -33,11 +40,40 @@ const colorMode = useColorMode();
<style scoped lang="scss">
.container {
- height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
- padding-top: 60px;
+}
+nav {
+ height: 65px;
+ width: 90%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-weight: 500;
+}
+.actions {
+ 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;
+ }
}
main {
@@ -60,33 +96,41 @@ main {
}
.intro h1 {
- font-size: 2.7rem;
+ font-size: 3.2rem;
font-weight: 700;
}
.intro h3 {
- font-size: 1.7rem;
+ font-size: 1.3rem;
font-weight: 500;
text-decoration: none;
}
-.get-started {
- margin: 2rem 0;
-
+.btns-block {
+ display: flex;
+ justify-content: center;
+ margin: 2rem;
a {
- padding: 0.5rem 1rem;
- border-radius: 0.5rem;
- background-color: var(--font-color);
- color: var(--bg-color);
+ margin: 0 0.5rem;
+ padding: 0.5rem 1.4rem;
+ border-radius: 0.45rem;
+
font-weight: 500;
font-size: 1.2rem;
-
-
- }
-
- &:hover {
- transform: scale(1.03)
+ &:hover {
+ transform: scale(1.03)
+ }
}
+ .get-started {
+ background-color: var(--font-color);
+ color: var(--bg-color);
+ border: 1px solid var(--bg-color);
+ }
+ .github {
+ background-color: var(--bg-color);
+ color: var(--font-color);
+ border: 1px solid var(--font-color);
+ }
}
.none {
@@ -97,12 +141,10 @@ main {
display: flex;
align-items: center;
justify-content: center;
- max-width: 80rem;
}
.img-container {
- width: 300px;
- height: 300px;
+ width: 1000px;
}
@media (min-width: 768px) {
@@ -113,8 +155,6 @@ main {
@media (min-width: 1024px) {
.img-container {
- width: 350px;
- height: 350px;
}
}
diff --git a/frontend/public/main-dark.webp b/frontend/public/main-dark.webp
new file mode 100644
index 00000000..5b5b4522
Binary files /dev/null and b/frontend/public/main-dark.webp differ
diff --git a/frontend/public/main-light.webp b/frontend/public/main-light.webp
new file mode 100644
index 00000000..58cc7ddb
Binary files /dev/null and b/frontend/public/main-light.webp differ
diff --git a/frontend/styles/_variables.scss b/frontend/styles/_variables.scss
index fc9b89a1..7b2b5752 100644
--- a/frontend/styles/_variables.scss
+++ b/frontend/styles/_variables.scss
@@ -14,7 +14,7 @@ $primary-400: #007bff;
$primary-300: lighten($primary-400, 10%);
$primary-500: darken($primary-400, 10%);
-$selection-color: rgba($primary-300, 0.9);
+$selection-color: #e1f2ff;
@import "./font.scss";
@@ -32,7 +32,7 @@ $transition-duration: 0.3s;
//--bg-color: #ECF2FF;
// --bg-contrast: #e7ecf7;
// --bg-contrast-2: #cdd5dd;
- --font-color: #333;
+ --font-color: #111;
--border-color: rgba(0, 0, 0, 0.1);
// COLORS \\
--grey: #666;
@@ -46,14 +46,14 @@ $transition-duration: 0.3s;
--red: #DC3545;
--red-bg: rgba(220, 53, 69, 0.15);
--red-border: rgba(220, 53, 69, 0.3);
- --yellow: #FF9800;
+ --yellow: #F97300;
--yellow-bg: rgba(255, 193, 7, 0.15);
--yellow-border: rgba(255, 193, 7, 0.3);
--turquoise: #00ADB5;
--turquoise-bg: rgba(23, 162, 184, 0.2);
--turquoise-border: rgba(23, 162, 184, 0.25);
- --pink: #FF2E63;
+ --pink: #FF204E;
--info-border: #2573cf;
}
@@ -71,13 +71,13 @@ $transition-duration: 0.3s;
--blue: #47a6ff;
--blue-bg: rgb(0, 140, 216, 0.2);
--blue-border: rgba(0, 140, 216, 0.25);
- --green: #009879;
+ --green: #03C988;
--green-bg: rgba(66, 184, 131, 0.2);
--green-border: rgba(66, 184, 131, 0.25);
--red: #ff4882;
--red-bg: rgba(237, 60, 80, 0.2);
--red-border: rgba(237, 60, 80, .25);
- --yellow: #FF9800;
+ --yellow: #F97300;
--yellow-bg: rgba(255, 197, 23, 0.2);
--yellow-border: rgba(255, 197, 23, .25);
--turquoise: #00d6b4;
diff --git a/frontend/styles/font.scss b/frontend/styles/font.scss
index 50ca1bac..9fd3f1d4 100644
--- a/frontend/styles/font.scss
+++ b/frontend/styles/font.scss
@@ -36,4 +36,68 @@
font-display: swap;
src: url(https://fonts.gstatic.com/s/poppins/v21/pxiByp8kv8JHgFVrLGT9Z1xlFQ.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
+}
+
+/* cyrillic-ext */
+@font-face {
+ font-family: 'Inter';
+ font-style: normal;
+ font-weight: 100 900;
+ font-display: swap;
+ src: url(https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa2JL7SUc.woff2) format('woff2');
+ unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
+}
+/* cyrillic */
+@font-face {
+ font-family: 'Inter';
+ font-style: normal;
+ font-weight: 100 900;
+ font-display: swap;
+ src: url(https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa0ZL7SUc.woff2) format('woff2');
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
+}
+/* greek-ext */
+@font-face {
+ font-family: 'Inter';
+ font-style: normal;
+ font-weight: 100 900;
+ font-display: swap;
+ src: url(https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa2ZL7SUc.woff2) format('woff2');
+ unicode-range: U+1F00-1FFF;
+}
+/* greek */
+@font-face {
+ font-family: 'Inter';
+ font-style: normal;
+ font-weight: 100 900;
+ font-display: swap;
+ src: url(https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1pL7SUc.woff2) format('woff2');
+ unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
+}
+/* vietnamese */
+@font-face {
+ font-family: 'Inter';
+ font-style: normal;
+ font-weight: 100 900;
+ font-display: swap;
+ src: url(https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa2pL7SUc.woff2) format('woff2');
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
+}
+/* latin-ext */
+@font-face {
+ font-family: 'Inter';
+ font-style: normal;
+ font-weight: 100 900;
+ font-display: swap;
+ src: url(https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa25L7SUc.woff2) format('woff2');
+ unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
+}
+/* latin */
+@font-face {
+ font-family: 'Inter';
+ font-style: normal;
+ font-weight: 100 900;
+ font-display: swap;
+ src: url(https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7.woff2) format('woff2');
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
\ No newline at end of file
diff --git a/frontend/styles/main.scss b/frontend/styles/main.scss
index 7902e863..d3931560 100644
--- a/frontend/styles/main.scss
+++ b/frontend/styles/main.scss
@@ -33,7 +33,6 @@
::selection {
background-color: $selection-color;
- color: white;
}
diff --git a/frontend/styles/markdown.scss b/frontend/styles/markdown.scss
index edca4f0c..9211b782 100644
--- a/frontend/styles/markdown.scss
+++ b/frontend/styles/markdown.scss
@@ -194,4 +194,20 @@
.custom-block a:hover {
opacity: 0.6;
+}
+
+red {
+ color: var(--red);
+}
+blue {
+ color: var(--blue);
+}
+green {
+ color: var(--green);
+}
+yellow {
+ color: var(--yellow);
+}
+pink {
+ color: var(--pink);
}
\ No newline at end of file