HinKhoj Dictionary & English Coach
Dictionary Word of the Day Word Games Vocabulary Tips Get the App — Free
/* ── Search result page ── */ .ds-page { background: #fff; padding-bottom: 16px; min-height: 40vh; --ds-head-grad: linear-gradient(90deg, #181481 0%, #3B0E6A 100%); } /* Hero search bar */ .ds-hero { background: var(--hkd-grad, linear-gradient(117deg, #03054F 0%, #680AC1 100%)); padding: 28px 0 24px; } /* The design's search row is as wide as the page, not a narrow centred box. */ .ds-hero .lang-search-wrap { max-width: none; margin: 0; } .ds-hero .hkd-search-row { gap: 14px; margin-bottom: 0; } .ds-hero .hkd-search-ipt { height: 54px; border: 0; border-radius: 12px; padding-left: 52px; font-size: 1rem; box-shadow: none; } .ds-hero .hkd-search-ico { left: 18px; width: 20px; height: 20px; } .ds-hero .hkd-search-btn { height: 54px; min-width: 137px; padding: 0 28px; border-radius: 12px; font-size: 1rem; font-weight: 700; } /* Sticky search. The script puts it directly under whatever is pinned above it -- the site header from 992px up, the download dock below that -- so it never covers either of them. */ #sticky-anchor { height: 0; } #sticky.stick { position: fixed; top: 0; left: 0; z-index: 999; width: 100%; background: var(--hkd-grad, linear-gradient(117deg, #03054F 0%, #680AC1 100%)); padding: 8px 16px; box-shadow: 0 4px 20px rgba(0,0,0,.18); } /* Pinned, the bar is slimmer than in the hero, so header + search + tabs together do not eat the screen. */ #sticky.stick .hkd-search-ipt, #sticky.stick .hkd-search-btn { height: 44px; } #sticky.stick .lang-search-wrap { max-width: 640px; margin: 0 auto; } /* From 992px the site header stays pinned, like on every other page. site-chrome.css switches that off on pages that pin their own search bar at top:0; here the bars are placed UNDER the header instead, so it is switched back on. Layers: the header keeps its own 1000 (so its menus are never hidden behind the bars at 999 and 900), and all of it stays under Bootstrap's modals (1040/1050), so the login pop-up is never covered by a pinned bar. */ @media (min-width: 992px) { body:has(#sticky-anchor) .hkd-topnav { position: sticky; } } /* Result container */ .ds-result-wrap { padding-top: 24px; } /* Section heading */ .ds-section-head { font-family: var(--hkd-font-disp, 'Space Grotesk', sans-serif); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--hkd-muted-fg, #6b7280); margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--hkd-border, #e2e5ec); } /* Word card (exact match) */ .ds-word-card { background: var(--hkd-card, #fff); border: 1px solid var(--hkd-border, #e2e5ec); border-radius: 1.25rem; box-shadow: 0 4px 24px -4px rgba(var(--hkd-primary-rgb, 94, 68, 228), .08); overflow: hidden; margin-bottom: 16px; } .ds-word-card__head { background: var(--ds-head-grad, linear-gradient(90deg, #181481 0%, #3B0E6A 100%)); padding: 20px 24px 16px; } .ds-word-card__label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.8); margin-bottom: 6px; } .ds-lang-switch { margin-top:.75rem; display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; } .ds-lang-switch__label { font-size:.82rem; color:rgba(255,255,255,.75); } .ds-lang-switch__select { font-size:.9rem; padding:.35rem .6rem; border-radius:.5rem; border:1px solid rgba(255,255,255,.25); background:rgba(255,255,255,.12); color:#fff; max-width:100%; } .ds-lang-switch__select option { color:#111; } .ds-lang-switch__list { display:flex; flex-wrap:wrap; gap:.4rem; list-style:none; padding:0; margin:.4rem 0 0; } .ds-lang-switch__list a { color:#fff; font-size:.82rem; text-decoration:underline; } .ds-word-card__word { font-family: var(--hkd-font-disp, 'Space Grotesk', sans-serif); font-size: clamp(1.6rem, 4vw, 2.25rem); font-weight: 700; color: #fff; line-height: 1.1; margin: 0; } .ds-word-card__body { padding: 20px 24px; } /* Pronunciation buttons */ .ds-pron-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; } .ds-pron-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 9999px; cursor: pointer; background: var(--hkd-bg, #f7f8fa); border: 1px solid var(--hkd-border, #e2e5ec); font-size: 1rem; color: var(--hkd-muted-fg, #6b7280); transition: background .18s, border-color .18s, box-shadow .18s; user-select: none; } .ds-pron-btn svg { width: 12px; height: 12px; flex-shrink: 0; stroke: currentColor; } .ds-pron-btn:hover { background: rgba(var(--hkd-primary-rgb, 94, 68, 228), .08); border-color: var(--hkd-primary, #6c5ce7); color: var(--hkd-primary, #6c5ce7); box-shadow: 0 2px 8px rgba(var(--hkd-primary-rgb, 94, 68, 228), .12); } .ds-ipa { font-size: .875rem; color: var(--hkd-muted-fg, #6b7280); margin-bottom: 10px; } .ds-hi-trans { font-size: .875rem; color: var(--hkd-muted-fg, #6b7280); margin-bottom: 16px; } /* Meaning items */ .ds-meaning-list { list-style: none; padding: 0; margin: 0; } .ds-meaning-item { padding: 14px 0; border-bottom: 1px solid var(--hkd-border, #e2e5ec); } .ds-meaning-item:last-child { border-bottom: none; } .ds-meaning-row { display: flex; align-items: flex-start; gap: 12px; } .ds-meaning-num { font-size: .75rem; font-weight: 700; color: var(--hkd-primary, #6c5ce7); min-width: 22px; padding-top: 3px; } .ds-meaning-body { flex: 1; min-width: 0; } .ds-meaning-hin { font-family: var(--hkd-font-disp, 'Space Grotesk', sans-serif); font-size: 1.1rem; font-weight: 700; color: var(--hkd-primary, #6c5ce7); text-decoration: none !important; } .ds-meaning-hin:hover { color: var(--hkd-accent, #f5a623); } .ds-meaning-eng { font-family: var(--hkd-font-disp, 'Space Grotesk', sans-serif); font-size: 1.05rem; font-weight: 600; color: var(--hkd-fg, #1a1a2e); text-decoration: none !important; } .ds-meaning-eng:hover { color: var(--hkd-primary, #6c5ce7); } .ds-meaning-gram { font-size: .8125rem; color: var(--hkd-muted-fg, #6b7280); font-style: italic; margin-left: 6px; } .ds-meaning-trans { font-size: .875rem; color: var(--hkd-muted-fg, #6b7280); margin-top: 2px; } .ds-meaning-trans a { color: var(--hkd-muted-fg, #6b7280); text-decoration: none !important; } .ds-meaning-trans a:hover { color: var(--hkd-primary, #6c5ce7); } .ds-example { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--hkd-primary, #6c5ce7); background: rgba(var(--hkd-primary-rgb, 94, 68, 228), .04); border-radius: 0 6px 6px 0; font-size: .875rem; color: var(--hkd-fg, #1a1a2e); line-height: 1.6; } .ds-example__label { font-weight: 600; font-size: .75rem; color: var(--hkd-muted-fg, #6b7280); margin-bottom: 2px; } .ds-pron-inline { display: inline-flex; align-items: center; margin-left: 8px; cursor: pointer; color: var(--hkd-muted-fg, #6b7280); vertical-align: middle; } .ds-pron-inline:hover { color: var(--hkd-primary, #6c5ce7); } /* Nearby card */ .ds-nearby-card { background: var(--hkd-card, #fff); border: 1px solid var(--hkd-border, #e2e5ec); border-radius: 1rem; padding: 20px 24px; margin-bottom: 12px; box-shadow: 0 2px 12px -2px rgba(var(--hkd-primary-rgb, 94, 68, 228), .06); } .ds-nearby-pair { font-size: 1rem; line-height: 1.5; } .ds-nearby-pair .ds-hin { font-weight: 700; color: var(--hkd-primary, #6c5ce7); text-decoration: none !important; } .ds-nearby-pair .ds-eng { font-weight: 600; color: var(--hkd-fg, #1a1a2e); text-decoration: none !important; } .ds-nearby-pair .ds-gram { font-size: .8125rem; color: var(--hkd-muted-fg, #6b7280); font-style: italic; } .ds-nearby-pair .ds-eq { color: var(--hkd-muted-fg, #6b7280); margin: 0 6px; } /* Def / content card */ .ds-def-card { background: var(--hkd-card, #fff); border: 1px solid var(--hkd-border, #e2e5ec); border-radius: 1rem; padding: 20px 24px; margin-bottom: 16px; box-shadow: 0 2px 12px -2px rgba(var(--hkd-primary-rgb, 94, 68, 228), .06); } .ds-def-card ul { padding-left: 20px; margin: 8px 0 0; } .ds-def-card li { font-size: .9375rem; color: var(--hkd-fg, #1a1a2e); line-height: 1.7; margin-bottom: 6px; } /* Chips */ .ds-chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .ds-chip { display: inline-block; padding: 5px 14px; border-radius: 9999px; font-size: .8125rem; font-weight: 500; text-decoration: none !important; transition: background .18s, color .18s; } .ds-chip--syn { background: rgba(var(--hkd-primary-rgb, 94, 68, 228), .1); color: var(--hkd-primary, #6c5ce7); border: 1px solid rgba(var(--hkd-primary-rgb, 94, 68, 228), .2); } .ds-chip--syn:hover { background: var(--hkd-primary, #6c5ce7); color: #fff; } .ds-chip--ant { background: hsla(0,70%,55%,.08); color: #c0392b; border: 1px solid hsla(0,70%,55%,.2); } .ds-chip--ant:hover { background: #c0392b; color: #fff; } /* No result */ .ds-no-result { background: var(--hkd-card, #fff); border: 1px solid var(--hkd-border, #e2e5ec); border-radius: 1.25rem; padding: 36px 32px; text-align: center; margin-bottom: 20px; } .ds-no-result__icon { font-size: 2.5rem; margin-bottom: 12px; } .ds-no-result__title { font-family: var(--hkd-font-disp, 'Space Grotesk', sans-serif); font-size: 1.2rem; font-weight: 700; color: var(--hkd-fg, #1a1a2e); margin-bottom: 8px; } .ds-no-result__sub { font-size: .9375rem; color: var(--hkd-muted-fg, #6b7280); } /* Usage items */ .ds-usage-item { padding: 10px 0; border-bottom: 1px solid var(--hkd-border, #e2e5ec); font-size: .9375rem; line-height: 1.65; } .ds-usage-item:last-child { border-bottom: none; } .ds-wiki-card { display: flex; gap: 20px; margin-top: 12px; align-items: flex-start; } .ds-wiki-card img { width: 140px; height: 140px; object-fit: cover; border-radius: 8px; flex-shrink: 0; } .ds-wiki-card__text { font-size: .9375rem; line-height: 1.7; color: var(--hkd-fg, #1a1a2e); } /* SEO block */ .ds-seo-block { background: var(--hkd-card, #fff); border: 1px solid var(--hkd-border, #e2e5ec); border-radius: 1rem; padding: 20px 24px; margin-top: 24px; font-size: .875rem; color: var(--hkd-muted-fg, #6b7280); line-height: 1.75; } .ds-seo-block h4 { font-size: .9375rem; font-weight: 700; color: var(--hkd-fg, #1a1a2e); margin-bottom: 8px; } /* Popular words */ .ds-popular-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } /* Autocomplete */ #acWords { border: 1px solid var(--hkd-border, #e2e5ec); background: var(--hkd-card, #fff); border-radius: 0 0 .75rem .75rem; overflow: auto; box-shadow: 0 8px 24px -4px rgba(0,0,0,.12); } .ac-word { padding: 10px 16px; font-size: .9375rem; color: var(--hkd-fg, #1a1a2e); cursor: pointer; border-bottom: 1px solid var(--hkd-border, #e2e5ec); } .ac-word:last-child { border-bottom: none; } .ac-word:hover { background: rgba(var(--hkd-primary-rgb, 94, 68, 228), .06); color: var(--hkd-primary, #6c5ce7); } /* Tabs (Meaning / Definition / Sentence) -- a segmented control on the white page, directly under the header and above the word card, like the app's own tabs. Every section stays rendered and the tabs only scroll to it: hiding panels would pull the meanings out of what crawlers weigh, and this page lives on search. Pinned by a class rather than position:sticky, because the shared header sets body{overflow-x:hidden !important}: that makes body a scroll container, and a sticky child then pins itself to something that never scrolls. */ .ds-jump-wrap { margin-top: 20px; } /* The pinned bar must be exactly as tall as the resting one: the script measures the resting height and uses it to land a clicked section under the bars. So the padding and the (transparent) border live on .ds-jump in both states. The margin sits on the wrap, not inside it, so the height the script reserves is the bar's alone. */ .ds-jump { padding: 8px 0; border-bottom: 1px solid transparent; } .ds-jump-wrap + .ds-result-wrap { padding-top: 8px; } .ds-jump__inner { display: inline-flex; gap: 4px; max-width: 100%; padding: 6px; border-radius: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; background: #F1F5F9; box-shadow: inset 0 0 0 1px #E2E8F0; } .ds-jump__inner::-webkit-scrollbar { display: none; } .ds-jump.stick { position: fixed; left: 0; right: 0; z-index: 900; background: #fff; border-bottom: 1px solid var(--hkd-border, #e2e5ec); box-shadow: 0 6px 16px -10px rgba(15, 23, 42, .35); } /* Realign the tabs with .container once the bar spans the whole viewport. */ .ds-jump.stick .ds-jump__row { margin: 0 auto; padding: 0 15px; } @media (min-width: 768px) { .ds-jump.stick .ds-jump__row { width: 750px; } } @media (min-width: 992px) { .ds-jump.stick .ds-jump__row { width: 970px; } } @media (min-width: 1200px) { .ds-jump.stick .ds-jump__row { width: 1170px; } } /* The pinned search bar otherwise keeps the form's bottom margin, which is dead space once fixed -- and the tabs park directly beneath it. */ #sticky.stick .hkd-search-row { margin-bottom: 0; } .ds-jump__pill { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 32px; border-radius: 10px; white-space: nowrap; cursor: pointer; font-size: .75rem; font-weight: 600; line-height: 1; color: #64748B; background: transparent; text-decoration: none !important; transition: background .18s, color .18s; } .ds-jump__pill:hover { color: #0F172A; background: rgba(15, 23, 42, .05); } .ds-jump__pill.is-active { background: #fff; color: var(--hkd-primary-dark, #1D4ED8); font-weight: 700; box-shadow: 0 2px 8px -2px rgba(15, 23, 42, .22); } .ds-jump__pill.is-active::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #10B981; } #meaning-section, #word_definitions, #sentences { scroll-margin-top: 16px; } /* Part of speech badge */ .ds-pos { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 9px; border-radius: 9999px; font-size: .6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: rgba(var(--hkd-primary-rgb, 94, 68, 228), .1); color: var(--hkd-primary, #6c5ce7); } .ds-pos--lead { display: table; margin-left: 0; margin-bottom: 8px; } /* Example sentences -- held in one section of their own instead of nailed to a single gloss, because the stored example often illustrates another sense. */ .ds-keymeanings { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .ds-keymeanings__lbl { font-size: .75rem; font-weight: 600; color: var(--hkd-muted-fg, #6b7280); margin-right: 2px; } .ds-keymeanings a { padding: 4px 12px; border-radius: 9999px; font-size: .8125rem; font-weight: 600; background: rgba(var(--hkd-primary-rgb, 94, 68, 228), .08); color: var(--hkd-primary, #6c5ce7); border: 1px solid rgba(var(--hkd-primary-rgb, 94, 68, 228), .18); text-decoration: none !important; transition: background .18s, color .18s; } .ds-keymeanings a:hover { background: var(--hkd-primary, #6c5ce7); color: #fff; } .ds-sent-list { display: grid; gap: 10px; margin-top: 14px; } .ds-sent { border: 1px solid var(--hkd-border, #e2e5ec); border-radius: .75rem; padding: 12px 16px; background: var(--hkd-card, #fff); transition: border-color .18s, box-shadow .18s; } .ds-sent:hover { border-color: rgba(var(--hkd-primary-rgb, 94, 68, 228), .35); box-shadow: 0 2px 12px -4px rgba(var(--hkd-primary-rgb, 94, 68, 228), .22); } .ds-sent__primary { font-size: .9375rem; line-height: 1.65; color: var(--hkd-fg, #1a1a2e); } .ds-sent__primary mark { background: rgba(var(--hkd-primary-rgb, 94, 68, 228), .14); color: var(--hkd-primary, #6c5ce7); font-weight: 700; padding: 0 2px; border-radius: 3px; } .ds-sent__secondary { font-size: .9375rem; line-height: 1.75; color: var(--hkd-muted-fg, #6b7280); margin-top: 5px; } .ds-sent-note { font-size: .75rem; font-style: italic; color: var(--hkd-muted-fg, #6b7280); margin-top: 14px; } @media (max-width: 767px) { .ds-hero { padding: 16px 0 18px; } .ds-hero .hkd-search-row { gap: 10px; } .ds-hero .hkd-search-ipt { height: 48px; padding-left: 46px; } .ds-hero .hkd-search-ico { left: 15px; } .ds-hero .hkd-search-btn { height: 48px; min-width: 105px; padding: 0 18px; font-size: .9375rem; } .ds-jump__inner { display: flex; width: 100%; } .ds-jump__pill { flex: 1 1 0; padding: 0 8px; font-size: .8125rem; } .ds-word-card__head { padding: 16px 18px 12px; } .ds-word-card__body { padding: 14px 18px; } .ds-nearby-card { padding: 14px 16px; } .ds-wiki-card { flex-direction: column; } .ds-wiki-card img { width: 100%; height: auto; } .ds-jump.stick .ds-jump__row { padding: 0 12px; } .ds-sent { padding: 10px 14px; } }

Speak English. Learn Smarter.

AI English Coach • 12+ Language Dictionary • Smart Translator • Pronunciation • Save Words

Download App Now

Speak English. Learn Smarter.

Download App
Bengali Word

জনগণ

IPA: kɑmənwɛlθ
🔊 Bengali Pronunciation
English Meanings
Advertisement
Other Related Words
জনগণনা = CENSUS (noun) 🔊
একটি বিস্তারিত আদমশুমারি শহুরে উন্নয়ন প্রকল্পের জন্য গুরুত্বপূর্ণ তথ্য সরবরাহ করে।
A detailed census provides crucial data for urban development projects.
তার সাধারণ ভাষা তার বক্তৃতাগুলিকে খুব জনপ্রিয় করে তুলেছিল।
His demotic language made his speeches very popular.
জনসংখ্যার পরিবর্তনের জন্য আন্তঃগণনা অনুমান ব্যবহার করা হয়।
Intercensal estimates are used for population changes.
Advertisement
Example Sentences of “জনগণ” (1)
Noun
জনগণের কল্যাণ, অর্থাৎ এর মানুষের কল্যাণ, সরকারের অগ্রাধিকার।
The welfare of the commonwealth, meaning its people, is the government's priority.
These sentences show how জনগণ is used in context. The exact sense can differ from one sentence to the next.

HinKhoj Bengali English Dictionary: জনগণ

Meaning of জনগণ in English, What is the meaning of in English Dictionary. Pronunciation, synonyms, antonyms, sentence usage and definition of জনগণ . meaning, pronunciation, definition, synonyms and antonyms in English. জনগণ ka angrezi mein matalab arth aur proyog

Tags: English meaning of জনগণ, Bengali to English, define জনগণ

Browse English-Bengali Dictionary

Browse by English Alphabets
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Browse by Bengali Varnamala

Start speaking today

Download Free — Start Today

Join 50 million+ learners already using HinKhoj on Android and iOS to speak confident English without hesitation.

★★★★ 4.3 on Google Play · 100% Free Core Features · No Credit Card Required

/* The pinned stack. From the top: the site header (992px and up, where it is pinned), the download dock (below 992px), the search bar, the tabs. Each one sits directly under the one above it, so none of them can cover another. */ function headerBottom() { var hd = document.querySelector('.hkd-topnav'); // Its real bottom edge: the full header height at the top of the page and while pinned, 0 wherever it is not pinned at all. return (hd && getComputedStyle(hd).position === 'sticky') ? Math.max(0, Math.round(hd.getBoundingClientRect().bottom)) : 0; } function dockHeight() { var $d = $('#ds-appdock'); return ($d.length && $d.css('display') !== 'none') ? $d.outerHeight() : 0; } // Pinned above the search bar right now. function topOffset() { return headerBottom() + ($('#ds-appdock').hasClass('is-on') ? dockHeight() : 0); } // Pinned above the tabs right now. function barHeight() { return topOffset() + ($('#sticky').hasClass('stick') ? $('#sticky').outerHeight() : 0); } /* The search bar's pinned height, even while it is not pinned. #sticky-anchor has no height, so the hero collapses when the bar pins and everything below shifts up by that bar's height. Measuring needs the pinned class, which goes on and off inside a single tick -- no paint happens in between, so nothing flickers. */ function pinnedBarHeight() { var $s = $('#sticky'); if (!$s.length) { return 0; } if ($s.hasClass('stick')) { return $s.outerHeight(); } $s.addClass('stick'); var h = $s.outerHeight(); $s.removeClass('stick'); return h; } function sticky_relocate() { var wt = $(window).scrollTop(); var dt = $('#sticky-anchor').offset().top; // Small screens: the dock appears just as the search bar would reach the top, and the bar then pins under it. var $dock = $('#ds-appdock'), dh = dockHeight(); if ($dock.length) { $dock.toggleClass('is-on', dh > 0 && wt + dh + headerBottom() > dt); } var top = topOffset(); if (wt + top > dt) { $('#sticky').addClass('stick').css('top', top + 'px'); } else { $('#sticky').removeClass('stick').css('top', ''); } } $(function() { $(window).on('scroll resize load', sticky_relocate); sticky_relocate(); }); /* The app card in the right-hand column stays on screen while the results scroll past. It sticks just under the pinned stack (header + search bar + tabs), so it can never sit beneath any of them, and it travels no further than the end of its own column, so it cannot reach the sections below. If the window is too short for the whole card it drops the phone picture; if even that does not fit it stays put like any other block. */ $(function() { var $c = $('.ds-appcard'); if (!$c.length) { return; } function fit() { if (!$c.is(':visible')) { return; } var tabs = $('#ds-jump-wrap').is(':visible') ? $('#ds-jump').outerHeight() : 0; var top = headerBottom() + pinnedBarHeight() + tabs + 16; document.documentElement.style.setProperty('--ds-card-top', top + 'px'); $c.removeClass('is-compact is-free'); var room = window.innerHeight - top - 16; if ($c.outerHeight() > room) { $c.addClass('is-compact'); if ($c.outerHeight() > room) { $c.addClass('is-free'); } } } $(window).on('resize load', fit); fit(); }); /* Jump nav. The pills stay real anchors so they still work if this never runs; when it does, we scroll by hand, which also keeps the URL free of a hash. */ $(function() { var $nav = $('#ds-jump'), $wrap = $('#ds-jump-wrap'); if (!$nav.length) { return; } var $pills = $nav.find('.ds-jump__pill'); var navH = $nav.outerHeight(), restAt = $wrap.offset().top; // Reserve the nav's height up front so pinning it never jumps the page. $wrap.css('min-height', navH); function sectionOf($p) { return $($p.attr('href')); } // What is actually covering the top of the viewport at this moment. function chromeNow() { return ($nav.hasClass('stick') ? navH : 0) + barHeight() + 12; } function place() { var bar = barHeight(); // Re-read while unpinned: late-loading images above can shift the anchor. if (!$nav.hasClass('stick')) { restAt = $wrap.offset().top; } if ($wrap.is(':visible') && $(window).scrollTop() + bar >= restAt) { $nav.addClass('stick').css('top', bar + 'px'); } else { $nav.removeClass('stick').css('top', ''); } } function sync() { var $vis = $pills.filter(':visible'); if (!$vis.length) { return; } var line = $(window).scrollTop() + chromeNow() + 24; var $best = $vis.first(); $vis.each(function() { var $t = sectionOf($(this)); if ($t.length && $t.offset().top <= line) { $best = $(this); } }); $pills.removeClass('is-active'); $best.addClass('is-active'); } /* One pill is not a nav. A word with no definition and no stored sentences would otherwise get a lone "Meaning" chip pinned to the top of the page. */ function refresh() { $wrap.toggle($pills.filter(':visible').length > 1); place(); sync(); } window.hkdJumpRefresh = refresh; /* Land the heading just under the pinned bars. Document offsets read before the scroll are wrong by whatever pins or collapses on the way there, so finish by measuring against the viewport and correcting. */ function settle($t) { var delta = $t[0].getBoundingClientRect().top - chromeNow(); if (Math.abs(delta) > 1) { window.scrollTo(0, Math.max($(window).scrollTop() + delta, 0)); } } $pills.on('click', function(e) { var $t = sectionOf($(this)); if (!$t.length) { return; } e.preventDefault(); /* The first tab is the top of the results, which is the top of the page: going there puts the whole word card in view. (Aiming it under the pinned bars is impossible: scrolled that far up, the bars are not pinned yet.) */ var first = $(this).is($pills.filter(':visible').first()); var to = first ? 0 : Math.max($t.offset().top - (navH + headerBottom() + dockHeight() + pinnedBarHeight() + 12), 0); $('html, body').stop(true).animate({ scrollTop: to }, 300, function() { // Twice: the first correction can itself change what is pinned. place(); if (!first) { settle($t); place(); settle($t); } sync(); }); }); $(window).on('scroll resize', function() { place(); sync(); }); $(window).on('load', refresh); refresh(); });