Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(desktop): update flat logo animation #1432

Merged
merged 1 commit into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions desktop/renderer-app/src/pages/SplashPage/SplashPage.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
display: flex;
flex-direction: column;
align-items: center;
margin-top: 80px;
animation: flat-fly 0.6s;
margin-top: 290px;
opacity: 0.3;

&.is-logo-loaded {
animation: flat-fly 1s forwards;
}

img {
margin-bottom: 24px;
Expand All @@ -25,11 +29,18 @@
opacity: 0.3;
transition-timing-function: ease-in;
transition-timing-function: cubic-bezier(0.42, 0, 1, 1);
transform: translateY(210px);
transform: translateY(0);
}
20% {
opacity: 0.7;
transition-timing-function: ease-in;
transition-timing-function: cubic-bezier(0.42, 0, 1, 1);
transform: translateY(0);
}
100% {
opacity: 1;
transition-timing-function: ease-out;
transition-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
transform: translateY(0);
transform: translateY(-210px);
}
}
10 changes: 9 additions & 1 deletion desktop/renderer-app/src/pages/SplashPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const SplashPage = observer<{}>(function SplashPage() {
useWindowSize("Splash");

const { t } = useTranslation();
const [logoLoaded, setLogoLoaded] = useState(false);
const [loginStatus, updateLoginStatus] = useState(LoginStatusType.Idle);
const pushHistory = usePushHistory();
const globalStore = useContext(GlobalStoreContext);
Expand Down Expand Up @@ -79,9 +80,16 @@ export const SplashPage = observer<{}>(function SplashPage() {
className={classNames("splash-content", {
// @TODO add loading status
"is-success": loginStatus === LoginStatusType.Success,
"is-logo-loaded": logoLoaded,
BlackHole1 marked this conversation as resolved.
Show resolved Hide resolved
})}
>
<img alt="flat logo" src={logoSVG} />
<img
alt="flat logo"
height={64}
src={logoSVG}
width={64}
onLoad={() => setLogoLoaded(true)}
/>
<span>{t("online-interaction-to-synchronize-ideas")}</span>
</div>
</div>
Expand Down