diff --git a/electron-builder.yml b/electron-builder.yml index 32c4ee8..0df20c5 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -1,5 +1,5 @@ -appId: 'be.guillaumevd.chatclasse' -productName: 'ChatClasse' +appId: 'be.guillaumevd.pearstreaming' +productName: 'Pears Streaming' artifactName: '${productName}-setup-${version}.${ext}' copyright: 'Copyright © 2022 Guillaume Vandriessche' @@ -33,17 +33,6 @@ nsis: createDesktopShortcut: true runAfterFinish: true -# macOS Configuration -mac: - icon: 'build/assets/images/icon.icns' - target: - - target: 'dmg' - arch: - - 'x64' - - 'arm64' - artifactName: '${productName}-setup-${version}-${arch}.${ext}' - category: 'public.app-category.games' - # Linux Configuration linux: icon: 'build/assets/images/icon.png' diff --git a/main_process/windows/main.js b/main_process/windows/main.js index 26edc73..58443b2 100644 --- a/main_process/windows/main.js +++ b/main_process/windows/main.js @@ -18,7 +18,7 @@ function destroyWindow() { function createWindow() { destroyWindow(); mainWindow = new electron.BrowserWindow({ - title: "ChatClasse", + title: "Pears Streaming", width: 1280, height: 720, minWidth: 980, diff --git a/main_process/windows/update.js b/main_process/windows/update.js index 7fe2675..fdb8d08 100644 --- a/main_process/windows/update.js +++ b/main_process/windows/update.js @@ -17,7 +17,7 @@ function destroyWindow() { function createWindow() { destroyWindow(); updateWindow = new electron.BrowserWindow({ - title: "Mise à jour", + title: "Pears Streaming MAJ", width: 400, height: 500, icon: path.join(electron.app.getAppPath(), 'build', 'assets', 'images', 'icon') + `.${os.platform() === "win32" ? "ico" : "png"}`, diff --git a/public/assets/images/icon.icns b/public/assets/images/icon.icns deleted file mode 100644 index 4a46d96..0000000 Binary files a/public/assets/images/icon.icns and /dev/null differ diff --git a/public/assets/images/icon.ico b/public/assets/images/icon.ico index 6a171e9..4dd7e08 100644 Binary files a/public/assets/images/icon.ico and b/public/assets/images/icon.ico differ diff --git a/public/assets/images/icon.png b/public/assets/images/icon.png index 05311de..0b3f114 100644 Binary files a/public/assets/images/icon.png and b/public/assets/images/icon.png differ diff --git a/public/assets/images/splash.png b/public/assets/images/splash.png index db953dd..063dc61 100644 Binary files a/public/assets/images/splash.png and b/public/assets/images/splash.png differ diff --git a/public/assets/js/splash.js b/public/assets/js/splash.js index 0f34ebb..ec4cc00 100644 --- a/public/assets/js/splash.js +++ b/public/assets/js/splash.js @@ -14,9 +14,7 @@ class Splash { async startAnimation() { let splashes = [ - { "message": "Nouvelle version !", "author": "Guillaume" }, - { "message": "BLABLABLA", "author": "Guillaume" }, - { "message": "VERSION 0.2.1 !", "author": "Guillaume" } + { "message": "Bienvenur sur Pears !", "author": "Guillaume" } ] let splash = splashes[Math.floor(Math.random() * splashes.length)]; this.splashMessage.textContent = splash.message; @@ -61,7 +59,7 @@ class Splash { } async maintenanceCheck() { - ipcRenderer.invoke('fetch', 'http://146.59.227.84:3001').then(res => { + ipcRenderer.invoke('fetch', 'https://raw.githubusercontent.com/guillaumevd/streaming_manifest/main/manifest.json').then(res => { if (res.maintenance) return this.shutdown(res.maintenance_message); this.startLauncher(); }).catch(e => { diff --git a/src/app.js b/src/app.js index 026eb99..f61092b 100644 --- a/src/app.js +++ b/src/app.js @@ -1,15 +1,45 @@ -import { useState } from "react"; +import { useState, useEffect } from "react"; +import axios from "axios"; +import 'bootstrap/dist/css/bootstrap.min.css'; +import 'bootstrap/dist/js/bootstrap.bundle.min'; +import 'font-awesome/css/font-awesome.min.css'; +import './assets/css/style.css' + +import MovieList from "./pages/movie/movieList"; +import MovieSingle from "./pages/movie/movieSingle"; import AuthPage from "./pages/auth/auth"; -import ChatsPage from "./pages/chat/chats"; function App() { const [user, setUser] = useState(); + const [movie, setMovie] = useState(null); + const [manifest, setManifest] = useState(); + + useEffect(() => { + const getData = async () => { + try { + const response = await axios.get( + `https://raw.githubusercontent.com/guillaumevd/streaming_manifest/main/manifest.json` + ); + setManifest(response.data); + } catch (err) { + setManifest(null); + } + }; + getData(); + }, []); - if (!user) { - return setUser(user)} />; - } else { - return ; + if (manifest) { + const movies = manifest.movies; + if (!user) { + return setUser(user)} />; + } else { + if (movie == null) { + return setMovie(movie)} user={user} movies={movies} />; + } else { + return setMovie(movie)} user={user} movie={movie} />; + } + } } } diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..8a33d22 --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,36 @@ +body { + background-color:rgb(12, 15, 22); + background-repeat: no-repeat; + background-size: cover; + height: 100%; + width: 100%; + margin: 0px; + margin-top: 4%; + margin-bottom: 4%; + -webkit-user-select: none; /* Safari */ + -ms-user-select: none; /* IE 10 and IE 11 */ + user-select: none; /* Standard syntax */ +} + + +.background { + display: table-cell; + vertical-align: middle; +} + +h1, h2, h3, h4, h5, h6 { + color: #ffffffea; +} + +::-webkit-scrollbar { + + width: 8px; + + height: 10px; + +} + +::-webkit-scrollbar-thumb { + border-radius: 8px; + background: #c2c9d2; +} \ No newline at end of file diff --git a/src/pages/auth/auth.js b/src/pages/auth/auth.js index 679541f..4893068 100644 --- a/src/pages/auth/auth.js +++ b/src/pages/auth/auth.js @@ -31,9 +31,9 @@ const AuthPage = (props) => { }; return ( -
+
-
+
Bienvenue 👋
@@ -64,7 +64,7 @@ const AuthPage = (props) => {
-
+
Pas encore de compte ?
diff --git a/src/pages/auth/style.css b/src/pages/auth/style.css index db7f74a..c07bd43 100644 --- a/src/pages/auth/style.css +++ b/src/pages/auth/style.css @@ -1,43 +1,6 @@ -body { - background-color:rgb(12, 15, 22); - background-repeat: no-repeat; - background-size: cover; - height: 100%; - width: 100%; - margin: 0px; -} - -.column { - float: left; -} - -.left { - width: 30%; -} - -.right { - width: 70%; -} - -/* Clear floats after the columns */ -.row:after { - content: ""; - display: table; - clear: both; -} - -.background { - width: 100vw; - height: 100vh; - background: linear-gradient(75deg, rgb(20, 23, 33) 0%, rgb(20, 23, 33) 50%, rgba(20, 23, 33,0.8) 100%); - /* Vertical center */ - display: table-cell; - vertical-align: middle; -} - .form-card { - width: 300px; - padding: 0% 25% 0% 25%; + padding-left: 20%; + width: 70%; } .form-title { @@ -98,23 +61,3 @@ body { -moz-transition: all .44s ease; } .auth-button:hover { filter: brightness(145%); } - -.chat-wrapper { - height: 80vh; - width: 80%; - margin-left: 10%; - color: white; - background: rgb(43, 47, 60); -} - -::-webkit-scrollbar { - - width: 8px; - - height: 10px; - -} -::-webkit-scrollbar-thumb { - border-radius: 8px; - background: #c2c9d2; -} \ No newline at end of file diff --git a/src/pages/chat/chats.js b/src/pages/chat/chats.js deleted file mode 100644 index 3fbc363..0000000 --- a/src/pages/chat/chats.js +++ /dev/null @@ -1,16 +0,0 @@ -import { PrettyChatWindow } from "react-chat-engine-pretty"; - -const ChatsPage = (props) => { - return ( -
- -
- ); -}; - -export default ChatsPage; diff --git a/src/pages/movie/movieList.js b/src/pages/movie/movieList.js new file mode 100644 index 0000000..97edbcc --- /dev/null +++ b/src/pages/movie/movieList.js @@ -0,0 +1,28 @@ +import { useState } from "react"; +import './style.css' + +const movieList = (props) => { + const movies = props.movies; + const user = props.user; + const handlePlayClick = (movie) => { + props.onSetMovie(movie); + }; + + return ( +
+

Bonjour, {user.username}

+

Voici les films à la une:

+ {movies.map((movie) => ( +
handlePlayClick(movie)} key={movie.id} className="card movie_card"> + ... +
+

{movie.title}

+
{movie.description}
+
+
+ ))} +
+ ); +}; + +export default movieList; diff --git a/src/pages/movie/movieSingle.js b/src/pages/movie/movieSingle.js new file mode 100644 index 0000000..a737f24 --- /dev/null +++ b/src/pages/movie/movieSingle.js @@ -0,0 +1,22 @@ +const movieSingle = (props) => { + const movie = props.movie; + + const handleBackClick = () => { + props.onSetMovie(null); + }; + + return ( +
+
+ +
+

{ movie.title }

+

{ movie.description }

+
+ +
+
+ ); +} + +export default movieSingle; \ No newline at end of file diff --git a/src/pages/movie/style.css b/src/pages/movie/style.css new file mode 100644 index 0000000..8835825 --- /dev/null +++ b/src/pages/movie/style.css @@ -0,0 +1,57 @@ +img { + -webkit-user-drag: none; + -moz-user-drag: none; + -o-user-drag: none; +} +.movie_list{ + padding-right: 8%; + padding-left: 8%; + padding-bottom: 5%; +} +.movie_card{ + padding: 0 !important; + background-color:rgba(0, 0, 0, 0.2); + width: 20%; + margin: 2%; + border-radius: 10px; + box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.2), 0 4px 15px 0 rgba(0, 0, 0, 0.19); + cursor:pointer; + transition: transform .2s ease; +} +.movie_card:hover { + transform: scale(1.1); +} +.movie_card img{ + border-top-left-radius: 10px; + border-top-right-radius: 10px; + height: 60%; +} +.card-title{ + width: 90%; + height: 20%; +} +.card-description{ + width: 90%; + height: 10%; +} + +.video-wrapper { + position: relative; + padding-bottom: 56.25%; + padding-top: 25px; + height: 0; +} +.video-wrapper iframe { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +#bouton-back { + height: 50px; + width: 500px; + background-color: #686de0; + position: fixed; + top: 100px; +} diff --git a/yarn.lock b/yarn.lock index d1b4d8f..7454e6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3047,6 +3047,11 @@ boolean@^3.0.1: resolved "https://registry.yarnpkg.com/boolean/-/boolean-3.2.0.tgz#9e5294af4e98314494cbb17979fa54ca159f116b" integrity sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw== +bootstrap@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.2.3.tgz#54739f4414de121b9785c5da3c87b37ff008322b" + integrity sha512-cEKPM+fwb3cT8NzQZYEu4HilJ3anCrWqh3CHAok1p9jXqMPsPTBhU25fBckEJHJ/p+tTxTFTsFQGM+gaHpi3QQ== + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -3243,9 +3248,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001449, caniuse-lite@^1.0.30001464: - version "1.0.30001467" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001467.tgz#1afc9c16ed61f50dd87139da87ca43a3e0051c77" - integrity sha512-cEdN/5e+RPikvl9AHm4uuLXxeCNq8rFsQ+lPHTfe/OtypP3WwnVVbjn+6uBV7PaFL6xUFzTh+sSCOz1rKhcO+Q== + version "1.0.30001468" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001468.tgz#0101837c6a4e38e6331104c33dcfb3bdf367a4b7" + integrity sha512-zgAo8D5kbOyUcRAgSmgyuvBkjrGk5CGYG5TYgFdpQv+ywcyEpo1LOWoG8YmoflGnh+V+UsNuKYedsoYs0hzV5A== case-sensitive-paths-webpack-plugin@^2.4.0: version "2.4.0" @@ -4980,6 +4985,11 @@ follow-redirects@^1.0.0, follow-redirects@^1.14.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +font-awesome@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/font-awesome/-/font-awesome-4.7.0.tgz#8fa8cf0411a1a31afd07b06d2902bb9fc815a133" + integrity sha512-U6kGnykA/6bFmg1M/oT9EkFeIYv7JlX3bozwQJWiiLz6L0w3F5vBVPxHlwyX/vtNq1ckcpRKOB9f2Qal/VtFpg== + for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e"