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

Add page indicators to feeds #1309

Open
rainbow-bamboo opened this issue Apr 15, 2023 · 1 comment
Open

Add page indicators to feeds #1309

rainbow-bamboo opened this issue Apr 15, 2023 · 1 comment

Comments

@rainbow-bamboo
Copy link

rainbow-bamboo commented Apr 15, 2023

Pitch

We can add an indicator to give the user an idea of how many statuses they've read in a row.

I've implemented a simple one that you can include in your custom css if you like.

body{
 --main-accent-color: #343434;
}

.theme-default, .dark-theme, .high-contrast, .theme-fairy-floss{
 --main-accent-color: #fafafa;
}

/* it's 5n, so it shows the indicator every 5 posts */
article:nth-child(5n):after{
    content: "";
    width: 20px;
    height: 20px;
    border-radius: 10px;
    margin: auto;
    margin-top: 1em;
    margin-bottom: 1em;
    background: var(--main-accent-color);
    display: block;
}

Motivation

It ends up looking something like:
image

The motivation is that an endless feed encourages endless consumption. By adding a visual indicator every 5 statuses, it gives you some sense of how much you are consuming and makes it easier to stop scrolling.

Notes:

  • When I used paddings instead of margins, scrolling down worked, but scrolling up did not.
  • I also tried implementing it in JS where I would get the list of articles (statuses) and then insert new page break elements, but it was difficult to get it to keep adding new elements when you scrolled down, and the feed loaded the next 20 statuses.
  • You can edit the page break to suit by adding text to the content attribute. One option is using css-counters to number the pages: eg:
body{
    counter-reset: page-number;
}

article:nth-child(5n){
 counter-increment: page-number;
}

article:nth-child(5n):after{
    content: "Page: " counter(page-number);
}

but having the pages be numbered made me feel more anxious/guilty than I would like.
A chill circle is pretty neat though.

@rainbow-bamboo
Copy link
Author

A flaw of this approach, is that if you don't have "slow mode" turned on, new posts change the position of the marker because instead of scrolling pass X number of posts, it's as if you scrolled past X + number of new posts .

Also, you can put emoji in the content field to get some easy icons.

article:nth-child(5n):after{
    content: "⛺";
    filter: greyscale(1);
}

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

No branches or pull requests

1 participant