4 Commits 89532ce95c ... b6f1245955

Author SHA1 Message Date
  Augusto Alves Silva b6f1245955 VScode Push 6 years ago
  Augusto Alves Silva e5fb98f128 Working app with loader screen 6 years ago
  Augusto Alves Silva fc4af1252d Corrected the div.indicator 6 years ago
  Augusto Alves Silva 92a8e1bc1a Webview created with no default menu 6 years ago
9 changed files with 2085 additions and 0 deletions
  1. 1 0
      .gitignore
  2. 16 0
      assets/css/base.css
  3. 41 0
      assets/css/loading.css
  4. BIN
      assets/icons/png/libreflix-936x756.png
  5. BIN
      assets/icons/win/libreflix-icon.ico
  6. 49 0
      index.html
  7. 28 0
      main.js
  8. 1924 0
      package-lock.json
  9. 26 0
      package.json

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+node_modules/

+ 16 - 0
assets/css/base.css

@@ -0,0 +1,16 @@
+ 
+body {
+    height: 100%;
+    display: flex;
+    justify-content: space-around;
+    align-items: center;
+    background: #000000;
+}
+#webview {
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    display: inline-flex !important;
+}

+ 41 - 0
assets/css/loading.css

@@ -0,0 +1,41 @@
+@-webkit-keyframes spin {
+    0% {
+      -webkit-transform: rotate(0deg);
+              transform: rotate(0deg);
+    }
+    100% {
+      -webkit-transform: rotate(360deg);
+              transform: rotate(360deg);
+    }
+  }
+  @keyframes spin {
+    0% {
+      -webkit-transform: rotate(0deg);
+              transform: rotate(0deg);
+    }
+    100% {
+      -webkit-transform: rotate(360deg);
+              transform: rotate(360deg);
+    }
+  }
+  @-webkit-keyframes pulse {
+    50% {
+      background: white;
+    }
+  }
+  @keyframes pulse {
+    50% {
+      background: white;
+    }
+  }
+ 
+  
+  .loading {
+    border-radius: 50%;
+    width: 120px;
+    height: 120px;
+    border: 0.25rem solid rgba(0, 0, 0, 0);
+    border-top-color: rgb(66, 131, 253);
+    -webkit-animation: spin 1s infinite linear;
+            animation: spin 1s infinite linear;
+  }

BIN
assets/icons/png/libreflix-936x756.png


BIN
assets/icons/win/libreflix-icon.ico


+ 49 - 0
index.html

@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+   <head>
+      <meta charset = "UTF-8">
+      <title>Libreflix</title>
+      <link rel="stylesheet" href="assets/css/base.css">
+      <link rel="stylesheet" href="assets/css/loading.css">
+   </head>
+   <body>
+      <div class="container">
+        <webview id="webview" src="https://libreflix.org/" autosize minwidth="800" minheight="600">
+        </webview>
+        <div class = "indicator"></div>
+      </div>
+      
+      <script type = "text/javascript">
+         // Event handlers for loading events.
+         // Use these to handle loading screens, transitions, etc
+         
+
+         onload = () => {
+            const webview = document.querySelector('webview')
+            const indicator = document.querySelector('.indicator')
+            const div = document.createElement('div');
+
+            const loadstart = () => {
+              //indicator.innerText = 'loading...'
+              div.className = "loading";
+              indicator.appendChild(div);
+
+            }
+
+            const loadstop = () => {
+              //indicator.innerText = ''
+              div.parentNode.removeChild(div);
+            }
+
+            const overflow = () => {
+              webview.insertCSS('::-webkit-scrollbar { display: none; } ');
+            }
+
+            webview.addEventListener('did-start-loading', loadstart)
+            webview.addEventListener('did-stop-loading', loadstop)
+            webview.addEventListener('did-stop-loading', overflow)
+         }
+      </script>
+
+   </body>
+</html>

+ 28 - 0
main.js

@@ -0,0 +1,28 @@
+const {app, BrowserWindow} = require('electron')
+const url = require('url')
+const path = require('path')
+
+let win
+
+function createWindow() {
+    win = new BrowserWindow({
+        width: 800,
+        height: 600,
+        webPreferences: {
+            nodeIntegration: true
+        },
+        menu: null,
+    })
+    
+    win.loadURL(url.format ({
+      pathname: path.join(__dirname, 'index.html'),
+      protocol: 'file:',
+      slashes: true
+    }))
+
+}
+
+app.on('ready', createWindow)
+app.on('browser-window-created',function(e,window) {
+    window.setMenu(null);
+});

File diff suppressed because it is too large
+ 1924 - 0
package-lock.json


+ 26 - 0
package.json

@@ -0,0 +1,26 @@
+{
+  "name": "libreflix-desktop",
+  "version": "0.1.0",
+  "description": "Libreflix é uma plataforma de streaming livre e colaborativa que reúne produções audiovisuais independentes, de livre exibição e que fazem pensar.",
+  "main": "main.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1",
+    "start": "electron .",
+    "package-win": "electron-packager . libreflix-app --overwrite --asar=true --platform=win32 --arch=ia32 --icon=assets/icons/win/libreflix-icon.ico --prune=true --out=release-builds/windows --version-string.CompanyName=\"Libreflix\"--version-string.FileDescription=\"Libreflix\" --version-string.ProductName=\"Libreflix Desktop App\"",    
+    "package-linux": "electron-packager . libreflix-app --overwrite --asar=true --platform=linux --arch=x64 --icon=assets/icons/png/libreflix-936x756.png --prune=true --out=release-builds/gnu-linux"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://notabug.org/augustoasilva/libreflix-desktop.git"
+  },
+  "keywords": [
+    "libreflix"
+  ],
+  "author": "Augusto Silva",
+  "license": "AGPL-3.0",
+  "devDependencies": {
+    "electron": "^2.0.4",
+    "electron-packager": "^12.1.0"
+  }
+    
+}