Changesets · Branches · Tags · Compare
| Changeset | cfa8d31094cb4dd5c33e05891a674ba1092eb0bfb356a13be1e6856b048e1903 |
|---|---|
| Author | Nate <sestinj@gmail.com> · 2025-06-26 23:38 -07:00 |
| Committer | Nate <sestinj@gmail.com> · 2025-06-26 23:38 -07:00 |
| Parents | 073baedf8ebe |
2 files changed
modified gui/src/components/mainInput/ContinueInputBox.tsx +2 −38
| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | import { Editor, JSONContent } from "@tiptap/react"; |
| 2 | 2 | import { ContextItemWithId, InputModifiers, RuleWithSource } from "core"; |
| 3 | 3 | import { useMemo } from "react"; |
| 4 | -import styled, { keyframes } from "styled-components"; | |
| 5 | 4 | import { defaultBorderRadius, vscBackground } from ".."; |
| 6 | 5 | import { useAppSelector } from "../../redux/hooks"; |
| 7 | 6 | import { selectSlashCommandComboBoxInputs } from "../../redux/selectors"; |
| 8 | 7 | import { ContextItemsPeek } from "./belowMainInput/ContextItemsPeek"; |
| 9 | 8 | import { RulesPeek } from "./belowMainInput/RulesPeek"; |
| 9 | +import { GradientBorder } from "./GradientBorder"; | |
| 10 | 10 | import { ToolbarOptions } from "./InputToolbar"; |
| 11 | 11 | import { Lump } from "./Lump"; |
| 12 | 12 | import { TipTapEditor } from "./TipTapEditor"; |
| @@ -38,43 +38,6 @@ | ||
| 38 | 38 | "repo-map", |
| 39 | 39 | ]; |
| 40 | 40 | |
| 41 | -const gradient = keyframes` | |
| 42 | - 0% { | |
| 43 | - background-position: 0px 0; | |
| 44 | - } | |
| 45 | - 100% { | |
| 46 | - background-position: 100em 0; | |
| 47 | - } | |
| 48 | -`; | |
| 49 | - | |
| 50 | -const GradientBorder = styled.div<{ | |
| 51 | - borderRadius?: string; | |
| 52 | - borderColor?: string; | |
| 53 | - loading: 0 | 1; | |
| 54 | -}>` | |
| 55 | - border-radius: ${(props) => props.borderRadius || "0"}; | |
| 56 | - padding: 1px; | |
| 57 | - background: ${(props) => | |
| 58 | - props.borderColor | |
| 59 | - ? props.borderColor | |
| 60 | - : `repeating-linear-gradient( | |
| 61 | - 101.79deg, | |
| 62 | - #1BBE84 0%, | |
| 63 | - #331BBE 16%, | |
| 64 | - #BE1B55 33%, | |
| 65 | - #A6BE1B 55%, | |
| 66 | - #BE1B55 67%, | |
| 67 | - #331BBE 85%, | |
| 68 | - #1BBE84 99% | |
| 69 | - )`}; | |
| 70 | - animation: ${(props) => (props.loading ? gradient : "")} 6s linear infinite; | |
| 71 | - background-size: 200% 200%; | |
| 72 | - width: 100%; | |
| 73 | - display: flex; | |
| 74 | - flex-direction: row; | |
| 75 | - align-items: center; | |
| 76 | -`; | |
| 77 | - | |
| 78 | 41 | function ContinueInputBox(props: ContinueInputBoxProps) { |
| 79 | 42 | const isStreaming = useAppSelector((state) => state.session.isStreaming); |
| 80 | 43 | const availableSlashCommands = useAppSelector( |
| @@ -146,6 +109,7 @@ | ||
| 146 | 109 | /> |
| 147 | 110 | </GradientBorder> |
| 148 | 111 | </div> |
| 112 | + | |
| 149 | 113 | {(appliedRules.length > 0 || contextItems.length > 0) && ( |
| 150 | 114 | <div className="mt-2 flex flex-col"> |
| 151 | 115 | <RulesPeek appliedRules={props.appliedRules} /> |
added gui/src/components/mainInput/GradientBorder.tsx +38 −0
| @@ -0,0 +1,38 @@ | ||
| 1 | +import styled, { keyframes } from "styled-components"; | |
| 2 | + | |
| 3 | +const gradient = keyframes` | |
| 4 | + 0% { | |
| 5 | + background-position: 0px 0; | |
| 6 | + } | |
| 7 | + 100% { | |
| 8 | + background-position: 100em 0; | |
| 9 | + } | |
| 10 | +`; | |
| 11 | + | |
| 12 | +export const GradientBorder = styled.div<{ | |
| 13 | + borderRadius?: string; | |
| 14 | + borderColor?: string; | |
| 15 | + loading: 0 | 1; | |
| 16 | +}>` | |
| 17 | + border-radius: ${(props) => props.borderRadius || "0"}; | |
| 18 | + padding: 1px; | |
| 19 | + background: ${(props) => | |
| 20 | + props.borderColor | |
| 21 | + ? props.borderColor | |
| 22 | + : `repeating-linear-gradient( | |
| 23 | + 101.79deg, | |
| 24 | + #1BBE84 0%, | |
| 25 | + #331BBE 16%, | |
| 26 | + #BE1B55 33%, | |
| 27 | + #A6BE1B 55%, | |
| 28 | + #BE1B55 67%, | |
| 29 | + #331BBE 85%, | |
| 30 | + #1BBE84 99% | |
| 31 | + )`}; | |
| 32 | + animation: ${(props) => (props.loading ? gradient : "")} 6s linear infinite; | |
| 33 | + background-size: 200% 200%; | |
| 34 | + width: 100%; | |
| 35 | + display: flex; | |
| 36 | + flex-direction: row; | |
| 37 | + align-items: center; | |
| 38 | +`; |