Giter Site home page Giter Site logo

Comments (23)

07akioni avatar 07akioni commented on May 18, 2024 2
System: Windows 10 version 10.0 (64-bit)
Browser: Chrome version 91.0.4472.77 (64-bit)
Display Resolution: 1920 * 1080

放大页面后看到了,直接在页面上看动画不明显,以为没有呢,还有就是展示小的情况下,动画闪烁很快

这个我自己感觉不太好解决,没有 window 电脑。从理论上写的样式应该是没问题。有兴趣调查一下原因吗?

from naive-ui.

07akioni avatar 07akioni commented on May 18, 2024

这个闪烁需要专门的 prop processing,不设定没有

from naive-ui.

Hucy avatar Hucy commented on May 18, 2024

https://codesandbox.io/s/13ti9?file=/src/Demo.vue:137-147

<template>
  <n-space :size="24" align="center">
    <n-badge dot processing>
      <n-avatar />
    </n-badge>
    <n-badge :value="20" processing>
      <n-avatar />
    </n-badge>
    <n-badge dot type="info" processing>
      <n-avatar />
    </n-badge>
  </n-space>
</template>

在示例代码中同时设置 valueprocessing 后没有动画,这个动画只有在设置 dot 后生效,本身的设计就是这样么,像是两个不同的展示形式

from naive-ui.

07akioni avatar 07akioni commented on May 18, 2024

image
我看是有的,会不会是浏览器问题?

from naive-ui.

Hucy avatar Hucy commented on May 18, 2024
System: Windows 10 version 10.0 (64-bit)
Browser: Chrome version 91.0.4472.77 (64-bit)
Display Resolution: 1920 * 1080

放大页面后看到了,直接在页面上看动画不明显,以为没有呢,还有就是展示小的情况下,动画闪烁很快

from naive-ui.

myst729 avatar myst729 commented on May 18, 2024

Mac在视网膜屏上没问题,外接2K显示器就能看到明显的闪烁。放大到150%以后正常。

from naive-ui.

07akioni avatar 07akioni commented on May 18, 2024

题,外接2K显示器就能看到明显的闪烁。放大到

确实能看出来... 这我有点绝望啊

from naive-ui.

07akioni avatar 07akioni commented on May 18, 2024
System: Windows 10 version 10.0 (64-bit)
Browser: Chrome version 91.0.4472.77 (64-bit)
Display Resolution: 1920 * 1080

放大页面后看到了,直接在页面上看动画不明显,以为没有呢,还有就是展示小的情况下,动画闪烁很快

这感觉理论上是 chrome 的 bug

from naive-ui.

Hucy avatar Hucy commented on May 18, 2024
System: Windows 10 version 10.0 (64-bit)
Browser: Chrome version 91.0.4472.77 (64-bit)
Display Resolution: 1920 * 1080

放大页面后看到了,直接在页面上看动画不明显,以为没有呢,还有就是展示小的情况下,动画闪烁很快

这感觉理论上是 chrome 的 bug

https://github.com/TuSimple/naive-ui/blob/d2b55889d8141844ec84e2eddc9e2d2cae76c20b/src/badge/src/styles/index.cssr.ts#L18

是这个原因么
window.devicePixelRatio1 的情况下会这样

from naive-ui.

myst729 avatar myst729 commented on May 18, 2024

@Hucy 根据目测结果猜测:

Safari 和 Firefox 的表现比较一致。应该没有 0.5px 那一帧,round 到前一桢或后一桢(整数px)重复播放。看着就像跳桢。
Chrome 更像是桢序列提前算好了,然后锁定 FPS 播放。结果就 2K 屏动画速度*2(桢少一半)。

from naive-ui.

07akioni avatar 07akioni commented on May 18, 2024

感觉这个我一时半会可能没法改,如果有人找到方法的话提个 PR 或者说一下。

浏览器确实会有很多奇奇怪怪的边缘情况。

from naive-ui.

Hucy avatar Hucy commented on May 18, 2024

感觉这个我一时半会可能没法改,如果有人找到方法的话提个 PR 或者说一下。

浏览器确实会有很多奇奇怪怪的边缘情况。

  1. 这个 0.5px 是必须的么,可以统一设置为 1px
  2. 或者使用 media query 兼容下

from naive-ui.

07akioni avatar 07akioni commented on May 18, 2024

感觉这个我一时半会可能没法改,如果有人找到方法的话提个 PR 或者说一下。
浏览器确实会有很多奇奇怪怪的边缘情况。

  1. 这个 0.5px 是必须的么,可以统一设置为 1px
  2. 或者使用 media query 兼容下

你换成整数 px 的话是没问题的吗?我当时用整数在 MBP 上是会出问题。

from naive-ui.

myst729 avatar myst729 commented on May 18, 2024

感觉这个我一时半会可能没法改,如果有人找到方法的话提个 PR 或者说一下。
浏览器确实会有很多奇奇怪怪的边缘情况。

  1. 这个 0.5px 是必须的么,可以统一设置为 1px
  2. 或者使用 media query 兼容下

media query 判断 dpr或许是个解法

from naive-ui.

07akioni avatar 07akioni commented on May 18, 2024

感觉这个我一时半会可能没法改,如果有人找到方法的话提个 PR 或者说一下。
浏览器确实会有很多奇奇怪怪的边缘情况。

  1. 这个 0.5px 是必须的么,可以统一设置为 1px
  2. 或者使用 media query 兼容下

media query 判断 dpr或许是个解法

应该是可以的,不过我先得确定一下在 windows 上改成整数会不会好呢?或者说在 dpr 为 1 的设备上改成整数。

from naive-ui.

Hucy avatar Hucy commented on May 18, 2024

感觉这个我一时半会可能没法改,如果有人找到方法的话提个 PR 或者说一下。
浏览器确实会有很多奇奇怪怪的边缘情况。

  1. 这个 0.5px 是必须的么,可以统一设置为 1px
  2. 或者使用 media query 兼容下

你换成整数 px 的话是没问题的吗?我当时用整数在 MBP 上是会出问题。

这个问题具体是指什么现象?设置的值是 5px 么。我改成 1px 后好像没问题。Windows 下的我回去测试下

from naive-ui.

07akioni avatar 07akioni commented on May 18, 2024

感觉这个我一时半会可能没法改,如果有人找到方法的话提个 PR 或者说一下。
浏览器确实会有很多奇奇怪怪的边缘情况。

  1. 这个 0.5px 是必须的么,可以统一设置为 1px
  2. 或者使用 media query 兼容下

你换成整数 px 的话是没问题的吗?我当时用整数在 MBP 上是会出问题。

这个问题具体是指什么现象?设置的值是 5px 么。我改成 1px 后好像没问题。Windows 下的我回去测试下

比如说改成一个接近的整数值,这样效果应该不会有很大偏差

from naive-ui.

Hucy avatar Hucy commented on May 18, 2024

1920x1080_1080p:

1920x1080_1080p

3840x2160_4k:

3840x2160_4k

from naive-ui.

jahnli avatar jahnli commented on May 18, 2024

Yes, at present, the flashing speed is too fast, which leads to the phenomenon of stalling. Would you consider supporting custom speed

from naive-ui.

07akioni avatar 07akioni commented on May 18, 2024

Yes, at present, the flashing speed is too fast, which leads to the phenomenon of stalling. Would you consider supporting custom speed

This is a bug of chrome. I have no windows laptop so doesn't know how to fix it.

from naive-ui.

Sepush avatar Sepush commented on May 18, 2024

chrome99 中这个bug 已经得到修复

Badge.-.Naive.UI.-.Google.Chrome.2022-03-09.01-19-23.mp4

from naive-ui.

hanjialin avatar hanjialin commented on May 18, 2024

edge这个问题到现在依然存在。。

from naive-ui.

mode365Dong avatar mode365Dong commented on May 18, 2024

https://github.com/tusen-ai/naive-ui/assets/88695831/ac5baa40-2d59-4558-8bbe-38a5b1ff7382
在手机中存在这个问题,如果是原生或者本身就是这样的话,能否考虑重新设计这个组件,因为本身的processing就不是很明显。考虑下呼吸灯?

from naive-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.