From 8055685822e89a81333e6be1b1082062633a65e2 Mon Sep 17 00:00:00 2001 From: dcordz <17937472+dcordz@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:33:29 -0400 Subject: [PATCH] fade-in - fade in child component rendered by Layout, don't render loading bar in menu, add scss for striped loading text --- app/assets/stylesheets/scss/striped.scss | 39 ++++++++++++++++++ app/frontend/components/Layout.tsx | 41 +++---------------- .../components/dialogs/InviteDialog.tsx | 2 - .../components/dialogs/InviteIconDialog.tsx | 10 +++-- .../components/user/LocaleSelector.tsx | 14 ++++--- app/frontend/hooks/useLocales.ts | 6 +-- app/frontend/pages/BillOfTheWeek.tsx | 3 -- 7 files changed, 62 insertions(+), 53 deletions(-) create mode 100644 app/assets/stylesheets/scss/striped.scss diff --git a/app/assets/stylesheets/scss/striped.scss b/app/assets/stylesheets/scss/striped.scss new file mode 100644 index 00000000..3555968e --- /dev/null +++ b/app/assets/stylesheets/scss/striped.scss @@ -0,0 +1,39 @@ +// https://lea.verou.me/demos/css3-patterns.html +// https://stackoverflow.com/questions/14072142/striped-text-in-css + +@import "./_constants.scss"; + +$primary: map-get($sway-theme-colors, "primary"); + +.stripes { + height: 250px; + width: 375px; + float: left; + margin: 10px; + -webkit-background-size: 50px 50px; + -moz-background-size: 50px 50px; + background-size: 50px 50px; + -moz-box-shadow: 1px 1px 8px gray; + -webkit-box-shadow: 1px 1px 8px gray; + box-shadow: 1px 1px 8px gray; + + .horizontal { + background-image: -webkit-gradient( + linear, + 0 0, + 0 100%, + color-stop(0.5, rgba(255, 255, 255, 0.2)), + color-stop(0.5, transparent), + to(transparent) + ); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.2) 50%, transparent 50%, transparent); + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.2) 50%, transparent 50%, transparent); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.2) 50%, transparent 50%, transparent); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.2) 50%, transparent 50%, transparent); + background-image: linear-gradient(rgba(255, 255, 255, 0.2) 50%, transparent 50%, transparent); + } + + .loading { + background-color: $primary; + } +} diff --git a/app/frontend/components/Layout.tsx b/app/frontend/components/Layout.tsx index 35fe015e..af74fd31 100644 --- a/app/frontend/components/Layout.tsx +++ b/app/frontend/components/Layout.tsx @@ -6,6 +6,7 @@ import React, { PropsWithChildren } from "react"; // Load react-select // @ts-expect-error - unused Select, importing here to have styles available import Select from "react-select"; // eslint-disable-line +import { Animate } from "react-simple-animate"; interface IProps extends PropsWithChildren { [key: string]: any; @@ -13,43 +14,13 @@ interface IProps extends PropsWithChildren { const _Layout: React.FC = ({ children, ...props }) => ( - {React.Children.map(children, (child) => - React.isValidElement(child) ? React.cloneElement(child, { ...child?.props, ...props }) : child, - )} + {React.Children.map(children, (child) => ( + + {React.isValidElement(child) ? React.cloneElement(child, { ...child?.props, ...props }) : child} + + ))}