Skip to content

Commit

Permalink
updating home
Browse files Browse the repository at this point in the history
  • Loading branch information
respinos committed Dec 4, 2023
1 parent dc2e3e6 commit 7c3c3ac
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 5 deletions.
8 changes: 7 additions & 1 deletion src/js/text/handlers/item-page-navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ window.addEventListener('DOMContentLoaded', (event) => {
// Where to grab the headings to build the table of contents.
contentSelector: '.main-panel',
// Which headings to grab inside of the contentSelector element.
headingSelector: 'h2, h3, h4',
headingSelector: 'h2, h3, h4, a.card[id]',
// For headings inside relative or absolute positioned containers within content.
hasInnerContainers: true,
collapseDepth: 6,
scrollSmooth: true,
headingObjectCallback: function(object, el) {
if ( el.classList.contains('card') ) {
object.headingLevel = 3;
}
return object;
}
// scrollEndCallback: function(event) {
// pageIndexDropdown.value = document.querySelector('.is-active-link').getAttribute('href');
// },
Expand Down
3 changes: 3 additions & 0 deletions styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -970,14 +970,17 @@ fieldset legend {

.results-list--grid .results-list__content h3:hover {
box-shadow: none;
background: transparent;
}

.results-list--grid .results-list__content h3 a {
box-shadow: inset 0 -1px #1d7491;
}

.results-list--grid .results-list__content h3 a:hover {
background: var(--color-maize-300);
box-shadow: inset 0 -2px #1d7491;
transition: background 0.5s;
}

.results-list__image {
Expand Down
4 changes: 4 additions & 0 deletions styles/text/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,8 @@ a.is-active-link {
}
.is-active-link::before {
background-color: var(--color-teal-400);
}

a.card:has(img) h3 {
scroll-margin-top: 12.5rem;
}
1 change: 1 addition & 0 deletions templates/text/qbat/qbat.base.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
<xsl:variable name="root-href">
<xsl:choose>
<xsl:when test="$docroot = '/'">/samples/</xsl:when>
<xsl:when test="starts-with($api_url, 'https://dcp-proto')">/samples/</xsl:when>
<xsl:when test="starts-with($api_url, 'https://quod.lib')">/lib/colllist/?byFormat=Text%20Collections</xsl:when>
<xsl:otherwise>/cgi/c/collsize/coll-idx?byFormat=Text%20Collections</xsl:otherwise>
</xsl:choose>
Expand Down
16 changes: 13 additions & 3 deletions templates/text/qbat/qbat.home.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
<div class="[ gallery-view ]">
<xsl:for-each select="xhtml:figure">
<!-- <div class="[ card ]"> -->
<a class="[ card ][ border mb-1 ]" href="{@href}">
<a class="[ card ][ border mb-1 ]" href="{@href}" id="{@id}">
<xsl:apply-templates select="xhtml:img" mode="card-image" />
<xsl:apply-templates select="xhtml:xfigcaption/xhtml:h3" mode="card-title" />
<xsl:apply-templates select="xhtml:figcaption" mode="card-body" />
Expand All @@ -202,7 +202,17 @@
<xsl:apply-templates select="." mode="copy-guts" />
</xsl:template>

<xsl:template match="xhtml:figcaption/xhtml:h3" mode="copy-guts" priority="101" />
<xsl:template match="xhtml:h3" mode="card-title" priority="102">
<h3 class="[ card__heading ]">
<xsl:apply-templates select="." mode="copy-guts" />
</h3>
</xsl:template>

<xsl:template match="xhtml:figcaption/xhtml:h3" mode="copy" priority="101">
<h3 class="card__heading js-toc-ignore">
<xsl:apply-templates select="." mode="copy-guts" />
</h3>
</xsl:template>

<xsl:template match="qui:block[@slot='contentwarning']">
<xsl:if test="normalize-space(.)">
Expand Down Expand Up @@ -273,7 +283,7 @@
</xsl:template>

<xsl:template match="qui:figure" mode="build-figure">
<figure class="flex align-center flex-flow-column">
<figure class="flex align-center flex-flow-column" id="{@id}">
<xsl:apply-templates select="qui:img" />
<xsl:apply-templates select="qui:caption" />
</figure>
Expand Down
2 changes: 1 addition & 1 deletion templates/text/qui/qui.home.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<xsl:template match="div[@data-slot='contents'][Content]" mode="copy-guts" priority="101">
<!-- we are doing a nested thing -->
<xsl:for-each select="Content/section">
<xhtml:figure href="browse#{@id}">
<xhtml:figure href="browse#{@id}" id="fig-{@id}">
<xhtml:img src="{img/@src}" alt="{img/@alt}" />
<xhtml:figcaption>
<xhtml:h3 id="{@id}">
Expand Down

0 comments on commit 7c3c3ac

Please sign in to comment.