npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jquery.trackrails

v1.10.2

Published

Create track points for a page and make the section browsering more easily.

Downloads

16

Readme

History

Without guidelines, users are difficult to understand the structure and hard to find out something from a page that includes many sections. This one is my side project and focus on solving the UI + UX for a single infinite page. jquery.trackrails is useful on a single infinite web page browsing. It lets your users have a best understanding that your page provides and can reach each section more easily by tap/click the track point.

Demonstration on CodePen

https://codepen.io/ssmak/pen/zarLVV

Installation + Use

  1. Install to your project as dependency from NPM (https://www.npmjs.com/package/jquery.trackrails)
npm install jquery.trackrails --save
  1. Load the dependency
<!-- // HEAD -->
<!-- put below stylesheets between the 'head' tag in below order -->
<!-- font awesome 4 - optional, but I use it in my test page. -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- jquery.trackrails, css(default) - provide default rendering -->
<link rel="stylesheet" href="/node_modules/jquery.trackrails/dist/jquery.trackrails.min.css">
<!-- jquery.trackrails, css(overrides) - you can overrides any styles by your own -->
<link rel="stylesheet" href="/project_root/css/jquery.trackrails.overrides.css">
<!-- // BODY -->
<!-- jquery.trackrails - put below script tag above the close tag of 'body' -->
<script src="/node_modules/jquery.trackrails/dist/jquery.trackrails.js" rails-easing="easeOutExpo" rails-duration="2000"></script>
  1. Write your page content
<!-- mock content -->
<div class="section rails" style="background-color:#f00">
  Section-A
</div>
<div class="section rails" rails-title="use title" style="background-color:#0f0">
  Section-2
</div>
<div class="section rails" style="background-color:#00f">
  Section-C
</div>
<div class="section rails" style="background-color:yellow; height:100px">
  Section-D
</div>
<div class="section rails" style="background-color:pink; height:50px">
  Section-E Section-E Section-E
</div>
  1. Place below tag within the 'body' tag which you want the DOM of jquery.trackrails to create in
<!-- jquery.trackrails, dom will attach here. If this tag not find, the DOM will append as a child to the 'body' tag -->
<div class="jq-trackrails"></div>

Test

A demo page is located in the /test folder. You can test it with the live reload by using lite-server which can be installed by

npm install lite-server -g
cd /project_root && lite-server

Customization

rails-title The title of the track point. If not set, the content will be used.

<div class="section rails" rails-title="use title" style="background-color:#0f0">Section-2</div>

rails-easing The easing animation that will be used on track moving. Please visit here for details: https://easings.net/zh-tw rails-duration How long will be moved to the target. Unit in ms, 2000 = 2 seconds.

<script src="/node_modules/jquery.trackrails/dist/jquery.trackrails.js" rails-easing="easeOutExpo" rails-duration="2000"></script>

License

MIT