Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RocketBrowser está pronto #6

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6b11357
:pencil: Adding README.md
johnazedo May 24, 2020
1e3569f
:construction: Adding index.html
johnazedo May 24, 2020
f79f577
:construction: Home page is on progress
johnazedo May 24, 2020
d69e4f9
:art: Applying a code structure
johnazedo May 24, 2020
557c522
:sparkles: Opening any link in the webView
johnazedo May 24, 2020
610159c
:truck: Structure has been modify with controllers adictions
johnazedo May 24, 2020
d1dbf2e
:truck: Structure has been modify with controllers adictions
johnazedo May 24, 2020
5594d02
Module exports on app.js has been delete
johnazedo May 24, 2020
66dfe95
Changing variables
johnazedo May 24, 2020
e23e4db
:truck: Changing index.html to home.html
johnazedo May 24, 2020
337688d
:bento: Updating SASS code and assets structure
johnazedo May 24, 2020
4eda342
:ambulance: Fixing import errors
johnazedo May 26, 2020
45b05e2
Removendo Ds_store
johnazedo May 26, 2020
9691cb7
:rocket: Check if url is active
johnazedo May 26, 2020
f5f405a
:ambulance: back button doesn't work
johnazedo May 26, 2020
12bde31
:poop: Using CmdOrCtrl+B instead of FAB
johnazedo May 26, 2020
8794e47
:pencil: Writing README.md
johnazedo May 26, 2020
b04cd27
:pencil: Writing README.md
johnazedo May 26, 2020
fecc80f
:page_facing_up: Adding license
johnazedo May 26, 2020
f82acb4
:page_facing_up: Adding license in README.md
johnazedo May 26, 2020
13f1ff9
:bento: Change home page
johnazedo May 29, 2020
be9e1f2
Update README.md
johnazedo May 29, 2020
b4e5823
Changing name
johnazedo May 29, 2020
6bd5537
Merge branch 'master' of github.com:JohnAzedo/simple-webview
johnazedo May 29, 2020
297804d
Update README.md
johnazedo May 29, 2020
27f25b4
docs: Updating README.md
johnazedo Jun 1, 2020
0225dff
Merge branch 'master' of github.com:JohnAzedo/simple-webview
johnazedo Jun 1, 2020
bb7cdd2
style: Deleting blank spaces
johnazedo Jun 1, 2020
ece8908
docs: Adding badges
johnazedo Jun 2, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 111 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,111 @@
node_modules/

# Created by https://www.gitignore.io/api/node
# Edit at https://www.gitignore.io/?templates=node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# rollup.js default build output
dist/

# Uncomment the public line if your project uses Gatsby
# https://nextjs.org/blog/next-9-1#public-directory-support
# https://create-react-app.dev/docs/using-the-public-folder/#docsNav
# public

# Storybook build outputs
.out
.storybook-out

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Temporary folders
tmp/
temp/

# End of https://www.gitignore.io/api/node
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 João Pedro Limão

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# :rocket: RocketBrowser Always on Top


<a href="#"><img src="https://img.shields.io/github/last-commit/JohnAzedo/RocketBrowser"></img></a><a href="https://github.com/JohnAzedo/RocketBrowser/blob/master/LICENSE">
<img alt="License" src="https://img.shields.io/badge/license-MIT-brightgreen.svg">
</a><a href="https://www.linkedin.com/in/jo%C3%A3o-pedro-lim%C3%A3o-960495111/"><img src="https://img.shields.io/badge/Author-JohnAzedo-brightgreen"></img></a>
<a><img src="https://img.shields.io/npm/v/npm"></img></a>

WebView that is always on top. Just type your link and click in search.

You can use it whenever you want to see a page always on the screen regardless of where to click or which program to open.

![gif](https://user-images.githubusercontent.com/19677206/83300760-fa20a600-a1ce-11ea-9100-035f1ab3f9e2.gif)

### Shortcuts

Shortcuts | Description
---------|---------
Cmd+J or Ctrl+J | Show dev tools
Cmd+B or Ctrl+b | Return to home page

## How to use?
A guide to use this software

### Install and usage

Clone this repository:

````sh
git clone [email protected]:JohnAzedo/RocketBrowser.git
````
This command will install all dependences.
Install npm before do this:
````sh
npm install
````

Run application with:
````sh
npm start
````

### SASS compile command

If you change something in SASS files, run this command:
```sh
sass --sourcemap=none --no-cache app/assets/sass/*.sass:app/assets/css/*.css
```
## Project structure
````sh
.
├── LICENSE
├── README.md
├── app
│   ├── assets
│   │   ├── css
│   │   │   └── home.css
│   │   └── sass
│   │   └── home.sass
│   ├── controllers
│   │   └── home.js
│   └── home.html
├── app.js
├── config
│   └── settings.js
├── package-lock.json
└── package.json

6 directories, 10 files
````

## Authors
- [@johnazedo](https://github.com/JohnAzedo)

- [@maykbrito](https://github.com/maykbrito)
22 changes: 18 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { app, BrowserWindow, globalShortcut } = require('electron')
const config = require('./config')
const { app, BrowserWindow, globalShortcut} = require('electron')
const config = require('./config/settings')


let win = null
let contents = null
Expand All @@ -18,7 +19,9 @@ function createWindow () {
},
})

win.loadURL(config.url)
// win.loadURL(config.url)

win.loadFile(config.file)

contents = win.webContents

Expand All @@ -28,9 +31,16 @@ function toggleDevTools() {
contents.toggleDevTools()
}

function backToHome(){
win.loadFile(config.file)

}

function createShortcuts() {
globalShortcut.register('CmdOrCtrl+J', toggleDevTools)
globalShortcut.register('CmdOrCtrl+B', backToHome)
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
Expand Down Expand Up @@ -59,4 +69,8 @@ function recreateWindow() {
}

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
// code. You can also put them in separate files and require them here.

module.exports = {
currentWindow: win
}
Binary file added app/.DS_Store
Binary file not shown.
40 changes: 40 additions & 0 deletions app/assets/css/home.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
body {
background-color: #694db5;
align-items: center;
display: flex;
height: 100vh;
font-family: "Chelsea Market"; }

input {
width: 85% !important;
border-top-left-radius: 20px !important;
border-bottom-left-radius: 20px !important; }

input:focus {
outline: none !important;
border-color: #ffcc4d !important;
box-shadow: 0 0 5px #ffcc4d !important; }

button {
width: 100%;
border-top-right-radius: 20px !important;
border-bottom-right-radius: 20px !important; }

.row {
width: 100%; }

.input-group-append {
width: 15% !important; }

.titleBox {
margin: 30px; }

i {
color: #ffcc4d; }

h1, h4 {
color: white; }

#container {
width: 100%;
margin-left: 0px; }
43 changes: 43 additions & 0 deletions app/assets/sass/home.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
$color: #694db5
$borderRadiusSize: 20px

body
background-color: $color
align-items: center
display: flex
height: 100vh
font-family: 'Chelsea Market'

input
width: 85% !important
border-top-left-radius: $borderRadiusSize !important
border-bottom-left-radius: $borderRadiusSize !important

input:focus
outline: none !important
border-color: #ffcc4d !important
box-shadow: 0 0 5px #ffcc4d !important

button
width: 100%
border-top-right-radius: $borderRadiusSize !important
border-bottom-right-radius: $borderRadiusSize !important

.row
width: 100%

.input-group-append
width: 15% !important

.titleBox
margin: 30px

i
color: #ffcc4d

h1, h4
color: white

#container
width: 100%
margin-left: 0px
16 changes: 16 additions & 0 deletions app/controllers/home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This file refer to index.html
const electron = require('electron');
const urlExists = require('url-exists');
const currentWindow = electron.remote.getCurrentWindow()


document.querySelector('#btnSearch').addEventListener('click', () => {
url = document.getElementById("inputURL").value;
urlExists(url, function(err, exists) {
if (exists) {
currentWindow.loadURL(url);
}
});
});


Loading