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

Fixed unreachable endpoint spinner size #504

Merged
merged 2 commits into from
Jan 22, 2018

Conversation

Weakky
Copy link
Contributor

@Weakky Weakky commented Jan 17, 2018

Fixes #499 .

Changes proposed in this pull request:

  • Reduced the size of the 'unreachable endpoint' loading spinner to match the mockup.

IMO, it looks very tiny now though, especially with the fade-out effect while it grows.
unreachable_spinner

@CLAassistant
Copy link

CLAassistant commented Jan 17, 2018

CLA assistant check
All committers have signed the CLA.

@timsuchanek
Copy link
Member

Thanks for the PR!
It is indeed pretty tiny and not really visible like this.
2 things: Can you try to change the color from #333 to rgba(255,255,255,0.2)? Maybe 0.1, maybe 0.3.
And add another div with a delayed pulse. That should make it more visible.

@Weakky
Copy link
Contributor Author

Weakky commented Jan 18, 2018

By another div, do you mean something like an inner/smaller pulse inside the bigger one ?

Something like the second spinner on this page: http://tobiasahlin.com/spinkit/

@timsuchanek
Copy link
Member

Yes exactly what I mean. You also can use the second spinner from that page!

@Weakky
Copy link
Contributor Author

Weakky commented Jan 20, 2018

Just pushed the changes you advised me. It currently looks like this.
The implementation with styled-components looks a bit heavy for me though.
Why can't we pass props through styled.div components ? I get insulted by Typescript trying to do so 🤕. I could have simplified it using a delay props on the <Pulse /> component, to conditionally set the animation-delay css instruction ?

spinner2

Update: Nevermind, just saw your comment on #516. The implementation doesn't look any better anyway IMO. I have to mess with position depending on the props passed, and that looks terrible !

interface PulseProps {
  delay: boolean
}

const Pulse = withProps<PulseProps>()(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;
  animation-delay: ${p => p.delay ? '-1s' : '0s'};
  -webkit-animation-delay: ${p => p.delay ? '-1s' : '0s'};
  position: ${p => p.delay ? 'absolute' : 'relative'};
  top: 0;
`

const SpinnerWrapper = styled.div`
  position: relative;
  margin: 6px;
`

const Spinner = () => (
  <SpinnerWrapper>
    <Pulse delay={false} />
    <Pulse delay={true} />
  </SpinnerWrapper>
)

Copy link
Member

@timsuchanek timsuchanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! The playground gets better and better with PRs like this 👍

@timsuchanek timsuchanek merged commit 640a492 into graphql:master Jan 22, 2018
cgxxv pushed a commit to cgxxv/graphql-playground that referenced this pull request Mar 25, 2022
* Fixed unreachable endpoint spinner size

* Changed 'unreachable endpoint' spinner animation and color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants