Ticker

6/recent/ticker-posts

Ad Code

EarnBD · গল্প

📝 গল্প / আর্টিকেল পেস্ট করুন

১ম লাইন → শিরোনাম হবে  |  খালি লাইন → প্যারাগ্রাফ ভাগ হবে
প্রতি ৩টি প্যারার পর অটো বিজ্ঞাপন বসবে (মোট ৫টি)

📖

✏️ বাটনে ক্লিক করে গল্প যোগ করুন

`; const AD_CODE_2 = `
`; const AD_CODE_3 = `
`; const AD_CODE_4 = `
`; const AD_CODE_5 = `
`; const adCodes = [AD_CODE_1, AD_CODE_2, AD_CODE_3, AD_CODE_4, AD_CODE_5]; // ===== ADMIN TOGGLE ===== document.getElementById('admin-toggle').addEventListener('click', () => { document.getElementById('admin-panel').classList.add('open'); }); function closeAdmin() { document.getElementById('admin-panel').classList.remove('open'); } // Close on backdrop click document.getElementById('admin-panel').addEventListener('click', function(e) { if (e.target === this) closeAdmin(); }); // ===== GENERATE PAGE ===== function generatePage() { const raw = document.getElementById('story-input').value.trim(); if (!raw) return; const lines = raw.split('\n').map(l => l.trim()).filter(l => l.length > 0); if (lines.length === 0) return; const title = lines[0]; const paragraphs = lines.slice(1); // Update page title document.getElementById('page-title').textContent = title + ' · EarnBD'; // Build HTML let html = ''; // Header html += `

${escHtml(title)}

`; let adIndex = 0; let paraCount = 0; // Ad after every 3 paragraphs, max 5 ads const adEvery = Math.max(3, Math.floor(paragraphs.length / 5)); paragraphs.forEach((para, i) => { html += `

${escHtml(para)}

`; paraCount++; if (paraCount % adEvery === 0 && adIndex < 5 && i < paragraphs.length - 1) { html += adBox(adIndex + 1, adCodes[adIndex]); adIndex++; } }); // Fill remaining ads if fewer than 5 placed while (adIndex < 5) { html += adBox(adIndex + 1, adCodes[adIndex]); adIndex++; } html += `
`; // close article-body // Footer html += ` `; document.getElementById('article-card').innerHTML = html; closeAdmin(); window.scrollTo({ top: 0, behavior: 'smooth' }); } function adBox(num, code) { return `
বিজ্ঞাপন
${code}
`; } function escHtml(str) { return str .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"'); } function readingTime(text) { const words = text.split(/\s+/).length; return Math.max(1, Math.ceil(words / 200)); } function getBanglaDate() { const bn = new Intl.DateTimeFormat('bn-BD', { day: 'numeric', month: 'long', year: 'numeric' }); return bn.format(new Date()); }

Post a Comment

0 Comments