rstacruz / nprogress

For slim progress bars like on YouTube, Medium, etc
http://ricostacruz.com/nprogress
MIT License
26.09k stars 1.81k forks source link

Rendering issue on Chrome #186

Closed oliviertassinari closed 7 years ago

oliviertassinari commented 7 years ago

I have increased the top positioning so we better see the issue on Chrome v60.0.3112.101:

capture d ecran 2017-08-26 a 15 44 08

oliviertassinari commented 7 years ago

On the other hand, YouTube implementation looks better. I will use this.

aout-26-2017 15-48-42

NProgress.configure({
  template: `
    <div class="bar" role="bar">
      <dt></dt>
      <dd></dd>
    </div>
  `,
});

const styles = {
  '#nprogress': {
    pointerEvents: 'none',
    '& .bar': {
      position: 'fixed',
      background: '#000',
      borderRadius: 1,
      zIndex: theme.zIndex.tooltip,
      top: 0,
      left: 0,
      width: '100%',
      height: 2,
    },
    '& dd, & dt': {
      position: 'absolute',
      top: 0,
      height: 2,
      boxShadow: '#000 1px 0 6px 1px',
      borderRadius: '100%',
      animation: 'nprogress-pulse 2s ease-out 0s infinite',
    },
    '& dd': {
      opacity: 0.6,
      width: 20,
      right: 0,
      clip: 'rect(-6px,22px,14px,10px)',
    },
    '& dt': {
      opacity: 0.6,
      width: 180,
      right: -80,
      clip: 'rect(-6px,90px,14px,-6px)',
    },
  },
  '@keyframes nprogress-pulse': {
    '30%': {
      opacity: 0.6,
    },
    '60%': {
      opacity: 0,
    },
    to: {
      opacity: 0.6,
    },
  },
};