Skip to content

Commit

Permalink
Favicons, github link, error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHawkinss committed Jul 13, 2021
1 parent a4125f4 commit 21a4f09
Show file tree
Hide file tree
Showing 16 changed files with 101 additions and 7 deletions.
Binary file added public/android-chrome-192x192.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 added public/android-chrome-512x512.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 added public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>
Binary file added public/favicon-16x16.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 added public/favicon-32x32.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 added public/favicon.ico
Binary file not shown.
12 changes: 9 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="because watching movies legally is boring"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />

<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#E880C5">
<meta name="msapplication-TileColor" content="#E880C5">
<meta name="theme-color" content="#E880C5">

<title>movie-web</title>
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
],
"start_url": ".",
"display": "standalone",
"theme_color": "#191c24",
"background_color": "#0c0e14"
"theme_color": "#E880C5",
"background_color": "#16171D"
}
Binary file added public/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions public/safari-pinned-tab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#E880C5",
"background_color": "#16171D",
"display": "standalone"
}
7 changes: 7 additions & 0 deletions src/components/VideoElement.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
.videoElement {
width: 100%;
background-color: #111117;
border-radius: 5px;
}

.videoElementText {
color: white;
margin: 0;
}
8 changes: 7 additions & 1 deletion src/components/VideoElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import './VideoElement.css'
// streamUrl: string
export function VideoElement({ streamUrl }) {
const videoRef = React.useRef(null);
const [error, setError] = React.useState(false);

React.useEffect(() => {
setError(false)
if (!videoRef || !videoRef.current) return;

const hls = new Hls();
Expand All @@ -15,13 +17,17 @@ export function VideoElement({ streamUrl }) {
videoRef.current.src = streamUrl;
return;
} else if (!Hls.isSupported()) {
return; // TODO show error
setError(true)
return;
}

hls.attachMedia(videoRef.current);
hls.loadSource(streamUrl);
}, [videoRef, streamUrl])

if (error)
return (<p className="videoElementText">Your browser is not supported</p>)

return (
<video className="videoElement" ref={videoRef} controls autoPlay />
)
Expand Down
27 changes: 26 additions & 1 deletion src/views/Search.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,29 @@

.cardView > div:first-child {
margin-top: 0;
}
}

.topRightCredits {
position: fixed;
right: 1rem;
top: 1rem;
margin-top: 0 !important;
}

.topRightCredits a, .topRightCredits a:visited {
color: #E880C5;
text-decoration: none;
margin: 0;
}
.topRightCredits a:hover, .topRightCredits a:active {
color: #f19fd6;
text-decoration: none;
}

.topRightCredits a .arrow {
transform: translateY(.1rem);
}

.topRightCredits a:hover .arrow {
transform: translateY(.1rem) translateX(.2rem);
}
4 changes: 4 additions & 0 deletions src/views/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { InputBox } from '../components/InputBox'
import { Title } from '../components/Title'
import { Card } from '../components/Card'
import { MovieRow } from '../components/MovieRow'
import { Arrow } from '../components/Arrow'
import { Progress } from '../components/Progress'
import { findMovie, getStreamUrl } from '../lib/lookMovie'
import { useMovie } from '../hooks/useMovie';
Expand Down Expand Up @@ -91,6 +92,9 @@ export function SearchView() {
}}/>
))}
</Card>
<div className="topRightCredits">
<a href="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/JamesHawkinss/movie-web" target="_blank" rel="noreferrer">Check it out on GitHub <Arrow/></a>
</div>
</div>
)
}

0 comments on commit 21a4f09

Please sign in to comment.