Skip to content

Commit

Permalink
mobile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zarSou9 committed Jun 11, 2024
1 parent 6593238 commit d7cdd87
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 19 deletions.
6 changes: 4 additions & 2 deletions app/components/Chatbot/chat_entry.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ article.stampy {
width: var(--spacing-32);
height: var(--spacing-32);
border-radius: var(--border-radius);
text-align: center;
line-height: 32px;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
}

.reference .source-link {
Expand Down
11 changes: 6 additions & 5 deletions app/components/Chatbot/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ const QuestionInput = ({
/>
<SendIcon className="send pointer" onClick={() => handleAsk(question)} />
</div>
{fixed && <div className="white-space"></div>}
{fixed && <div className="white-space" />}

<div className="mobile-only grey padding-top-8">
<ExclamationIcon /> <span>Stampy can be inaccurate. Always verify its sources.</span>
<div className="mobile-only grey mobile-caution xxs">
<ExclamationIcon />{' '}
<span className="padding-left-4">Stampy can be inaccurate. Always verify its sources.</span>
</div>
</div>
)
Expand Down Expand Up @@ -319,7 +320,7 @@ export const Chatbot = ({question, questions, settings}: ChatbotProps) => {
<ChatEntry key={`chat-entry-${i}`} {...item} no={i} />
))}

<div className="padding-bottom-128">
<div className="followups-container">
{followups ? (
<Followups
title="Continue the conversation"
Expand All @@ -336,7 +337,7 @@ export const Chatbot = ({question, questions, settings}: ChatbotProps) => {
fixed
/>

<div className="desktop-only warning-floating">
<div className="desktop-only warning-floating z-index-1">
<p className="xs">
<span className="red xs-bold">Caution! </span>
This is an early prototype. Don’t automatically trust what it says, and make sure to
Expand Down
29 changes: 23 additions & 6 deletions app/components/Chatbot/widgit.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
.widget-ask.fixed {
position: fixed;
bottom: var(--spacing-48);
bottom: 42px;
}

.right-icon {
Expand All @@ -44,6 +44,12 @@
left: var(--spacing-32);
}

.mobile-caution {
position: absolute;
top: calc(100% + var(--spacing-8));
display: flex;
}

.settings {
padding: var(--spacing-32);
margin-bottom: var(--spacing-8);
Expand All @@ -57,7 +63,8 @@
justify-content: start;
padding: var(--spacing-8) var(--spacing-12);
position: absolute;
top: calc(-1 * var(--spacing-56));
bottom: 100%;
height: auto;
}

.widget-ask .suggestion:hover {
Expand All @@ -66,16 +73,26 @@

.widget-ask .send {
position: absolute;
right: 4px;
bottom: 4px;
right: var(--spacing-8);
bottom: var(--spacing-8);
}

.white-space {
position: absolute;
left: -1000px;
width: calc(100% + 2000px);
height: 100px;
top: 100%;
height: 120px;
top: 0;
z-index: -1;
background: #ffffff;
}

.followups-container {
padding-bottom: calc(106px + var(--spacing-48));
}

@media (max-width: 780px) {
.widget-ask.fixed {
bottom: 56px;
}
}
7 changes: 4 additions & 3 deletions app/components/Input/input.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
border: 1px solid var(--colors-cool-grey-200, #dfe3e9);
background: var(--colors-white, #fff);
color: var(--colors-cool-grey-900, #1b2b3e);
padding: var(--spacing-8) 0 var(--spacing-8) var(--spacing-12);
padding: var(--spacing-8) var(--height-48) var(--spacing-8) var(--spacing-12);
/* This can't be a variable because it shouldn't shrink when the screen gets small */
height: 48px;
height: var(--height-48);
font-size: 16px;
font-weight: 300;
line-height: 170%; /* 27.2px */
Expand All @@ -24,9 +24,10 @@
/* size */

.input.large {
height: 56px;
height: var(--height-64);
font-size: 18px;
letter-spacing: -0.18px;
padding-right: var(--height-64);
}

/* states */
Expand Down
11 changes: 9 additions & 2 deletions app/root.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ h2 {
letter-spacing: -0.14px;
}

.xxs {
font-size: 12px;
font-weight: 300;
line-height: 150%; /* 23.8px */
letter-spacing: -0.1px;
}

.leading-0 {
line-height: 0 !important;
}
Expand Down Expand Up @@ -353,7 +360,7 @@ h2 {
}

.col-6 {
width: clamp(0px, 35.28vw, 640px);
width: clamp(270px, 35.28vw, 640px);
}

.col-7 {
Expand All @@ -369,7 +376,7 @@ h2 {
}

.col-10 {
width: clamp(0px, 60.62vw, 1109px);
width: clamp(300px, 60.62vw, 1109px);
}

.col-11 {
Expand Down
2 changes: 1 addition & 1 deletion app/routes/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function App() {
<Page noFooter>
<div className="page-body full-height padding-top-32">
<Chatbot question={question} questions={questions} settings={chatSettings} />
<div className="settings-container z-index-1" ref={clickDetectorRef}>
<div className="settings-container z-index-1 desktop-only" ref={clickDetectorRef}>
{showSettings && (
<div className="settings bordered flex-container">
<div>Answer detail</div>
Expand Down

0 comments on commit d7cdd87

Please sign in to comment.