{"id":6,"date":"2025-07-20T16:27:38","date_gmt":"2025-07-20T16:27:38","guid":{"rendered":"https:\/\/legoidentifier.digital-innovations.com.au\/?page_id=6"},"modified":"2025-07-26T19:01:32","modified_gmt":"2025-07-26T19:01:32","slug":"home","status":"publish","type":"page","link":"https:\/\/legoidentifier.digital-innovations.com.au\/","title":{"rendered":"home"},"content":{"rendered":"<div id=\"cs-content\" class=\"cs-content\"><div class=\"x-section e6-e1 m6-0\"><div class=\"x-bg\" aria-hidden=\"true\"><div class=\"x-bg-layer-lower-image\" style=\" background-image: url(https:\/\/legoidentifier.digital-innovations.com.au\/wp-content\/uploads\/2025\/07\/silver-aesthetic-wallpaper-with-small-bricks-scaled.jpg); background-repeat: no-repeat; background-position: left; background-size: cover;\"><\/div><\/div><div class=\"x-row x-container max width e6-e2 m6-1 m6-2\"><div class=\"x-row-inner\"><div class=\"x-col e6-e3 m6-3\"><div class=\"x-text x-content e6-e4 m6-4\"><p>TIPS:<br \/>1. Bright clear photos work best.<br \/>2. try different angles until you get an accurate result.<\/p>\n<p>        <div id=\"lego-recognition-form\">\n            <form id=\"lego-upload-form\" enctype=\"multipart\/form-data\">\n                <div>\n                    <label for=\"lego_image\">Upload LEGO piece image:<\/label>\n                    <input type=\"file\" id=\"lego_image\" name=\"lego_image\" accept=\"image\/*\" required>\n                <\/div>\n                <div>\n                    <button type=\"submit\">Identify LEGO Piece<\/button>\n                <\/div>\n            <\/form>\n            <div id=\"lego-results\" style=\"display:none;\">\n                <h3>Results:<\/h3>\n                <div id=\"results-content\"><\/div>\n            <\/div>\n        <\/div>\n        \n        <script>\n        jQuery(document).ready(function($) {\n            $('#lego-upload-form').on('submit', function(e) {\n                e.preventDefault();\n                \n                var formData = new FormData();\n                formData.append('action', 'upload_image');\n                formData.append('nonce', lego_ajax.nonce);\n                formData.append('lego_image', $('#lego_image')[0].files[0]);\n                \n                $.ajax({\n                    url: lego_ajax.ajax_url,\n                    type: 'POST',\n                    data: formData,\n                    processData: false,\n                    contentType: false,\n                    success: function(response) {\n                        if (response.success) {\n                            displayResults(response.data);\n                        } else {\n                            alert('Error: ' + response.data);\n                        }\n                    }\n                });\n            });\n            \n            function displayResults(matches) {\n                var html = '';\n                if (matches.length === 0) {\n                    html = '<p>No matches found.<\/p>';\n                } else {\n                    matches.forEach(function(match) {\n                        html += '<div style=\"border:1px solid #ccc; padding:10px; margin:10px 0;\">';\n                        html += '<h4>' + match.part_name + ' (' + match.part_num + ')<\/h4>';\n                        html += '<p>Confidence: ' + Math.round(match.confidence * 100) + '%<\/p>';\n                        html += '<p>Color: ' + (match.color_name || 'Unknown') + '<\/p>';\n                        html += '<p>Category: ' + (match.part_cat_name || 'Unknown') + '<\/p>';\n                        if (match.image_url) {\n                            html += '<img decoding=\"async\" src=\"' + match.image_url + '\" style=\"max-width:100px; max-height:100px;\">';\n                        }\n                        html += '<\/div>';\n                    });\n                }\n                $('#results-content').html(html);\n                $('#lego-results').show();\n            }\n        });\n        <\/script>\n        <\/p><\/div><\/div><\/div><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>TIPS:1. Bright clear photos work best.2. try different angles until you get an accurate result. Upload LEGO piece image: Identify LEGO Piece Results:<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"template-blank-6.php","meta":{"footnotes":""},"class_list":["post-6","page","type-page","status-publish","hentry","no-post-thumbnail"],"_links":{"self":[{"href":"https:\/\/legoidentifier.digital-innovations.com.au\/index.php\/wp-json\/wp\/v2\/pages\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/legoidentifier.digital-innovations.com.au\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/legoidentifier.digital-innovations.com.au\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/legoidentifier.digital-innovations.com.au\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/legoidentifier.digital-innovations.com.au\/index.php\/wp-json\/wp\/v2\/comments?post=6"}],"version-history":[{"count":10,"href":"https:\/\/legoidentifier.digital-innovations.com.au\/index.php\/wp-json\/wp\/v2\/pages\/6\/revisions"}],"predecessor-version":[{"id":27,"href":"https:\/\/legoidentifier.digital-innovations.com.au\/index.php\/wp-json\/wp\/v2\/pages\/6\/revisions\/27"}],"wp:attachment":[{"href":"https:\/\/legoidentifier.digital-innovations.com.au\/index.php\/wp-json\/wp\/v2\/media?parent=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}