From 65a0d44976d567cf36996b61952c4cf2c0f141af Mon Sep 17 00:00:00 2001 From: Flavian DESVERNE Date: Wed, 17 Jan 2018 20:43:21 +0100 Subject: [PATCH 1/2] Fixed unreachable endpoint spinner size --- .../src/components/Playground/TopBar/TopBar.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/graphql-playground-react/src/components/Playground/TopBar/TopBar.tsx b/packages/graphql-playground-react/src/components/Playground/TopBar/TopBar.tsx index cc43adf5b..cee43786c 100644 --- a/packages/graphql-playground-react/src/components/Playground/TopBar/TopBar.tsx +++ b/packages/graphql-playground-react/src/components/Playground/TopBar/TopBar.tsx @@ -187,9 +187,9 @@ const ReloadIcon = styled(Icon)` const Spinner = styled.div` & { - width: 40px; - height: 40px; - margin: 40px auto; + width: 16px; + height: 16px; + margin: 6px; background-color: #333; border-radius: 100%; -webkit-animation: sk-pulseScaleOut 1s infinite ease-in-out; From ce6e3fe6e95e0c9368f5cce2884e4c022c2e008e Mon Sep 17 00:00:00 2001 From: Flavian DESVERNE Date: Sat, 20 Jan 2018 16:48:52 +0100 Subject: [PATCH 2/2] Changed 'unreachable endpoint' spinner animation and color --- .../components/Playground/TopBar/TopBar.tsx | 79 +++++++++++-------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/packages/graphql-playground-react/src/components/Playground/TopBar/TopBar.tsx b/packages/graphql-playground-react/src/components/Playground/TopBar/TopBar.tsx index cee43786c..017db127c 100644 --- a/packages/graphql-playground-react/src/components/Playground/TopBar/TopBar.tsx +++ b/packages/graphql-playground-react/src/components/Playground/TopBar/TopBar.tsx @@ -4,7 +4,7 @@ import * as theme from 'styled-theming' import { darken, lighten } from 'polished' import * as CopyToClipboard from 'react-copy-to-clipboard' import Share, { SharingProps } from '../../Share' -import { StyledComponentClass } from 'styled-components' +import { keyframes, StyledComponentClass } from 'styled-components' import { Icon } from 'graphcool-styles' import * as cx from 'classnames' @@ -115,6 +115,11 @@ const barBorder = theme('mode', { dark: p => '#09141c', }) +const spinnerColor = theme('mode', { + light: p => p.theme.colours.black40, + dark: p => p.theme.colours.white30, +}) + export const Button: StyledComponentClass = styled.button` text-transform: uppercase; font-weight: 600; @@ -138,8 +143,7 @@ export const Button: StyledComponentClass = styled.button` const TopBarWrapper = styled.div` display: flex; background: ${backgroundColor}; - padding: 10px; - padding-bottom: 4px; + padding: 10px 10px 4px; align-items: center; ` @@ -185,38 +189,45 @@ const ReloadIcon = styled(Icon)` } ` as any // TODO remove this once typings are fixed -const Spinner = styled.div` - & { - width: 16px; - height: 16px; - margin: 6px; - background-color: #333; - border-radius: 100%; - -webkit-animation: sk-pulseScaleOut 1s infinite ease-in-out; - animation: sk-pulseScaleOut 1s infinite ease-in-out; +const bounceAnimation = keyframes` + 0%, 100% { + transform: scale(0); } - - @-webkit-keyframes sk-pulseScaleOut { - 0% { - -webkit-transform: scale(0); - transform: scale(0); - } - 100% { - -webkit-transform: scale(1); - transform: scale(1); - opacity: 0; - } + 50% { + transform: scale(1); } +` - @keyframes sk-pulseScaleOut { - 0% { - -webkit-transform: scale(0); - transform: scale(0); - } - 100% { - -webkit-transform: scale(1); - transform: scale(1); - opacity: 0; - } - } +const Pulse = styled.div` + width: 16px; + height: 16px; + background-color: ${spinnerColor}; + border-radius: 100%; + animation: ${bounceAnimation} 2s infinite ease-in-out; + -webkit-animation: ${bounceAnimation} 2s infinite ease-in-out; +` + +const DelayedPulse = styled.div` + width: 16px; + height: 16px; + position: absolute; + top: 0; + background-color: ${spinnerColor}; + border-radius: 100%; + animation: ${bounceAnimation} 2s infinite ease-in-out; + -webkit-animation: ${bounceAnimation} 2s infinite ease-in-out; + animation-delay: -1s; + -webkit-animation-delay: -1.0s; ` + +const SpinnerWrapper = styled.div` + position: relative; + margin: 6px; +` + +const Spinner = () => ( + + + + +)