- Oppskrifter med disse blir markert.
+ Oppskrifter med disse blir markert (ikke aktiv ennå).
{ALLERGIES.map((name) => {
diff --git a/client/src/index.css b/client/src/index.css
index 0c3e02a..46007b1 100644
--- a/client/src/index.css
+++ b/client/src/index.css
@@ -33,6 +33,36 @@
/* bredde der pc header tar over fra mobil header */
--breakpoint-desktop: 35rem;
+
+
+ /* popup tones inn og glir inn */
+ --animate-dialog-in: dialog-in 200ms ease-out;
+ --animate-dialog-out: dialog-out 150ms ease-in;
+ --animate-overlay-in: overlay-in 200ms ease-out;
+ --animate-overlay-out: overlay-out 150ms ease-in;
+
+ @keyframes dialog-in {
+ from {
+ opacity: 0;
+ transform: translateY(12px);
+ }
+ }
+ @keyframes dialog-out {
+ to {
+ opacity: 0;
+ transform: translateY(12px);
+ }
+ }
+ @keyframes overlay-in {
+ from {
+ opacity: 0;
+ }
+ }
+ @keyframes overlay-out {
+ to {
+ opacity: 0;
+ }
+ }
}
/* Grunnleggende styling */
diff --git a/client/src/lib/motion.ts b/client/src/lib/motion.ts
index 6032a35..a4e3f18 100644
--- a/client/src/lib/motion.ts
+++ b/client/src/lib/motion.ts
@@ -4,6 +4,8 @@ import type { Transition, Variants } from 'motion/react';
// felles fart så alle animasjoner føles like
export const quick: Transition = { duration: 0.2, ease: 'easeOut' };
+// rolig gli for ting som flytter seg
+export const glide: Transition = { duration: 0.3, ease: 'easeOut' };
// spring for ting som skal gli eller sprette
export const spring: Transition = {
diff --git a/client/src/routes/FavoritesPage.tsx b/client/src/routes/FavoritesPage.tsx
index 4e33c48..f893998 100644
--- a/client/src/routes/FavoritesPage.tsx
+++ b/client/src/routes/FavoritesPage.tsx
@@ -1,7 +1,6 @@
import { Link } from 'react-router';
import { useQuery } from '@apollo/client/react';
import { RecipeCard } from '../components/recipe/RecipeCard';
-import { FavoriteButton } from '../components/favorites/FavoriteButton';
import { MY_FAVORITES } from '../graphql/favorites';
// oppskriftene brukeren har lagret som favoritter
@@ -39,10 +38,6 @@ export default function FavoritesPage() {
{favorites.map((recipe) => (
- {/* hjertet åpner ikke oppskriften */}
-
-
-
))}
diff --git a/client/src/routes/ProfilePage.tsx b/client/src/routes/ProfilePage.tsx
index 889979b..ccaf320 100644
--- a/client/src/routes/ProfilePage.tsx
+++ b/client/src/routes/ProfilePage.tsx
@@ -11,8 +11,9 @@ import { useCurrentUser } from '../lib/useCurrentUser';
import { useQuery } from '@apollo/client/react';
import { MY_RECIPES } from '../graphql/profile';
import { RecipeCard } from '../components/recipe/RecipeCard';
-import { FavoriteButton } from '../components/favorites/FavoriteButton';
import { MY_FAVORITES } from '../graphql/favorites';
+import { AnimatePresence, motion } from 'motion/react';
+import { fadeUp, quick, glide } from '../lib/motion';
type Tab = 'preferences' | 'favorites' | 'shared' | 'sharedWithMe';
type RecipeTab = Exclude
;
@@ -195,8 +196,9 @@ export default function ProfilePage() {
)}
- {/* mobilmeny som kan sveipes */}
-
-
+
{/* preferanser på mobil bare når fanen er valgt */}
setActiveTab(tab)}
- className={`-mb-px cursor-pointer border-b-2 pb-2 font-display text-2xl transition-colors ${FOCUS_RING} ${
- desktopTab === tab
- ? 'border-primary text-primary'
- : 'border-transparent hover:text-primary'
+ className={`relative cursor-pointer pb-2 font-display text-2xl transition-colors ${FOCUS_RING} ${
+ desktopTab === tab ? 'text-primary' : 'hover:text-primary'
}`}
>
{RECIPE_TABS[tab].label}
+ {/* streken glir til fanen som er valgt */}
+ {desktopTab === tab && (
+
+ )}
))}
@@ -256,19 +272,29 @@ export default function ProfilePage() {
{/* søppelbøtte som slår på valg av egne oppskrifter */}
{desktopTab === 'shared' && myRecipes.length > 0 && (