diff --git a/src/layouts/Category.astro b/src/layouts/Category.astro deleted file mode 100644 index 8655310..0000000 --- a/src/layouts/Category.astro +++ /dev/null @@ -1,92 +0,0 @@ ---- -// Properties -const { - FetchData, - CategoryName, - CategoryDescription, - GradientHero -} = Astro.props - -// Use on top of Default Layout -import Base from '@layouts/Default.astro' -import Video from '@components/VideoItem.astro' - -// Configuration -import { - DEFAULT_MEDIA_DATA_PROXY, - DEFAULT_MEDIA_DATA_PROXY -} from '@utils/GetConfig' - - -// Fetch -const fetchFrom = DEFAULT_MEDIA_DATA_PROXY + '/api/v1/trending' + FetchData -const response = await fetch(fetchFrom) -const data = await response.json() - -const heroItem = data.slice(0,1) ---- - - -
-
-
-

{CategoryName}

-

{CategoryDescription}

-
-
- {heroItem.map((data) => - - )} -
-
-
- -
- {data.map((data) => -
- - - \ No newline at end of file diff --git a/src/pages/discover.astro b/src/pages/discover.astro new file mode 100644 index 0000000..9396f66 --- /dev/null +++ b/src/pages/discover.astro @@ -0,0 +1,72 @@ +--- +// Layout +import Base from "@layouts/Default.astro" + +// i18n +import { t, changeLanguage } from "i18next" + +// Configuration +import { DEFAULT_MEDIA_DATA_PROXY, DEFAULT_IMAGE_PROXY, DEFAULT_STREAM_DATA_PROXY } from '@utils/GetConfig' + +// Components +import Video from '@components/VideoItem.astro' +import Stream from "@components/search/Stream.astro" + +// Get URL Strings +const SearchQueryWithParameters = Astro.url.href.split("&?").shift() +const SearchQuery = SearchQueryWithParameters.split("discover?category=").pop() +if (Astro.url.href.includes('?platform=youtube')) {var SelectedPlatform = "YouTube"} +else if (Astro.url.href.includes('?platform=twitch')) {var SelectedPlatform = "Twitch"} +var FullCategoryName = SearchQuery.charAt(0).toUpperCase() + SearchQuery.slice(1) + + + +// Fetch +if (Astro.url.href.includes('?platform=youtube')) { + var PlatformYouTube = true + var YouTubeCategory = DEFAULT_MEDIA_DATA_PROXY + '/api/v1/trending?=' + SearchQuery + var YouTubeFetch = await fetch(YouTubeCategory) + var YouTubeData = await YouTubeFetch.json() +} +else if (Astro.url.href.includes('?platform=twitch')) { + var PlatformTwitch = true + var TwitchFetch = await fetch('https://twitch-backend.sudovanilla.org/api/discover/' + SearchQuery) + var TwitchData = await TwitchFetch.json() +} + +--- + + +

{FullCategoryName} on {SelectedPlatform}

+
+
+ {PlatformYouTube ? + YouTubeData.map((video) => +
+ \ No newline at end of file diff --git a/src/pages/discover/comedy.astro b/src/pages/discover/comedy.astro deleted file mode 100644 index 67b1da3..0000000 --- a/src/pages/discover/comedy.astro +++ /dev/null @@ -1,33 +0,0 @@ ---- -// Layout -import Base from "@layouts/Default.astro"; - -// Properties -const { FetchData, CategoryName, CategoryDescription } = Astro.props; - -// Components -import DiscoverChannel from '@components/DiscoverChannel.astro' - -// Configuration -import { DEFAULT_MEDIA_DATA_PROXY, DEFAULT_IMAGE_PROXY } from '@utils/GetConfig' - -// Discover Data -import DiscoverData from "../../data/discover.json"; - - ---- - - -
- {DiscoverData.Comedy.map((channel) => - - )} -
-
-
-

This is a curated list for all MinPluto users.

-

Is there a channel missing here that you think should be added? You can either edit our list here or you can submit a request.

-
- - - \ No newline at end of file diff --git a/src/pages/discover/gaming.astro b/src/pages/discover/gaming.astro deleted file mode 100644 index a95dc55..0000000 --- a/src/pages/discover/gaming.astro +++ /dev/null @@ -1,33 +0,0 @@ ---- -// Layout -import Base from "@layouts/Default.astro"; - -// Properties -const { FetchData, CategoryName, CategoryDescription } = Astro.props; - -// Components -import DiscoverChannel from '@components/DiscoverChannel.astro' - -// Configuration -import { DEFAULT_MEDIA_DATA_PROXY, DEFAULT_IMAGE_PROXY } from '@utils/GetConfig' - -// Discover Data -import DiscoverData from "../../data/discover.json"; - - ---- - - -
- {DiscoverData.Gamers.map((channel) => - - )} -
-
-
-

This is a curated list for all MinPluto users.

-

Is there a channel missing here that you think should be added? You can either edit our list here or you can submit a request.

-
- - - \ No newline at end of file diff --git a/src/pages/discover/tech.astro b/src/pages/discover/tech.astro deleted file mode 100644 index 4d2cf9e..0000000 --- a/src/pages/discover/tech.astro +++ /dev/null @@ -1,33 +0,0 @@ ---- -// Layout -import Base from "@layouts/Default.astro"; - -// Properties -const { FetchData, CategoryName, CategoryDescription } = Astro.props; - -// Components -import DiscoverChannel from '@components/DiscoverChannel.astro' - -// Configuration -import { DEFAULT_MEDIA_DATA_PROXY, DEFAULT_IMAGE_PROXY } from '@utils/GetConfig' - -// Discover Data -import DiscoverData from "../../data/discover.json"; - - ---- - - -
- {DiscoverData.Tech.map((channel) => - - )} -
-
-
-

This is a curated list for all MinPluto users.

-

Is there a channel missing here that you think should be added? You can either edit our list here or you can submit a request.

-
- - - \ No newline at end of file diff --git a/src/styles/index.scss b/src/styles/index.scss index 4689e33..dd2c605 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -6,7 +6,7 @@ body { top: 0px; right: 0px; margin: auto; - width: calc(100% - 204px); + width: calc(100% - 246px); } a {