Skip to content

Commit

Permalink
* adjust readmed and fix bugs for localfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
victorferraz committed May 1, 2015
1 parent bcdfbb6 commit 6019b57
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 13 deletions.
29 changes: 24 additions & 5 deletions README.md
@@ -1,7 +1,26 @@
Install
------
# Break Shot
# ![break shot](http://i.imgur.com/pz4yf10.jpg?1)

npm install
cd public/ && npm install && cd -
grunt nodewebkit
### About
Break Shot is amazing screen capture for responsive websites. It's detects all resolutions and take a print screens.
It's possible are you choose a others resolutions.
It can also take a print for just html selector called '#breakshot'.

### Usage simple detect breakpoint
1. Chose source selection (local html file) from an url or from a file (complete URL of site)
2. Click in next step
3. Choose auto sizing (break shot will find media queries break point) or custom size ( your prefered resolution, such as 800 x 600, 1024 x 768, etc)
4. Click in next
5. Chose a extension of file and outpu file name.
6. Click in save file, chose directory.

### Usage generate ad banner
Create your banners using media queries in diferentes resolutions and user #breakshot selector.

### Team
#####Developer
Victor Ferraz [@victorferraz](https://github.com/victorferraz)

#####Designer
Bruno Magalhães [@brunomagalhaes]
(https://www.facebook.com/BrunodeMagalhaes?fref=ts)
15 changes: 14 additions & 1 deletion public/app/scripts/process/getcss.js
Expand Up @@ -28,7 +28,11 @@ GetCss.prototype.getCss = function (file) {
var style = $('link[rel=stylesheet]');
for(var index=0; index < style.length; index++){
array = [];
array.css = path + style[index].attribs.href;
var cssFile = style[index].attribs.href;
if (this.data.from === 'from-url') {
path = this.getPathUrl(cssFile);
}
array.css = path + cssFile;
array.path = path;
array.html = file[i].html;
link.push(array);
Expand All @@ -37,6 +41,15 @@ GetCss.prototype.getCss = function (file) {
return link;
};


GetCss.prototype.getPathUrl = function (cssFile){
var urlFormated;
if (cssFile.search('http://') === -1){
urlFormated = this.data.origin + '/';
}
return urlFormated;
};

GetCss.prototype.getPath = function (url){
var arrayPath = url.split('/');
arrayPath.pop();
Expand Down
5 changes: 1 addition & 4 deletions public/app/scripts/process/mediaQuerieRotine.js
Expand Up @@ -71,7 +71,6 @@ MediaQuerieRotine.prototype.analysisCss = function (arrayStyle) {
this.verifyArray = [];
this.verifyAdExists = false;
var breakPoints = null;
var result = null;
for (var i = 0; i < arrayStyle.length; i++) {
cssFile = arrayStyle[i];
breakPoints = null;
Expand All @@ -85,9 +84,6 @@ MediaQuerieRotine.prototype.analysisCss = function (arrayStyle) {
return media;
};

MediaQuerieRotine.prototype.mergeArray = function () {
};

MediaQuerieRotine.prototype.getMedia = function (cssFile) {
var ast = mensch.parse(cssFile.css);
var tree = null;
Expand Down Expand Up @@ -152,6 +148,7 @@ MediaQuerieRotine.prototype.findKey = function (obj, selector) {
var properties = null;
for(var index=0; index < obj.selectors.length; index++){
if (obj.selectors[index] === selector) {
console.log(obj);
properties = this.findProperties(obj);
}
}
Expand Down
6 changes: 3 additions & 3 deletions public/package.json
@@ -1,16 +1,16 @@
{
"main": "index.html",
"name": "break-shot",
"description": "demo app of node-webkit",
"description": "BreakShot",
"version": "0.1.0",
"keywords": [
"resize",
"node-webkit"
],
"window": {
"title": "node-webkit demo",
"title": "BrekShot",
"icon": "link.png",
"toolbar": true,
"toolbar": false,
"frame": true,
"width": 1100,
"height": 700,
Expand Down

0 comments on commit 6019b57

Please sign in to comment.