Skip to content

Commit

Permalink
fix: Add cue for assembled section content on mobile
Browse files Browse the repository at this point in the history
Show a green radiating dot on the expand button when there is content
inside the assembled output section so that user knows to click and see
the assembled output.
  • Loading branch information
debjitbis08 committed Nov 16, 2024
1 parent c99ba4f commit 3b90fd0
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 11 deletions.
22 changes: 13 additions & 9 deletions src/components/Assembled.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { FiAlertCircle, FiAlertTriangle } from 'solid-icons/fi';
import CopyComponent from './CopyComponent.jsx';
import { Tooltip } from '@kobalte/core/tooltip';
import { BsArrowBarLeft, BsArrowBarRight } from 'solid-icons/bs';
import styles from './Assembled.module.css';

export function Assembled() {
let [lines, setLines] = createSignal([]);
Expand Down Expand Up @@ -84,15 +85,18 @@ export function Assembled() {
</div>
<div class="flex-grow"></div>
<Tooltip placement="left">
<Tooltip.Trigger class="tooltip__trigger" onClick={toggleExpanded}>
{expanded() ? <BsArrowBarRight /> : <BsArrowBarLeft />}
</Tooltip.Trigger>
<Tooltip.Portal>
<Tooltip.Content class="tooltip__content">
<Tooltip.Arrow />
<p>{expanded() ? "Collapse Panel" : "Expand Panel"}</p>
</Tooltip.Content>
</Tooltip.Portal>
<Tooltip.Trigger class="tooltip__trigger relative" onClick={toggleExpanded}>
{expanded() ? <BsArrowBarRight /> : <BsArrowBarLeft />}
{ store.assembled.length || store.errors.length && !expanded() ? (
<span class={`w-2 h-2 rounded-[2rem] bg-terminal absolute left-0 bottom-[-4px] ${styles.radiatingBorder}`}> </span>
) : null }
</Tooltip.Trigger>
<Tooltip.Portal>
<Tooltip.Content class="tooltip__content">
<Tooltip.Arrow />
<p>{expanded() ? "Collapse Panel" : "Expand Assembled Ouput Panel"}</p>
</Tooltip.Content>
</Tooltip.Portal>
</Tooltip>
</div>
<div class={`flex flex-col ${expanded() ? 'block' : 'hidden'}`} style={{ height: "calc(100vh - 8rem - 1px)" }}>
Expand Down
27 changes: 27 additions & 0 deletions src/components/Assembled.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.radiatingBorder {
}

.radiatingBorder::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 50%; /* Creates the circular border */
border: 2px solid rgb(var(--sm-primary)); /* Replace with your terminal color */
animation: radiate 1.5s infinite;
opacity: 0;
}

/* Keyframes for radiating effect */
@keyframes radiate {
0% {
transform: scale(1);
opacity: 1;
}
100% {
transform: scale(3); /* Expands outward */
opacity: 0; /* Fades out */
}
}
2 changes: 1 addition & 1 deletion src/components/Flags.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function Flags() {

return (
<div>
<div class="flex border-b border-b-inactive-border">
<div class="flex border-b border-b-inactive-border px-1">
<h2 class="text-xl grow pb-1">Flags</h2>
<button title="Reset Flags" class="text-red-foreground" onClick={clearFlags}>
<AiOutlineClear />
Expand Down
2 changes: 1 addition & 1 deletion src/components/Registers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function Registers() {

return (
<div>
<div class="flex border-b border-b-inactive-border">
<div class="flex border-b border-b-inactive-border px-1">
<h2 class="text-xl grow pb-1">Registers</h2>
<button title="Clear Registers" class="text-red-foreground" onClick={clearRegisters}>
<AiOutlineClear />
Expand Down

0 comments on commit 3b90fd0

Please sign in to comment.