Skip to content

Commit

Permalink
Merge branch 'Version-1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-nyt committed May 17, 2020
2 parents 335b44b + cdc642b commit 1ac6e8c
Show file tree
Hide file tree
Showing 33 changed files with 895 additions and 93 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ npm start <-- Runs the app itself.
- Open Folder Icon: <div>Icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>
- Error Icon: <div>Icons made by <a href="https://www.flaticon.com/authors/vectors-market" title="Vectors Market">Vectors Market</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>
- Update Icon: <div>Icons made by <a href="https://www.flaticon.com/authors/dave-gandy" title="Dave Gandy">Dave Gandy</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>
- Browser Icon: <div>Icons made by <a href="https://www.flaticon.com/authors/smashicons" title="Smashicons">Smashicons</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>

### License
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">Novel Scraper</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="https://github.com/dr-nyt/Translated-Novel-Downloader" property="cc:attributionName" rel="cc:attributionURL">dr_nyt</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.
Expand Down
1 change: 1 addition & 0 deletions attributions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ Open Folder Icon: <div>Icons made by <a href="https://www.flaticon.com/authors/f
Error Icon: <div>Icons made by <a href="https://www.flaticon.com/authors/vectors-market" title="Vectors Market">Vectors Market</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>
Update Icon: <div>Icons made by <a href="https://www.flaticon.com/authors/dave-gandy" title="Dave Gandy">Dave Gandy</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>

Browser Icon: <div>Icons made by <a href="https://www.flaticon.com/authors/smashicons" title="Smashicons">Smashicons</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>

Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 33 additions & 5 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,57 @@ import * as url from 'url';
const ipc = require('electron').ipcMain;
const { autoUpdater } = require('electron-updater');

const Splashscreen = require('@trodi/electron-splashscreen');

var status = 0;
let win: BrowserWindow = null;
const args = process.argv.slice(1),
serve = args.some(val => val === '--serve');
serve = args.some(val => val === '--serve');

function createWindow(): BrowserWindow {

const electronScreen = screen;
const size = electronScreen.getPrimaryDisplay().workAreaSize;

// Create the browser window.
win = new BrowserWindow({
x: 0,
y: 0,
// win = new BrowserWindow({
// x: 0,
// y: 0,
// width: 1060,
// height: 600,
// 'minWidth': 1060,
// 'minHeight': 500,
// frame: false,
// webPreferences: {
// nodeIntegration: true,
// allowRunningInsecureContent: (serve) ? true : false,
// },
// });

const windowOptions = {
width: 1060,
height: 600,
center: true,
'minWidth': 1060,
'minHeight': 500,
frame: false,
webPreferences: {
nodeIntegration: true,
allowRunningInsecureContent: (serve) ? true : false,
}
};

autoUpdater.checkForUpdatesAndNotify();

win = Splashscreen.initSplashScreen({
windowOpts: windowOptions,
templateUrl: path.join(__dirname, "splashScreen.html"),
delay: 0, // force show immediately since example will load fast
minVisible: 2000, // show for 1.5s so example is obvious
splashScreenOpts: {
height: 500,
width: 700,
transparent: true,
},
});

Expand Down Expand Up @@ -104,7 +133,6 @@ ipc.on('closed', _ => {
ipc.on('app_version', (event) => {
event.sender.send('app_version', { version: app.getVersion() });
console.log('Checking for updates...');
autoUpdater.checkForUpdatesAndNotify();
});

autoUpdater.on('update-available', () => {
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "novelscraper",
"version": "1.0.0",
"version": "1.0.3",
"description": "Educational app on how to web scrape novels from pirate sites.",
"homepage": "https://github.com/dr-nyt/NovelScraper",
"author": {
"name": "dr_nyt",
"email": "[email protected]"
},
"repository": {
"type" : "git",
"url" : "https://github.com/dr-nyt/NovelScraper.git"
"type": "git",
"url": "https://github.com/dr-nyt/NovelScraper.git"
},
"keywords": [
"webscraper",
Expand Down Expand Up @@ -63,7 +63,7 @@
"@typescript-eslint/parser": "2.20.0",
"chai": "4.2.0",
"codelyzer": "5.1.2",
"conventional-changelog-cli": "2.0.32",
"conventional-changelog-cli": "2.0.34",
"core-js": "3.1.4",
"cross-env": "7.0.0",
"electron": "8.0.1",
Expand Down Expand Up @@ -94,10 +94,11 @@
},
"dependencies": {
"@angular/animations": "9.1.0",
"@trodi/electron-splashscreen": "1.0.0",
"cloudscraper": "4.6.0",
"electron-updater": "4.2.5",
"fs-extra": "9.0.0",
"jquery": "3.4.1",
"jquery": "3.5.1",
"mime": "2.4.4",
"nconf": "0.10.0",
"nodepub": "2.2.0",
Expand Down
183 changes: 183 additions & 0 deletions splashScreen.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
<style>

@keyframes yourAnimation {
0%{
transform: rotate(0) translateX(0px);
}
50%{
transform: rotate(0) translateX(345px);
}
51%{
transform: rotate(0) translateX(-357px);
}
100%{
transform: rotate(0) translateX(0px);
}
}

html {
background-color: white;
font-family: 'Open Sans', sans-serif;
-webkit-user-select: none;
}
body {
background-color: #033e63;
width: 700px;
height: 500px;
margin: 0;
-webkit-app-region: drag;
}

body center {
color: white;
margin: 0;
font-size: 1.5rem;
}

body center h1 {
margin: 0;
padding-top: 30px;
}

body center h1 span {
color: rgb(0, 153, 255);
}

body center img {
width: 230px;
margin-top: 70px;
}

body center p {
font-size: 0.7em;
margin-top: 68px;
}

.load {
margin: 0;
float: left;

}

#load1 {
margin-left: 340px;
animation: yourAnimation 2s infinite 0s;
}
#load2{
animation: yourAnimation 2.5s infinite 0s;
}
#load3{
animation: yourAnimation 3s infinite 0s;
}
body,
html,
.wrapper {
width: 100%;
height: 100%;
}
.wrapper {
position: relative;
background: #e7f0f7;
}
.progressbar {
display: block;
position: absolute;
z-index: 9;
top: 100px;
right: 0;
bottom: 0;
left: 0;
margin: auto;
width: 300px;
height: 15px;
}
.progressbar::before,
.progressbar::after {
content: '';
display: block;
position: absolute;
z-index: 99;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 15px;
background-image: linear-gradient(90deg, #e91e63 0%, #e91e63 20%, #03a9f4 20%, #03a9f4 40%, #8bc34a 40%, #8bc34a 60%, #ffeb3b 60%, #ffeb3b 80%, #ff5722 80%, #ff5722 100%);
background-position: 0 0;
background-repeat: repeat-x;
-webkit-animation: movebar 5s linear infinite;
animation: movebar 5s linear infinite;
}
.progressbar::before {
box-shadow: 0 6px 10px 0 rgba(0,0,0,0.1);
}
.progressbar::after {
z-index: 9;
top: 6px;
-webkit-filter: blur(16px);
filter: blur(16px);
opacity: 0.7;
}
.stylization {
position: absolute;
z-index: 999;
height: 4px;
width: 90%;
left: 5%;
top: 6px;
opacity: 0.3;
}
.stylization::before,
.stylization::after {
content: '';
display: block;
position: absolute;
height: 4px;
top: 0;
border-radius: 2px;
}
.stylization::before {
background: #fff;
left: 0;
right: 10px;
}
.stylization::after {
width: 6px;
background: #fff;
right: 0;
}
@-webkit-keyframes movebar {
from {
background-position: 0 0;
} to {
background-position: 400px 0;
}
}
@keyframes movebar {
from {
background-position: 0 0;
} to {
background-position: 400px 0;
}
}
</style>
<head></head>
<body>
<center>
<img src="./logo.png">
<h1><span>Novel</span>Scraper</h1>

<div class="wrapper">
<div class="progressbar">
<div class="stylization"></div>
</div>
</div>

<p>CHECKING FOR UPDATES...</p>
</center>
</body>
</html>
2 changes: 2 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { PageNotFoundComponent } from './shared/components';
// Page routes
import { SourcesComponent } from './sources/sources.component';
import { NovelplanetSourceComponent } from './novelplanet-source/novelplanet-source.component';
import { ReadlightnovelSourceComponent } from './readlightnovel-source/readlightnovel-source.component';
import { BoxnovelSourceComponent } from './boxnovel-source/boxnovel-source.component';
import { LibraryComponent } from './library/library.component';
import { NovelComponent } from './novel/novel.component';
Expand All @@ -13,6 +14,7 @@ import { SettingComponent } from './setting/setting.component';
const routes: Routes = [
{ path: 'sources', component: SourcesComponent },
{ path: 'novelplanetSource', component: NovelplanetSourceComponent },
{ path: 'readlightnovelSource', component: ReadlightnovelSourceComponent },
{ path: 'boxnovelSource', component: BoxnovelSourceComponent },
{ path: 'novel', component: NovelComponent },
{ path: 'library', component: LibraryComponent },
Expand Down
3 changes: 2 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { AppComponent } from './app.component';
import { SourcesComponent } from './sources/sources.component';
import { LibraryComponent } from './library/library.component';
import { NovelplanetSourceComponent } from './novelplanet-source/novelplanet-source.component';
import { ReadlightnovelSourceComponent } from './readlightnovel-source/readlightnovel-source.component';
import { BoxnovelSourceComponent } from './boxnovel-source/boxnovel-source.component';
import { NovelComponent } from './novel/novel.component';
import { SettingComponent } from './setting/setting.component';
Expand All @@ -30,7 +31,7 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
}

@NgModule({
declarations: [AppComponent, SourcesComponent, LibraryComponent, NovelplanetSourceComponent, BoxnovelSourceComponent, NovelComponent, SettingComponent],
declarations: [AppComponent, SourcesComponent, LibraryComponent, NovelplanetSourceComponent, BoxnovelSourceComponent, NovelComponent, SettingComponent, ReadlightnovelSourceComponent],
imports: [
BrowserModule,
FormsModule,
Expand Down
1 change: 1 addition & 0 deletions src/app/boxnovel-source/boxnovel-source.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<div class="page">
<div class="headerPanel">
<h1>BoxNovel</h1>
<img src="../assets/rsc/internet.svg" alt="" id="boxnovel-website" class="website">
</div>

<div class="content">
Expand Down
9 changes: 8 additions & 1 deletion src/app/boxnovel-source/boxnovel-source.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { LibraryService } from '../library.service';
// Import BoxNovel Service
import { BoxnovelService } from '../boxnovel.service';

const { shell } = require('electron');

@Component({
selector: 'app-boxnovel-source',
templateUrl: './boxnovel-source.component.html',
Expand All @@ -18,9 +20,10 @@ export class BoxnovelSourceComponent implements OnInit {
constructor(private router: Router, private library: LibraryService ,public boxnovelService: BoxnovelService) { }

ngOnInit(): void {
document.getElementById("boxnovel-website").addEventListener("click", this.openWebsite);
}

// Binded to novelplanet search bar
// Binded to boxnovel search bar
search(val) {
if(val == undefined || val == "") {
return;
Expand All @@ -34,6 +37,10 @@ export class BoxnovelSourceComponent implements OnInit {
}
}

openWebsite() {
shell.openExternal('https://boxnovel.com/')
}

// Load novelpage with the information of the novel clicked on
loadNovelPage(novel) {
this.router.navigateByUrl('/novel', { state: { novel: novel, source: 'boxnovel' } });
Expand Down
Loading

0 comments on commit 1ac6e8c

Please sign in to comment.