GithubHelp home page GithubHelp logo

fcschmidt / pixel-to-em Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 2 MB

[PWA - Experiment] - WebApp Pixel to EM Converter

Home Page: https://pixel.fcschmidt.me/

License: MIT License

HTML 41.15% CSS 45.00% JavaScript 13.85%
pwa-training service-worker jekyll

pixel-to-em's Introduction

Font Converter Offline Web Application [PWA Experiment]

Pixel to EM is an Offline Web Application, which is used to calculate (convert) values from one source to another. For example: convert a pixel value to in points, or percent to in pixel. This app is an exeperiment study on Progressive Web App (PWA).

Install App

See how to install the app in pixel install.

Calculation Method (convert values)

Conversions based on 16px browser default size value.

Pixel to:

Pixel to Formula Example
EM input value / pixel base 16px / 16px = 1em
Percent (input value / pixel base) * 100 (16px/16px ) * 100 = 100%
Points input value * (dots per inch / pixel per inch) 16px * (72px/96px) = 12pt

EM to:

EM to Formula Example
Pixel input value * pixel base 1em * 16px = 16px
Percent input value * 100 1em * 100% = 100%
Points (dots per inch / pixel per inch) / input value * pixel base (72px/96px) / 1em * 16px = 12pt

Percent to:

Percent to Formula Example
Pixel (input value * pixel base) / 100 (100% * 16px) / 100 = 16px
EM input value / 100 100% / 100 = 1em
Points ((dots per inch / pixel per inch) * input value) * pixel base / 100 ((72px/96px) * 100%) * 16px / 100 = 12pt

Points to:

Points to Formula Example
Pixel (pixel per inch / dots per inch) * input value (96px/72px) * 12pt = 16px
EM ((pixel per inch / dots per inch) * input value) / pixel base ((96px/72px) * 12pt) / 16px = 1em
Percent ((pixel per inch / dots per inch) * input value) / pixel base * 100 ((96px/72px) * 12pt) / 16px * 100 = 100%

Development

Site is built with Jekyll (requires Ruby and more). Install Jekyll and run a local server to view your changes:

Install Jekyll: Instalation guide jekyll.

Start locallhost server: $ jekyll serve --watch

See also

Accessing app https://pixel.fcschmidt.me.

License

MIT License © Fábio Schmidt · by @fcschimidt

pixel-to-em's People

Contributors

fcschmidt avatar

Watchers

 avatar  avatar

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.