GithubHelp home page GithubHelp logo

Comments (8)

RexSkz avatar RexSkz commented on July 16, 2024 4

The element article.post.post-type-normal has a css rule transform: translateY(0px), it'll create a stacking context, cause the inner DPlayer element use this element for positioning instead of browser window, even if its position is fixed. It's a css bug, we have no idea. The only solution is to change your blog's css code.


Reference:

  1. https://developer.mozilla.org/en-US/docs/Web/CSS/transform (MDN)

If the property has a value different than none, a stacking context will be created. In that case the object will act as a containing block for position: fixed elements that it contains.

  1. https://segmentfault.com/a/1190000002783265#articleHeader6 (A chinese article about stacking context)

  2. https://www.w3.org/TR/css-transforms-1/#transform-rendering (W3C)

For elements whose layout is governed by the CSS box model, any value other than none for the transform results in the creation of both a stacking context and a containing block. The object acts as a containing block for fixed positioned descendants.

from hexo-tag-dplayer.

RexSkz avatar RexSkz commented on July 16, 2024 1

There're four points:

  1. use_motion means making elements move to exact places when page is loaded, which is a feature in NexT theme.
  2. NexT use transform to accelerate the animation, which is the method that most people will use. Without transform (for instance, use relative and top), it may cause some performance issue.
  3. Authors can't predict whether a user wants a full-page player inside the article (in most cases full-screen is enough for videos in article).
  4. Based on W3C, transform is surely conflict with inner element's full-page style.

So they might not make any changes even if you make an issue. The best way is changing the code yourself. I prefer your second idea, because NexT theme has too many element-moves when page is loaded, it's worth to reduce some of them, keeping fade-in effect is enough.

from hexo-tag-dplayer.

Myer921 avatar Myer921 commented on July 16, 2024

@reuixiy 手机测试未发现,明天试试电脑

from hexo-tag-dplayer.

Myer921 avatar Myer921 commented on July 16, 2024

好的,我收回上句话,明天开电脑看看吧 @dixyes
日常召唤

from hexo-tag-dplayer.

reuixiy avatar reuixiy commented on July 16, 2024

@Myer921 谢谢:innocent:

from hexo-tag-dplayer.

reuixiy avatar reuixiy commented on July 16, 2024

@RexSkz Thanks a lot, I'll try it.:thumbsup:

from hexo-tag-dplayer.

reuixiy avatar reuixiy commented on July 16, 2024

Okay, I think I've got it! To solve this problem, I've found two solutions:

  1. Add the following code into ~/blog/themes/next/source/css/_custom/custom.styl:
.post.post-type-normal {
    transform: inherit !important;
}
  1. Modify true to false in ~/blog/themes/next/_config.yml:
# Motion
use_motion: false

However, none of them is perfect. Could you give me a better solution? Or I'd better set up a new issue in hexo-theme-next.

Thanks again. @RexSkz

from hexo-tag-dplayer.

reuixiy avatar reuixiy commented on July 16, 2024

Okay! Thank you so much! @RexSkz

from hexo-tag-dplayer.

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.