Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Lopez committed Apr 11, 2017
0 parents commit 7116782
Show file tree
Hide file tree
Showing 11 changed files with 224 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#directories
bower_components
node_modules
dist

#files
*.tgz
*.log

#:)
haters
1 change: 1 addition & 0 deletions css/jquery.flipster.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 67 additions & 0 deletions css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
*{
margin:0;
padding:0;
}

html{
background: #14243d;
background: radial-gradient(ellipse at center, #14243d 0%,#030611 100%);
position: absolute;
top:0;
left:0;
width:100%;
height:100%;
}

body{
font: 14px/1.5 Arial, Helvetica, sans-serif;
color:#fff;
}

a, a:visited, a:hover{
color:#fff;
text-decoration: none;
}


/* The cover flow slider */

.flipster {
margin-top:120px;
}

.flipster ul li {
text-align: center;
}

.flipster ul li a {
text-align: center;
}

.flipster ul li a:after{
content:'oo';
letter-spacing: -2px;
font-size: 12px;
color:orange;
margin-left:5px;
font-weight: bold;
}

.flip-item img{
margin-bottom: 10px;
}

/* Stats */

.stats{
text-align: center;
margin-top: 80px;
color: #8C91A0;
font-size: 13px;
}

.stats span{
font-weight: bold;
color: #A2A9BD;
margin-right: 10px;
}
10 changes: 10 additions & 0 deletions enupal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Enupal</title>
</head>
<body>
<h2>Hello world from ENUPAL</h2>
</body>
</html>
23 changes: 23 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello Electron</title>
<link rel="stylesheet" href="./css/jquery.flipster.min.css">
<link rel="stylesheet" href="./css/styles.css">
</head>
<body>

<div class="flipster">
<ul>
</ul>
</div>

<p class="stats"></p>

<h1> Enupal Feed</h1>
<script>window.$ = window.jQuery = require('./js/jquery.min.js');</script>
<script src="./js/jquery.flipster.min.js"></script>
<script> require('./index.js') </script>
</body>
</html>
47 changes: 47 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const remote = require('electron').remote
const main = remote.require('./main.js')

$(function(){

const os = require('os')
const prettyBytes = require('pretty-bytes')

$('.stats').append('Numero de procesadores: <span>'+ os.cpus().length +'</span>')
$('.stats').append('Memoria: <span>'+ prettyBytes(os.freemem()) +'</span>')


const ul = $('.flipster ul');

$.get('http://enupal.com/blog/rss', function(response){

const rss = $(response)

rss.find('item').each(function(){
const item = $(this)

const content = item.find('description').html().split('</a></div>')[0]+'</a></div>'

const urlRegex = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?/g;

const imageSource = content.match(urlRegex)[1];

const li = $('<li><img /><a target="_blank"></a></li>')

li.find('a')
.attr('href', item.find('link').text())
.html('<br>'+item.find('title').text())

li.find('img').attr('src', imageSource)
li.find('img').attr('width', 400)
li.find('img').attr('height', 300)

li.appendTo(ul)
});

// init plugin
$('.flipster').flipster({
style: 'carousel'
});

});
});
2 changes: 2 additions & 0 deletions js/jquery.flipster.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions js/jquery.min.js

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const electron = require('electron')
const {app, BrowserWindow} = electron

const path = require('path')
const url = require('url')

let win

function createWindow(){
win = new BrowserWindow ({width: 800, height:600})
win.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file',
slashes: true
}))

win.webContents.openDevTools()
}

exports.openWindow = () => {
let newWin = new BrowserWindow ({width: 400, height:200})
newWin.loadURL(url.format({
pathname: path.join(__dirname, 'enupal.html'),
protocol: 'file',
slashes: true
}))
}

app.on('ready', createWindow)
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "enupal-electron",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start" : "electron main.js"
},
"author": "",
"license": "ISC"
}
18 changes: 18 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Enupal Feed
===============

Enupal Feed is an Electron app that shows the feed of enupal.com/blog


Basic Usage
---------------

**Step 1**: Hit composer update:
```bash
composer update
```

**Step 2**: Execute electron:
```bash
npm start
```

0 comments on commit 7116782

Please sign in to comment.