{"id":498,"date":"2026-02-13T20:09:27","date_gmt":"2026-02-13T20:09:27","guid":{"rendered":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/?page_id=498"},"modified":"2026-02-13T20:09:27","modified_gmt":"2026-02-13T20:09:27","slug":"matches","status":"publish","type":"page","link":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/matches\/","title":{"rendered":"Matches"},"content":{"rendered":"<div class=\"buddyUpPjaxContainer\" data-buddyup-pjax-container=\"1\"><style>body {\n    background: var(--buddyup-background);\n}\n\n.pinnacleMainNavBar .logo-wrapper img {\n    height: 75px !important;\n    width: auto;\n}\n\n#buddyUpMatchesWrapper {\n    max-width: 1200px;\n    margin: 0 auto;\n    padding: 2rem 1rem;\n}\n\n.matches-page-title {\n    text-align: center;\n    font-size: 2.5rem;\n    margin-bottom: 1rem;\n    color: #333;\n}\n\n.matches-description {\n    text-align: center;\n    font-size: 1.1rem;\n    color: #666;\n    margin-bottom: 2rem;\n}\n\n.matches-container {\n    display: grid;\n    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));\n    gap: 1.5rem;\n    padding: 1rem 0;\n}\n\n.matches-loading {\n    grid-column: 1 \/ -1;\n    text-align: center;\n    padding: 3rem;\n    font-size: 1.2rem;\n    color: #666;\n}\n\n.match-card {\n    background: #fff;\n    border-radius: var(--buddyup-panel-radius);\n    border: 1px solid rgba(0, 0, 0, 0.06);\n    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n    overflow: hidden;\n    transition: transform 0.3s, box-shadow 0.3s;\n    position: relative;\n}\n\n.match-card:hover {\n    transform: translateY(-5px);\n    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);\n}\n\n.match-card.blurred {\n    cursor: pointer;\n}\n\n.match-card-image {\n    height: 300px;\n    overflow: hidden;\n    position: relative;\n    background: #f0f0f0;\n}\n\n.match-card-image img {\n    width: 100%;\n    height: 100%;\n    object-fit: cover;\n}\n\n.match-card-image.blurred-image {\n    position: relative;\n}\n\n.match-card-image.blurred-image::before {\n    content: '';\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    backdrop-filter: blur(20px);\n    -webkit-backdrop-filter: blur(20px);\n    background: rgba(255, 255, 255, 0.3);\n    z-index: 1;\n}\n\n.match-card-image.blurred-image img {\n    filter: blur(20px);\n}\n\n.match-blur-overlay {\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 100%);\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    z-index: 2;\n    color: #fff;\n}\n\n.match-blur-overlay i {\n    font-size: 3rem;\n    margin-bottom: 1rem;\n    opacity: 0.9;\n}\n\n.match-blur-overlay p {\n    font-size: 1.1rem;\n    font-weight: bold;\n    text-align: center;\n    padding: 0 1rem;\n    margin: 0;\n}\n\n.match-card-details {\n    padding: 1.5rem;\n}\n\n.match-card-name {\n    font-size: 1.5rem;\n    font-weight: bold;\n    margin-bottom: 0.5rem;\n    color: #333;\n}\n\n.match-card-info {\n    font-size: 0.95rem;\n    color: #666;\n    margin-bottom: 0.5rem;\n}\n\n.match-card-info strong {\n    color: #333;\n}\n\n.match-card-date {\n    font-size: 0.85rem;\n    color: #999;\n    margin-top: 1rem;\n}\n\n.match-card-actions {\n    padding: 0 1.5rem 1.5rem;\n    display: flex;\n    gap: 0.75rem;\n}\n\n.match-action-btn {\n    flex: 1;\n    padding: 0.75rem 1rem;\n    border: none;\n    border-radius: var(--buddyup-control-radius);\n    font-size: 0.95rem;\n    font-weight: bold;\n    cursor: pointer;\n    transition: transform 0.2s, box-shadow 0.2s;\n}\n\n.match-action-btn:hover:not(:disabled) {\n    transform: translateY(-2px);\n    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);\n}\n\n.match-action-btn:disabled {\n    opacity: 0.5;\n    cursor: not-allowed;\n}\n\n.btn-message {\n    background: var(--secondary-color);\n    color: #fff;\n}\n\n.btn-reject {\n    background: var(--buddyup-red);\n    color: #fff;\n}\n\n.btn-reveal {\n    background: var(--primary-color);\n    color: #fff;\n    width: 100%;\n}\n\n.matches-empty {\n    grid-column: 1 \/ -1;\n    text-align: center;\n    padding: 4rem 2rem;\n}\n\n.matches-empty h2 {\n    font-size: 2rem;\n    color: #999;\n    margin-bottom: 1rem;\n}\n\n.matches-empty p {\n    font-size: 1.1rem;\n    color: #666;\n    margin-bottom: 2rem;\n}\n\n.matches-empty .buddyUpButton1 {\n    display: inline-block;\n    margin-top: 1rem;\n}\n\n.reveal-limit-info {\n    background: var(--secondary-color);\n    color: #fff;\n    padding: 1rem 1.5rem;\n    border-radius: var(--buddyup-panel-radius);\n    margin-bottom: 2rem;\n    text-align: center;\n}\n\n.reveal-limit-info p {\n    margin: 0;\n    font-size: 1rem;\n}\n\n.reveal-limit-info strong {\n    font-size: 1.1rem;\n}\n\n\/* Responsive *\/\n@media (max-width: 768px) {\n    .matches-page-title {\n        font-size: 2rem;\n    }\n\n    .matches-container {\n        grid-template-columns: 1fr;\n    }\n\n    .match-card-actions {\n        flex-direction: column;\n    }\n\n    .match-action-btn {\n        width: 100%;\n    }\n}\n\n\/* Free Tier Message *\/\n#buddyUpMatchesFree {\n    text-align: center;\n    padding: 3rem 2rem;\n    max-width: 600px;\n    margin: 0 auto;\n}\n\n#buddyUpMatchesFree h1 {\n    font-size: 2rem;\n    margin-bottom: 1rem;\n}\n\n#buddyUpMatchesFree p {\n    font-size: 1.1rem;\n    color: #666;\n    margin-bottom: 2rem;\n}\n<\/style><div id=\"buddyUpMatchesWrapper\">\n    <h1 class=\"matches-page-title\">Your Matches<\/h1>\n    <p class=\"matches-description\">These are users you've matched with in Matchup. Reveal matches to connect with them!<\/p>\n    <div class=\"matches-container\">\n        <div class=\"matches-loading\">Loading your matches...<\/div>\n    <\/div>\n<\/div>\n<script>(async function(){\n    const currentActiveUser = BUDDYUP.getCurrentUser();\n    const matchesWrapper = document.getElementById('buddyUpMatchesWrapper');\n\n    if (!currentActiveUser) {\n        let errMessageContent = `<p>Please log in or register to view your matches!<\/p>\n            <a href=\"${buddyUpVariables.login_link}\" class=\"buddyUpButton1\">Log in<\/a>\n            <a href=\"${buddyUpVariables.register_link}\" class=\"buddyUpButton1\" style=\"margin-left: .5rem;\">Sign Up<\/a>`;\n        let errMessage = BUDDYUP.errorPage('Please log in', errMessageContent);\n        if (matchesWrapper) matchesWrapper.innerHTML = errMessage;\n        return;\n    }\n\n    jQuery(document).ready(function($){\n        let matchesData = null;\n\n        async function loadMatches(){\n            const matchesContainer = $('.matches-container');\n            matchesContainer.html('<div class=\"matches-loading\">' + BUDDYUP.loading('Loading your matches') + '<\/div>');\n\n            const response = await BUDDYUP.apiRequest('matches-list');\n            \n            if (response && response.status === 'error') {\n                const msg = response.message || 'An error occurred loading matches.';\n                BUDDYUP.openModal(msg, 'Error', 'buddyUpTextCenter');\n                matchesContainer.html('<div class=\"matches-loading\">Error loading matches.<\/div>');\n                return;\n            }\n\n            if (response && response.status === 'success' && response.matches) {\n                matchesData = response;\n                displayMatches();\n            } else {\n                matchesContainer.html('<div class=\"matches-loading\">Error loading matches.<\/div>');\n            }\n        }\n\n        function displayMatches(){\n            const matchesContainer = $('.matches-container');\n            const matches = matchesData.matches || [];\n            const canReveal = matchesData.can_reveal;\n            const revealLimit = matchesData.reveal_limit;\n            const revealsUsed = matchesData.reveals_used;\n\n            matchesContainer.empty();\n\n            \/\/ Show reveal limit info for free tier users\n            if (revealLimit > 0) {\n                const limitInfo = $(`\n                    <div class=\"reveal-limit-info\" style=\"grid-column: 1 \/ -1;\">\n                        <p>\n                            <strong>Free Tier:<\/strong> You can reveal ${revealLimit} match${revealLimit > 1 ? 'es' : ''} per week. \n                            ${canReveal ? `You have ${revealLimit - revealsUsed} reveal${(revealLimit - revealsUsed) !== 1 ? 's' : ''} remaining this week.` : 'You have used all your reveals for this week.'}\n                        <\/p>\n                        ${!canReveal ? '<p style=\"margin-top: 0.5rem;\">Upgrade to reveal unlimited matches!<\/p>' : ''}\n                    <\/div>\n                `);\n                matchesContainer.append(limitInfo);\n\n                \/\/ Add upgrade button if no reveals left\n                if (!canReveal) {\n                    const upgradeBtn = $(`<a href=\"${buddyUpVariables.subscriptions_info_link || '#'}\" class=\"buddyUpButton1\" style=\"grid-column: 1 \/ -1; text-align: center; margin: 0 auto; max-width: 300px;\">Upgrade Subscription<\/a>`);\n                    matchesContainer.append(upgradeBtn);\n                }\n            }\n\n            if (matches.length === 0) {\n                const emptyState = $(`\n                    <div class=\"matches-empty\">\n                        <h2>No Matches Yet<\/h2>\n                        <p>Start swiping in Matchup to find your perfect buddy!<\/p>\n                        <a href=\"${buddyUpVariables.matchup_link || '#'}\" class=\"buddyUpButton1\">Go to Matchup<\/a>\n                    <\/div>\n                `);\n                matchesContainer.append(emptyState);\n                return;\n            }\n\n            matches.forEach(match => {\n                const card = createMatchCard(match, canReveal);\n                matchesContainer.append(card);\n            });\n        }\n\n        function createMatchCard(match, canReveal){\n            const isRevealed = match.is_revealed;\n            const user = match.user || {};\n            const isBlurred = user.blurred === true;\n\n            let card = $('<div class=\"match-card\">');\n            if (isBlurred) {\n                card.addClass('blurred');\n            }\n\n            \/\/ Image section\n            let imageSection = $('<div class=\"match-card-image\">');\n            \n            if (isBlurred) {\n                imageSection.addClass('blurred-image');\n                imageSection.append(`<img decoding=\"async\" src=\"${BUDDYUP.profileImageSrc('')}\" alt=\"Blurred profile\">`);\n                \n                const overlay = $(`\n                    <div class=\"match-blur-overlay\">\n                        <i class=\"fas fa-lock\"><\/i>\n                        <p>Click to reveal this match<\/p>\n                    <\/div>\n                `);\n                imageSection.append(overlay);\n                \n                \/\/ Click to reveal if allowed\n                if (canReveal) {\n                    card.on('click', function() {\n                        revealMatch(match.match_id, card);\n                    });\n                } else {\n                    card.on('click', function() {\n                        BUDDYUP.subscriptionModal('You have reached your weekly match reveal limit. Please upgrade your subscription to reveal more matches.', 'Reveal Limit Reached');\n                    });\n                }\n            } else {\n                imageSection.append(`<img decoding=\"async\" src=\"${BUDDYUP.profileImageSrc(user.profile_image)}\" alt=\"${user.first_name}'s profile\" onerror=\"BUDDYUP.onErrProfileImage(this)\">`);\n            }\n\n            card.append(imageSection);\n\n            \/\/ Details section\n            if (!isBlurred) {\n                const details = $('<div class=\"match-card-details\">');\n                details.append(`<div class=\"match-card-name\">${user.first_name} ${user.last_name}<\/div>`);\n                \n                if (user.city || user.state) {\n                    details.append(`<div class=\"match-card-info\"><strong>Location:<\/strong> ${user.city || ''}${user.city && user.state ? ', ' : ''}${user.state || ''}<\/div>`);\n                }\n                \n                if (user.interests) {\n                    const interestsArray = Array.isArray(user.interests) ? user.interests : (typeof user.interests === 'string' ? user.interests.split(',').map(i => i.trim()) : []);\n                    if (interestsArray.length > 0) {\n                        details.append(`<div class=\"match-card-info\"><strong>Interests:<\/strong> ${interestsArray.slice(0, 3).join(', ')}<\/div>`);\n                    }\n                }\n                \n                details.append(`<div class=\"match-card-date\">Matched: ${formatMatchDate(match.created_at)}<\/div>`);\n                card.append(details);\n\n                \/\/ Actions\n                const actions = $('<div class=\"match-card-actions\">');\n                const messageBtn = $(`<button class=\"match-action-btn btn-message\">Send Message<\/button>`);\n                const rejectBtn = $(`<button class=\"match-action-btn btn-reject\">Remove<\/button>`);\n\n                messageBtn.on('click', function(e) {\n                    e.stopPropagation();\n                    createFriendshipFromMatch(match.match_id, user);\n                });\n\n                rejectBtn.on('click', function(e) {\n                    e.stopPropagation();\n                    rejectMatch(match.match_id, card);\n                });\n\n                actions.append(messageBtn).append(rejectBtn);\n                card.append(actions);\n            }\n\n            return card;\n        }\n\n        async function revealMatch(matchId, cardElement){\n            \/\/ Disable clicking while revealing\n            cardElement.off('click');\n            cardElement.css('pointer-events', 'none');\n\n            const response = await BUDDYUP.apiRequest('matches-reveal', { match_id: matchId });\n            \n            if (response && response.status === 'success') {\n                BUDDYUP.openModal('Match revealed! You can now connect with them.', 'Success', 'buddyUpTextCenter');\n                \/\/ Reload matches to show the revealed user\n                loadMatches();\n            } else {\n                const msg = response?.message || response?.data?.message || response?.data || 'Failed to reveal match.';\n                const isLimitReached = \/reveal limit|weekly limit\/i.test(String(msg));\n                \n                if (isLimitReached) {\n                    BUDDYUP.subscriptionModal(msg, 'Reveal Limit Reached');\n                } else {\n                    BUDDYUP.openModal(msg, 'Error', 'buddyUpTextCenter');\n                }\n                \n                cardElement.css('pointer-events', 'auto');\n                cardElement.on('click', function() {\n                    revealMatch(matchId, cardElement);\n                });\n            }\n        }\n\n        async function createFriendshipFromMatch(matchId, user){\n            const confirmed = confirm(`Create friendship with ${user.first_name}? You'll be able to message each other.`);\n            if (!confirmed) return;\n\n            const response = await BUDDYUP.apiRequest('matches-create-friendship', { match_id: matchId });\n            \n            if (response && response.status === 'success') {\n                BUDDYUP.openModal(`You are now buddies with ${user.first_name}! You can message them now.`, 'Friendship Created', 'buddyUpTextCenter');\n                \/\/ Remove this match from the list\n                loadMatches();\n            } else {\n                const msg = response?.message || response?.data || 'Failed to create friendship.';\n                BUDDYUP.openModal(msg, 'Error', 'buddyUpTextCenter');\n            }\n        }\n\n        async function rejectMatch(matchId, cardElement){\n            const confirmed = confirm('Remove this match? This action cannot be undone.');\n            if (!confirmed) return;\n\n            const response = await BUDDYUP.apiRequest('matches-reject', { match_id: matchId });\n            \n            if (response && response.status === 'success') {\n                \/\/ Fade out and remove the card\n                cardElement.fadeOut(300, function() {\n                    $(this).remove();\n                    \/\/ Check if there are any matches left\n                    if ($('.match-card').length === 0) {\n                        loadMatches();\n                    }\n                });\n            } else {\n                const msg = response?.message || response?.data || 'Failed to reject match.';\n                BUDDYUP.openModal(msg, 'Error', 'buddyUpTextCenter');\n            }\n        }\n\n        function formatMatchDate(dateString){\n            const date = new Date(dateString);\n            const now = new Date();\n            const diffTime = Math.abs(now - date);\n            const diffDays = Math.floor(diffTime \/ (1000 * 60 * 60 * 24));\n            \n            if (diffDays === 0) return 'Today';\n            if (diffDays === 1) return 'Yesterday';\n            if (diffDays < 7) return `${diffDays} days ago`;\n            if (diffDays < 30) return `${Math.floor(diffDays \/ 7)} week${Math.floor(diffDays \/ 7) > 1 ? 's' : ''} ago`;\n            return date.toLocaleDateString();\n        }\n\n        \/\/ Initial load\n        loadMatches();\n    });\n})();\n<\/script><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"templates\/full-width-no-header.php","meta":{"footnotes":""},"class_list":["post-498","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/pages\/498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/comments?post=498"}],"version-history":[{"count":1,"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/pages\/498\/revisions"}],"predecessor-version":[{"id":499,"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/pages\/498\/revisions\/499"}],"wp:attachment":[{"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/media?parent=498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}