Spaces:
Sleeping
Sleeping
<!-- templates/index.html --> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Xylaria Chat</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/atom-one-dark.min.css"> | |
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> | |
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> | |
<style> | |
/* --- static/css/style.css --- */ | |
/* Reset and basic styles */ | |
* { | |
box-sizing: border-box; | |
margin: 0; | |
padding: 0; | |
} | |
body { | |
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; | |
background-color: #1c1c1e; /* Dark background */ | |
color: #ececf1; /* Light text */ | |
display: flex; | |
flex-direction: column; | |
height: 100vh; | |
overflow: hidden; /* Prevent scrolling on the body itself */ | |
} | |
/* Top Bar */ | |
.top-bar { | |
display: flex; | |
justify-content: space-between; | |
align-items: center; | |
padding: 0.5rem 1rem; | |
background-color: #28282a; /* Slightly lighter than main background */ | |
border-bottom: 1px solid #444654; | |
height: 35px; /* Fixed height */ | |
} | |
.memory-status { | |
color: #f4c35e; /* Yellowish for "Memory Full" */ | |
} | |
.share-button { | |
background: none; | |
border: none; | |
color: #ececf1; | |
cursor: pointer; | |
padding: 0.5rem; | |
border-radius: 0.375rem; /* Rounded corners */ | |
} | |
.share-button:hover{ | |
background-color: #3f3f46; | |
} | |
/* Sidebar */ | |
.sidebar { | |
width: 0px; /*Initially hidden*/ | |
background-color: #202123; | |
overflow-y: auto; | |
transition: width 0.5s ease; /* Smooth transition */ | |
position: fixed; /* Fixed position */ | |
top: 35px; /* Below the top bar */ | |
height: calc(100vh - 35px); /* Fill the remaining height */ | |
z-index: 100; /* Make sure it's above other content */ | |
} | |
.new-chat-button { | |
display: flex; | |
align-items: center; | |
padding: 1rem; | |
color: #ececf1; | |
cursor: pointer; | |
border-bottom: 1px solid #444654; | |
} | |
.new-chat-button i { | |
margin-right: 0.75rem; | |
} | |
.new-chat-button:hover{ | |
background-color: #3f3f46; | |
} | |
.chat-history { | |
padding: 0.5rem; | |
} | |
.chat-history > div { /* Style for individual chat history items */ | |
padding: 0.75rem; | |
cursor: pointer; | |
border-radius: 0.375rem; /* Match input box rounding */ | |
transition: background-color 0.2s ease; | |
white-space: nowrap; /* Prevent text wrapping */ | |
overflow: hidden; /* Hide overflowing text */ | |
text-overflow: ellipsis; /* Add ellipsis for long titles */ | |
} | |
.chat-history > div:hover{ | |
background-color: #3f3f46; | |
} | |
/* Main Container */ | |
.main-container { | |
display: flex; | |
flex-direction: column; | |
flex: 1; | |
overflow: hidden; /* Hide scrollbars, scrolling handled within children */ | |
position: relative; /* For absolute positioning of elements inside */ | |
width: 99%; | |
height: calc(100vh - 35px); /*takes the full height except topbar*/ | |
top: 35px; /*pushes the container down from top bar.*/ | |
} | |
/* Messages Area */ | |
.messages { | |
flex: 1; /* Take up all available space */ | |
overflow-y: auto; /* Enable vertical scrolling */ | |
padding: 1rem; | |
display: flex; | |
flex-direction: column; /* Stack messages vertically */ | |
} | |
/* Individual message styles (User and AI) */ | |
.user { | |
background-color: rgba(51, 51, 51, 0.4); /* Darker background */ | |
color: #b4b4b4; /* Lighter text */ | |
padding: 15px; | |
margin: 10px 10px 5px auto; /* Push to the right */ | |
border-radius: 10px; /* Rounded corners */ | |
line-height: 1.4; /* Comfortable line spacing */ | |
max-width: 70%; /* Limit width */ | |
word-wrap: break-word; /* Handles long words/links */ | |
align-self: flex-end; /* Align to the right */ | |
} | |
.ai { | |
background-color: rgba(28, 28, 28, 0.5); /* Slightly lighter background */ | |
color: #c5c5c5; /* Lighter text */ | |
padding: 20px; | |
border-radius: 10px; /* Rounded corners */ | |
border: 1px solid rgba(255,255,255,0.1); | |
margin: 10px auto 5px 5px; /* Push to the left */ | |
line-height: 1.4; /* Comfortable line spacing */ | |
max-width: 70%; /* Limit width */ | |
word-wrap: break-word; /* Handles long words/links */ | |
align-self: flex-start; /* Align to the left */ | |
} | |
.ai p { | |
margin: 0; /* Remove default paragraph margins */ | |
} | |
/* Input Area */ | |
.input-area { | |
position: relative; | |
padding: 1rem; | |
border-top: 1px solid #444654; | |
display: flex; | |
flex-direction: column; /* Stack elements vertically */ | |
align-items: center; /* Center horizontally */ | |
justify-content: center; | |
} | |
.input-box { | |
display: flex; | |
width: 70%; | |
position: relative; | |
margin-bottom: 0.75rem; | |
} | |
.input-box textarea { | |
flex: 1; /* Let textarea take up available space */ | |
resize: none; /* Disable manual resizing */ | |
border: none; | |
border-radius: 20px; /* Rounded corners */ | |
padding: 0.75rem 3rem 0.75rem 1rem; /* Padding, with extra space on the right */ | |
background-color: #40414f; | |
color: #ececf1; | |
outline: none; /* Remove focus outline */ | |
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Subtle shadow */ | |
} | |
.input-box button { | |
position: absolute; | |
right: 0.5rem; /* Position inside the input box */ | |
top: 50%; | |
transform: translateY(-50%); | |
background: none; | |
border: none; | |
color: #9f9fa5; | |
cursor: pointer; | |
padding: 0.5rem; | |
font-size: 1.25rem; | |
border-radius: 5px; | |
z-index: 1000; /* Ensure it's above the textarea */ | |
} | |
.input-box button:hover{ | |
background-color: #555; | |
} | |
/* Disclaimer */ | |
.disclaimer { | |
color: #9f9fa5; | |
font-size: 0.75rem; | |
text-align: center; | |
margin-top: 0.5rem; | |
} | |
/* Custom Scrollbar */ | |
/* (This works in WebKit-based browsers like Chrome and Safari) */ | |
::-webkit-scrollbar { | |
width: 8px; /* Width of the scrollbar */ | |
} | |
::-webkit-scrollbar-track { | |
background: transparent; /* Transparent track */ | |
} | |
::-webkit-scrollbar-thumb { | |
background-color: #444654; /* Darker thumb */ | |
border-radius: 4px; /* Rounded corners */ | |
} | |
::-webkit-scrollbar-thumb:hover { | |
background-color: #585a6d; /* Slightly lighter on hover */ | |
} | |
/* Progress Bar Container */ | |
.progress-container { | |
display: none; /* Initially hidden */ | |
align-items: center; | |
justify-content: center; | |
margin-bottom: 10px; | |
padding-top: 10px; | |
} | |
.progress-bar{ | |
width: 45px; | |
height: 45px; | |
border-radius: 50%; | |
border: 5px solid #3f3f46; /* Consistent with other borders */ | |
position: relative; | |
margin-right: 10px; | |
} | |
.progress-bar-inner { | |
position: absolute; | |
top: -5px; | |
left: -5px; | |
width: 45px; | |
height: 45px; | |
border-radius: 50%; | |
border: 5px solid transparent; | |
border-top-color: #7710ee; /* color */ | |
animation: rotate 2s linear infinite; | |
} | |
@keyframes rotate { | |
0% { transform: rotate(0deg); } | |
100% { transform: rotate(360deg); } | |
} | |
/* Style for progress update text */ | |
.progress-update { | |
font-size: 0.9em; | |
color: #aaa; | |
margin-bottom: 5px; | |
font-style: italic; | |
} | |
/* Style for <think> tag box */ | |
.think-box { | |
border: 1px solid #555; | |
background-color: rgba(55, 55, 55, 0.7); | |
padding: 10px; | |
margin-top: 10px; | |
margin-bottom: 15px; | |
border-radius: 5px; | |
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2); | |
} | |
.think-header { | |
font-weight: bold; | |
color: #eee; | |
margin-bottom: 5px; | |
display: flex; | |
align-items: center; | |
} | |
.think-icon { | |
margin-left: 5px; | |
font-size: 1.2em; | |
} | |
.think-content { | |
color: #ccc; | |
font-style: italic; | |
white-space: pre-wrap; /* Preserve line breaks and spacing */ | |
} | |
#progressText{ | |
color: #a3a3a3; | |
font-size: small; | |
} | |
/* Style for the select element */ | |
.models{ | |
position: absolute; | |
margin: auto; | |
padding: 10px ; | |
outline: none; | |
background-color: #2e2e35; /* Dark background */ | |
color: rgb(177, 177, 177); | |
border: none; | |
border-radius: 10px; | |
top: -60px; /* Position above the input area */ | |
left: 10px; /* Align with the left side */ | |
} | |
.models:hover{ | |
background-color: #383838; /* Slightly lighter on hover */ | |
} | |
.models option{ | |
background-color: rgb(34, 34, 34); /* Dark background for options */ | |
color: #afafaf; | |
padding: 10px; | |
} | |
/*Hamburger*/ | |
.hamburger{ | |
display: flex; | |
flex-direction: column; | |
gap: 7px; | |
width: 20vh; | |
color: white; | |
margin: 1vw; | |
cursor: pointer; | |
position: absolute; | |
margin: 10px; | |
z-index: 101; | |
} | |
.line1{ | |
background-color: rgb(122, 122, 122); | |
width: 6vh; | |
height: 0.5vh; | |
} | |
.line2{ | |
background-color: rgb(104, 104, 104); | |
width: 3vh; | |
height: 0.5vh; | |
} | |
.hamburger:hover .line1{ | |
transform: translateX(-30px); | |
transition: transform 1s ease; | |
} | |
.hamburger:hover .line2{ | |
transform: translateX(30px); | |
transition: transform 1s ease; | |
} | |
/* Style the "Upgrade plan" section */ | |
.upgrade-plan { | |
padding: 30px; | |
border-radius: 5px; /* Rounded corners */ | |
border: 1px solid #3f3f46; /* A subtle border */ | |
background-color: rgba(30, 30, 30, 0.5); /* Semi-transparent background */ | |
margin: 30px; | |
} | |
/* Styling the button container */ | |
.buttons { | |
width: 70%; /* Same width as the input box */ | |
display: flex; | |
flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */ | |
margin-top: 15px; /* Space above the buttons */ | |
margin-bottom: 15px; | |
gap: 5px; /* Space between buttons */ | |
justify-content: center; /* Center the buttons horizontally */ | |
} | |
/* Styling for the individual buttons */ | |
.features { | |
border-radius: 5px; /* Rounded corners */ | |
background: none; /* No background */ | |
border: none; /* No border */ | |
color: #9f9fa5; /* Text color */ | |
padding: 10px; | |
} | |
.features:hover{ | |
background-color: #3f3f46; | |
} | |
/* Responsive adjustments */ | |
/* Adjustments for smaller screens */ | |
/* General layout adjustments */ | |
@media (max-width: 768px) { | |
.sidebar { | |
width: 0px; /* Initially hidden */ | |
} | |
.hamburger{ | |
display: flex; /* Show hamburger */ | |
} | |
.main-container { | |
width: 100vw; /* Full width on smaller screens */ | |
left: 0; /* Reset left positioning */ | |
margin-left: 0; | |
} | |
.input-box, .buttons { | |
width: 95%; /* Wider on smaller screens */ | |
} | |
.messages{ | |
width: 100%; | |
} | |
.user, .ai { | |
max-width: 90%; /* Allow messages to take up more width */ | |
} | |
} | |
</style> | |
</head> | |
<body> | |
<div class="top-bar"> | |
<div class="memory-status">Memory Full <i class="fas fa-exclamation-circle"></i></div> | |
<button class="share-button"> | |
<i class="fas fa-share-alt"></i> Share | |
</button> | |
</div> | |
<div class="sidebar" id="sidebar"> | |
<div class="new-chat-button" id="newChat"> | |
<i class="fas fa-plus"></i> New Chat | |
</div> | |
<div class="chat-history" id="prevChatsCont"> | |
<!-- Chat history items will be added here --> | |
</div> | |
<div class="upgrade-plan"> | |
<p>Upgrade plan</p> | |
<p style="font-size: small;">More access to the best models</p> | |
</div> | |
</div> | |
<div class="main-container"> | |
<div class="hamburger" id="hamburger"> | |
<div class="line1"></div> | |
<div class="line2"></div> | |
</div> | |
<div class="messages" id="messages"> | |
<!-- Messages will be added here --> | |
</div> | |
<div class="progress-container" id="progressContainer"> | |
<div class="progress-bar" id="progressBar"> | |
<div class="progress-bar-inner"></div> | |
</div> | |
<p id="progressText"></p> | |
</div> | |
<div class="input-area"> | |
<select name="" id="models" class="models"> | |
</select> | |
<div class="input-box"> | |
<textarea id="textBox" placeholder="What can I help with?"></textarea> | |
<button id="sendBtn"><i class="fas fa-arrow-up"></i></button> | |
</div> | |
<div class = "buttons"> | |
<button id="webSearch" class="features webSearch"><i class="fa-solid fa-globe"></i></button> | |
<button id="deepReason" class="features webSearch"><i class="fa-solid fa-brain"></i></button> | |
<button id="createImage" class="features"><i class="fas fa-image"></i> Create image</button> | |
<button id="brainstorm" class="features"><i class="fas fa-lightbulb"></i> Brainstorm</button> | |
<button id="getAdvice" class="features"><i class="fas fa-handshake"></i> Get advice</button> | |
<button id="analyzeImages" class="features"><i class="fas fa-chart-bar"></i> Analyze images</button> | |
<button id="code" class="features"><i class="fas fa-code"></i> Code</button> | |
<button id="more" class="features">More</button> | |
</div> | |
<p class="disclaimer"> | |
Xylaria can make mistakes. Check important info. | |
</p> | |
</div> | |
</div> | |
<script src="{{ url_for('static', filename='js/script.js') }}" type="module"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script> | |
</body> | |
</html> |