diff --git a/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountProfilePicture.cs b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountProfilePicture.cs index 8ca5569..06114ee 100644 --- a/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountProfilePicture.cs +++ b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountProfilePicture.cs @@ -2,20 +2,8 @@ namespace WatchIt.Common.Model.Accounts; -public abstract class AccountProfilePicture +public abstract class AccountProfilePicture : Picture { - #region PROPERTIES - - [JsonPropertyName("image")] - public required byte[] Image { get; set; } - - [JsonPropertyName("mime_type")] - public required string MimeType { get; set; } - - #endregion - - - #region CONSTRUCTORS [JsonConstructor] diff --git a/WatchIt.Common/WatchIt.Common.Model/Media/MediaRatingRequest.cs b/WatchIt.Common/WatchIt.Common.Model/Rating/RatingRequest.cs similarity index 74% rename from WatchIt.Common/WatchIt.Common.Model/Media/MediaRatingRequest.cs rename to WatchIt.Common/WatchIt.Common.Model/Rating/RatingRequest.cs index 6358b4a..54b7ac2 100644 --- a/WatchIt.Common/WatchIt.Common.Model/Media/MediaRatingRequest.cs +++ b/WatchIt.Common/WatchIt.Common.Model/Rating/RatingRequest.cs @@ -1,9 +1,9 @@ using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; -namespace WatchIt.Common.Model.Media; +namespace WatchIt.Common.Model.Rating; -public class MediaRatingRequest +public class RatingRequest { #region PROPERTIES @@ -17,7 +17,7 @@ public class MediaRatingRequest #region CONSTRUCTORS [SetsRequiredMembers] - public MediaRatingRequest(short rating) + public RatingRequest(short rating) { Rating = rating; } diff --git a/WatchIt.Common/WatchIt.Common.Model/Media/MediaRatingResponse.cs b/WatchIt.Common/WatchIt.Common.Model/Rating/RatingResponse.cs similarity index 74% rename from WatchIt.Common/WatchIt.Common.Model/Media/MediaRatingResponse.cs rename to WatchIt.Common/WatchIt.Common.Model/Rating/RatingResponse.cs index e51c9e9..b2b374c 100644 --- a/WatchIt.Common/WatchIt.Common.Model/Media/MediaRatingResponse.cs +++ b/WatchIt.Common/WatchIt.Common.Model/Rating/RatingResponse.cs @@ -1,9 +1,9 @@ using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; -namespace WatchIt.Common.Model.Media; +namespace WatchIt.Common.Model.Rating; -public class MediaRatingResponse +public class RatingResponse { #region PROPERTIES @@ -20,10 +20,10 @@ public class MediaRatingResponse #region CONSTRUCTORS [JsonConstructor] - public MediaRatingResponse() {} + public RatingResponse() {} [SetsRequiredMembers] - public MediaRatingResponse(double ratingAverage, long ratingCount) + public RatingResponse(double ratingAverage, long ratingCount) { RatingAverage = ratingAverage; RatingCount = ratingCount; diff --git a/WatchIt.Common/WatchIt.Common.Query/QueryParameters.cs b/WatchIt.Common/WatchIt.Common.Query/QueryParameters.cs index 685da26..7934cdc 100644 --- a/WatchIt.Common/WatchIt.Common.Query/QueryParameters.cs +++ b/WatchIt.Common/WatchIt.Common.Query/QueryParameters.cs @@ -66,7 +66,7 @@ public abstract class QueryParameters ( !string.IsNullOrEmpty(property) && - new Regex(regexQuery).IsMatch(property) + Regex.IsMatch(property, regexQuery, RegexOptions.IgnoreCase) ) ); diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Controllers/MediaController.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Controllers/MediaController.cs index e2cbce7..0a095e1 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Controllers/MediaController.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Controllers/MediaController.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Mvc; using WatchIt.Common.Model.Genres; using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Photos; +using WatchIt.Common.Model.Rating; using WatchIt.WebAPI.Services.Controllers.Media; namespace WatchIt.WebAPI.Controllers; @@ -74,7 +75,7 @@ public class MediaController : ControllerBase [HttpGet("{id}/rating")] [AllowAnonymous] - [ProducesResponseType(typeof(MediaRatingResponse), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(RatingResponse), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] public async Task GetMediaRating([FromRoute] long id) => await _mediaControllerService.GetMediaRating(id); @@ -90,7 +91,7 @@ public class MediaController : ControllerBase [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status404NotFound)] - public async Task PutMediaRating([FromRoute] long id, [FromBody] MediaRatingRequest data) => await _mediaControllerService.PutMediaRating(id, data); + public async Task PutMediaRating([FromRoute] long id, [FromBody] RatingRequest data) => await _mediaControllerService.PutMediaRating(id, data); [HttpDelete("{id}/rating")] [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Media/IMediaControllerService.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Media/IMediaControllerService.cs index df8c5c4..a93a938 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Media/IMediaControllerService.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Media/IMediaControllerService.cs @@ -1,5 +1,6 @@ using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Photos; +using WatchIt.Common.Model.Rating; using WatchIt.WebAPI.Services.Controllers.Common; namespace WatchIt.WebAPI.Services.Controllers.Media; @@ -14,7 +15,7 @@ public interface IMediaControllerService Task GetMediaRating(long mediaId); Task GetMediaRatingByUser(long mediaId, long userId); - Task PutMediaRating(long mediaId, MediaRatingRequest data); + Task PutMediaRating(long mediaId, RatingRequest data); Task DeleteMediaRating(long mediaId); Task PostMediaView(long mediaId); diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Media/MediaControllerService.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Media/MediaControllerService.cs index 50ee996..454cd97 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Media/MediaControllerService.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Media/MediaControllerService.cs @@ -3,6 +3,7 @@ using SimpleToolkit.Extensions; using WatchIt.Common.Model.Genres; using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Photos; +using WatchIt.Common.Model.Rating; using WatchIt.Database; using WatchIt.Database.Model.Media; using WatchIt.Database.Model.Rating; @@ -109,7 +110,7 @@ public class MediaControllerService(DatabaseContext database, IUserService userS double ratingAverage = item.RatingMedia.Any() ? item.RatingMedia.Average(x => x.Rating) : 0; long ratingCount = item.RatingMedia.Count(); - MediaRatingResponse ratingResponse = new MediaRatingResponse(ratingAverage, ratingCount); + RatingResponse ratingResponse = new RatingResponse(ratingAverage, ratingCount); return RequestResult.Ok(ratingResponse); } @@ -131,7 +132,7 @@ public class MediaControllerService(DatabaseContext database, IUserService userS return RequestResult.Ok(rating.Value); } - public async Task PutMediaRating(long mediaId, MediaRatingRequest data) + public async Task PutMediaRating(long mediaId, RatingRequest data) { short ratingValue = data.Rating; if (ratingValue < 1 || ratingValue > 10) diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Movies/MoviesControllerService.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Movies/MoviesControllerService.cs index 50256b0..f94ce06 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Movies/MoviesControllerService.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Movies/MoviesControllerService.cs @@ -38,7 +38,8 @@ public class MoviesControllerService : IMoviesControllerService public async Task GetAllMovies(MovieQueryParameters query) { - IEnumerable data = await _database.MediaMovies.Select(x => new MovieResponse(x)).ToListAsync(); + IEnumerable rawData = await _database.MediaMovies.ToListAsync(); + IEnumerable data = rawData.Select(x => new MovieResponse(x)); data = query.PrepareData(data); return RequestResult.Ok(data); } diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Series/SeriesControllerService.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Series/SeriesControllerService.cs index 79527ad..15cee28 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Series/SeriesControllerService.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Series/SeriesControllerService.cs @@ -38,7 +38,8 @@ public class SeriesControllerService : ISeriesControllerService public async Task GetAllSeries(SeriesQueryParameters query) { - IEnumerable data = await _database.MediaSeries.Select(x => new SeriesResponse(x)).ToListAsync(); + IEnumerable rawData = await _database.MediaSeries.ToListAsync(); + IEnumerable data = rawData.Select(x => new SeriesResponse(x)); data = query.PrepareData(data); return RequestResult.Ok(data); } diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/IMediaWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/IMediaWebAPIService.cs index 4eae4f4..9e5c9b4 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/IMediaWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/IMediaWebAPIService.cs @@ -1,6 +1,7 @@ using WatchIt.Common.Model.Genres; using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Photos; +using WatchIt.Common.Model.Rating; namespace WatchIt.Website.Services.WebAPI.Media; @@ -12,9 +13,9 @@ public interface IMediaWebAPIService Task PostMediaGenre(long mediaId, long genreId, Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null, Action? notFoundAction = null); Task DeleteMediaGenre(long mediaId, long genreId, Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null, Action? notFoundAction = null); - Task GetMediaRating(long mediaId, Action? successAction = null, Action? notFoundAction = null); + Task GetMediaRating(long mediaId, Action? successAction = null, Action? notFoundAction = null); Task GetMediaRatingByUser(long mediaId, long userId, Action? successAction = null, Action? notFoundAction = null); - Task PutMediaRating(long mediaId, MediaRatingRequest body, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null, Action? notFoundAction = null); + Task PutMediaRating(long mediaId, RatingRequest body, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null, Action? notFoundAction = null); Task DeleteMediaRating(long mediaId, Action? successAction = null, Action? unauthorizedAction = null); Task PostMediaView(long mediaId, Action? successAction = null, Action? notFoundAction = null); diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/MediaWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/MediaWebAPIService.cs index 47bec77..f95ae52 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/MediaWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/MediaWebAPIService.cs @@ -1,6 +1,7 @@ using WatchIt.Common.Model.Genres; using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Photos; +using WatchIt.Common.Model.Rating; using WatchIt.Common.Services.HttpClient; using WatchIt.Website.Services.Utility.Configuration; using WatchIt.Website.Services.Utility.Configuration.Model; @@ -93,7 +94,7 @@ public class MediaWebAPIService : BaseWebAPIService, IMediaWebAPIService #region Rating - public async Task GetMediaRating(long mediaId, Action? successAction = null, Action? notFoundAction = null) + public async Task GetMediaRating(long mediaId, Action? successAction = null, Action? notFoundAction = null) { string url = GetUrl(EndpointsConfiguration.Media.GetMediaRating, mediaId); @@ -117,7 +118,7 @@ public class MediaWebAPIService : BaseWebAPIService, IMediaWebAPIService .ExecuteAction(); } - public async Task PutMediaRating(long mediaId, MediaRatingRequest body, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null, Action? notFoundAction = null) + public async Task PutMediaRating(long mediaId, RatingRequest body, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null, Action? notFoundAction = null) { string url = GetUrl(EndpointsConfiguration.Media.PutMediaRating, mediaId); diff --git a/WatchIt.Website/WatchIt.Website/App.razor b/WatchIt.Website/WatchIt.Website/App.razor index b7ea5bd..35cf53c 100644 --- a/WatchIt.Website/WatchIt.Website/App.razor +++ b/WatchIt.Website/WatchIt.Website/App.razor @@ -9,12 +9,18 @@ - - + + + + + + + + diff --git a/WatchIt.Website/WatchIt.Website/Components/ErrorComponent.razor b/WatchIt.Website/WatchIt.Website/Components/ErrorComponent.razor index 6f1c699..bc34f73 100644 --- a/WatchIt.Website/WatchIt.Website/Components/ErrorComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/ErrorComponent.razor @@ -1,32 +1,28 @@ -
-
-
-
-
-
-
-
⚠︎
-
-
+
+
+
+
+
+
⚠︎
-
-
-
-

An error occured while loading a page

-
-
-
- @if (!string.IsNullOrWhiteSpace(ErrorMessage)) - { -
-
-
-

@ErrorMessage

-
-
-
- }
+
+
+
+

An error occured while loading a page

+
+
+
+ @if (!string.IsNullOrWhiteSpace(ErrorMessage)) + { +
+
+
+

@ErrorMessage

+
+
+
+ }
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/ListItemComponent.razor b/WatchIt.Website/WatchIt.Website/Components/ListItemComponent.razor new file mode 100644 index 0000000..cb879cc --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/ListItemComponent.razor @@ -0,0 +1,26 @@ +
+
+
+ picture +
+
+
+
+ + @(Name)@(string.IsNullOrWhiteSpace(AdditionalNameInfo) ? string.Empty : AdditionalNameInfo) + +
+
+ +
+ @(_rating is not null && _rating.RatingCount > 0 ? _rating.RatingAverage : "--")/10 + @if (_rating is not null && _rating.RatingCount > 0) + { + @(_rating.RatingCount) + } +
+
+
+
+
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/ListItemComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/ListItemComponent.razor.cs new file mode 100644 index 0000000..3b72748 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/ListItemComponent.razor.cs @@ -0,0 +1,56 @@ +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model; +using WatchIt.Common.Model.Rating; + +namespace WatchIt.Website.Components; + +public partial class ListItemComponent : ComponentBase +{ + #region PARAMETERS + + [Parameter] public required long Id { get; set; } + [Parameter] public required string Name { get; set; } + [Parameter] public string? AdditionalNameInfo { get; set; } + [Parameter] public required Func, Task> PictureDownloadingTask { get; set; } + [Parameter] public required Func, Task> RatingDownloadingTask { get; set; } + [Parameter] public int PictureHeight { get; set; } = 150; + + #endregion + + + + #region FIELDS + + private bool _loaded; + + private Picture? _picture; + private RatingResponse? _rating; + + #endregion + + + + #region PRIVATE METHODS + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + List endTasks = new List(); + + // STEP 0 + endTasks.AddRange( + [ + PictureDownloadingTask(Id, picture => _picture = picture), + RatingDownloadingTask(Id, rating => _rating = rating) + ]); + + await Task.WhenAll(endTasks); + + _loaded = true; + StateHasChanged(); + } + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/ListItemComponent.razor.css b/WatchIt.Website/WatchIt.Website/Components/ListItemComponent.razor.css new file mode 100644 index 0000000..91b920c --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/ListItemComponent.razor.css @@ -0,0 +1,17 @@ +/* IDS */ + +#nameText { + font-size: 25px; +} + +#ratingStar { + font-size: 30px; +} + +#ratingValue { + font-size: 20px; +} + +#ratingCount { + font-size: 10px; +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/LoadingComponent.razor b/WatchIt.Website/WatchIt.Website/Components/LoadingComponent.razor index ea3d99a..4803ba5 100644 --- a/WatchIt.Website/WatchIt.Website/Components/LoadingComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/LoadingComponent.razor @@ -1,12 +1,8 @@ -
-
-
-
-
-
-
-

Loading...

-
-
+
+
+
+
+
+

Loading...

\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/LoadingComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/LoadingComponent.razor.cs new file mode 100644 index 0000000..2ab6e66 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/LoadingComponent.razor.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Components; + +namespace WatchIt.Website.Components; + +public partial class LoadingComponent : ComponentBase +{ + #region PARAMETERS + + [Parameter] public string Color { get; set; } = "dark"; + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/SearchPage/SearchResultComponent.razor b/WatchIt.Website/WatchIt.Website/Components/SearchPage/SearchResultComponent.razor new file mode 100644 index 0000000..4903e4d --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/SearchPage/SearchResultComponent.razor @@ -0,0 +1,82 @@ +@using Microsoft.IdentityModel.Tokens + +@typeparam TItem +@typeparam TQuery where TQuery : WatchIt.Common.Query.QueryParameters + + + +
+
+
+
+

@(Title)

+
+
+ @if (_loaded) + { + if (!_items.IsNullOrEmpty()) + { + for (int i = 0; i < _items.Count; i++) + { + if (i > 0) + { +
+
+
+
+
+ } +
+
+ + + +
+
+ } + if (!_allItemsLoaded) + { +
+
+
+ +
+
+
+ } + } + else + { +
+
+
+ No items found +
+
+
+ } + } + else + { +
+
+ +
+
+ } +
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/SearchPage/SearchResultComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/SearchPage/SearchResultComponent.razor.cs new file mode 100644 index 0000000..d115cac --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/SearchPage/SearchResultComponent.razor.cs @@ -0,0 +1,93 @@ +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model; +using WatchIt.Common.Model.Rating; +using WatchIt.Common.Query; + +namespace WatchIt.Website.Components.SearchPage; + +public partial class SearchResultComponent : ComponentBase where TQuery : QueryParameters +{ + #region PARAMETERS + + [Parameter] public required string Title { get; set; } + [Parameter] public required TQuery Query { get; set; } + [Parameter] public required Func IdSource { get; set; } + [Parameter] public required Func NameSource { get; set; } + [Parameter] public Func AdditionalNameInfoSource { get; set; } = _ => null; + [Parameter] public required string UrlIdTemplate { get; set; } + [Parameter] public required Func>, Task> ItemDownloadingTask { get; set; } + [Parameter] public required Func, Task> PictureDownloadingTask { get; set; } + [Parameter] public required Func, Task> RatingDownloadingTask { get; set; } + + #endregion + + + + #region FIELDS + + private bool _loaded; + + private List _items = []; + private bool _allItemsLoaded; + private bool _itemsLoading; + + #endregion + + + + #region PRIVATE METHODS + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + // INIT + Query.First = 5; + + List endTasks = new List(); + + // STEP 0 + endTasks.AddRange( + [ + ItemDownloadingTask(Query, data => + { + _items.AddRange(data); + if (data.Count() < 5) + { + _allItemsLoaded = true; + } + else + { + Query.After = 5; + } + }) + ]); + + // END + await Task.WhenAll(endTasks); + + _loaded = true; + StateHasChanged(); + } + } + + private async Task DownloadItems() + { + _itemsLoading = true; + await ItemDownloadingTask(Query, data => + { + _items.AddRange(data); + if (data.Count() < 5) + { + _allItemsLoaded = true; + } + else + { + Query.After += 5; + } + _itemsLoading = false; + }); + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/SearchPage/SearchResultComponent.razor.css b/WatchIt.Website/WatchIt.Website/Components/SearchPage/SearchResultComponent.razor.css new file mode 100644 index 0000000..e69de29 diff --git a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor index 338cb2f..7473c33 100644 --- a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor +++ b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor @@ -1,178 +1,97 @@ @using WatchIt.Common.Model.Photos @using WatchIt.Website.Services.WebAPI.Photos + @inherits LayoutComponentBase -@if (_loaded) -{ -
-
- -
-

Menu

-
-
-
- @if (_user is null) - { - Sign in - } - else - { - - - -} - - - -@code -{ - #region SERVICES - - [Inject] public ILogger Logger { get; set; } = default!; - [Inject] public NavigationManager NavigationManager { get; set; } = default!; - [Inject] public ITokensService TokensService { get; set; } = default!; - [Inject] public IAuthenticationService AuthenticationService { get; set; } = default!; - [Inject] public IAccountsWebAPIService AccountsWebAPIService { get; set; } = default!; - [Inject] public IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] public IPhotosWebAPIService PhotosWebAPIService { get; set; } = default!; - - #endregion - - - - #region FIELDS - - private bool _loaded = false; - - private string _background = "assets/background_temp.jpg"; - private string _firstGradientColor = "#c6721c"; - private string _secondGradientColor = "#85200c"; - - private User? _user = null; - private string _userProfilePicture = "assets/user_placeholder.png"; - private bool _userMenuIsActive = false; - - #endregion - - - - #region METHODS - - protected override async Task OnAfterRenderAsync(bool firstRender) - { - if (firstRender) - { - List bgTasks = new List(); - - bgTasks.Add(GetBackground()); - - await GetAuthenticatedUser(); - - if (_user is not null) - { - bgTasks.Add(GetProfilePicture()); + } - - private async Task GetProfilePicture() - { - Action successAction = (data) => - { - string imageBase64 = Convert.ToBase64String(data.Image); - _userProfilePicture = $"data:{data.MimeType};base64,{imageBase64}"; - }; - await AccountsWebAPIService.GetAccountProfilePicture(_user.Id, successAction); - } - - private async Task UserMenuLogOut() - { - await AuthenticationService.LogoutAsync(); - await TokensService.RemoveAuthenticationData(); - NavigationManager.Refresh(true); - } - - #endregion -} \ No newline at end of file + \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs new file mode 100644 index 0000000..db6a271 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs @@ -0,0 +1,140 @@ +using System.Net; +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model.Accounts; +using WatchIt.Common.Model.Photos; +using WatchIt.Website.Services.Utility.Authentication; +using WatchIt.Website.Services.Utility.Tokens; +using WatchIt.Website.Services.WebAPI.Accounts; +using WatchIt.Website.Services.WebAPI.Media; +using WatchIt.Website.Services.WebAPI.Photos; + +namespace WatchIt.Website.Layout; + +public partial class MainLayout : LayoutComponentBase +{ + #region SERVICES + + [Inject] public ILogger Logger { get; set; } = default!; + [Inject] public NavigationManager NavigationManager { get; set; } = default!; + [Inject] public ITokensService TokensService { get; set; } = default!; + [Inject] public IAuthenticationService AuthenticationService { get; set; } = default!; + [Inject] public IAccountsWebAPIService AccountsWebAPIService { get; set; } = default!; + [Inject] public IMediaWebAPIService MediaWebAPIService { get; set; } = default!; + [Inject] public IPhotosWebAPIService PhotosWebAPIService { get; set; } = default!; + + #endregion + + + + #region FIELDS + + private bool _loaded; + + private User? _user; + private PhotoResponse? _defaultBackgroundPhoto; + private AccountProfilePictureResponse? _userProfilePicture; + + private bool _searchbarVisible; + private string _searchbarText = string.Empty; + + #endregion + + + + #region PROPERTIES + + private PhotoResponse? _backgroundPhoto; + public PhotoResponse? BackgroundPhoto + { + get => _backgroundPhoto; + set + { + _backgroundPhoto = value; + StateHasChanged(); + } + } + + #endregion + + + + #region PRIVATE METHODS + + #region Main + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + List endTasks = new List(); + List step1Tasks = new List(); + + // STEP 0 + step1Tasks.AddRange( + [ + Task.Run(async () => _user = await AuthenticationService.GetUserAsync()) + ]); + endTasks.AddRange( + [ + PhotosWebAPIService.GetPhotoRandomBackground(data => _defaultBackgroundPhoto = data) + ]); + + // STEP 1 + await Task.WhenAll(step1Tasks); + if (_user is not null) + { + endTasks.AddRange( + [ + AccountsWebAPIService.GetAccountProfilePicture(_user.Id, data => _userProfilePicture = data) + ]); + } + + // END + await Task.WhenAll(endTasks); + + _loaded = true; + StateHasChanged(); + } + } + + private PhotoResponse? GetBackgroundPhoto() + { + if (BackgroundPhoto?.Background is not null) + { + return BackgroundPhoto; + } + else if (_defaultBackgroundPhoto?.Background is not null) + { + return _defaultBackgroundPhoto; + } + return null; + } + + #endregion + + #region Search + + private void SearchStart() + { + if (!string.IsNullOrWhiteSpace(_searchbarText)) + { + string query = WebUtility.UrlEncode(_searchbarText); + NavigationManager.NavigateTo($"/search/{query}"); + } + } + + #endregion + + #region User menu + + private async Task UserMenuLogOut() + { + await AuthenticationService.LogoutAsync(); + await TokensService.RemoveAuthenticationData(); + NavigationManager.Refresh(true); + } + + #endregion + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.css b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.css index 350d80d..9a467a1 100644 --- a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.css +++ b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.css @@ -1,21 +1,18 @@ -body { - background-size: cover; -} - -.logo { - font-size: 40px; -} - -.header { - position: sticky; - top: 10px; - height: 60px; -} - -.body-content { - padding-top: 100px; -} +/* TAGS */ h1 { margin: 0; +} + + + +/* IDS */ + +#logo { + font-size: 40px; +} + +#searchbarCancel { + cursor: pointer; + color: #6c757d; } \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor b/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor index fed8def..c13c42f 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor +++ b/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor @@ -2,7 +2,7 @@ WatchIt administrator panel -
+
@if (_loaded) { if (_authenticated) @@ -26,11 +26,21 @@ } else { - +
+
+ +
+
} } else { - +
+
+
+ +
+
+
}
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.cs index 2a9306a..3817611 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.cs @@ -1,15 +1,24 @@ using Microsoft.AspNetCore.Components; +using WatchIt.Website.Layout; using WatchIt.Website.Services.Utility.Authentication; namespace WatchIt.Website.Pages; public partial class AdminPage { - #region SERVICE + #region SERVICES [Inject] public IAuthenticationService AuthenticationService { get; set; } = default!; #endregion + + + + #region PARAMETERS + + [CascadingParameter] public MainLayout Layout { get; set; } + + #endregion @@ -28,6 +37,8 @@ public partial class AdminPage { if (firstRender) { + Layout.BackgroundPhoto = null; + User? user = await AuthenticationService.GetUserAsync(); if (user is not null && user.IsAdmin) { diff --git a/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor b/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor index 2d99b94..1766091 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor +++ b/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor @@ -1,9 +1,8 @@ @page "/" -@using WatchIt.Common.Model.Movies WatchIt -
+
@if (_loaded) { if (string.IsNullOrWhiteSpace(_error)) @@ -11,7 +10,7 @@
-
+

Top 5 movies this week by popularity

@@ -26,7 +25,7 @@
poster -
+
@(i + 1)
@@ -49,7 +48,7 @@
-
+

Top 5 TV series this week by popularity

@@ -64,7 +63,7 @@
poster -
+
@(i + 1)
@@ -87,11 +86,21 @@ } else { - +
+
+ +
+
} } else { - +
+
+
+ +
+
+
}
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor.cs index 706a9c6..5f528db 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor.cs @@ -2,6 +2,7 @@ using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Movies; using WatchIt.Common.Model.Series; +using WatchIt.Website.Layout; using WatchIt.Website.Services.WebAPI.Media; using WatchIt.Website.Services.WebAPI.Movies; using WatchIt.Website.Services.WebAPI.Series; @@ -21,6 +22,14 @@ public partial class HomePage + #region PARAMETERS + + [CascadingParameter] public MainLayout Layout { get; set; } + + #endregion + + + #region FIELDS private bool _loaded; @@ -39,6 +48,8 @@ public partial class HomePage { if (firstRender) { + Layout.BackgroundPhoto = null; + List step1Tasks = new List(); List endTasks = new List(); diff --git a/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor b/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor index 616d826..461dfcc 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor +++ b/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor @@ -40,7 +40,7 @@ } -
+
@if (_loaded) { if (string.IsNullOrWhiteSpace(_error)) @@ -57,7 +57,7 @@
-
+
poster @@ -77,12 +77,12 @@
@@ -96,12 +96,12 @@
@@ -115,7 +115,7 @@
-
+
@@ -183,12 +183,12 @@
@@ -202,7 +202,7 @@
-
+
@@ -226,12 +226,12 @@ @@ -248,7 +248,7 @@
@foreach (PhotoResponse photo in _photos) { -
+
photo @@ -301,10 +301,10 @@ } else { -
+
-
+
edit_photo @@ -321,7 +321,7 @@
-
+
@@ -362,31 +362,30 @@ } else { - +
+
+ +
+
} } else { - +
+
+ +
+
} } else { - +
+
+
+ +
+
+
} -
- - - -@if (_background is not null) -{ - -} \ No newline at end of file +
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor.cs index 780d580..e034282 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor.cs @@ -5,6 +5,7 @@ using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Movies; using WatchIt.Common.Model.Photos; using WatchIt.Common.Model.Series; +using WatchIt.Website.Layout; using WatchIt.Website.Services.Utility.Authentication; using WatchIt.Website.Services.WebAPI.Media; using WatchIt.Website.Services.WebAPI.Movies; @@ -33,6 +34,8 @@ public partial class MediaEditPage : ComponentBase [Parameter] public long? Id { get; set; } [Parameter] public string? Type { get; set; } + [CascadingParameter] public MainLayout Layout { get; set; } + #endregion @@ -43,8 +46,6 @@ public partial class MediaEditPage : ComponentBase private string? _error; private User? _user; - - private PhotoResponse? _background; private MediaResponse? _media; private MovieRequest? _movieRequest; @@ -86,6 +87,8 @@ public partial class MediaEditPage : ComponentBase { if (firstRender) { + Layout.BackgroundPhoto = null; + List step1Tasks = new List(); List step2Tasks = new List(); List endTasks = new List(); @@ -112,7 +115,7 @@ public partial class MediaEditPage : ComponentBase { endTasks.AddRange( [ - MediaWebAPIService.GetMediaPhotoRandomBackground(Id.Value, data => _background = data), + MediaWebAPIService.GetMediaPhotoRandomBackground(Id.Value, data => Layout.BackgroundPhoto = data), MediaWebAPIService.GetMediaPoster(Id.Value, data => { _mediaPosterSaved = data; diff --git a/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor b/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor index a59a95f..ef9ff93 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor +++ b/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor @@ -24,7 +24,7 @@ else -
+
@if (_loaded) { if (string.IsNullOrWhiteSpace(_error)) @@ -35,7 +35,7 @@ else
-
+

@@ -60,7 +60,7 @@ else
-
+
@@ -133,7 +133,7 @@ else
-
+

@@ -193,26 +193,21 @@ else } else { - +
+
+ +
+
} } else { - +
+
+
+ +
+
+
} -

- - - -@if (_background is not null) -{ - -} \ No newline at end of file +
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor.cs index 0df1dc3..fb48fd0 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor.cs @@ -4,7 +4,9 @@ using WatchIt.Common.Model.Genres; using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Movies; using WatchIt.Common.Model.Photos; +using WatchIt.Common.Model.Rating; using WatchIt.Common.Model.Series; +using WatchIt.Website.Layout; using WatchIt.Website.Services.Utility.Authentication; using WatchIt.Website.Services.WebAPI.Media; using WatchIt.Website.Services.WebAPI.Movies; @@ -30,6 +32,8 @@ public partial class MediaPage : ComponentBase [Parameter] public long Id { get; set; } + [CascadingParameter] public MainLayout Layout { get; set; } + #endregion @@ -43,10 +47,9 @@ public partial class MediaPage : ComponentBase private User? _user; - private PhotoResponse? _background; private MediaPosterResponse? _poster; private IEnumerable _genres; - private MediaRatingResponse _globalRating; + private RatingResponse _globalRating; private MovieResponse? _movie; private SeriesResponse? _series; @@ -62,6 +65,8 @@ public partial class MediaPage : ComponentBase { if (firstRender) { + Layout.BackgroundPhoto = null; + List step1Tasks = new List(); List step2Tasks = new List(); List endTasks = new List(); @@ -84,7 +89,7 @@ public partial class MediaPage : ComponentBase endTasks.AddRange( [ MediaWebAPIService.PostMediaView(Id), - MediaWebAPIService.GetMediaPhotoRandomBackground(Id, data => _background = data), + MediaWebAPIService.GetMediaPhotoRandomBackground(Id, data => Layout.BackgroundPhoto = data), MediaWebAPIService.GetMediaPoster(Id, data => _poster = data), MediaWebAPIService.GetMediaGenres(Id, data => _genres = data), MediaWebAPIService.GetMediaRating(Id, data => _globalRating = data), @@ -119,7 +124,7 @@ public partial class MediaPage : ComponentBase } else { - await MediaWebAPIService.PutMediaRating(Id, new MediaRatingRequest(rating)); + await MediaWebAPIService.PutMediaRating(Id, new RatingRequest(rating)); _userRating = rating; } await MediaWebAPIService.GetMediaRating(Id, data => _globalRating = data); diff --git a/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor b/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor new file mode 100644 index 0000000..48e98dc --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor @@ -0,0 +1,79 @@ +@using WatchIt.Common.Model.Movies +@using WatchIt.Common.Model.Series +@using WatchIt.Common.Query +@using WatchIt.Website.Components.SearchPage +@using WatchIt.Website.Services.WebAPI.Movies + +@layout MainLayout + +@page "/search/{query}" + +WatchIt - Searching "@(Query)" + + + +
+ @if (_loaded) + { + if (string.IsNullOrWhiteSpace(_error)) + { +
+
+
+
+

+ Search results for phrase: "@(DecodedQuery)" +

+
+
+
+
+
+
+ +
+
+
+
+ +
+
+ } + else + { +
+
+ +
+
+ } + } + else + { +
+
+ +
+
+ } +
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor.cs new file mode 100644 index 0000000..0e926d6 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor.cs @@ -0,0 +1,61 @@ +using System.Net; +using Microsoft.AspNetCore.Components; +using WatchIt.Website.Layout; +using WatchIt.Website.Services.WebAPI.Media; +using WatchIt.Website.Services.WebAPI.Movies; +using WatchIt.Website.Services.WebAPI.Series; + +namespace WatchIt.Website.Pages; + +public partial class SearchPage : ComponentBase +{ + #region SERVICES + + [Inject] private IMoviesWebAPIService MoviesWebAPIService { get; set; } = default!; + [Inject] private ISeriesWebAPIService SeriesWebAPIService { get; set; } = default!; + [Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!; + + #endregion + + + + #region FIELDS + + private bool _loaded; + private string? _error; + + #endregion + + + + #region PARAMETERS + + [Parameter] public string Query { get; set; } + + [CascadingParameter] public MainLayout Layout { get; set; } + + #endregion + + + + #region PROPERTIES + + public string DecodedQuery => WebUtility.UrlDecode(Query); + + #endregion + + + + #region PRIVATE METHODS + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + _loaded = true; + StateHasChanged(); + } + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor.css b/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor.css new file mode 100644 index 0000000..e69de29 diff --git a/WatchIt.Website/WatchIt.Website/Program.cs b/WatchIt.Website/WatchIt.Website/Program.cs index ee79676..283995a 100644 --- a/WatchIt.Website/WatchIt.Website/Program.cs +++ b/WatchIt.Website/WatchIt.Website/Program.cs @@ -1,5 +1,8 @@ using System.Text.Json; using System.Text.Json.Serialization; +using Blazorise; +using Blazorise.Bootstrap5; +using Blazorise.Icons.FontAwesome; using Microsoft.AspNetCore.Components.Authorization; using WatchIt.Common.Services.HttpClient; using WatchIt.Website.Services.Utility.Authentication; @@ -53,6 +56,12 @@ public static class Program private static WebApplicationBuilder SetupServices(this WebApplicationBuilder builder) { builder.Services.AddSingleton(); + builder.Services.AddBlazorise(options => + { + options.Immediate = true; + }) + .AddBootstrap5Providers() + .AddFontAwesomeIcons(); // Utility builder.Services.AddSingleton(); diff --git a/WatchIt.Website/WatchIt.Website/WatchIt.Website.csproj b/WatchIt.Website/WatchIt.Website/WatchIt.Website.csproj index 0722800..3ba0027 100644 --- a/WatchIt.Website/WatchIt.Website/WatchIt.Website.csproj +++ b/WatchIt.Website/WatchIt.Website/WatchIt.Website.csproj @@ -35,10 +35,16 @@ <_ContentIncludedByDefault Remove="Components\Pages\Weather.razor" /> <_ContentIncludedByDefault Remove="wwwroot\bootstrap\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\bootstrap\bootstrap.min.css.map" /> + <_ContentIncludedByDefault Remove="wwwroot\scripts\popper.min.js" /> + + + + + diff --git a/WatchIt.Website/WatchIt.Website/_Imports.razor b/WatchIt.Website/WatchIt.Website/_Imports.razor index 7376a6e..b8693f8 100644 --- a/WatchIt.Website/WatchIt.Website/_Imports.razor +++ b/WatchIt.Website/WatchIt.Website/_Imports.razor @@ -14,4 +14,5 @@ @using WatchIt.Website.Services.Utility.Tokens @using WatchIt.Website.Services.Utility.Authentication @using WatchIt.Website.Services.WebAPI.Accounts -@using WatchIt.Website.Services.WebAPI.Media \ No newline at end of file +@using WatchIt.Website.Services.WebAPI.Media +@using Blazorise \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/wwwroot/assets/icons/cancel.png b/WatchIt.Website/WatchIt.Website/wwwroot/assets/icons/cancel.png new file mode 100644 index 0000000..68a9cba Binary files /dev/null and b/WatchIt.Website/WatchIt.Website/wwwroot/assets/icons/cancel.png differ diff --git a/WatchIt.Website/WatchIt.Website/wwwroot/css/general.css b/WatchIt.Website/WatchIt.Website/wwwroot/css/general.css new file mode 100644 index 0000000..443ec27 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/wwwroot/css/general.css @@ -0,0 +1,99 @@ +/* TAGS */ + +html { + height: 100%; +} + +body { + background-position: center; + background-repeat: no-repeat; + background-size: cover; + background-attachment: fixed; + + height: 100%; +} + +body, html { + background-color: transparent; + + + height: 100%; + margin: 0; + padding: 0; + + color: lightgray; + font-family: "PT Sans"; +} + +/* CLASSES */ + +.container-grid { + padding: 0 !important; + margin: 0 !important; + --bs-gutter-x: 1.5rem; + --bs-gutter-y: 0; + width: 100%; +} + +.logo { + font-family: "Belanosima"; + text-decoration: none; + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; +} + + + + + +.top-3 { + top: 1rem !important; +} + +.mb-2rem { + margin-bottom: 2rem !important; +} + + + + + +.mt-9 { + margin-top: 9rem !important; +} + +.panel-header { + background-color: rgba(0, 0, 0, 0.8); +} + +.panel-regular { + background-color: rgba(0, 0, 0, 0.6); +} + +.panel-yellow { + background-color: rgba(255, 184, 58, 0.6); +} + +.panel { + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); + backdrop-filter: blur(25px); +} + + + +.dropdown-menu-left { + right: auto; + left: 0; +} + +.btn-stretch-x { + width: 100%; +} + +.w-100 { + width: 100%; +} + +.picture-aspect-ratio { + aspect-ratio: 3/5; +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/wwwroot/app.css b/WatchIt.Website/WatchIt.Website/wwwroot/css/main_button.css similarity index 58% rename from WatchIt.Website/WatchIt.Website/wwwroot/app.css rename to WatchIt.Website/WatchIt.Website/wwwroot/css/main_button.css index dbd9667..2bfc5c7 100644 --- a/WatchIt.Website/WatchIt.Website/wwwroot/app.css +++ b/WatchIt.Website/WatchIt.Website/wwwroot/css/main_button.css @@ -1,40 +1,4 @@ -body, html { - background-color: transparent; - height: 100%; - margin: 0; - padding: 0; - - color: lightgray; - font-family: "PT Sans"; -} - -.logo { - font-family: "Belanosima"; - text-decoration: none; - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; -} - -.mt-9 { - margin-top: 9rem !important; -} - -.panel-header { - background-color: rgba(0, 0, 0, 0.8); -} - -.panel-regular { - background-color: rgba(0, 0, 0, 0.6); -} - -.panel-yellow { - background-color: rgba(255, 184, 58, 0.6); -} - -.panel { - box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); - backdrop-filter: blur(25px); -} +/* CLASSES */ .main-button { --r:10px; @@ -83,17 +47,4 @@ body, html { .main-button:hover::before { -webkit-mask:none; -} - -.dropdown-menu-left { - right: auto; - left: 0; -} - -.btn-stretch-x { - width: 100%; -} - -.w-100 { - width: 100%; } \ No newline at end of file