Skip to content

Commit

Permalink
change goofy arrow to animation on download button
Browse files Browse the repository at this point in the history
  • Loading branch information
beebls committed Nov 9, 2023
1 parent 550b34d commit 79daa4b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
7 changes: 0 additions & 7 deletions src/components/QAMTab/QAMThemeToggleList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ export function QAMThemeToggleList() {
if (localThemeList.length === 0) {
return (
<>
<BsArrowDown
style={{
position: "absolute",
right: "4.85em",
transform: "rotate(180deg) scale(2) translateY(13px)",
}}
/>
<span>You have no themes currently, get started by clicking the download icon above!</span>
</>
);
Expand Down
27 changes: 25 additions & 2 deletions src/components/TitleView.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { DialogButton, Navigation, staticClasses, Focusable } from "decky-frontend-lib";
import { BsGearFill } from "react-icons/bs";
import { BiDownload } from "react-icons/bi";
import { FaDownload } from "react-icons/fa";
import { useCssLoaderState } from "../state";

export function TitleView({ onDocsClick }: { onDocsClick?: () => {} }) {
const { localThemeList } = useCssLoaderState();

const onSettingsClick = () => {
Navigation.CloseSideMenus();
Navigation.Navigate("/cssloader/settings");
Expand All @@ -26,9 +28,30 @@ export function TitleView({ onDocsClick }: { onDocsClick?: () => {} }) {
}}
className={staticClasses.Title}
>
<style>
{`
@keyframes onboarding {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
`}
</style>
<div style={{ marginRight: "auto" }}>CSS Loader</div>
<DialogButton
style={{ height: "28px", width: "40px", minWidth: 0, padding: "10px 12px" }}
style={{
height: "28px",
width: "40px",
minWidth: 0,
padding: "10px 12px",
animation: localThemeList.length === 0 ? "onboarding 1s infinite ease-in-out" : "",
}}
onClick={onStoreClick}
>
<FaDownload style={{ marginTop: "-4px", display: "block" }} />
Expand Down
6 changes: 5 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ export default definePlugin((serverApi: ServerAPI) => {
));

return {
titleView: <TitleView />,
titleView: (
<CssLoaderContextProvider cssLoaderStateClass={state}>
<TitleView />
</CssLoaderContextProvider>
),
title: <div>CSSLoader</div>,
alwaysRender: true,
content: (
Expand Down

0 comments on commit 79daa4b

Please sign in to comment.