|
7 | 7 | export let publicationDate = 1827; |
8 | 8 | export let author = 'Nicolas, Nicholas Harris, Sir, 1799-1848.'; |
9 | 9 | export let supportsSelection = true; |
| 10 | + export let visited = false; |
10 | 11 |
|
11 | 12 | let coverUrl = `https://babel.hathitrust.org/cgi/imgsrv/cover?id=${htid}&width=250`; |
12 | 13 | let blankImage = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=`; |
|
43 | 44 | <a |
44 | 45 | class="list-group-item list-group-item-action w-sm-50" |
45 | 46 | href="http://catalog.hathitrust.org/Record/{catalogId}" |
46 | | - ><i class="fa-solid fa-circle-info" aria-hidden="true" /> <span>Catalog Record</span></a |
| 47 | + ><i class="fa-solid fa-circle-info" aria-hidden="true" /> <span>Catalog Record</span>{#if visited}<i |
| 48 | + aria-hidden="true" |
| 49 | + class="visited-link fa-solid fa-check-double" |
| 50 | + ></i>{/if}</a |
47 | 51 | > |
48 | 52 | {#if access == 'multiple-items'} |
49 | 53 | <a |
|
54 | 58 | <!-- <span class="list-group-item w-sm-50 border-0 bg-transparent fs-7">Use the Catalog Record to view multiple volumes</span> --> |
55 | 59 | {:else if access == 'limited-search-only'} |
56 | 60 | <a class="list-group-item list-group-item-action w-sm-50" href="https://babel.hathitrust.org/cgi/pt?id={htid}" |
57 | | - ><i aria-hidden="true" class="fa-solid fa-lock" /> <span>Limited (search-only)</span></a |
| 61 | + ><i aria-hidden="true" class="fa-solid fa-lock" /> <span>Limited (search-only)</span>{#if visited}<i |
| 62 | + aria-hidden="true" |
| 63 | + class="visited-link fa-solid fa-check-double" |
| 64 | + ></i>{/if}</a |
| 65 | + > |
| 66 | + {:else if access == 'registered-access'} |
| 67 | + <a |
| 68 | + data-activated-role="superuser" |
| 69 | + class="list-group-item list-group-item-action w-sm-50" |
| 70 | + href="https://babel.hathitrust.org/cgi/pt?id={htid}" |
| 71 | + ><i aria-hidden="true" class="fa-solid fa-lock-open" /> <span>Registered Access</span>{#if visited}<i |
| 72 | + aria-hidden="true" |
| 73 | + class="visited-link fa-solid fa-check-double" |
| 74 | + ></i>{/if}</a |
58 | 75 | > |
59 | 76 | {:else if access == 'limited-access-permitted'} |
60 | 77 | <a |
61 | | - data-access-role="superuser" |
| 78 | + data-activated-role="superuser" |
62 | 79 | class="list-group-item list-group-item-action w-sm-50" |
63 | 80 | href="https://babel.hathitrust.org/cgi/pt?id={htid}" |
64 | | - ><i aria-hidden="true" class="fa-solid fa-unlock-keyhole" /> <span>Limited (access permitted)</span></a |
| 81 | + ><i aria-hidden="true" class="fa-solid fa-unlock" /> <span>Limited (access permitted)</span>{#if visited}<i |
| 82 | + aria-hidden="true" |
| 83 | + class="visited-link fa-solid fa-check-double" |
| 84 | + ></i>{/if}</a |
65 | 85 | > |
66 | 86 | {:else} |
67 | 87 | <a |
68 | 88 | class="list-group-item list-group-item-action active active w-sm-50" |
69 | 89 | href="https://babel.hathitrust.org/cgi/pt?id={htid}" |
70 | | - ><i class="fa-regular fa-file-lines" aria-hidden="true" /> <span>Full View</span></a |
| 90 | + ><i class="fa-regular fa-file-lines" aria-hidden="true" /> <span>Full View</span>{#if visited}<i |
| 91 | + aria-hidden="true" |
| 92 | + class="visited-link fa-solid fa-check-double" |
| 93 | + ></i>{/if}</a |
71 | 94 | > |
72 | 95 | {/if} |
73 | 96 | </div> |
|
106 | 129 | text-decoration: none; |
107 | 130 | } |
108 | 131 |
|
109 | | - a[data-access-role] { |
110 | | - background: #924a0b; |
111 | | - // border-radius: 4px; |
112 | | - color: white; |
| 132 | + .list-group { |
| 133 | + a { |
| 134 | + white-space: nowrap; |
113 | 135 |
|
114 | | - &:hover { |
115 | | - background: white; |
116 | | - color: #924a0b; |
| 136 | + &:has(+ span) { |
| 137 | + border-top-right-radius: var(--bs-list-group-border-radius) !important; |
| 138 | + border-bottom-right-radius: var(--bs-list-group-border-radius) !important; |
| 139 | + } |
| 140 | + .visited-link { |
| 141 | + color: var(--bs-list-group-color); |
| 142 | + margin-left: auto; |
| 143 | + } |
| 144 | + &:hover .visited-link, |
| 145 | + &:focus .visited-link { |
| 146 | + color: var(--bs-list-group-action-hover-color); |
| 147 | + } |
| 148 | +
|
| 149 | + &:active .visited-link { |
| 150 | + color: var(--bs-list-group-action-active-bg); |
| 151 | + } |
| 152 | +
|
| 153 | + .visited-link { |
| 154 | + color: var(--bs-list-group-color); |
| 155 | + } |
| 156 | +
|
| 157 | + // &.active .visited-link { |
| 158 | + // color: var(--bs-list-group-active-bg); |
| 159 | + // } |
| 160 | +
|
| 161 | + &.active .visited-link { |
| 162 | + color: var(--bs-list-group-active-color); |
| 163 | + } |
| 164 | + } |
| 165 | + .list-group-item { |
| 166 | + display: flex; |
| 167 | + align-items: center; |
| 168 | + gap: 0.5rem; |
117 | 169 | } |
118 | 170 | } |
| 171 | + a[data-activated-role] { |
| 172 | + background: var(--color-primary-800); |
| 173 | + color: white; |
119 | 174 |
|
120 | | - .list-group a { |
121 | | - white-space: nowrap; |
122 | | -
|
123 | | - &:has(+ span) { |
124 | | - border-top-right-radius: var(--bs-list-group-border-radius) !important; |
125 | | - border-bottom-right-radius: var(--bs-list-group-border-radius) !important; |
| 175 | + &:hover, |
| 176 | + &:focus { |
| 177 | + background: white; |
| 178 | + color: var(--color-primary-800); |
| 179 | + } |
| 180 | + .visited-link { |
| 181 | + color: var(--color-shades-0); |
| 182 | + } |
| 183 | + &:hover .visited-link, |
| 184 | + &:focus .visited-link { |
| 185 | + color: var(--color-primary-800); |
| 186 | + } |
| 187 | + &:active { |
| 188 | + background-color: var(--color-primary-900); |
| 189 | + color: var(--color-shades-0); |
| 190 | + } |
| 191 | + &:active .visited-link { |
| 192 | + color: var(--color-shades-0); |
126 | 193 | } |
127 | 194 | } |
128 | 195 | </style> |
0 commit comments