Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to make it?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #274373
    boni
    Participant

    Hello,
    How to reduce the site when scrolling?
    Example: http://doze.studio/
    If you scroll down the site, then the border around the edges will increase. How can I do this?
    Please, help

    #274376
    Beverleyh
    Participant

    If you inspect the page with the developer console (F12) it shows that they’re using 4 separate elements – one for each border;

    • div 1 = top border,
    • div 2 = bottom border,
    • div 3 = left border,
    • div 4 = right border

    They’re initially hidden off-screen with transform: translate3d()

    These styles are inline in the elements themselves, so most likely, they’re using JavaScript to watch page scroll position, and also (re)calculate each (new) translated position and write it inline, on the fly. This is what makes the border bars move in and out as the user scrolls.

    I wrote a “Add Class to Target-Element when Trigger-Element is Scrolled into View” script which can be used to achieve something similar, although it doesn’t incrementally alter the border movement at each tiny scroll change. It either moves it in, or moves it out when triggered (no middle ground).

    Here’s the blog and script demos http://blog.fofwebdesign.co.uk/41-add-classes-to-an-element-when-scrolled-into-viewport

    And here’s a makeshift moving border demo using a simplified version of the script https://codepen.io/anon/pen/vaXqbX

    #274377
    Beverleyh
    Participant

    The CodePen demo doesn’t seem to work on mobile, but it does when transferred to a standalone page http://fofwebdesign.co.uk/template/_testing/scroll-in-view/borders-on-scroll.htm

    #274380
    boni
    Participant

    I can not do it :c

    #274381
    boni
    Participant

    I’m dumb to do this :c

    #274454
    WP OPPO
    Participant

    Great post!

    It is too hard to understand the codepan demo. Can anyone help me to find Online website or tools to converter for PNG files into BMP?

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.