mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
Polish flix page again, all we have to do is add endpoint redirects and posters!
This commit is contained in:
parent
36e247cf24
commit
b9a830a298
2 changed files with 37 additions and 37 deletions
|
@ -21,7 +21,7 @@ export function ThinContainer(props: ThinContainerProps) {
|
||||||
export function ThiccContainer(props: ThinContainerProps) {
|
export function ThiccContainer(props: ThinContainerProps) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`mx-auto w-[1250px] max-w-full px-8 sm:px-0 ${
|
className={`mx-auto w-[1000px] max-w-full sm:px-0 ${
|
||||||
props.classNames || ""
|
props.classNames || ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
|
|
|
@ -20,7 +20,7 @@ function Button(props: {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
className={classNames(
|
className={classNames(
|
||||||
"font-bold rounded h-10 w-40 scale-95 hover:scale-100 transition-all duration-200",
|
"font-bold rounded h-10 w-40 scale-90 hover:scale-95 transition-all duration-200",
|
||||||
props.className,
|
props.className,
|
||||||
)}
|
)}
|
||||||
type="button"
|
type="button"
|
||||||
|
@ -89,8 +89,8 @@ async function getTotalViews() {
|
||||||
const response = await fetch("https://backend.sudo-flix.lol/metrics");
|
const response = await fetch("https://backend.sudo-flix.lol/metrics");
|
||||||
const text = await response.text();
|
const text = await response.text();
|
||||||
|
|
||||||
// Regex to match the view counts of all shows/movies with success="true"
|
// Add up all mw_media_watch_count entries
|
||||||
const regex = /mw_media_watch_count{[^}]*,success="true"} (\d+)/g;
|
const regex = /mw_media_watch_count{[^}]*} (\d+)/g;
|
||||||
let totalViews = 0;
|
let totalViews = 0;
|
||||||
let match = regex.exec(text);
|
let match = regex.exec(text);
|
||||||
|
|
||||||
|
@ -158,21 +158,21 @@ export function TopFlix() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SubPageLayout>
|
<SubPageLayout>
|
||||||
<ThiccContainer classNames="px-4">
|
<ThiccContainer>
|
||||||
<Heading1>Top flix</Heading1>
|
<div className="mt-8 w-full px-8">
|
||||||
<Paragraph className="mb-18">
|
<Heading1>Top flix</Heading1>
|
||||||
The most popular movies on sudo-flix.lol, this data is fetched from
|
<Paragraph className="mb-18">
|
||||||
the current backend deployment.
|
The most popular movies on sudo-flix.lol, this data is fetched from
|
||||||
</Paragraph>
|
the current backend deployment.
|
||||||
<div className="mt-8 w-auto">
|
</Paragraph>
|
||||||
<div className="bg-buttons-secondary rounded-xl py-5 px-7 inline-block">
|
<div className="mt-8 w-auto">
|
||||||
<p className="font-bold bg-opacity-90 text-buttons-secondaryText">
|
<div className="bg-buttons-secondary rounded-xl scale-95 py-3 px-5 mb-2 inline-block">
|
||||||
Overall Views: {totalViews}
|
<p className="font-bold bg-opacity-90 text-buttons-secondaryText">
|
||||||
</p>
|
Overall Views: {totalViews}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="mt-8 w-full max-w-none">
|
|
||||||
<Divider marginClass="my-3" />
|
<Divider marginClass="my-3" />
|
||||||
{getItemsForCurrentPage().map((item) => {
|
{getItemsForCurrentPage().map((item) => {
|
||||||
const coverUrl = getMediaPoster(item.tmdbFullId);
|
const coverUrl = getMediaPoster(item.tmdbFullId);
|
||||||
|
@ -183,28 +183,28 @@ export function TopFlix() {
|
||||||
</ConfigValue>
|
</ConfigValue>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
<div
|
</div>
|
||||||
style={{ display: "flex", justifyContent: "space-between" }}
|
<div
|
||||||
className="mt-6"
|
style={{ display: "flex", justifyContent: "space-between" }}
|
||||||
|
className="mt-5 w-full px-8"
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
className="py-px box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"
|
||||||
|
onClick={() => setCurrentPage(currentPage - 1)}
|
||||||
|
disabled={currentPage === 1}
|
||||||
>
|
>
|
||||||
<Button
|
Previous page
|
||||||
className="py-px box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"
|
</Button>
|
||||||
onClick={() => setCurrentPage(currentPage - 1)}
|
<div style={{ display: "flex", alignItems: "center" }}>
|
||||||
disabled={currentPage === 1}
|
{currentPage} / {maxPageCount}
|
||||||
>
|
|
||||||
Previous page
|
|
||||||
</Button>
|
|
||||||
<div>
|
|
||||||
{currentPage} / {maxPageCount}
|
|
||||||
</div>
|
|
||||||
<Button
|
|
||||||
className="py-px box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"
|
|
||||||
onClick={() => setCurrentPage(currentPage + 1)}
|
|
||||||
disabled={currentPage === maxPageCount}
|
|
||||||
>
|
|
||||||
Next page
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
|
<Button
|
||||||
|
className="py-px box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"
|
||||||
|
onClick={() => setCurrentPage(currentPage + 1)}
|
||||||
|
disabled={currentPage === maxPageCount}
|
||||||
|
>
|
||||||
|
Next page
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</ThiccContainer>
|
</ThiccContainer>
|
||||||
</SubPageLayout>
|
</SubPageLayout>
|
||||||
|
|
Loading…
Reference in a new issue