Giter VIP home page Giter VIP logo

scrollpage-js's Introduction

Hi ๐Ÿ‘‹! My name is Bagus Indrayana and I'm a Fullstack Developer, from Indonesia

stats graph languages graph

Stack

Platform Stack/Tech
WEB
laravel logo php logo javascript logo typescript logo nodejs logo nextjs logo react logo html5 logo css3 logo python logo go logo
MOBILE flutter logo kotlin logo
DATABASE mysql logo postgresql logo firebase logo

Personal Project

Stack Name Description Repo/Link
laravel logo php logo TERTULAR Sistem informasi berbasis web untuk pendataan dan pemetaan lokasi pasien positif covid-19/virus corona https://github.com/bagusindrayana/tertular
laravel logo php logo GOBLOG Simple Blog System With Laravel https://github.com/bagusindrayana/goblog
laravel logo php logo LARAVEL-COORDINATE (package) find data with the closest location based on its coordinates with eloquent laravel https://github.com/bagusindrayana/goblog
php logo SCAN-GACOR scan file php dan html dengan wordlist tertentu https://github.com/bagusindrayana/scan-gacor.git
python logo Perompak7Samudra scraping data film beserta link stream dan downloadnya https://github.com/bagusindrayana/perompak7samudra
python logo Bot Film Telegram Bot Telegram untuk mencari link stream film https://github.com/bagusindrayana/telegram-bot-film
python logo MABOX-CLI convert web to stupid CLI https://github.com/bagusindrayana/mabox-cli
python logo Scraping stream cctv jalanan indonesia rest API untuk scraping streaming cctv yang tersedia dari web pemerintah indonesia https://github.com/bagusindrayana/scrape-cctv-gov-id
javascript logo nodejs logo Scraping berita indonesia rest API untuk scraping berita dari beberapa portal berita indonesia https://github.com/bagusindrayana/scraping-berita
html5 logo css3 logo javascript logo Isometric Web Desain Web 3D isometric https://github.com/bagusindrayana/isometric-web https://isometric-web.netlify.app
html5 logo css3 logo javascript logo Infografis Covid19 Web Infografis jumlah korban covid 19 https://github.com/bagusindrayana/covid19
javascript logo scrollpage-js Single full page scroll animation inspired by fullPage JS https://github.com/bagusindrayana/scrollpage-js https://scrollpage-js.netlify.app
go logo go-api-wilayah Single full page scroll animation inspired by fullPage JS https://github.com/bagusindrayana/go-api-wilayah https://4f6kku51q0.apidog.io
typescript logo nextjs logo Extract APK Data extract and view data inside APK file in browser client https://github.com/bagusindrayana/extract-apk-web https://extract-apk.vercel.app
typescript logo nextjs logo ews-concept EWS (Early Warning System) Design Concept - Nerv APP or neon genesis Evangelion https://github.com/bagusindrayana/ews-concept https://ews-concept.vercel.app

scrollpage-js's People

Contributors

bagusindrayana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

scrollpage-js's Issues

Parent and previous sibling content not respected on scrollback

Thank you for your effort. I appreciate the small, and not overly complicated package. I think it is a few minor improvements from being a valuable resource. Nice job.

but... I found another issue.

Codepen

If in a layout such as

<div>PARENT
  <div>PREVIOUS SIBLING</div>
  <div id="main-page">
    <div  id="page1"></div>
    <div  id="page2"></div>
    <div  id="page3"></div>
  </div>
</div>

scrolling down, then back up does not show PARENT or PREVIOUS SIBLING and they stay inaccessible. I probably is reasonable to require main-page to be first child below a parent, but the parent should be respected (pun intended).

README.md - More Advanced Menu

A humble addition to the documentation. If you decide to use it, consider forking the codepen and changing the link so I don't accidentally change it.

Replacing the #Menu section of README.md

Basic Menu

You can add a custom menu that works to control the page, this will read every element that is in the menu element and if those elements are clicked it will redirect to the page based on the data-page attribute.

Every selected menu both menu item and page element will be add active class, you can change class name with pageSelectedClass and menuSelectedClass in options.

<ul class="side-nav">
    <!-- add the `data-page` attribute that contains the selector to the page element -->
    <li data-page="#page1">Page 1</li>
    <li data-page="#page2">Page 2</li>
    <li data-page="#page3">Page 3</li>
</ul>
const scrollPage = new ScrollPage("#main-page",{
    menu:"ul.side-nav",//menu selector
});

Advanced Menu

In this example the menu will only display dots and on hover will show the page name.

Codepen

<ul class="side-nav">
    <!-- add the `data-hovertext` attribute to represent the hover text -->
    <li data-page="#page1" data-hovertext="Page 1"></li>
    <li data-page="#page2" data-hovertext="Page 2"></li>
    <li data-page="#page3" data-hovertext="Page 3"></li>
</ul>

All the functionality happens in CSS.

/* below relates to scollPage-js Advanced Menu */
:root {
    --dotMenuColor: black;
    --dotMenuCircleSize: 7px;
    --dotMenuBWCircles: 7px;
}

ul.side-nav {
    position: fixed;
    top: 50%;
    transform: translate(0, -50%);
    right: 0;
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    width: max-content;
    padding: 0;
    margin: 0;
    z-index: 999;
}

ul.side-nav li {
    position: relative;
    list-style: none;
    color: var(--dotMenuColor);
    border: 2px solid var(--dotMenuColor);
    border-radius: 50%;
    text-transform: uppercase;
    margin: var(--dotMenuBWCircles); 
    padding: var(--dotMenuCircleSize);
}

ul.side-nav li:hover {
    cursor: pointer;
    background-color: var(--dotMenuColor);
}

ul:hover li:not(:hover) {
    background-color: unset !important;
}

/* Careful if using some frameworks, this dynamically added style will be pruned, consider :global() */
ul.side-nav li.active {
	cursor: pointer;
	background-color: var(--dotMenuColor);
}

ul.side-nav li:after {
    content: attr(data-hovertext);
    position: absolute;
    color: var(--dotMenuColor);
    visibility: hidden;
    width: max-content;
    opacity: 0;
    top: -2px;
    z-index: 1;
    transition: opacity .25s ease-in-out;
}

ul.side-nav li:hover:after {
    visibility: visible;
    right: 25px;
    opacity: 1;
    transition: opacity .75s ease-in-out;
}

menuSelectedClass is not updated

Clicking on a menu item does give it the appropriate "active" class, but the class is not updated on a scrollpage event. Also active class for 1st menu items should be added on initialization rather than requiring hardcoded. Thanks for a small and great project.

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.