Skip to content

Commit

Permalink
refactor!: rewrite, split components, global state store
Browse files Browse the repository at this point in the history
  • Loading branch information
PleahMaCaka committed Oct 24, 2023
1 parent e233f81 commit 94b30d4
Show file tree
Hide file tree
Showing 20 changed files with 536 additions and 477 deletions.
12 changes: 6 additions & 6 deletions src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface Platform {}
}
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface Platform {}
}
}

export {};
18 changes: 9 additions & 9 deletions src/app.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<svelte>%sveltekit.body%</svelte>
</body>
<head>
<meta charset="utf-8" />
<link href="%sveltekit.assets%/favicon.png" rel="icon" />
<meta content="width=device-width, initial-scale=1" name="viewport" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<svelte>%sveltekit.body%</svelte>
</body>
</html>
96 changes: 0 additions & 96 deletions src/lib/components/Input.svelte

This file was deleted.

131 changes: 131 additions & 0 deletions src/lib/components/NavSidebar.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<script lang="ts">
import Profile from "$lib/components/sidebar/Profile.svelte"
import SideButton from "$lib/components/sidebar/SideButton.svelte"
import Icon from "@iconify/svelte"
</script>

<div class="side-container dark:bg-dark bg-lightdark">
<!-- -->
<div class="sidebar-content">
<div class="sidebar-top-content">
<a class="side-new-chat" href="/">
<i>
<Icon icon="ph:chat-bold" />
</i>
<span>New Chat</span>
</a>
<button class="side-close">
<i>
<Icon icon="mdi:close-outline" />
</i>
</button>
</div>
<ul class="side-buttons">
<SideButton
iconSrc="/chat.svg"
name="Chat with AI"
/>
</ul>
</div>
<!-- -->
<div class="side-bottom">
<Profile />
</div>
</div>
<!-- -->

<style>
/* new chat, hide sidebar icons/text */
.side-container i {
color: white;
font-size: 24px;
display: flex;
justify-content: center;
align-items: center;
}
.side-container {
display: flex;
flex-direction: column;
align-items: center;
/* TODO I think 320/340px is better for get the widgets */
width: 280px;
height: 100vh;
padding: 8px 12px;
}
.sidebar-content {
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
width: 100%;
}
.sidebar-top-content {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
height: 55px;
margin: 10px;
}
.side-new-chat {
display: flex;
align-items: center;
width: 77%;
height: 100%;
background-color: transparent;
padding: 10px;
border: 1px solid #474749;
border-radius: 5px;
cursor: pointer;
}
.side-new-chat span {
font-size: 14px;
color: white;
margin-left: 10px;
}
.side-close {
width: 20%;
height: 100%;
border-radius: 10px;
border: 1px solid #474749;
background-color: transparent;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
/* */
.side-buttons {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
height: 100%;
border-top: 1px solid #474749;
border-bottom: 1px solid #474749;
overflow-y: auto;
padding-top: 10px;
}
.side-bottom {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
margin-top: 10px;
width: 100%;
}
/* Media */
</style>
Loading

0 comments on commit 94b30d4

Please sign in to comment.