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

gulp-mobile-splashscreens

v1.2.1

Published

Gulp plugin that creates PNG splashscreens for iOS based on a SVG image

Downloads

17

Readme

gulp-mobile-splashscreens Build Status Greenkeeper badge

Gulp plugin that creates PNG splashscreens for iOS and Android based on a SVG image

Please read this blog post for a detailed explanation of the problem that the plugin solves.

Usage

To use the the plugin in your gulp process:

const gulp = require('gulp');
const mobileSplashscreens = require('gulp-mobile-splashscreens');

gulp.task('default', [], function() {
    gulp.src('splashscreen.svg')
        .pipe(mobileSplashscreens())
        .pipe(gulp.dest('images'));
});

This will create all splashscreens in the folder images/.

Cordova / PhoneGap

Add the following to your config.xml to use the icons in a Cordova/PhoneGap application:

<platform name="ios">
    <!-- Splashscreens -->
    <splash src="images/ios-1080-portrait.png"       width="1080" height="1920"/>
    <splash src="images/ios-1080-landscape.png"      width="1920" height="1080"/>
    <splash src="images/ios-750-portrait.png"        width="750"  height="1334"/>
    <splash src="images/ios-750-landscape.png"       width="1334" height="750"/>
    <splash src="images/ios-1242-portrait.png"       width="1242" height="2208"/>
    <splash src="images/ios-1242-landscape.png"      width="2208" height="1242"/>
    <splash src="images/ios-640-portrait.png"        width="640"  height="1136"/>
    <splash src="images/ios-640-landscape.png"       width="1136" height="640"/>
    <splash src="images/ios-640-short-portrait.png"  width="640"  height="960"/>
    <splash src="images/ios-640-short-landscape.png" width="960"  height="640"/>
    <splash src="images/ios-320-portrait.png"        width="320"  height="480"/>
    <splash src="images/ios-320-landscape.png"       width="480"  height="320"/>
    <splash src="images/ios-2048-portrait.png"       width="2048" height="2732"/>
    <splash src="images/ios-2048-landscape.png"      width="2732" height="2048"/>
    <splash src="images/ios-1536-portrait.png"       width="1536" height="2048"/>
    <splash src="images/ios-1536-landscape.png"      width="2048" height="1536"/>
    <splash src="images/ios-768-portrait.png"        width="768"  height="1024"/>
    <splash src="images/ios-768-landscape.png"       width="1024" height="768"/>
</platform>

<platform name="android">
    <splash src="images/android-ldpi-portrait.png"     density="port-ldpi"/>
    <splash src="images/android-ldpi-landscape.png"    density="land-ldpi"/>
    <splash src="images/android-mdpi-portrait.png"     density="port-mdpi"/>
    <splash src="images/android-mdpi-landscape.png"    density="land-mdpi"/>
    <splash src="images/android-hdpi-portrait.png"     density="port-hdpi"/>
    <splash src="images/android-hdpi-landscape.png"    density="land-hdpi"/>
    <splash src="images/android-xhdpi-portrait.png"    density="port-xhdpi"/>
    <splash src="images/android-xhdpi-landscape.png"   density="land-xhdpi"/>
    <splash src="images/android-xxhdpi-portrait.png"   density="port-xxhdpi"/>
    <splash src="images/android-xxhdpi-landscape.png"  density="land-xxhdpi"/>
    <splash src="images/android-xxxhdpi-portrait.png"  density="port-xxxhdpi"/>
    <splash src="images/android-xxxhdpi-landscape.png" density="land-xxxhdpi"/>
</platform>

FAQ

Q: Why does iOS add a black background behind my splashscreen?

If you use a SVG with a transparent background, the gulp-mobile-splashscreens will create splashscreens with transparent background. iOS always adds a black background to those transparent splashscreens.

You need to add to your SVG a background if you want to have another color. It's important that the background area stretches beyond the image itself because gulp-mobile-splashscreens will otherwise add transparent areas around the image to fill the target size of each splashscreen.

For example, this adds a red background to your splashscreens:

<?xml version="1.0" encoding="UTF-8"?>
<svg width="375px" height="667px" viewBox="0 0 375 667" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <rect fill="red" width="10000" height="10000" transform="translate(-5000, -5000)"/>
    <!-- Your image -->
</svg>

Credits

Sample icon made by Freepik from www.flaticon.com is licensed by Creative Commons BY 3.0