{"id":313,"date":"2025-07-29T00:52:33","date_gmt":"2025-07-29T00:52:33","guid":{"rendered":"https:\/\/insaatsirketleri.com.tr\/en\/?p=313"},"modified":"2025-07-29T00:52:33","modified_gmt":"2025-07-29T00:52:33","slug":"free-dictionary","status":"publish","type":"post","link":"https:\/\/insaatsirketleri.com.tr\/en\/free-dictionary\/","title":{"rendered":"Free Dictionary"},"content":{"rendered":"\n<p><\/p>\n\n\n\n\n    <script src=\"https:\/\/cdn.tailwindcss.com\"><\/script>\n    <style>\n        \/* Custom font for a clean look *\/\n        @import url('https:\/\/fonts.googleapis.com\/css2?family=Inter:wght@400;600;700&display=swap');\n        body {\n            font-family: 'Inter', sans-serif;\n            background-color: #f0f2f5; \/* Light gray background *\/\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            min-height: 100vh;\n            padding: 1rem;\n            box-sizing: border-box;\n        }\n        .card {\n            background-color: #ffffff;\n            border-radius: 1.5rem; \/* More rounded corners *\/\n            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); \/* Softer shadow *\/\n            padding: 2.5rem;\n            max-width: 900px; \/* Increased max-width *\/\n            width: 100%;\n            text-align: center;\n        }\n        input[type=\"text\"], select { \/* Apply styles to select as well *\/\n            border: 2px solid #e2e8f0; \/* Light border *\/\n            border-radius: 0.75rem; \/* Rounded input *\/\n            padding: 0.75rem 1.25rem;\n            font-size: 1rem;\n            width: 100%;\n            transition: border-color 0.2s ease-in-out;\n        }\n        input[type=\"text\"]:focus, select:focus { \/* Apply focus styles to select *\/\n            outline: none;\n            border-color: #6366f1; \/* Indigo focus color *\/\n            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);\n        }\n        button {\n            background-color: #6366f1; \/* Indigo button *\/\n            color: white;\n            padding: 0.75rem 2rem;\n            border-radius: 0.75rem;\n            font-weight: 600;\n            transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;\n            cursor: pointer;\n            box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);\n        }\n        button:hover {\n            background-color: #4f46e5; \/* Darker indigo on hover *\/\n            transform: translateY(-2px);\n        }\n        button:active {\n            transform: translateY(0);\n        }\n        .loading-spinner {\n            border: 4px solid rgba(0, 0, 0, 0.1);\n            border-left-color: #6366f1;\n            border-radius: 50%;\n            width: 24px;\n            height: 24px;\n            animation: spin 1s linear infinite;\n            display: inline-block;\n            vertical-align: middle;\n            margin-left: 0.5rem;\n        }\n        @keyframes spin {\n            0% { transform: rotate(0deg); }\n            100% { transform: rotate(360deg); }\n        }\n        .definition-section {\n            background-color: #f8fafc; \/* Lighter background for definition *\/\n            border-left: 4px solid #6366f1; \/* Indigo left border *\/\n            padding: 1.5rem;\n            border-radius: 0.75rem;\n            text-align: left;\n            margin-top: 2rem;\n            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05); \/* Subtle inner shadow *\/\n        }\n        .definition-section h3 {\n            font-size: 1.5rem;\n            font-weight: 700;\n            color: #1e293b; \/* Darker text for title *\/\n            margin-bottom: 1rem;\n        }\n        .definition-section p {\n            font-size: 1.1rem;\n            line-height: 1.6;\n            color: #334155; \/* Medium dark text *\/\n            margin-bottom: 0.75rem;\n        }\n        .definition-section .example {\n            font-style: italic;\n            color: #475569; \/* Slightly lighter text for example *\/\n            border-top: 1px dashed #cbd5e1; \/* Dashed separator *\/\n            padding-top: 0.75rem;\n            margin-top: 1rem;\n        }\n        .definition-section .related-terms {\n            margin-top: 1rem;\n            padding-top: 0.75rem;\n            border-top: 1px dashed #cbd5e1; \/* Dashed separator *\/\n        }\n        .definition-section .related-terms strong {\n            color: #1e293b;\n        }\n        .definition-section .related-terms span {\n            display: inline-block;\n            background-color: #e0e7ff; \/* Light indigo tag background *\/\n            color: #4338ca; \/* Darker indigo tag text *\/\n            padding: 0.3rem 0.7rem;\n            border-radius: 0.5rem;\n            font-size: 0.9rem;\n            margin-right: 0.5rem;\n            margin-bottom: 0.5rem;\n        }\n        .message-box {\n            background-color: #fff;\n            border-radius: 0.75rem;\n            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);\n            padding: 1.5rem;\n            position: fixed;\n            top: 50%;\n            left: 50%;\n            transform: translate(-50%, -50%);\n            z-index: 1000;\n            text-align: center;\n            max-width: 400px;\n            width: 90%;\n            border: 1px solid #e2e8f0;\n        }\n        .message-box-overlay {\n            position: fixed;\n            top: 0;\n            left: 0;\n            width: 100%;\n            height: 100%;\n            background-color: rgba(0, 0, 0, 0.5);\n            z-index: 999;\n        }\n        .message-box button {\n            margin-top: 1rem;\n        }\n        \/* Added margin-top to the ad container for spacing *\/\n        .ad-container {\n            margin-top: 2rem;\n        }\n    <\/style>\n<\/head>\n<body>\n    <div class=\"card\">\n        <h1 class=\"text-4xl font-extrabold text-gray-900 mb-6\">Urban-Like Dictionary<\/h1>\n        <p class=\"text-gray-600 mb-8\">Argo ve gayri resmi terimler i\u00e7in tan\u0131mlar al\u0131n.<\/p>\n\n        <div class=\"flex flex-col sm:flex-row gap-4 mb-8 items-center\">\n            <input type=\"text\" id=\"searchTerm\" placeholder=\"Bir terim girin...\" class=\"flex-grow\">\n            <select id=\"languageSelect\" class=\"flex-shrink-0 w-full sm:w-auto\">\n                <option value=\"en\">English<\/option>\n                <option value=\"tr\">T\u00fcrk\u00e7e<\/option>\n                <option value=\"es\">Espa\u00f1ol<\/option>\n                <option value=\"fr\">Fran\u00e7ais<\/option>\n                <option value=\"de\">Deutsch<\/option>\n            <\/select>\n            <button id=\"searchButton\" class=\"flex-shrink-0\">\n                Ara\n                <span id=\"loadingIndicator\" class=\"loading-spinner hidden\"><\/span>\n            <\/button>\n        <\/div>\n\n        <div id=\"definitionOutput\" class=\"definition-section hidden\">\n            <!-- Tan\u0131m burada g\u00f6r\u00fcnt\u00fclenecek -->\n        <\/div>\n\n        <!-- Reklam Kodu Buraya Eklendi -->\n        <div class=\"ad-container\">\n            <script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-2506329722665303\"\n            crossorigin=\"anonymous\"><\/script>\n            <!-- yatay2025 -->\n            <ins class=\"adsbygoogle\"\n                style=\"display:block\"\n                data-ad-client=\"ca-pub-2506329722665303\"\n                data-ad-slot=\"1444491293\"\n                data-ad-format=\"auto\"\n                data-full-width-responsive=\"true\"><\/ins>\n            <script>\n                \/\/ AdSense push call moved to window.onload with a slight delay\n                window.addEventListener('load', function() {\n                    setTimeout(function() {\n                        (adsbygoogle = window.adsbygoogle || []).push({});\n                    }, 100); \/\/ 100ms delay to ensure layout is calculated\n                });\n            <\/script>\n        <\/div>\n    <\/div>\n\n    <script type=\"module\">\n        \/\/ Firebase imports\n        import { initializeApp } from \"https:\/\/www.gstatic.com\/firebasejs\/11.6.1\/firebase-app.js\";\n        import { getAuth, signInAnonymously, signInWithCustomToken } from \"https:\/\/www.gstatic.com\/firebasejs\/11.6.1\/firebase-auth.js\";\n        import { getFirestore } from \"https:\/\/www.gstatic.com\/firebasejs\/11.6.1\/firebase-firestore.js\";\n\n        \/\/ Global variables for Firebase config and app ID\n        const appId = typeof __app_id !== 'undefined' ? __app_id : 'default-app-id';\n        const firebaseConfig = typeof __firebase_config !== 'undefined' ? JSON.parse(__firebase_config) : {};\n        const initialAuthToken = typeof __initial_auth_token !== 'undefined' ? __initial_auth_token : null;\n\n        let app;\n        let auth;\n        let db;\n\n        \/**\n         * Initializes Firebase and authenticates the user.\n         *\/\n        async function initializeFirebase() {\n            try {\n                app = initializeApp(firebaseConfig);\n                auth = getAuth(app);\n                db = getFirestore(app);\n\n                \/\/ Sign in with custom token if available, otherwise anonymously\n                if (initialAuthToken) {\n                    await signInWithCustomToken(auth, initialAuthToken);\n                    console.log(\"Signed in with custom token.\");\n                } else {\n                    await signInAnonymously(auth);\n                    console.log(\"Signed in anonymously.\");\n                }\n            } catch (error) {\n                console.error(\"Error initializing Firebase or signing in:\", error);\n                \/\/ Display a user-friendly message if Firebase initialization fails\n                showMessageBox(\"Hata\", \"Uygulama ba\u015flat\u0131l\u0131rken bir hata olu\u015ftu. L\u00fctfen daha sonra tekrar deneyin.\");\n            }\n        }\n\n        \/**\n         * Displays a custom message box instead of alert().\n         * @param {string} title - The title of the message box.\n         * @param {string} message - The message to display.\n         *\/\n        function showMessageBox(title, message) {\n            const overlay = document.createElement('div');\n            overlay.className = 'message-box-overlay';\n            document.body.appendChild(overlay);\n\n            const messageBox = document.createElement('div');\n            messageBox.className = 'message-box';\n            messageBox.innerHTML = `\n                <h3 class=\"text-xl font-bold mb-4 text-gray-800\">${title}<\/h3>\n                <p class=\"text-gray-600 mb-6\">${message}<\/p>\n                <button id=\"messageBoxCloseButton\">Tamam<\/button>\n            `;\n            document.body.appendChild(messageBox);\n\n            document.getElementById('messageBoxCloseButton').addEventListener('click', () => {\n                document.body.removeChild(messageBox);\n                document.body.removeChild(overlay);\n            });\n        }\n\n        \/\/ DOM elements\n        const searchTermInput = document.getElementById('searchTerm');\n        const languageSelect = document.getElementById('languageSelect'); \/\/ New language select element\n        const searchButton = document.getElementById('searchButton');\n        const loadingIndicator = document.getElementById('loadingIndicator');\n        const definitionOutput = document.getElementById('definitionOutput');\n\n        \/**\n         * Fetches the definition for a given term using the Gemini API.\n         * @param {string} term - The term to search for.\n         * @param {string} language - The target language for the definition.\n         * @returns {Promise<object|null>} - A promise that resolves to the definition object or null if not found.\n         *\/\n        async function fetchDefinition(term, language) {\n            loadingIndicator.classList.remove('hidden');\n            searchButton.disabled = true;\n            searchTermInput.disabled = true;\n            languageSelect.disabled = true; \/\/ Disable language select during search\n            definitionOutput.classList.add('hidden'); \/\/ Hide previous results\n\n            try {\n                let chatHistory = [];\n                \/\/ Modify the prompt to include the target language\n                const prompt = `Provide an Urban Dictionary style definition for the term \"${term}\" in ${language === 'en' ? 'English' : language === 'tr' ? 'Turkish' : language === 'es' ? 'Spanish' : language === 'fr' ? 'French' : language === 'de' ? 'German' : 'English'}. Include a concise definition, an example sentence using the term, and a few related terms. Format the response as a JSON object with keys: \"term\", \"definition\", \"example\", and \"relatedTerms\" (an array of strings). If you cannot provide a definition, return an empty JSON object.`;\n                chatHistory.push({ role: \"user\", parts: [{ text: prompt }] });\n\n                const payload = {\n                    contents: chatHistory,\n                    generationConfig: {\n                        responseMimeType: \"application\/json\",\n                        responseSchema: {\n                            type: \"OBJECT\",\n                            properties: {\n                                \"term\": { \"type\": \"STRING\" },\n                                \"definition\": { \"type\": \"STRING\" },\n                                \"example\": { \"type\": \"STRING\" },\n                                \"relatedTerms\": {\n                                    \"type\": \"ARRAY\",\n                                    \"items\": { \"type\": \"STRING\" }\n                                }\n                            },\n                            \"propertyOrdering\": [\"term\", \"definition\", \"example\", \"relatedTerms\"]\n                        }\n                    }\n                };\n\n                const apiKey = \"\"; \/\/ API key is automatically provided by Canvas runtime\n                const apiUrl = `https:\/\/generativelanguage.googleapis.com\/v1beta\/models\/gemini-2.0-flash:generateContent?key=${apiKey}`;\n\n                const response = await fetch(apiUrl, {\n                    method: 'POST',\n                    headers: { 'Content-Type': 'application\/json' },\n                    body: JSON.stringify(payload)\n                });\n\n                if (!response.ok) {\n                    const errorText = await response.text();\n                    throw new Error(`API call failed with status ${response.status}: ${errorText}`);\n                }\n\n                const result = await response.json();\n\n                if (result.candidates && result.candidates.length > 0 &&\n                    result.candidates[0].content && result.candidates[0].content.parts &&\n                    result.candidates[0].content.parts.length > 0) {\n                    const jsonString = result.candidates[0].content.parts[0].text;\n                    try {\n                        const parsedJson = JSON.parse(jsonString);\n                        \/\/ Check if the parsed JSON is empty, indicating no definition found\n                        if (Object.keys(parsedJson).length === 0 || !parsedJson.definition) {\n                            return null;\n                        }\n                        return parsedJson;\n                    } catch (parseError) {\n                        console.error(\"Error parsing JSON response:\", parseError, \"Raw JSON:\", jsonString);\n                        return null; \/\/ Return null if JSON parsing fails\n                    }\n                } else {\n                    console.warn(\"Unexpected API response structure:\", result);\n                    return null;\n                }\n            } catch (error) {\n                console.error(\"Error fetching definition:\", error);\n                showMessageBox(\"Hata\", \"Tan\u0131m al\u0131namad\u0131. L\u00fctfen tekrar deneyin veya a\u011f ba\u011flant\u0131n\u0131z\u0131 kontrol edin.\");\n                return null;\n            } finally {\n                loadingIndicator.classList.add('hidden');\n                searchButton.disabled = false;\n                searchTermInput.disabled = false;\n                languageSelect.disabled = false; \/\/ Re-enable language select\n            }\n        }\n\n        \/**\n         * Displays the fetched definition in the output area.\n         * @param {object|null} definition - The definition object to display.\n         *\/\n        function displayDefinition(definition) {\n            definitionOutput.innerHTML = ''; \/\/ Clear previous content\n\n            if (definition) {\n                definitionOutput.classList.remove('hidden');\n                definitionOutput.innerHTML = `\n                    <h3 class=\"text-2xl font-bold text-gray-900 mb-4\">${definition.term}<\/h3>\n                    <p class=\"text-gray-700 mb-4\">${definition.definition}<\/p>\n                    ${definition.example ? `<p class=\"example text-gray-600\"><strong>\u00d6rnek:<\/strong> \"${definition.example}\"<\/p>` : ''}\n                    ${definition.relatedTerms && definition.relatedTerms.length > 0 ? `\n                        <div class=\"related-terms\">\n                            <strong class=\"text-gray-800\">\u0130lgili Terimler:<\/strong>\n                            ${definition.relatedTerms.map(term => `<span class=\"inline-block bg-indigo-100 text-indigo-800 text-sm px-3 py-1 rounded-full mr-2 mb-2\">${term}<\/span>`).join('')}\n                        <\/div>\n                    ` : ''}\n                `;\n            } else {\n                definitionOutput.classList.remove('hidden');\n                definitionOutput.innerHTML = `\n                    <p class=\"text-gray-600 text-center\">Bu terim i\u00e7in tan\u0131m bulunamad\u0131. Ba\u015fka bir tane deneyin!<\/p>\n                `;\n            }\n        }\n\n        \/\/ Event listener for the search button\n        searchButton.addEventListener('click', async () => {\n            const term = searchTermInput.value.trim();\n            const selectedLanguage = languageSelect.value; \/\/ Get selected language\n            if (term) {\n                const definition = await fetchDefinition(term, selectedLanguage);\n                displayDefinition(definition);\n            } else {\n                showMessageBox(\"Giri\u015f Gerekli\", \"L\u00fctfen aranacak bir terim girin.\");\n            }\n        });\n\n        \/\/ Event listener for pressing Enter in the input field\n        searchTermInput.addEventListener('keypress', (event) => {\n            if (event.key === 'Enter') {\n                searchButton.click(); \/\/ Simulate a click on the search button\n            }\n        });\n\n        \/\/ Initialize Firebase when the window loads\n        window.onload = initializeFirebase;\n    <\/script>\n\n","protected":false},"excerpt":{"rendered":"<p>Urban-Like Dictionary Argo ve gayri resmi terimler i\u00e7in tan\u0131mlar al\u0131n. EnglishT\u00fcrk\u00e7eEspa\u00f1olFran\u00e7aisDeutsch Ara<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-313","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/posts\/313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/comments?post=313"}],"version-history":[{"count":1,"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/posts\/313\/revisions"}],"predecessor-version":[{"id":314,"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/posts\/313\/revisions\/314"}],"wp:attachment":[{"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/media?parent=313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/categories?post=313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/tags?post=313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}