Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

How I built a Tinder-style Card Swipe in Next.js 16

I recently decided to build a mobile-first roommate finder app as a way to learn the new Next.js 16 App Router. The hardest part? Building a "Card Stack" that feels like a native app (Tinder-style) without using heavy libraries like…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

I recently decided to build a mobile-first roommate finder app as a way to learn the new Next.js 16 App Router.



The hardest part? Building a "Card Stack" that feels like a native app (Tinder-style) without using heavy libraries like framer-motion.



This is how I solved it using just React 19, Tailwind CSS, and good old useState.






Here is the gig!



"Moving" a stack of DOM elements was never a thing. We have been rendering one active card and changing the data behind it all this time!



To do this, we need to track two things in our state:





  1. The Index: Which item in the array are we looking at?


  2. The Direction: Is the user swiping Left (Reject) or Right (Like)?






The Code



Here is the simplified logic from my ExplorePage component:




'use client';

import { useState } from 'react';

export default function SwipeStack({ items }) {
// 1. Track which card is active
const [currentIndex, setCurrentIndex] = useState(0);

// 2. Track animation direction ('left' | 'right' | null)
const [swipeDirection, setSwipeDirection] = useState(null);

const handleSwipe = (direction) => {
// Step A: Trigger the animation
setSwipeDirection(direction);

// Step B: Wait for animation to finish, then show next card
setTimeout(() => {
setCurrentIndex((prev) => prev + 1);
setSwipeDirection(null); // Reset animation
}, 300); // Matches CSS transition duration
};

const currentItem = items[currentIndex];

if (!currentItem) return <div>No more profiles!</div>;

return (
<div className="relative w-full max-w-sm h-[500px]">
<div
className={`
transition-all duration-300 ease-out
${swipeDirection === 'left' ? '-translate-x-full -rotate-12 opacity-0' : ''}
${swipeDirection === 'right' ? 'translate-x-full rotate-12 opacity-0' : ''}
`
}
>
{/* Your Card Component */}
<Card item={currentItem} />
</div>

{/* Control Buttons */}
<div className="flex gap-4 justify-center mt-8">
<button onClick={() => handleSwipe('left')}>❌</button>
<button onClick={() => handleSwipe('right')}>💚</button>
</div>
</div>
);
}






Check this out, with the code, you get:




  1. Instant Feedback: When you click "Like", setSwipeDirection('right') adds the Tailwind classes translate-x-full and rotate-12. The card visually flies off the screen.


  2. State Update: The setTimeout waits exactly 300ms (the duration of our CSS transition). Once the card is off-screen, we increment currentIndex.


  3. Reset: React re-renders with the new data at the same position (center), and we remove the animation classes. To the user, it looks like a brand new card appeared behind the old one.




The Result

This creates a buttery smooth 60fps animation on mobile browsers because we are only transforming translate and opacity.






WAIT



I open-sourced the entire UI kit, including the Swipe Logic, Bottom Navigation, and Chat Interface.



You can grab the repo here to see how I handled the array filtering and mobile safe-areas:



👉 GitHub Repo: Next.js Mobile Marketplace Starter



👉 Live Demo



Let me know if you have questions about the framework!

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Remote Code Execution (RCE) Defense
Syntax validiert (0 Fehler)
title: Detect Exploitation - How I built a Tinder-style Card Swipe in Next.js 16
id: 36ccf594-5900-4ef5-b64b-d8f6aca4e3fb
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-25
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-25"
        description = "YARA Signature for "
    strings:
        $str = "How I built a Tinder-style Car" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("How I built a Tinder-style Card Swipe in")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*How I built a Tinder-style Card Swipe in*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "How I built a Tinder-style Card Swipe in"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich How I built a Tinder-style Card Swipe in.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How I built a Tinder-style Card Swipe in Next.js 16

Thematisch verwandte Begriffe: built, Tinderstyle, Card, Swipe · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-100372 | ClipBucket v5 before 5.5.3-#197 contains a path traversal vulnerability…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag