diff --git a/;w b/;w deleted file mode 100644 index 1344455..0000000 --- a/;w +++ /dev/null @@ -1,207 +0,0 @@ -/* ============================================================ - COLLECTION GRID - ============================================================ */ - -.grid-item { - border: 1px solid #ccc; - padding: 8px; - border-radius: 4px; - box-shadow: rgba(0, 0, 0, 0.39) 0px 5px 11px -2px; - line-height: 1; -} - -.grid-item .grid-item__image { - margin: 0; - background: #ece8e3; - overflow: hidden; - height: 350px; -} - -.grid-item .grid-item__image img { - width: 100%; -} - -.grid-item .grid-item__title { - display: block; - padding: 0.5em 0; - line-height: 1.2; - margin: 5px 0 6px; - font-weight: bold; - border-bottom: 1px dotted #574938; - font-size: 0.8em; -} - -.grid-item .grid-item__title a { - text-decoration: none; - font-family: var(--font-serif); - color: var(--color--upei-red); -} - -.grid-item .views-field-field-abstract, -.grid-item .abstract { - display: block; - line-height: 1.4; - margin-bottom: 5px; - font-size: 0.9em; - color: var(--color-text-neutral-medium); -} - -.grid-item .views-field-field-abstract a.views-more-link, -.grid-item .abstract a.views-more-link { - text-decoration: underline; -} - -.grid-item .views-field-member-of-title { - line-height: 1.2; -} -.grid-item .views-label, -.grid-item .views-field-member-of-title .field__label { - font-size: 0.8em; - font-weight: bold; - font-family: var(--font-serif); - color: var(--color--upei-red); -} - -.grid-item .views-field-member-of-title .field__item { - font-size: 0.9em; -} - -div#block-olivesnews-solrsearchcontentsearchresultspagerforpage { - margin: 0; -} - -div#block-olivesnews-content .view-header { - margin: 0; -} -/* ============================================================ - FACETS - ============================================================ */ - -.facets-widget-links ul { - list-style-type: none; - margin-left: 0; -} - -.facets-widget-links ul li { - margin-bottom: 3px; -} - -.facets-widget-links ul span.facet-item__count { - font-weight: 600; -} -.facets-widget-range_nouislider ul { - list-style-type: none; - margin: 0; -} - -.facets-widget-range_nouislider .facet-slider { - margin: 60px 14px 0; -} - -.facets-widget-range_nouislider .js-form-type-textfield { - display: flex; - /* width: 100%; */ -} - -.facets-widget-range_nouislider label.form-item__label { - width: 3em; -} - -.facets-widget-range_nouislider .noUi-tooltip { - border: 1px solid #8196a2; -} -.facets-widget-range_nouislider .noUi-connect { - background: #691803; -} - -/* ============================================================ - SITE HEADER - ============================================================ */ - -div#block-olivesnews-site-branding { - background: #333; -} - -.site-header__initial { - background: #000; -} - -.social-bar { - background-image: url(../../images/natural_paper.png); -} -/* ============================================================ - Accordion pages - ============================================================ */ -.form-item-field-edtf-date-issued-value label.form-item__label { - /*font-family: var(--font-serif);*/ - font-size: var(--font-size-base); -} -/* ============================================================ - BROWSE PAGE - ============================================================ */ -.view-newspaper-directory img { - border: 1px solid #ccc; - padding: 2px; - width: 150px; -} -.node--type-islandora-object .field { - display: flex; - border-bottom: 1px dotted #ccc; - margin: 0; - padding-bottom: 0.5em; - margin-bottom: 0.5em; - - .field__label { - font-family: var(--font-sans); - font-size: var(--font-size-base); - flex: 0 0 150px; - } - .field__item { - font-family: var(--font-sans); - font-size: var(--font-size-base); - flex: 1; - line-height: 2; - p { - margin: 0; - } - } - summary { - font-family: var(--font-sans); - font-size: var(--font-size-base); - margin: 0; - } -} -.node--type-islandora-object .field--name-field-contributor-details { - p { - display: flex; - border-bottom: 1px dotted #ccc; - strong { - flex: 0 0 155px; - /*text-align:right;*/ - } - } -} -div#block-views-block-media-display-blocks-source:has(.view-empty) { - display: none; -} /*display: flex;*/ -div#edit-citation-info { - margin-right: 1em; -} - -div#formatted-bibliography:has(div) { - box-shadow: rgba(0, 0, 0, 0.39) 0px 5px 11px -2px; - border: 1px solid #ccc; - padding: 1em; - margin: 0; -} -.expAll, .collAll { - margin: .5em; - display: inline-block; -} -nav.pager { - display: flex; - justify-content: space-around; -} -div#block-olivesnews-creatorsandcontributors .block__title { - line-height: 1; -} diff --git a/css/components/islandora_mods.css b/css/components/islandora_mods.css index 3d1b59a..689c971 100755 --- a/css/components/islandora_mods.css +++ b/css/components/islandora_mods.css @@ -129,6 +129,24 @@ div#block-olivesnews-site-branding { .social-bar { background-image: url(../../images/natural_paper.png); } +/* ============================================================ + Directory + ============================================================ */ +.newspaper-directory .views-row { + border-bottom: 1px solid #ccc; + margin-bottom: 1em; + strong { + font-family: var(--font-serif); + font-size: var(--font-size-base); + a { + text-decoration: none; + } + } + p { + margin-left: 1em; + } +} + /* ============================================================ Accordion pages ============================================================ */ @@ -251,3 +269,15 @@ nav.pager { div#block-olivesnews-creatorsandcontributors .block__title { line-height: 1; } +/*misc*/ +article .text-content img { + border: 1px solid #ccc; + padding: 4px; +} +#election_dates h2 { + margin: 1; + padding: 3px 0px 3px 0px; + text-align: center; + color: #fff; + font-family: var(--font-serif) !important; +} diff --git a/css/components/readmore.css b/css/components/readmore.css new file mode 100644 index 0000000..f3daaa2 --- /dev/null +++ b/css/components/readmore.css @@ -0,0 +1,24 @@ +.read-more-box { + display: -webkit-box; + -webkit-line-clamp: var(--clamp-lines, 3); + -webkit-box-orient: vertical; + overflow: hidden; + transition: all 0.3s ease; +} + +.read-more-box.expanded { + display: block; + overflow: visible; +} + +.read-more-btn { + background: none; + border: none; + color: var(--color--upei-red); + cursor: pointer; + padding: 4px 0; + font: inherit; + text-decoration: underline; + display: block; + margin-top: 4px; +} diff --git a/js/readmore.js b/js/readmore.js new file mode 100644 index 0000000..dc603bc --- /dev/null +++ b/js/readmore.js @@ -0,0 +1,42 @@ +(function (Drupal) { + 'use strict'; + + Drupal.behaviors.readMore = { + attach: function (context, settings) { + + function initReadMore({ + selector = '.truncate-me', + lines = 3, + moreText = 'Read more', + lessText = 'Read less' + } = {}) { + + once('readMore', selector, context).forEach(el => { + el.classList.add('read-more-box'); + el.style.setProperty('--clamp-lines', lines); + + const isTruncated = el.scrollHeight > el.clientHeight; + if (!isTruncated) return; + + const btn = document.createElement('button'); + btn.className = 'read-more-btn'; + btn.textContent = moreText; + + btn.addEventListener('click', () => { + const expanded = el.classList.toggle('expanded'); + btn.textContent = expanded ? lessText : moreText; + }); + + el.insertAdjacentElement('afterend', btn); + }); + } + + initReadMore({ + selector: '.field--type-text-long p', + lines: 4, + }); + + } + }; + +}(Drupal)); diff --git a/olivesnews.libraries.yml b/olivesnews.libraries.yml index 452e503..3db1dce 100755 --- a/olivesnews.libraries.yml +++ b/olivesnews.libraries.yml @@ -54,10 +54,12 @@ global-styling: css/components/unsorted.css: {} css/components/islandora_mods.css: {} css/components/advanced_search.pager.css: {} + css/components/readmore.css: {} js: js/checkbox.js: {} js/custom.js: {} + js/readmore.js: {} dependencies: - core/drupal