All Projects → julienetie → Mimetic

julienetie / Mimetic

Licence: mit
Scalable Fonts & Zoom Detection

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Mimetic

Neural-Zoom-Legacy
Infinite Zoom For Style Transfer
Stars: ✭ 14 (-41.67%)
Mutual labels:  zoom
Chartjs Plugin Zoom
Zoom and pan plugin for Chart.js
Stars: ✭ 404 (+1583.33%)
Mutual labels:  zoom
T Scroll
A modern reveal-on-scroll library with useful options and animations. (Animate Elements On Reveal)
Stars: ✭ 642 (+2575%)
Mutual labels:  zoom
ha-zoom-automation
Custom Home Assistant component for Zoom. Tracks when you are connected to a Zoom call by default but may allow you to track more.
Stars: ✭ 47 (+95.83%)
Mutual labels:  zoom
Zoomove
🔍 🎆 Enlarges the image with the mouse hover and move
Stars: ✭ 339 (+1312.5%)
Mutual labels:  zoom
Yeetgif
gif effects CLI. single binary, no dependencies. linux, osx, windows. #1 workplace productivity booster. #yeetgif #eggplant #golang
Stars: ✭ 467 (+1845.83%)
Mutual labels:  zoom
lovelace-plotly-graph-card
Highly customisable Lovelace card to display interactive graphs. Brings scrolling, zooming, and much more!
Stars: ✭ 38 (+58.33%)
Mutual labels:  zoom
Image Zoom
🔎 Medium.com style image zoom for React 🔍
Stars: ✭ 920 (+3733.33%)
Mutual labels:  zoom
React Image Magnify
A responsive image zoom component designed for shopping sites.
Stars: ✭ 391 (+1529.17%)
Mutual labels:  zoom
React Svg Pan Zoom
👀 A React component that adds pan and zoom features to SVG
Stars: ✭ 569 (+2270.83%)
Mutual labels:  zoom
React Native Image View
Modal component to view images with zoom
Stars: ✭ 273 (+1037.5%)
Mutual labels:  zoom
Oauth
🔗 OAuth 2.0 implementation for various providers in one place.
Stars: ✭ 336 (+1300%)
Mutual labels:  zoom
React Use Gesture
👇Bread n butter utility for component-tied mouse/touch gestures in React and Vanilla Javascript.
Stars: ✭ 5,704 (+23666.67%)
Mutual labels:  zoom
neural-greenscreen
Real time background replacement on a mac os driven webcam using the DeepLabV3 neural network for image segmentation and the native CoreMediaIO DAL framework of Mac OS.
Stars: ✭ 18 (-25%)
Mutual labels:  zoom
Mediumlightbox
Nice and elegant way to add zooming functionality for images, inspired by medium.com
Stars: ✭ 671 (+2695.83%)
Mutual labels:  zoom
ngx-ionic-image-viewer
An Ionic 4 Angular component to view & zoom on images and photos without any additional dependencies.
Stars: ✭ 129 (+437.5%)
Mutual labels:  zoom
Amplify
A tiny script allowing inline image zoom
Stars: ✭ 458 (+1808.33%)
Mutual labels:  zoom
Zoom
Google Room Persistence Library Extend.谷歌官方Room数据库扩展库
Stars: ✭ 23 (-4.17%)
Mutual labels:  zoom
React Zmage
一个基于 React 的可缩放图片控件 | A scalable image wrapper power by react
Stars: ✭ 713 (+2870.83%)
Mutual labels:  zoom
Pixi Viewport
A highly configurable viewport/2D camera designed to work with pixi.js
Stars: ✭ 532 (+2116.67%)
Mutual labels:  zoom

IN PRODUCTION, USE AT OWN RISK

BrowserStack Status

npm version Build Status

Browser Support

  • MIMETIC supports IE9+, Safari 6.2+, Chrome, Firefox, Edge, Opera, etc. Will be depreciating support for IE9 + IE10 in releases beyond v0.7.3.
  • MIMETIC does not use user-agent detection nor does it modify element styles.

MIMETIC

Scalable Fonts & Zoom Detection

The sincerest form of flattery

"Mimetic" - relating to, constituting, or habitually practising mimesis (T1000 Mimetic polyalloy)

MIMETIC is a JavaScript viewport engine, that quantifies relative units in accordance to the viewport and devicePixelRatio conditionally. Which means text can scale to the viewport's dimensions without breaking the browser’s ability to zoom.

WHY?

It enables developers to:

  • Design fluid website with fonts that scale to the viewport width.
  • Reduces/ eliminates maintainability for retina and high resolutions displays.
  • Normalise the perceived devicePixelRatio for high resolution tablet devices (optional).
  • Detect the zoom level on all modern desktop browsers IE9+
  • Improve and fine-tune accessibility when the user utilities zoom.
  • Control when and when not to scale via media queries.
  • Take an existing Responsive Website and convert it instantly to a Scalable Website.
  • Less screen resolutions to consider for improved work flows.
  • Design more aesthetically pleasing websites.
  • Future proof designs from MIMETIC sized rem units to future relative-percentile units by simply changing the unit and root font-size.

An alternative?

Alternatives seem to have some combination of the below issues:

Inconsistent browser compatibility, difficult to no ability to zoom thus breaking accessibility, doesn't scale padding/ margin/ line-height and other relative dimensions, doesn’t respect the style attributes on elements. Must always specify relative dimensions (padding/ margin)(More maintenance), you can’t specify relative dimensions, scales to a container only, jQuery dependent, does exactly what vw, vh, vmin, vmax does on mobile, fonts blur, no longer being maintained.

What do I need to know?

There’s a few simple concepts you need to understand to create Scalable Web Design via MIMETIC.

  • You must use relative units to keep in proportion (EM & REM units)
  • MIMETIC "can" scales all quantities not just font-size margins/ padding, width, height etc.
  • Avoid pixel units.
  • Your website should be usable and functional with mimetic included and when left out.

Install

npm i mimetic

or

yarn add mimetic

First Meaningful Paint

Ideally MIMETIC should execute before other scripts that directly alter or affect the DOM. But it does require the DOM to load first.

Usage

mimetic();

Standalone zoom detection

mimetic({
  scale: false,
  onZoom: (a,b,c,d) => console.log(a,b,c,d);
});

Size

MIMETIC has a 2.5kb gzip size and will not exceed a 3.5kb gzip size.

Options

Below is the list of config options passed as an object:

Property Value Description Default
cutOffWidth String - CSS units The minimal width to disable scaling 0
enableScale Booolean Enables scaling of relative units true
loadEvent String - LoadEvent type native load event to use before auctioning "DOMContentLoaded"
mobileWidth String - CSS units The minimal width to disable scaling for mobile devices "40em"
onResize ({viewportWidth, innerWidth, evalDPR, calculatedDPR, normalizedDPR}) => {} Callback on scale and or zoom undefined
onScale ({viewportWidth, innerWidth, evalDPR, calculatedDPR, normalizedDPR}) => {} Callback on resize only undefined
onZoom ({viewportWidth, innerWidth, evalDPR, calculatedDPR, normalizedDPR}) => {} Callback on zoom only undefined
preserveDevicePixelRatio Boolean Normalises the device pixel ratio for high ratio devices false
relativeDesignWidth String - CSS units The width relative to the font size "1024px"
scaleDelay Number - Milliseconds The debounced delay to call on resize 16

Big thanks to BrowserStack for sponsoring the cross browser & device testing of this project.

MIT © 2018 Julien Etienne.

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].