Skip to content

Commit

Permalink
maj
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumevd committed Mar 19, 2023
1 parent fbbb02c commit 2825681
Show file tree
Hide file tree
Showing 17 changed files with 203 additions and 106 deletions.
15 changes: 2 additions & 13 deletions electron-builder.yml
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion main_process/windows/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function destroyWindow() {
function createWindow() {
destroyWindow();
mainWindow = new electron.BrowserWindow({
title: "ChatClasse",
title: "Pears Streaming",
width: 1280,
height: 720,
minWidth: 980,
Expand Down
2 changes: 1 addition & 1 deletion main_process/windows/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"}`,
Expand Down
Binary file removed public/assets/images/icon.icns
Binary file not shown.
Binary file modified public/assets/images/icon.ico
Binary file not shown.
Binary file modified public/assets/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions public/assets/js/splash.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 => {
Expand Down
42 changes: 36 additions & 6 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -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 <AuthPage onAuth={(user) => setUser(user)} />;
} else {
return <ChatsPage user={user} />;
if (manifest) {
const movies = manifest.movies;
if (!user) {
return <AuthPage onAuth={(user) => setUser(user)} />;
} else {
if (movie == null) {
return <MovieList onSetMovie={(movie) => setMovie(movie)} user={user} movies={movies} />;
} else {
return <MovieSingle onSetMovie={(movie) => setMovie(movie)} user={user} movie={movie} />;
}
}
}
}

Expand Down
36 changes: 36 additions & 0 deletions src/assets/css/style.css
Original file line number Diff line number Diff line change
@@ -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;
}
6 changes: 3 additions & 3 deletions src/pages/auth/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const AuthPage = (props) => {
};

return (
<div className="background">
<div style={{ height: "100%", width: "100%" }}>
<div className="row">
<div className="column left">
<div className="col-md-6">
<form onSubmit={onLogin} className="form-card">
<div className="form-title">Bienvenue 👋</div>

Expand Down Expand Up @@ -64,7 +64,7 @@ const AuthPage = (props) => {
</div>
</form>
</div>
<div className="column right">
<div className="col-md-6">
<form onSubmit={onSignup} className="form-card">
<div className="form-subtitle">Pas encore de compte ?</div>
<div className="auth">
Expand Down
61 changes: 2 additions & 59 deletions src/pages/auth/style.css
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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;
}
16 changes: 0 additions & 16 deletions src/pages/chat/chats.js

This file was deleted.

28 changes: 28 additions & 0 deletions src/pages/movie/movieList.js
Original file line number Diff line number Diff line change
@@ -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 (
<div style={{ height: "100vh", width: "100vw" }} className="row movie_list">
<h1>Bonjour, {user.username}</h1>
<h2>Voici les films à la une:</h2>
{movies.map((movie) => (
<div onClick={() => handlePlayClick(movie)} key={movie.id} className="card movie_card">
<img src={movie.img_url} className="card-img-top" alt="..."/>
<div className="card-body">
<h3 className="card-title">{movie.title}</h3>
<h6 className="card-description">{movie.description}</h6>
</div>
</div>
))}
</div>
);
};

export default movieList;
22 changes: 22 additions & 0 deletions src/pages/movie/movieSingle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const movieSingle = (props) => {
const movie = props.movie;

const handleBackClick = () => {
props.onSetMovie(null);
};

return (
<div style={{ height: "100vh", width: "100vw" }}>
<div id="button-back">
<button onClick={() => handleBackClick()} class="btn btn-lg btn-dark"><span class="fa fa-back"></span> RETOUR</button>
</div>
<h1 className="text-center">{ movie.title }</h1>
<h1 className="text-center">{ movie.description }</h1>
<div class="video-wrapper">
<iframe src={ movie.stream_url } frameborder="0" width="90%" height="90%" align="center" ></iframe>
</div>
</div>
);
}

export default movieSingle;
57 changes: 57 additions & 0 deletions src/pages/movie/style.css
Original file line number Diff line number Diff line change
@@ -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;
}
Loading

0 comments on commit 2825681

Please sign in to comment.