Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[web] style beautification #196

Merged
merged 9 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions skyagi-web/src/lib/AgentForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -162,26 +162,27 @@
<div id="profileButton">
<div class="text-sm" id="profileText">Profile Picture</div>
<Button size="xs" class="!text-sm font-normal" id="profileButton">Change</Button>
<Dropdown class="w-30 overflow-y-auto py-1 h-48">
{#each globalAvatarImageList as avatarImage, i}
<DropdownItem
class="flex items-center text-base font-semibold gap-2"
on:click={() => handleAvatarClick(avatarImage)}
>
<Avatar src={avatarImage} size="lg" rounded />
</DropdownItem>
{/each}
</Dropdown>
</div>
</div>

<Dropdown class="w-48 overflow-y-auto py-1 h-48">
{#each globalAvatarImageList as avatarImage, i}
<DropdownItem
class="flex items-center text-base font-semibold gap-2"
on:click={() => handleAvatarClick(avatarImage)}
>
<Avatar src={avatarImage} size="lg" rounded />
</DropdownItem>
{/each}
</Dropdown>

</div>
</Label>
</div>
<hr class="border-zinc-500">
<div>
<div class="h-4 text-zinc-500 text-sm" id="profileText">Name:</div>
<input id="name" type="text" class="text-gray-200 relative right-3 h-4 text-lg font-light bg-transparent border-0 focus:ring-0" bind:value={agentData.name} />
<input id="name" type="text" class="text-gray-200 relative right-3 h-6 text-lg font-light bg-transparent border-0 focus:ring-0" bind:value={agentData.name} />
</div>
<hr class="border-zinc-500">
<div>
Expand All @@ -193,7 +194,7 @@
<div class="h-4 text-zinc-500 text-sm" id="profileText">Personalities:</div>
<input id="personalities" type="text" class="text-gray-200 relative right-3 h-6 text-lg font-light bg-transparent border-0 focus:ring-0" bind:value={agentData.personalities} />
</div>
<hr class="border-zinc-500">
<hr class="border-zinc-500 border-1">
<div>
<div class="h-4 text-zinc-500 text-sm" id="profileText">Social status:</div>
<input id="social-status" type="text" class="text-gray-200 relative right-3 h-6 text-lg font-light bg-transparent border-0 focus:ring-0" bind:value={agentData.socialStatus} />
Expand All @@ -203,10 +204,10 @@
<div class="h-4 text-zinc-500 text-sm" id="profileText">Memories:</div>
{#each agentData.memories as memory, index}
<div class="mb-5 mt-5 flex">
<input
<div class="text-gray-200 text-lg font-bold relative top-2"> • </div>
<textarea
id="memories"
type="text"
class="text-gray-200 relative right-3 h-6 mr-2 text-lg font-light bg-transparent border-0 focus:ring-0"
class="text-gray-200 relative left-3 mr-2 text-lg font-light bg-transparent border-0 focus:ring-0"
placeholder="Social relationship, experience, catch phrase, ..."
bind:value={memory}
on:input={event => updateMemory(index, event)}
Expand Down Expand Up @@ -293,6 +294,10 @@
grid-row-gap: 12px;
/* grid-auto-columns: 400px 400px; */
}
#memories {
width: 100%;
resize: none
}
/* .field {
display: grid;
grid-template-columns: 100%;
Expand Down
9 changes: 6 additions & 3 deletions skyagi-web/src/lib/dashboard-character.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
</script>

<figure>
<img class="rounded-lg" src={imageUrl} alt="" width="70px" />
<figcaption>{character.name}</figcaption>
<img class="rounded-lg" src={imageUrl} style="width:70px" alt=""/>
<figcaption class="font-light text-sm">{character.name}</figcaption>
</figure>

<style>
figure {
text-align: center;
width: 70px;
width: 100px;
}
img {
margin-left: 15px
}
</style>
6 changes: 3 additions & 3 deletions skyagi-web/src/lib/dashboard-conversation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
$: activeId = handleOpen(open, activeId);
</script>

<AccordionItem bind:open id="accordion">
<span slot="header">
<AccordionItem bind:open id="accordion" class="rounded-none">
<span slot="header" class="text-gray-200 font-light text-lg">
{conversationSummary.name}
</span>
<div slot="arrowup">
Expand Down Expand Up @@ -56,5 +56,5 @@
/></svg
>
</span>
<p class="whitespace-pre-line mb-2 text-gray-400 text-xl">{conversationSummary.text}</p>
<p class="whitespace-pre-line mb-2 text-gray-400 text-base border-0 font-light">{conversationSummary.text}</p>
</AccordionItem>
3 changes: 1 addition & 2 deletions skyagi-web/src/lib/room-new-character.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
alt=""
on:click={updateLastClickedCharacter}
class={avatarStyle}
width="100px"
/>
<figcaption class="text-lg mt-2">{character.name}</figcaption>
<figcaption class="text-base mt-2">{character.name}</figcaption>
</figure>
</div>
<Toast />
Expand Down
3 changes: 2 additions & 1 deletion skyagi-web/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
#header {
text-align: right;
margin-top: 20px;
margin-right: 400px;
margin-right: 80px;

}
</style>
</html>
9 changes: 1 addition & 8 deletions skyagi-web/src/routes/agent/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,12 @@
import type { PageData } from './$types';
import { isAgentFormEditing } from '$lib/stores';
import type { User } from '@supabase/supabase-js';
import Error from '$lib/Error.svelte';

export let data: PageData;

let agentData: AgentDataType = data.body;
let user: User = data.user;
let error = data.error;
</script>


<AgentDetailsNew {agentData} {user} />


{#if agentData == null && error}
<Error errorCode={error.errorCode} errorName={error.errorName} errorMsg={error.errorMsg} />
{/if}
<AgentForm {agentData} {user} />
70 changes: 43 additions & 27 deletions skyagi-web/src/routes/dashboard/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@
};
});
});
let popUpError = false;
let errorName = 'Selection Error';
let errorMsg = '';

function handleResumeRoomClick() {
if (activeId == ""){
popUpError = true
errorMsg = 'Please select a conversation to resume'
return false
}
window.location.href = '/room/resume-room/' + activeId;
}

Expand All @@ -38,11 +46,12 @@

<div id="globalGrid">
<div>
<div class="conversationscroller">
<div id="conversationscroller" class="rounded-lg">
<Accordion
id="conversationBoard"
activeClasses="bg-gray-800 text-white focus:ring-4 focus:ring-blue-800 text-2xl"
inactiveClasses="text-gray-400 hover:bg-gray-800 text-2xl"
activeClasses="bg-gray-800 text-white ring-0 text-lg border-0"
inactiveClasses="bg-gray-700 text-gray-400 hover:bg-gray-800 text-lg border-0"
class="border-0 divide-y-1 !divide-gray-600 rounded-none group-first:rounded-t-xl"
>
{#await data.streamed.conversations}
<div class="text-center"><Spinner /></div>
Expand All @@ -64,54 +73,59 @@
<Button size="xl" on:click={handleResumeRoomClick}>Resume to the selected conversation</Button
>
<Button size="xl" on:click={handleCreateRoomClick}>Create new conversation</Button>
<Button size="xl" on:click={handleCreateAgentClick}>Create new agent</Button>

</div>
</div>

<div class="scroller">
{#await getCharacters}
<div class="text-center"><Spinner /></div>
{:then value}
{#each value as character, i}
<a href="agent/{character.id}">
<div class="characterInfoSet">
<Character {character} imageUrl={character.image} />
</div>
</a>
{/each}
{:catch error}
<Error errorCode={500} errorName={error.name || ''} errorMsg={error.message} />
{/await}
<div>
<div class="scroller">
{#await getCharacters}
<div class="text-center"><Spinner /></div>
{:then value}
{#each value as character, i}
<a href="agent/{character.id}">
<div class="characterInfoSet">
<Character {character} imageUrl={character.image} />
</div>
</a>
{/each}
{:catch error}
<Error errorCode={500} errorName={error.name || ''} errorMsg={error.message} />
{/await}
</div>
<div id="buttonGrid">
<Button size="xl" on:click={handleCreateAgentClick}>Create new agent</Button>
</div>
</div>
<Error {errorName} {errorMsg} {popUpError} />
</div>

<style>
.scroller {
width: 600px;
height: 500px;
height: 600px;
top: 20px;
position: relative;
overflow-x: hidden;
overflow-y: auto;
display: grid;
grid-template-columns: repeat(3, 200px);
/*grid-template-rows: repeat(auto-fill, 220px);*/
grid-template-columns: repeat(3, 250px);
grid-template-rows: repeat(auto-fill, 150px);
}

.conversationscroller {
#conversationscroller {
border: none;
width: 600px;
height: 1000px;
height: 600px;
top: 20px;
position: relative;
overflow-x: hidden;
overflow-y: auto;
display: grid;
grid-template-rows: repeat(auto-fill, 950px);
/* grid-template-rows: repeat(auto-fill, 950px); */
}

#conversationBoard {
height: 2000px;
height: 600px;
white-space: pre-line;
}

Expand All @@ -126,6 +140,8 @@
#buttonGrid {
display: grid;
width: 600px;
grid-template-rows: (3, 50%);
padding-top:50px;
position:relative;
grid-template-rows: (2, 50%);
}
</style>
Loading
Loading