diff --git a/src/components/IngredientFeed.vue b/src/components/IngredientFeed.vue index 03b8fc0..0cd91c4 100644 --- a/src/components/IngredientFeed.vue +++ b/src/components/IngredientFeed.vue @@ -117,7 +117,15 @@

{{ category.name }}

-
@@ -266,6 +282,14 @@ export default { } ); }, + scroll_right(categoryToScroll) { + let content = document.getElementById(categoryToScroll); + content.scrollLeft += 500; + }, + scroll_left(categoryToScroll) { + let content = document.getElementById(categoryToScroll); + content.scrollLeft -= 500; + }, }, watch: { selected(newVal) { @@ -397,6 +421,7 @@ ul { padding: 0; overflow: auto; overflow-y: hidden; + overflow-x: hidden; } h3 { diff --git a/src/components/RecipeFeed.vue b/src/components/RecipeFeed.vue index 20688a9..6f4cb29 100644 --- a/src/components/RecipeFeed.vue +++ b/src/components/RecipeFeed.vue @@ -70,7 +70,14 @@

{{ name }}

-
@@ -98,6 +112,16 @@ export default { return this.$store.state.auth.user; }, }, + methods: { + scroll_right(categoryToScroll) { + let content = document.getElementById(categoryToScroll); + content.scrollLeft += 500; + }, + scroll_left(categoryToScroll) { + let content = document.getElementById(categoryToScroll); + content.scrollLeft -= 500; + }, + }, mounted() { if (!this.currentUser) { this.$router.push("/login"); @@ -135,6 +159,34 @@ export default { recipeName: "Recipe7", recipeType: "Category1", }, + Recipe8: { + recipeName: "Recipe1", + recipeType: "Category1", + }, + Recipe9: { + recipeName: "RecipeNameVeryLong", + recipeType: "Category1", + }, + Recipe10: { + recipeName: "Recipe3", + recipeType: "Category1", + }, + Recipe11: { + recipeName: "Recipe4", + recipeType: "Category1", + }, + Recipe12: { + recipeName: "Recipe5", + recipeType: "Category1", + }, + Recipe13: { + recipeName: "Recipe6", + recipeType: "Category1", + }, + Recipe14: { + recipeName: "Recipe7", + recipeType: "Category1", + }, }, Category2: { @@ -159,6 +211,37 @@ export default { recipeType: "Category5", }, }, + + Category3: { + Recipe1: { + recipeName: "Recipe1", + recipeType: "Category1", + }, + RecipeNameVeryLong: { + recipeName: "RecipeNameVeryLong", + recipeType: "Category1", + }, + Recipe3: { + recipeName: "Recipe3", + recipeType: "Category1", + }, + Recipe4: { + recipeName: "Recipe4", + recipeType: "Category1", + }, + Recipe5: { + recipeName: "Recipe5", + recipeType: "Category1", + }, + Recipe6: { + recipeName: "Recipe6", + recipeType: "Category1", + }, + Recipe7: { + recipeName: "Recipe7", + recipeType: "Category1", + }, + }, }, ]); return { @@ -283,6 +366,7 @@ ul { padding: 0; overflow: auto; overflow-y: hidden; + overflow-x: hidden; } h3 { @@ -317,4 +401,20 @@ h3 { cursor: pointer; width: 100%; } + +.scroll { + position: sticky; + z-index: 1; + height: fit-content; +} + +.left-scroll { + top: 40%; + left: 3%; +} + +.right-scroll { + top: 40%; + right: 3%; +}