All Projects → mzdr → fluffy.js

mzdr / fluffy.js

Licence: MIT License
🍱 Makes sure your content – no matter how big it is – will fit in any screen!

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to fluffy.js

Update
清晰灵活简单易用的应用更新库
Stars: ✭ 1,739 (+3600%)
Mutual labels:  flexible, simple
Parvula
An extremely simple & flexible CMS generated from flat files with a complete RESTful API —
Stars: ✭ 76 (+61.7%)
Mutual labels:  light, simple
Hugo Paper
🥛 A simple, clean, flexible Hugo theme
Stars: ✭ 538 (+1044.68%)
Mutual labels:  flexible, simple
Appupdate
🚀 Android 版本更新 🚀 a library for android version update 🚀
Stars: ✭ 3,375 (+7080.85%)
Mutual labels:  flexible, simple
graph-client
light zero dependency graphql-client, supporting cache and SSR
Stars: ✭ 27 (-42.55%)
Mutual labels:  light, simple
Yui
Minimal vim color scheme
Stars: ✭ 93 (+97.87%)
Mutual labels:  light, simple
Server Manager
This repository holds the IntISP Interface. It can be rebuilt to interface with any other hosting panel.
Stars: ✭ 31 (-34.04%)
Mutual labels:  light, simple
touchMyRipple
A simple library for apply the ripple effect where you want
Stars: ✭ 19 (-59.57%)
Mutual labels:  light, simple
Alfred Simple
Simple theme for Alfred
Stars: ✭ 217 (+361.7%)
Mutual labels:  light, simple
Mu
The μ css framework — a 1 ko css file.
Stars: ✭ 202 (+329.79%)
Mutual labels:  light, simple
MatrixLib
Lightweight header-only matrix library (C++) for numerical optimization and machine learning. Contact me if there is an exciting opportunity.
Stars: ✭ 35 (-25.53%)
Mutual labels:  light, simple
wasm-joey
Serverless Wasm - A lightweight Node.js application for deploying and executing WebAssembly(Wasm) binary-code via HTTP
Stars: ✭ 48 (+2.13%)
Mutual labels:  flexible, simple
nginx-jwt-module
NGINX module to check for a valid JWT.
Stars: ✭ 39 (-17.02%)
Mutual labels:  light
HACKTOBERFEST2021 INSPIRATION
😎A Hacktoberfest-2021 Contribution Repository For Beginners😎...Simplest Repo for Beginners👨‍💻👨‍💻👨‍💻...Add your Profile Details, Photo and Inspirational Quote 🙌🙌🙌& There you go to do your first PR❤❤❤
Stars: ✭ 30 (-36.17%)
Mutual labels:  simple
simple-blog-engine-for-asp-net-core
A simple blog engine for ASP.NET Core developers.
Stars: ✭ 15 (-68.09%)
Mutual labels:  simple
AndroidBatteryStats
Displays all battery stats of an Android device using broadcast receiver.
Stars: ✭ 20 (-57.45%)
Mutual labels:  simple
wip
WIP & naenae: CLI utilities to easily manage Work In Progress with Git
Stars: ✭ 46 (-2.13%)
Mutual labels:  simple
SimpleCore
.NET C# common/utilities library
Stars: ✭ 11 (-76.6%)
Mutual labels:  simple
wigo
Wigo, aka "What Is Going On" is a light pull/push monitoring tool written in Golang.
Stars: ✭ 33 (-29.79%)
Mutual labels:  light
Chocolater
Chocolater is simply a PowerShell code generator and it was conceived in order to facilitate the selection and installation of your favorite applications in one go.
Stars: ✭ 26 (-44.68%)
Mutual labels:  simple

Fluffy.js GitHub release

A simple, light and flexible JavaScript library that makes your content – no matter how big it is – fit in any screen!

http://mzdr.github.io/fluffy.js/

Sebastian Prein
Copyright 2016, MIT License

Contributions are greatly appreciated. Please fork this repository and open a pull request to add features, improvements, bugfixes etc.

Usage

Markup

Now let me explain you how Fluffy works.

  1. Everything that is related to it gets into the Fluffy container. This helps Fluffy to correctly inject elements and classes for several states of execution.

Notice: If you don't use automatic detection, you can use any selector you like. That means you don't have to stick to the data attribute.

<div data-fluffy-container></div>
  1. Your actual content is an element with the data-fluffy-content attribute.

Notice: The content element does not necessarily has to be the direct child of the container. But it's recommended to do it that way.

<div data-fluffy-container>
    <div data-fluffy-content>
        <!-- your content -->
    </div>
</div>

Your content can be anything you'd like it to be. Check out the examples to get glimpse of what possibilities you have.

  1. And that's it almost it!

Now depending on your setup (either as a module or plain in the browser) you have to hack a little JavaScript or just load the correct files. See below for further instructions.

Use it as a module

Since Fluffy.js is a registered NPM package (Bower too), you can use it as a module.

  1. Install it with:

npm install --save fluffy.js

  1. Now you can require it anywhere you like:
const Fluffy = require('fluffy.js');

// Prints 2.1.0
console.log(Fluffy.version);

// Start automatic detection
Fluffy.detect();

// Or provide a DOM node for single creation
const myElement = document.querySelector('#what-ever-you-like');

Fluffy.create(myElement);

Use it plain in the browser

If you just want to hit and run, this is probably the best way.

  1. Download the latest stable version and move all the files from the zip archive to the respective folder in your project.

  2. Include the two lines below somewhere in your HTML file.

<link rel="stylesheet" href="PATH/TO/fluffy.min.css">
<script src="PATH/TO/fluffy.min.js"></script>
  1. That's it! Open your browser and see for yourself!

Options

Since each Fluffy container is an instance on its own you're able to customize each one independently with the data-fluffy-options='…' attribute. This takes a JSON string with all of the options you want to change.

Example

Let's say you don't want to have scrollbars and a separate trigger instead. The markup then would look like this:

<div data-fluffy-container
     data-fluffy-options='{"showScrollbars": false, "triggerSelector": "#my-trigger"}'>
    <div data-fluffy-content>
        <!-- your content -->
    </div>
</div>

Available options

Below you see all the available options, their default values and it's description.

Option Default Description
triggerSelector null Defines a separate element which is used to trigger the actual interaction with the Fluffy content. If the target element doesn't exist, the container will be used as fallback/default.

Allowed values: '[any valid CSS selector]'
Examples: '#my-trigger', '#id > li:nth-child(8) a + img'
showScrollbars true Displays the current position within the scrollable content in forms of scrollbars.

Allowed values: true, false
smartHeight false Automatically adjust the height of the content container according to the smallest, largest or the average height of all items found.

Allowed values: false, 'smallest', 'average', 'largest'.
smartWidth false See smartHeight, just for width this time.
triggerDirection 'x' Define which axis to trigger movement for.

Allowed values: 'x', 'y', 'xy'.
mouseDamp 20 The higher the value the more lazier the reaction to the mouse movement will be.

Allowed values: [any positive number]
mousePadding 60 Adds space (in pixel) to the trigger area where no action happens.

Allowed values: [any positive number]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].