• Stars
    star
    279
  • Rank 147,646 (Top 3 %)
  • Language
    JavaScript
  • License
    Other
  • Created over 9 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Takes screenshots of a webpage in different resolutions and automatically applies it to mockup templates.

Responsive Mockups via PhantomJS 2.0

Small PhantomJS based script that allows you to automatically create mockup graphics, providing only a URL.

mockup 1 mockup 2 mockup 3

How To

  • Clone this repo
  • Edit example.js to choose mockup template and target url
  • Call phantomjs example.js (for an example with a single URL)
  • Or call phantomjs example-mobile-multiple.js (for an example with multiple URLs)

Requirements

The only external requirement is PhantomJS in version >= 2.0.0.

brew install phantomjs

Double check the version of PhantomJS

phantomjs -v

Known issues with SSL

PhantomJS seems to have problems with some SSL certficates. In case you get errors like Unable to load the address for layer [...] - you can get a more verbose output by running PhantomJS in debug mode, e.g. phantomjs --debug=true example.js.

If the output says something like SSL Error: "The issuer certificate of a locally looked up certificate could not be found", but you still want to take screenshots via HTTPS, you can deactivate SSL checks using phantomjs --ignore-ssl-errors=true example.js.

Please be aware that this disables SSL certificate validations, so don't pass credentials or other data to the script that would require a verified secure connection.

Credits for provided mockup templates

At the moment this script includes two mockup templates of pixeden.com:

The awesome people at pixeden.com gave me permission to even include the PSD files so you can tweak the mockups to fit your needs. โค๏ธ

How can I customize the templates?

For now, mockups are based on two files: a PSD (that's the graphical template) and a metadata.js JavaScript file that contains information which resolutions to take for the screenshots and where to place them in the mockup. Based on the PSD, there are also exported "layers" that will be used to render the mockup.

Just have a look at the templates in the /templates folder, the information in the metadata.js file will map to the pixel coordinates in the PSD.

If you move or scale a device in the PSD template, you have to update the pixel coordinates in the metadata.js file and you will have to export the layers (mobile.png, tablet.png, desktop.png) again.

Additionally, keep in mind that the resulting image is just another screenshot of a html page with a canvas tag. This minimal html file is called render.html and is also contained in every template folder. So you can not only affect the appearance by modifying the PSD, you can also customize the render.html page, e.g. by HTML, CSS or even additional stuff you draw on the canvas with JS.

More Repositories

1

acts_as_api

makes creating API responses in Rails easy and fun
Ruby
508
star
2

writing_an_interpreter_in_elixir

Elixir implementation of an interpreter for the Monkey programming language
Elixir
128
star
3

facebook-user.js

A small wrapper that wraps facebook connect in a backbone.js model
JavaScript
54
star
4

node_tile_server

A node.js powered tile server for leaflet to render openstreetmap data
CoffeeScript
17
star
5

pusher

A simple node.js publisher lib for pusher.com
JavaScript
15
star
6

single-file-ruby-programs

Talk: Introducing rbgif and LRuby 1.8.7
JavaScript
12
star
7

traffic-light-client-elixir

A web controlled traffic light for Raspberry PI, powered by Elixir and Nerves
Elixir
11
star
8

cat_facts

Rack middleware that to add cat facts in headers of HTTP responses.
Ruby
11
star
9

traffic-light-server

Configure traffic lights on heroku
JavaScript
9
star
10

fb_cms

A simple website that gets its content via the fb graph api
Ruby
7
star
11

.spacemacs.d

My Emacs/Spacemacs configuration, including org-mode and custom themes
Emacs Lisp
6
star
12

traffic-light-client-raspberry

A web controlled traffic light for Raspberry PI
Ruby
5
star
13

traffic-light-server-elixir

Configure traffic lights on Heroku, powered by Elixir and Phoenix
Elixir
4
star
14

lruby

Logging Ruby - The Ruby alias for the forgetful scripter
Ruby
3
star
15

maptp-service

Provides a ruby interface to the NAVTEQ MapTP web services
Ruby
3
star
16

fabrik42.github.com

my github user page
HTML
2
star
17

work_log

A simple time tracker that logs your work times to a file using a command line interface.
Ruby
2
star
18

espruino-doorbell

Espruino WiFi powered Doorbell notification service for Slack
JavaScript
2
star
19

flocking_elixir

A simple swarm simulation, written in Elixir and Phoenix
Elixir
2
star
20

mechanicon.io

The official MECHANICON website
HTML
1
star
21

ankkb_fb

sinatra app that presents fb site data (events, photos, ...) on the web
Ruby
1
star
22

deployment_song

Deployment is boring, let's sing-a-long
1
star
23

yoloframe

Digital, physical picture frame that I keep in the background of my video calls. It shows only the latest images and everyone can just upload new ones.
HTML
1
star