commit 4d17df0ccbaca76247d8631c8e607a37c0fd659f
Author: root <root@hub.scroll.pub> Date: 2024-12-27 09:53:33 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..bd3908f --- /dev/null +++ b/body.html @@ -0,0 +1,45 @@ +<header> + <nav> + <div class="logo">SwipeMate</div> + <div class="nav-links"> + <a href="#" class="nav-link">Sign In</a> + <a href="#" class="nav-link btn-primary">Create Account</a> + </div> + </nav> +</header> + +<main> + <section class="card-container"> + <div class="card"> + <div class="profile-photo"> + <img src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><rect width='200' height='200' fill='%23ddd'/><text x='50%' y='50%' text-anchor='middle' fill='%23999'>Photo</text></svg>" alt="Profile photo placeholder"> + </div> + <div class="profile-info"> + <h2>Sarah, 25</h2> + <p>Professional photographer who loves hiking and coffee ☕</p> + </div> + <div class="action-buttons"> + <button class="btn-dislike" aria-label="Dislike">✕</button> + <button class="btn-like" aria-label="Like">♥</button> + </div> + </div> + </section> + + <div class="match-modal" hidden> + <div class="modal-content"> + <h2>It's a Match! 🎉</h2> + <p>You and Sarah have liked each other</p> + <button class="btn-primary">Send Message</button> + <button class="btn-secondary">Keep Swiping</button> + </div> + </div> +</main> + +<footer> + <nav> + <a href="#">About</a> + <a href="#">Safety</a> + <a href="#">Terms</a> + <a href="#">Privacy</a> + </nav> +</footer> diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..20fca19 --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://swipemate.scroll.pub +metaTags +editButton /edit.html +title SwipeMate - Find Your Perfect Match +style.css +body.html +script.js diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..ab8170d --- /dev/null +++ b/readme.scroll @@ -0,0 +1,2 @@ +# swipemate.scroll.pub +Website generated by Claude from prompt: Create fully functional Tinder website \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..9571ee6 --- /dev/null +++ b/script.js @@ -0,0 +1,63 @@ +document.addEventListener('DOMContentLoaded', () => { + const card = document.querySelector('.card'); + const likeBtn = document.querySelector('.btn-like'); + const dislikeBtn = document.querySelector('.btn-dislike'); + const modal = document.querySelector('.match-modal'); + let startX = 0; + let currentX = 0; + + // Touch events for swiping + card.addEventListener('touchstart', (e) => { + startX = e.touches[0].clientX; + card.style.transition = 'none'; + }); + + card.addEventListener('touchmove', (e) => { + currentX = e.touches[0].clientX - startX; + card.style.transform = `translateX(${currentX}px) rotate(${currentX * 0.1}deg)`; + }); + + card.addEventListener('touchend', () => { + card.style.transition = 'transform 0.3s ease'; + if (Math.abs(currentX) > 100) { + const liked = currentX > 0; + handleSwipe(liked); + } else { + card.style.transform = ''; + } + }); + + // Button click events + likeBtn.addEventListener('click', () => handleSwipe(true)); + dislikeBtn.addEventListener('click', () => handleSwipe(false)); + + function handleSwipe(liked) { + const direction = liked ? 1 : -1; + card.style.transform = `translateX(${direction * window.innerWidth}px) rotate(${direction * 30}deg)`; + + if (liked) { + // 30% chance of a match when liking + if (Math.random() < 0.3) { + setTimeout(() => { + modal.removeAttribute('hidden'); + }, 500); + } + } + + // Reset card position after animation + setTimeout(() => { + card.style.transition = 'none'; + card.style.transform = ''; + setTimeout(() => { + card.style.transition = 'transform 0.3s ease'; + }, 50); + }, 300); + } + + // Modal controls + modal.addEventListener('click', (e) => { + if (e.target === modal || e.target.classList.contains('btn-secondary')) { + modal.setAttribute('hidden', ''); + } + }); +}); diff --git a/style.css b/style.css new file mode 100644 index 0000000..b40971d --- /dev/null +++ b/style.css @@ -0,0 +1,199 @@ +:root { + --primary-color: #fe3c72; + --secondary-color: #424242; + --background-color: #f5f7fa; + --text-color: #333; + --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); +} + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; + background: var(--background-color); + color: var(--text-color); + line-height: 1.6; +} + +header { + background: white; + padding: 1rem; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); + position: fixed; + width: 100%; + top: 0; + z-index: 100; +} + +nav { + max-width: 1200px; + margin: 0 auto; + display: flex; + justify-content: space-between; + align-items: center; +} + +.logo { + font-size: 1.5rem; + font-weight: bold; + color: var(--primary-color); +} + +.nav-links { + display: flex; + gap: 1rem; +} + +.nav-link { + text-decoration: none; + color: var(--secondary-color); + padding: 0.5rem 1rem; + border-radius: 20px; + transition: all 0.3s ease; +} + +.btn-primary { + background: var(--primary-color); + color: white; +} + +main { + margin-top: 80px; + padding: 2rem; + min-height: calc(100vh - 160px); +} + +.card-container { + max-width: 400px; + margin: 0 auto; +} + +.card { + background: white; + border-radius: 20px; + box-shadow: var(--card-shadow); + overflow: hidden; + transform-origin: center; + transition: transform 0.3s ease; +} + +.card:hover { + transform: scale(1.02); +} + +.profile-photo { + width: 100%; + height: 400px; + overflow: hidden; +} + +.profile-photo img { + width: 100%; + height: 100%; + object-fit: cover; +} + +.profile-info { + padding: 1rem; +} + +.action-buttons { + display: flex; + justify-content: center; + gap: 2rem; + padding: 1rem; +} + +.btn-like, .btn-dislike { + width: 60px; + height: 60px; + border-radius: 50%; + border: none; + font-size: 1.5rem; + cursor: pointer; + transition: all 0.3s ease; +} + +.btn-like { + background: #fff; + color: var(--primary-color); + border: 2px solid var(--primary-color); +} + +.btn-dislike { + background: #fff; + color: #666; + border: 2px solid #666; +} + +.btn-like:hover { + background: var(--primary-color); + color: white; + transform: scale(1.1); +} + +.btn-dislike:hover { + background: #666; + color: white; + transform: scale(1.1); +} + +.match-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); + display: flex; + align-items: center; + justify-content: center; + z-index: 1000; +} + +.modal-content { + background: white; + padding: 2rem; + border-radius: 20px; + text-align: center; +} + +footer { + background: white; + padding: 1rem; + text-align: center; +} + +footer nav { + display: flex; + justify-content: center; + gap: 2rem; +} + +footer a { + color: var(--secondary-color); + text-decoration: none; +} + +@media (max-width: 768px) { + .card-container { + max-width: 100%; + } + + .profile-photo { + height: 300px; + } + + .action-buttons { + gap: 1rem; + } + + .btn-like, .btn-dislike { + width: 50px; + height: 50px; + } +}