snapshot_live.html 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326
  1. {% load static tz core_tags %}
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <title>{{title}}</title>
  6. <meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">
  7. <style>
  8. /* Keep this inline, don't move to external css file because this template is used to generate static exports that need to be usable as-is without an accompanying staticfiles dir */
  9. * { box-sizing: border-box; }
  10. html, body {
  11. width: 100%;
  12. height: 100%;
  13. background-color: #ddd;
  14. margin: 0;
  15. padding: 0;
  16. }
  17. body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
  18. a { color: inherit; text-decoration: none; }
  19. a:hover { text-decoration: underline; }
  20. .container-fluid { width: 100%; margin: 0 auto; padding: 0 12px; }
  21. .row { display: flex; flex-wrap: wrap; width: 100%; margin: 0; }
  22. .col-lg-2 { flex: 0 0 16.6667%; max-width: 16.6667%; }
  23. .col-lg-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
  24. .col-lg-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
  25. .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
  26. .badge { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 12px; line-height: 1.2; }
  27. .badge-default { background: rgba(255,255,255,0.2); color: #f6f6f6; }
  28. .badge-info { background: #dbe7ff; color: #2b4aa0; }
  29. .badge-success { background: #d4edda; color: #1e7e34; }
  30. .badge-warning { background: #fff3cd; color: #856404; }
  31. .badge-danger { background: #f8d7da; color: #721c24; }
  32. .alert { padding: 6px 10px; border-radius: 6px; background: #f5f5f5; color: #333; }
  33. header {
  34. background-color: #aa1e55;
  35. }
  36. small {
  37. font-weight: 200;
  38. }
  39. header a:hover {
  40. text-decoration: none;
  41. }
  42. .header-top {
  43. width: 100%;
  44. height: auto;
  45. min-height: 40px;
  46. margin: 0px;
  47. text-align: center;
  48. color: #f6f6f6;
  49. font-size: calc(10px + 0.44vw);
  50. font-weight: 200;
  51. padding: 3px 4px;
  52. background-color: #aa1e55;
  53. }
  54. .header-top .header-nav {
  55. display: grid;
  56. grid-template-columns: auto minmax(0, 1fr) auto auto;
  57. align-items: start;
  58. gap: 16px;
  59. width: 100%;
  60. }
  61. .header-top .header-col {
  62. min-height: 30px;
  63. line-height: 1.2;
  64. min-width: 0;
  65. }
  66. .header-top .header-left {
  67. white-space: nowrap;
  68. }
  69. .header-top .header-main {
  70. display: flex;
  71. flex-direction: column;
  72. align-items: flex-start;
  73. gap: 4px;
  74. min-width: 0;
  75. }
  76. .header-top .header-meta {
  77. display: flex;
  78. flex-direction: column;
  79. align-items: flex-end;
  80. gap: 4px;
  81. min-width: 0;
  82. }
  83. .header-top .header-right {
  84. text-align: right;
  85. white-space: nowrap;
  86. padding-right: 10px;
  87. }
  88. .header-right .header-date {
  89. text-align: center;
  90. }
  91. .snapshot-variants {
  92. position: relative;
  93. display: inline-block;
  94. white-space: nowrap;
  95. }
  96. .snapshot-variants summary {
  97. list-style: none;
  98. cursor: pointer;
  99. color: #f6f6f6 !important;
  100. }
  101. .snapshot-variants summary:hover {
  102. color: #f6f6f6 !important;
  103. }
  104. .header-top .snapshot-variants summary {
  105. color: #f6f6f6 !important;
  106. }
  107. .snapshot-variants summary::-webkit-details-marker {
  108. display: none;
  109. }
  110. .snapshot-variants-list {
  111. position: absolute;
  112. right: 0;
  113. top: calc(100% + 6px);
  114. background: rgba(18, 18, 18, 0.95);
  115. border: 1px solid rgba(255,255,255,0.15);
  116. border-radius: 8px;
  117. min-width: 260px;
  118. max-width: 420px;
  119. max-height: 240px;
  120. overflow: auto;
  121. box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  122. z-index: 50;
  123. padding: 6px;
  124. }
  125. .snapshot-variants-list a {
  126. display: block;
  127. padding: 6px 8px;
  128. color: #f6f6f6;
  129. font-size: 12px;
  130. line-height: 1.3;
  131. border-radius: 6px;
  132. }
  133. .snapshot-variants-list a:hover {
  134. background: rgba(255,255,255,0.08);
  135. color: #fff;
  136. }
  137. .header-top .snapshot-variants-list a {
  138. color: #f6f6f6 !important;
  139. }
  140. .header-top .snapshot-variants-list a:hover {
  141. color: #fff !important;
  142. }
  143. .year-variants summary {
  144. list-style: none;
  145. cursor: pointer;
  146. }
  147. .year-variants summary::-webkit-details-marker {
  148. display: none;
  149. }
  150. .header-top .header-url {
  151. width: 100%;
  152. background-color: rgb(216, 216, 235, 0.05);
  153. text-align: left;
  154. line-height: 1.3;
  155. font-family: monospace;
  156. font-weight: 200;
  157. margin-top: 0;
  158. font-size: 23px;
  159. opacity: 0.8;
  160. border-radius: 0px 0px 8px 8px;
  161. }
  162. .header-top .header-url a.header-url-text {
  163. display: block;
  164. color: #f6f6f6;
  165. user-select: all;
  166. overflow: hidden;
  167. text-overflow: ellipsis;
  168. white-space: nowrap;
  169. padding: 2px 10px;
  170. }
  171. .header-top .header-url a.header-url-text:hover {
  172. color: rgb(144, 161, 255);
  173. }
  174. .header-top a {
  175. text-decoration: none;
  176. color: rgba(0,0,0,0.6);
  177. }
  178. .header-top a:hover {
  179. text-decoration: none;
  180. color: rgba(0,0,0,0.9);
  181. }
  182. .header-title-line {
  183. color: rgba(0,0,0,0.6);
  184. display: flex;
  185. align-items: center;
  186. gap: 6px;
  187. min-width: 0;
  188. width: 100%;
  189. }
  190. .header-title-text {
  191. display: inline-block;
  192. max-width: 100%;
  193. overflow: hidden;
  194. text-overflow: ellipsis;
  195. white-space: nowrap;
  196. text-align: left;
  197. }
  198. .header-tags {
  199. display: flex;
  200. flex-wrap: wrap;
  201. justify-content: flex-end;
  202. gap: 4px;
  203. }
  204. .header-badges {
  205. display: flex;
  206. flex-wrap: wrap;
  207. justify-content: flex-end;
  208. align-items: center;
  209. gap: 6px;
  210. }
  211. .header-year-badges {
  212. display: flex;
  213. flex-wrap: wrap;
  214. justify-content: flex-end;
  215. align-items: center;
  216. gap: 6px;
  217. margin-top: 4px;
  218. }
  219. .header-top .favicon {
  220. width: 20px;
  221. height: 20px;
  222. max-width: 30px;
  223. max-height: 30px;
  224. vertical-align: -4px;
  225. margin-right: 6px;
  226. object-fit: contain;
  227. border-radius: 3px;
  228. background: rgba(255,255,255,0.08);
  229. }
  230. .header-top .col-lg-4 {
  231. text-align: center;
  232. padding-top: 4px;
  233. padding-bottom: 4px;
  234. }
  235. .header-archivebox img {
  236. display: inline-block;
  237. margin-right: 3px;
  238. height: 30px;
  239. margin-left: 12px;
  240. margin-top: -4px;
  241. margin-bottom: 2px;
  242. }
  243. .header-archivebox {
  244. display: inline-flex;
  245. align-items: center;
  246. gap: 6px;
  247. white-space: nowrap;
  248. }
  249. .header-right .header-date {
  250. display: inline-block;
  251. white-space: nowrap;
  252. }
  253. .header-archivebox img:hover {
  254. opacity: 0.5;
  255. }
  256. header small code {
  257. white-space: nowrap;
  258. font-weight: 200;
  259. display: block;
  260. margin-top: -1px;
  261. font-size: 13px;
  262. opacity: 0.8;
  263. user-select: all;
  264. }
  265. .header-toggle {
  266. line-height: 12px;
  267. font-size: 70px;
  268. vertical-align: -12px;
  269. margin-left: 4px;
  270. }
  271. @media(max-width: 900px) {
  272. .header-top .header-nav {
  273. grid-template-columns: 1fr;
  274. gap: 8px;
  275. }
  276. .header-top .header-left,
  277. .header-top .header-main,
  278. .header-top .header-meta,
  279. .header-top .header-right {
  280. width: 100%;
  281. text-align: left;
  282. align-items: flex-start;
  283. }
  284. .header-archivebox img {
  285. margin-left: 0;
  286. }
  287. }
  288. @media(max-width: 600px) {
  289. .header-top {
  290. font-size: 14px;
  291. }
  292. .header-top .header-url {
  293. font-size: 16px;
  294. }
  295. .header-title-text,
  296. .header-top .header-url a.header-url-text {
  297. white-space: normal;
  298. overflow: hidden;
  299. display: -webkit-box;
  300. -webkit-line-clamp: 2;
  301. -webkit-box-orient: vertical;
  302. }
  303. .header-badges,
  304. .header-tags,
  305. .header-year-badges {
  306. justify-content: flex-start;
  307. }
  308. .header-toggle {
  309. font-size: 46px;
  310. vertical-align: -6px;
  311. }
  312. }
  313. .info-row {
  314. margin-top: 2px;
  315. margin-bottom: 5px;
  316. }
  317. .info-row .alert {
  318. margin-bottom: 0px;
  319. }
  320. .row.header-bottom {
  321. margin-left: -10px;
  322. margin-right: -10px;
  323. }
  324. .header-bottom .col-lg-2 {
  325. padding-left: 4px;
  326. padding-right: 4px;
  327. }
  328. .header-bottom-frames .card {
  329. box-shadow: 2px 2px 7px 0px rgba(0, 0, 0, 0.1);
  330. margin-bottom: 6px;
  331. border: 1px solid rgba(0, 0, 0, 0.06);
  332. border-radius: 10px;
  333. background-color: #efefef;
  334. overflow: hidden;
  335. min-height: 130px;
  336. }
  337. .header-bottom-frames .card:has([data-compact]) {
  338. min-height: 0;
  339. }
  340. .card h4 {
  341. font-size: 0.8em;
  342. display: inline-block;
  343. width: auto;
  344. text-transform: uppercase;
  345. margin-top: 0px;
  346. margin-bottom: 5px;
  347. color: #222;
  348. }
  349. .card-body {
  350. font-size: 14px;
  351. padding: 4px 10px;
  352. padding-bottom: 0px;
  353. /* padding-left: 3px; */
  354. /* padding-right: 3px; */
  355. /* padding-bottom: 3px; */
  356. line-height: 1;
  357. word-wrap: break-word;
  358. max-height: 102px;
  359. overflow: hidden;
  360. text-overflow: ellipsis;
  361. color: #222;
  362. background-color: #f6f6f6;
  363. }
  364. .card-title {
  365. margin-bottom: 4px;
  366. text-transform: uppercase;
  367. }
  368. .card-img-top {
  369. border: 0px;
  370. padding: 0px;
  371. margin: 0px;
  372. overflow: hidden;
  373. opacity: 0.8;
  374. border-top: 1px solid rgba(0,0,0,0);
  375. border-radius: 4px;
  376. border-bottom: 1px solid rgba(0,0,0,0);
  377. height: 430px;
  378. width: 405%;
  379. margin-bottom: -330px;
  380. background-color: #333;
  381. margin-left: -1%;
  382. margin-right: -1%;
  383. pointer-events: none;
  384. transform: scale(0.25);
  385. transform-origin: 0 0;
  386. }
  387. #main-frame {
  388. border-top: 1px solid #ddd;
  389. width: 100%;
  390. height: calc(100vh - 210px);
  391. margin: 0px;
  392. border: 0px;
  393. border-top: 3px solid #aa1e55;
  394. }
  395. #main-frame-wrapper {
  396. width: 100%;
  397. height: calc(100vh - 210px);
  398. border-top: 3px solid #aa1e55;
  399. overflow: hidden;
  400. }
  401. #main-frame-wrapper iframe {
  402. width: 100%;
  403. height: 100%;
  404. border: none;
  405. }
  406. .full-page-wrapper {
  407. width: 100%;
  408. height: calc(100vh - 210px);
  409. }
  410. .thumbnail-wrapper {
  411. height: 100px;
  412. overflow: hidden;
  413. background-color: #333;
  414. pointer-events: none;
  415. }
  416. .thumbnail-wrapper.compact {
  417. height: 32px;
  418. background-color: #111;
  419. }
  420. .thumbnail-wrapper iframe {
  421. width: 405%;
  422. height: 430px;
  423. margin-bottom: -330px;
  424. margin-left: -1%;
  425. transform: scale(0.25);
  426. transform-origin: 0 0;
  427. border: none;
  428. }
  429. .thumbnail-wrapper img {
  430. width: 100%;
  431. height: 100%;
  432. object-fit: cover;
  433. object-position: top center;
  434. }
  435. .thumbnail-compact {
  436. height: 32px;
  437. display: flex;
  438. align-items: center;
  439. gap: 6px;
  440. padding: 0 8px;
  441. font-size: 13px;
  442. line-height: 1;
  443. color: #bdbdbd;
  444. text-transform: uppercase;
  445. letter-spacing: 0.02em;
  446. }
  447. .thumbnail-compact-label {
  448. color: #e1e1e1;
  449. }
  450. .thumbnail-compact-meta {
  451. color: #777;
  452. font-size: 11px;
  453. margin-left: auto;
  454. }
  455. .thumbnail-compact svg,
  456. .thumbnail-compact img {
  457. height: 12px;
  458. width: 12px;
  459. }
  460. .thumbnail-text {
  461. height: 100px;
  462. background: #121212;
  463. color: #d8d8d8;
  464. padding: 6px 8px;
  465. display: flex;
  466. flex-direction: column;
  467. gap: 4px;
  468. font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  469. font-size: 11px;
  470. line-height: 1.2;
  471. overflow: hidden;
  472. }
  473. .thumbnail-text-header {
  474. display: flex;
  475. align-items: center;
  476. gap: 6px;
  477. font-size: 10px;
  478. color: #9b9b9b;
  479. text-transform: uppercase;
  480. letter-spacing: 0.04em;
  481. }
  482. .thumbnail-text-pre {
  483. margin: 0;
  484. white-space: pre-wrap;
  485. overflow: hidden;
  486. display: -webkit-box;
  487. -webkit-box-orient: vertical;
  488. -webkit-line-clamp: 5;
  489. }
  490. .thumbnail-text[data-plugin="title"] .thumbnail-text-pre {
  491. font-size: 13px;
  492. font-weight: 600;
  493. -webkit-line-clamp: 3;
  494. }
  495. .card.selected-card {
  496. border: 2px solid orange;
  497. box-shadow: 0px -6px 13px 1px rgba(0,0,0,0.05);
  498. }
  499. .thumb-compact .card-body {
  500. display: block;
  501. padding: 4px 8px;
  502. font-size: 12px;
  503. line-height: 1.2;
  504. max-height: none;
  505. }
  506. .thumb-compact {
  507. margin-bottom: 0px;
  508. border-radius: 6px;
  509. }
  510. .thumb-compact .thumbnail-wrapper {
  511. height: 32px;
  512. }
  513. .thumb-compact .thumbnail-compact,
  514. .thumb-compact .thumbnail-text {
  515. height: 32px;
  516. max-height: 32px;
  517. }
  518. .iframe-large {
  519. height: calc(100vh - 70px);
  520. }
  521. .preview-hidden {
  522. display: none !important;
  523. }
  524. img.external {
  525. height: 30px;
  526. margin-right: -10px;
  527. padding: 3px;
  528. border-radius: 4px;
  529. vertical-align: middle;
  530. border: 4px solid rgba(0,0,0,0);
  531. }
  532. img.external:hover {
  533. border: 4px solid green;
  534. }
  535. .screenshot {
  536. background-color: #333;
  537. transform: scale(1.05);
  538. transform-origin: top center;
  539. width: 100%;
  540. min-height: 100px;
  541. max-height: 100px;
  542. margin-bottom: 0px;
  543. object-fit: cover;
  544. object-position: top center;
  545. }
  546. .thumb-grid {
  547. display: block;
  548. column-gap: 6px;
  549. align-content: start;
  550. width: 100vw;
  551. margin-left: calc(50% - 50vw);
  552. padding: 0 6px;
  553. column-fill: balance;
  554. column-count: 2;
  555. }
  556. @media (min-width: 720px) {
  557. .thumb-grid { column-count: 3; }
  558. }
  559. @media (min-width: 1024px) {
  560. .thumb-grid { column-count: 4; }
  561. }
  562. @media (min-width: 1280px) {
  563. .thumb-grid { column-count: 5; }
  564. }
  565. @media (min-width: 1600px) {
  566. .thumb-grid { column-count: 6; }
  567. }
  568. @media (min-width: 1920px) {
  569. .thumb-grid { column-count: 7; }
  570. }
  571. .thumb-card {
  572. box-shadow: 2px 2px 7px 0px rgba(0, 0, 0, 0.1);
  573. border: 1px solid rgba(0, 0, 0, 0.06);
  574. border-radius: 10px;
  575. background-color: #efefef;
  576. overflow: hidden;
  577. display: inline-block;
  578. width: 100%;
  579. break-inside: avoid;
  580. box-sizing: border-box;
  581. margin-bottom: 6px;
  582. height: 138px;
  583. min-height: 138px;
  584. max-height: 138px;
  585. display: flex;
  586. flex-direction: column;
  587. align-items: stretch;
  588. }
  589. .thumb-card:has([data-compact]) {
  590. height: 46px;
  591. min-height: 46px;
  592. max-height: 46px;
  593. }
  594. .thumb-card .thumb-body {
  595. font-size: 14px;
  596. padding: 3px 8px;
  597. line-height: 1.2;
  598. word-wrap: break-word;
  599. overflow: hidden;
  600. text-overflow: ellipsis;
  601. color: #222;
  602. background-color: #f6f6f6;
  603. flex: 0 0 auto;
  604. position: relative;
  605. }
  606. .thumb-actions {
  607. position: absolute;
  608. top: 2px;
  609. right: 6px;
  610. display: flex;
  611. gap: 6px;
  612. font-size: 12px;
  613. line-height: 1;
  614. opacity: 0.7;
  615. }
  616. .thumb-actions a {
  617. text-decoration: none;
  618. color: inherit;
  619. }
  620. .thumb-actions a:hover {
  621. opacity: 1;
  622. }
  623. .thumb-card .thumb-body h4 {
  624. font-size: 0.8em;
  625. text-transform: uppercase;
  626. margin: 0 0 2px 0;
  627. color: #222;
  628. line-height: 1.1;
  629. overflow: hidden;
  630. text-overflow: ellipsis;
  631. white-space: nowrap;
  632. }
  633. .thumb-card .thumbnail-wrapper,
  634. .thumb-card iframe.card-img-top {
  635. display: block;
  636. width: 100%;
  637. flex: 1 1 auto;
  638. min-height: 0;
  639. }
  640. .thumb-card .thumbnail-wrapper {
  641. display: flex;
  642. align-items: stretch;
  643. width: 100% !important;
  644. min-width: 0;
  645. max-width: 100%;
  646. box-sizing: border-box;
  647. height: auto !important;
  648. }
  649. .thumb-card .thumbnail-wrapper > *,
  650. .thumb-card iframe.card-img-top {
  651. width: 100% !important;
  652. height: 100%;
  653. object-fit: cover;
  654. max-width: 100%;
  655. }
  656. .thumb-card .card-img-top {
  657. width: 100% !important;
  658. max-width: 100% !important;
  659. height: 100% !important;
  660. margin: 0 !important;
  661. transform: none !important;
  662. opacity: 1 !important;
  663. }
  664. .thumb-card .thumbnail-wrapper img,
  665. .thumb-card .thumbnail-wrapper video,
  666. .thumb-card .thumbnail-wrapper canvas {
  667. width: 100% !important;
  668. height: 100% !important;
  669. max-width: 100% !important;
  670. object-fit: cover;
  671. transform: none !important;
  672. margin: 0 !important;
  673. }
  674. .thumb-card .thumbnail-wrapper iframe,
  675. .thumb-card .thumbnail-wrapper object,
  676. .thumb-card .thumbnail-wrapper embed {
  677. width: 405% !important;
  678. height: 405% !important;
  679. transform: scale(0.25);
  680. transform-origin: 0 0;
  681. margin: 0 !important;
  682. border: 0 !important;
  683. }
  684. .thumb-card iframe.card-img-top {
  685. width: 405% !important;
  686. height: 405% !important;
  687. transform: scale(0.25);
  688. transform-origin: 0 0;
  689. margin: 0 !important;
  690. border: 0 !important;
  691. }
  692. .thumb-card:has([data-compact]) .thumbnail-wrapper,
  693. .thumb-card:has([data-compact]) .thumbnail-wrapper.compact {
  694. height: 24px;
  695. flex: 0 0 auto;
  696. }
  697. .thumb-card:has([data-compact]) .thumb-body {
  698. padding: 2px 6px;
  699. font-size: 12px;
  700. max-height: 20px;
  701. }
  702. .thumb-card:has([data-compact]) .thumb-body h4 {
  703. font-size: 0.9em;
  704. margin-bottom: 0px;
  705. line-height: 1;
  706. display: flex;
  707. align-items: center;
  708. gap: 4px;
  709. overflow: hidden;
  710. text-overflow: ellipsis;
  711. white-space: nowrap;
  712. }
  713. .thumb-card:has([data-compact]) .thumbnail-text-header,
  714. .thumb-card:has([data-compact]) .thumbnail-compact-icon,
  715. .thumb-card:has([data-compact]) .thumbnail-compact-label {
  716. display: none;
  717. }
  718. .thumb-card.selected-card {
  719. border: 2px solid orange;
  720. box-shadow: 0px -6px 13px 1px rgba(0,0,0,0.05);
  721. }
  722. .loose-items {
  723. display: flex;
  724. flex-wrap: wrap;
  725. gap: 4px 8px;
  726. font-size: 12px;
  727. line-height: 1.2;
  728. max-height: 84px;
  729. overflow: auto;
  730. }
  731. .loose-items a {
  732. color: #333;
  733. text-decoration: none;
  734. background: rgba(0, 0, 0, 0.04);
  735. padding: 2px 6px;
  736. border-radius: 6px;
  737. }
  738. .loose-items a:hover {
  739. background: rgba(0, 0, 0, 0.08);
  740. }
  741. .failed-items a {
  742. color: #b91c1c;
  743. background: rgba(185, 28, 28, 0.08);
  744. }
  745. .failed-items a:hover {
  746. background: rgba(185, 28, 28, 0.16);
  747. }
  748. .header-bottom {
  749. border-top: 1px solid rgba(170, 30, 85, 0.9);
  750. padding-bottom: 1px;
  751. border-bottom: 5px solid rgb(170, 30, 85);
  752. margin-bottom: -1px;
  753. border-radius: 0px;
  754. background-color: #f4eeee;
  755. border: 1px solid rgba(0,0,0,0.2);
  756. box-shadow: 4px 4px 4px rgba(0,0,0,0.2);
  757. margin-top: 0px;
  758. }
  759. .header-bottom.container-fluid {
  760. padding-left: 6px;
  761. padding-right: 6px;
  762. }
  763. .header-bottom-info {
  764. color: #6f6f6f;
  765. padding-top: 0px;
  766. padding-bottom: 0px;
  767. margin: 0px -15px;
  768. }
  769. .header-bottom-info > div {
  770. text-align: center;
  771. }
  772. .header-bottom-info h5 {
  773. font-size: 12px;
  774. font-weight: 400;
  775. margin-top: 3px;
  776. margin-bottom: 3px;
  777. }
  778. .info-chunk {
  779. width: auto;
  780. display: inline-block;
  781. text-align: center;
  782. margin: 8px 4px;
  783. vertical-align: top;
  784. font-size: 14px;
  785. }
  786. header .badge {
  787. margin-top: 3px;
  788. font-size: 0.9rem;
  789. font-weight: 200;
  790. font-family: monospace;
  791. }
  792. header .internal-links {
  793. text-align: left;
  794. opacity: 1;
  795. background-color: rgba(0,0,0,0.03);
  796. padding: 1px 3px;
  797. }
  798. header .external-links {
  799. text-align: center;
  800. opacity: 0.9;
  801. /*background-color: rgba(0,0,0,0.03);*/
  802. margin-top: 0px;
  803. padding: 1px 3px;
  804. font-size: 14px;
  805. color: #ddd;
  806. width: 100%;
  807. overflow: hidden;
  808. }
  809. .row.header-bottom-frames {
  810. padding-top: 5px;
  811. display: block !important;
  812. width: 100%;
  813. max-width: 100%;
  814. column-width: 180px;
  815. column-gap: 8px;
  816. column-fill: auto;
  817. margin-left: 0px;
  818. margin-right: 0px;
  819. flex: none !important;
  820. }
  821. .header-bottom-frames .col-lg-2 {
  822. padding-left: 0px;
  823. padding-right: 0px;
  824. max-width: 100%;
  825. width: 100% !important;
  826. display: inline-block !important;
  827. float: none !important;
  828. flex: none !important;
  829. break-inside: avoid;
  830. margin-bottom: 6px;
  831. vertical-align: top;
  832. }
  833. .header-bottom-frames .card:has([data-compact]) .thumbnail-wrapper,
  834. .header-bottom-frames .card:has([data-compact]) .thumbnail-wrapper.compact {
  835. height: 32px;
  836. }
  837. .header-bottom-frames .card:has([data-compact]) .thumbnail-text {
  838. height: auto;
  839. max-height: 64px;
  840. }
  841. .header-bottom-frames .card:has([data-compact]) .card-body {
  842. padding: 4px 8px;
  843. max-height: 44px;
  844. }
  845. .header-bottom-frames .card-title {
  846. width: 100%;
  847. text-align: center;
  848. font-size: 17px;
  849. margin-bottom: 0px;
  850. display: inline-block;
  851. color: #222;
  852. font-weight: 200;
  853. vertical-align: 3px;
  854. }
  855. .header-bottom-frames .card-text {
  856. /* width: 100%;
  857. text-align: center;*/
  858. font-size: 0.9em;
  859. display: inline-block;
  860. position: relative;
  861. /* top: -11px;*/
  862. }
  863. .card-text code {
  864. padding: .1rem .2rem;
  865. font-size: 90%;
  866. color: #bd4147;
  867. background-color: rgb(204, 204, 204, 0.28);
  868. border-radius: .25rem;
  869. }
  870. /*@media(max-width: 1092px) {
  871. iframe {
  872. display: none;
  873. }
  874. }*/
  875. @media(max-width: 728px) {
  876. .card h4 {
  877. font-size: 5vw;
  878. }
  879. .card-body {
  880. font-size: 4vw;
  881. }
  882. .card {
  883. margin-bottom: 5px;
  884. }
  885. header > h1 > a.header-url, header > h1 > a.header-archivebox {
  886. display: none;
  887. }
  888. }
  889. </style>
  890. </head>
  891. <body>
  892. <header>
  893. <div class="header-top">
  894. <div class="header-nav">
  895. <div class="header-col header-left" style="line-height: 58px; vertical-align: middle">
  896. <a href="/" class="header-archivebox" title="Go to Main Index...">
  897. {% web_base_url as web_base %}
  898. <img src="{% if web_base %}//{{ web_base|cut:'http://'|cut:'https://' }}/static/archive.png{% else %}{% static 'archive.png' %}{% endif %}" alt="Archive Icon">
  899. ArchiveBox
  900. </a>
  901. </div>
  902. <div class="header-col header-main">
  903. <div class="header-url">
  904. <a class="header-url-text" href="{{url}}" title="Open original URL in new window..." target="_blank" rel="noreferrer">
  905. {{url}}
  906. </a>
  907. </div>
  908. <div class="header-title-line header-toggle-trigger">
  909. <img src="{% snapshot_url snapshot 'favicon/favicon.ico' %}" onerror="this.style.opacity=0" alt="Favicon" class="favicon"/>
  910. <span class="header-title-text">{{title|truncatechars:120|safe}}</span>
  911. <a href="#" class="header-toggle header-toggle-trigger">▾</a>
  912. </div>
  913. </div>
  914. <div class="header-col header-meta">
  915. <div class="header-badges">
  916. <div class="badge badge-default" style="font-weight: 200">
  917. {{num_outputs}}
  918. {% if num_failures %}
  919. + {{num_failures}} <small>errors</small>
  920. {% endif %}
  921. </div>
  922. <div class="badge badge-info">
  923. <a href="{% admin_base_url %}/admin/core/snapshot/{{snapshot_id|default:id}}/change/" title="Click to edit this Snapshot in the Admin UI">
  924. {{size}}
  925. </a>
  926. </div>
  927. <div class="badge badge-default">
  928. <a href="{% admin_base_url %}/admin/core/snapshot/{{snapshot_id|default:id}}/change/" title="Click to edit this Snapshot in the Admin UI">
  929. ✏️
  930. </a>
  931. </div>
  932. {% for tag in tags_str|split:',' %}
  933. {% if tag %}
  934. <div class="badge badge-default tag" style="word-break: break-all;">{{tag}}</div>
  935. {% endif %}
  936. {% endfor %}
  937. <div class="badge badge-{{status_color}}">
  938. <a href="{% admin_base_url %}/admin/core/snapshot/?q={{snapshot_id|default:id}}" title="Click to see options to pull, re-snapshot, or delete this Snapshot">
  939. {{status|upper}}
  940. </a>
  941. </div>
  942. </div>
  943. {% if related_years %}
  944. <div class="header-year-badges">
  945. {% for entry in related_years %}
  946. {% if entry.snapshots|length > 1 %}
  947. <details class="snapshot-variants year-variants">
  948. <summary class="badge badge-default">{{ entry.year }}</summary>
  949. <div class="snapshot-variants-list">
  950. {% for snap in entry.snapshots %}
  951. <a href="{% web_base_url %}/{{ snap.archive_path }}/index.html" title="{{ snap.url }}">
  952. {{ snap.bookmarked_at|default:snap.created_at|default:snap.downloaded_at|date:"Y-m-d H:i:s" }} &nbsp; 📁 {{ snap.num_outputs }}
  953. </a>
  954. {% endfor %}
  955. </div>
  956. </details>
  957. {% else %}
  958. <div class="badge badge-default">
  959. <a href="{% web_base_url %}/{{ entry.latest.archive_path }}/index.html" title="{{ entry.latest.url }}">
  960. {{ entry.year }}
  961. </a>
  962. </div>
  963. {% endif %}
  964. {% endfor %}
  965. </div>
  966. {% endif %}
  967. </div>
  968. <div class="header-col header-right" style="padding-top: 4px">
  969. {% if related_snapshots %}
  970. <details class="snapshot-variants">
  971. <summary class="header-date" title="Click to see other snapshots for this URL">
  972. {{oldest_archive_date|default:downloaded_datestr|default:bookmarked_date}}
  973. </summary>
  974. <div class="snapshot-variants-list">
  975. {% for snap in related_snapshots %}
  976. <a href="{% web_base_url %}/{{ snap.archive_path }}/index.html" title="{{ snap.url }}">
  977. {{ snap.bookmarked_at|default:snap.created_at|default:snap.downloaded_at|date:"Y-m-d H:i:s" }} &nbsp; 📁 {{ snap.num_outputs }}
  978. </a>
  979. {% endfor %}
  980. </div>
  981. </details>
  982. {% else %}
  983. <a class="header-date" href="{% web_base_url %}/{{archive_path}}/index.html" title="Date Added: {{bookmarked_date}} | First Archived: {{oldest_archive_date|default:downloaded_datestr}} | Last Checked: {{downloaded_datestr}} (UTC)">
  984. {{oldest_archive_date|default:downloaded_datestr|default:bookmarked_date}}
  985. </a>
  986. {% endif %}
  987. <br/>
  988. <div class="external-links">
  989. 📁 &nbsp;
  990. <a href="{% snapshot_base_url snapshot %}/?files=1" title="Browse files for this snapshot" target="_blank">FILES</a> &nbsp;|&nbsp; 🗃️
  991. <a href="{% snapshot_url snapshot warc_path %}" title="Download the ArchiveBox-generated WARC file" target="_blank">WARC</a> &nbsp;|&nbsp;
  992. <a href="https://web.archive.org/web/{{url}}" title="Search for a copy of the URL saved in Archive.org" target="_blank" rel="noreferrer">🏛️ Archive.org</a>
  993. <!--<a href="https://archive.md/{{url}}" title="Search for a copy of the URL saved in Archive.today" target="_blank" rel="noreferrer">Archive.today</a> &nbsp;|&nbsp; -->
  994. <!--<a href="https://ghostarchive.org/search?term={{url}}" title="Search for a copy of the URL saved in GhostArchive.org" target="_blank" rel="noreferrer">More...</a>-->
  995. </div>
  996. </div>
  997. </div>
  998. </div>
  999. <div class="header-bottom container-fluid">
  1000. <div class="thumb-grid">
  1001. {% for result in archiveresults %}
  1002. {% with display_path=result.path|default:result.result.embed_path display_url='' %}
  1003. {% if display_path %}{% snapshot_url snapshot display_path as display_url %}{% endif %}
  1004. <div class="thumb-card{% if forloop.first %} selected-card{% endif %}"{% if display_url %} data-preview-url="{{display_url}}"{% endif %}>
  1005. <div class="thumb-body">
  1006. <div class="thumb-actions">
  1007. <a href="{% snapshot_url snapshot result.name %}/?files=1" data-no-preview="1" title="Open output folder" target="_blank" rel="noopener">📁</a>
  1008. {% if display_path %}
  1009. <a href="{{display_url}}" data-no-preview="1" title="Download output file" download>⬇️</a>
  1010. {% endif %}
  1011. </div>
  1012. {% if display_path %}
  1013. <a href="{{display_url}}" target="preview" title="./{{display_path}} (downloaded {{result.ts}})">
  1014. <h4>{% plugin_icon result.name %} {{result.name|plugin_name|truncatechars:20}}{% if result.size %} <small>({{result.size|filesizeformat}})</small>{% endif %}</h4>
  1015. </a>
  1016. {% else %}
  1017. <h4>{% plugin_icon result.name %} {{result.name|plugin_name|truncatechars:20}}{% if result.size %} <small>({{result.size|filesizeformat}})</small>{% endif %}</h4>
  1018. {% endif %}
  1019. {% if result.result %}
  1020. {% with plugin_base=result.name|plugin_name %}
  1021. {% if plugin_base == 'ytdlp' or plugin_base == 'yt-dlp' or plugin_base == 'youtube-dl' %}
  1022. {% plugin_card result.result %}
  1023. {% endif %}
  1024. {% endwith %}
  1025. {% endif %}
  1026. </div>
  1027. {% if result.result and display_path %}
  1028. {% with plugin_base=result.name|plugin_name %}
  1029. {% if plugin_base != 'ytdlp' and plugin_base != 'yt-dlp' and plugin_base != 'youtube-dl' %}
  1030. {# Use plugin-specific card template when ArchiveResult is available #}
  1031. <div class="card-img-top thumbnail-wrapper">
  1032. {% plugin_card result.result %}
  1033. </div>
  1034. {% else %}
  1035. {# YT-DLP renders its file list in the body #}
  1036. {% endif %}
  1037. {% endwith %}
  1038. {% elif result.is_metadata and display_path %}
  1039. <div class="card-img-top thumbnail-wrapper compact">
  1040. <div class="thumbnail-compact" data-plugin="{{result.name}}">
  1041. <span class="thumbnail-compact-icon">{% plugin_icon result.name %}</span>
  1042. <span class="thumbnail-compact-label">{{result.name|plugin_name}}</span>
  1043. <span class="thumbnail-compact-meta">metadata</span>
  1044. </div>
  1045. </div>
  1046. {% elif display_path %}
  1047. {# Fall back to generic iframe for filesystem-discovered files #}
  1048. <iframe class="card-img-top" src="{{display_url}}?autoplay=0" allow="autoplay 'none'; fullscreen 'none'; navigation-override 'none'; " sandbox="allow-same-origin allow-top-navigation-by-user-activation allow-scripts allow-forms" scrolling="no" loading="lazy"></iframe>
  1049. {% endif %}
  1050. </div>
  1051. {% endwith %}
  1052. {% endfor %}
  1053. {% if loose_items %}
  1054. <div class="thumb-card">
  1055. <div class="thumb-body">
  1056. <div class="thumb-actions">
  1057. <a href="{% snapshot_base_url snapshot %}/?files=1" data-no-preview="1" title="Browse all snapshot files" target="_blank" rel="noopener">📁</a>
  1058. </div>
  1059. <h4>📦 Other files</h4>
  1060. <div class="loose-items">
  1061. {% for item in loose_items %}
  1062. {% if item.is_dir %}
  1063. <a href="{% snapshot_url snapshot item.path %}/?files=1" data-no-preview="1" target="_blank" rel="noopener">📁 {{item.name}}</a>
  1064. {% else %}
  1065. <a href="{% snapshot_url snapshot item.path %}" data-no-preview="1" target="_blank" rel="noopener">📄 {{item.name}}</a>
  1066. {% endif %}
  1067. {% endfor %}
  1068. </div>
  1069. </div>
  1070. </div>
  1071. {% endif %}
  1072. {% if failed_items %}
  1073. <div class="thumb-card">
  1074. <div class="thumb-body">
  1075. <div class="thumb-actions">
  1076. <a href="{% snapshot_base_url snapshot %}/?files=1" data-no-preview="1" title="Browse all snapshot files" target="_blank" rel="noopener">📁</a>
  1077. </div>
  1078. <h4>⚠️ Failed</h4>
  1079. <div class="loose-items failed-items">
  1080. {% for item in failed_items %}
  1081. {% if item.is_dir %}
  1082. <a href="{% snapshot_url snapshot item.path %}/?files=1" data-no-preview="1" target="_blank" rel="noopener">📁 {{item.name}}</a>
  1083. {% else %}
  1084. <a href="{% snapshot_url snapshot item.path %}" data-no-preview="1" target="_blank" rel="noopener">📄 {{item.name}}</a>
  1085. {% endif %}
  1086. {% endfor %}
  1087. </div>
  1088. </div>
  1089. </div>
  1090. {% endif %}
  1091. </div>
  1092. </div>
  1093. </header>
  1094. {% if best_result.result %}
  1095. {# Use plugin-specific fullscreen template when ArchiveResult is available #}
  1096. <div id="main-frame-wrapper" class="full-page-wrapper">
  1097. <div id="plugin-full-wrapper">
  1098. {% plugin_full best_result.result %}
  1099. </div>
  1100. <iframe id="main-frame" sandbox="allow-same-origin allow-top-navigation-by-user-activation allow-scripts allow-forms" class="full-page-iframe preview-hidden" src="{% if best_result.path %}{% snapshot_url snapshot best_result.path %}{% else %}about:blank{% endif %}" name="preview"></iframe>
  1101. </div>
  1102. {% else %}
  1103. {# Fall back to generic iframe #}
  1104. <iframe id="main-frame" sandbox="allow-same-origin allow-top-navigation-by-user-activation allow-scripts allow-forms" class="full-page-iframe" src="{% if best_result.path %}{% snapshot_url snapshot best_result.path %}{% else %}about:blank{% endif %}" name="preview"></iframe>
  1105. {% endif %}
  1106. <script src="{% static 'jquery.min.js' %}" type="text/javascript"></script>
  1107. <script>
  1108. const snapshotBaseUrl = "{% snapshot_base_url snapshot %}";
  1109. function tryCenterImageFrame(frame) {
  1110. try {
  1111. const doc = frame.contentDocument || frame.contentWindow.document
  1112. if (!doc || !doc.body || !doc.images || doc.images.length !== 1) {
  1113. return
  1114. }
  1115. const img = doc.images[0]
  1116. doc.documentElement.style.height = '100%'
  1117. doc.body.style.height = '100%'
  1118. doc.documentElement.style.width = '100%'
  1119. doc.body.style.width = '100%'
  1120. doc.body.style.margin = '0'
  1121. doc.body.style.display = 'flex'
  1122. doc.body.style.alignItems = 'flex-start'
  1123. doc.body.style.justifyContent = 'center'
  1124. doc.body.style.background = '#222'
  1125. img.style.maxWidth = '100%'
  1126. img.style.width = 'auto'
  1127. img.style.height = 'auto'
  1128. img.style.maxHeight = 'none'
  1129. img.style.display = 'block'
  1130. } catch (err) {}
  1131. }
  1132. function attachPreviewFrameHandlers(frame) {
  1133. if (frame.src.endsWith('.pdf')) {
  1134. frame.removeAttribute('sandbox')
  1135. frame.src = frame.src + '#toolbar=0'
  1136. }
  1137. frame.onload = function() {
  1138. if (this.src.includes('.pdf')) {
  1139. this.removeAttribute('sandbox')
  1140. this.src = this.src.split('?autoplay=')[0] + '#toolbar=0'
  1141. }
  1142. tryCenterImageFrame(this)
  1143. try {
  1144. // doesnt work if frame origin rules prevent accessing its DOM via JS
  1145. this.contentWindow.scrollTo(0, 0);
  1146. } catch(err) {}
  1147. }
  1148. }
  1149. // un-sandbox iframes showing pdfs (required to display pdf viewer)
  1150. jQuery('iframe').map(function() {
  1151. attachPreviewFrameHandlers(this)
  1152. })
  1153. function getPreviewTypeFromPath(link) {
  1154. if (link.getAttribute('href') == './') {
  1155. return 'all'
  1156. }
  1157. return link.getAttribute('href')
  1158. }
  1159. function resolvePreviewUrl(raw) {
  1160. if (!raw) return ''
  1161. if (raw.startsWith('http://') || raw.startsWith('https://')) return raw
  1162. if (raw.startsWith('//')) return window.location.protocol + raw
  1163. if (!snapshotBaseUrl) return raw
  1164. return snapshotBaseUrl + (raw.startsWith('/') ? raw : `/${raw}`)
  1165. }
  1166. function ensureMainFrame() {
  1167. let frame = document.getElementById('main-frame')
  1168. if (!frame) {
  1169. const wrapper = document.getElementById('main-frame-wrapper')
  1170. frame = document.createElement('iframe')
  1171. frame.id = 'main-frame'
  1172. frame.name = 'preview'
  1173. frame.className = 'full-page-iframe'
  1174. frame.sandbox = "allow-same-origin allow-top-navigation-by-user-activation allow-scripts allow-forms"
  1175. if (wrapper) {
  1176. wrapper.innerHTML = ''
  1177. wrapper.appendChild(frame)
  1178. wrapper.classList.remove('full-page-wrapper')
  1179. }
  1180. attachPreviewFrameHandlers(frame)
  1181. }
  1182. const pluginWrapper = document.getElementById('plugin-full-wrapper')
  1183. if (pluginWrapper) {
  1184. pluginWrapper.classList.add('preview-hidden')
  1185. }
  1186. frame.classList.remove('preview-hidden')
  1187. return frame
  1188. }
  1189. function handleCardClick(card, event) {
  1190. const targetEl = event.target.nodeType === Node.ELEMENT_NODE ? event.target : event.target.parentElement
  1191. if (targetEl && targetEl.closest('[data-no-preview]')) {
  1192. return
  1193. }
  1194. const link = (targetEl && targetEl.closest('a[target=preview]')) || card.querySelector('a[target=preview]') || card.querySelector('a')
  1195. const previewUrl = card.dataset.previewUrl
  1196. const rawTarget = (link ? link.getAttribute('href') : '') || previewUrl || ''
  1197. const target = resolvePreviewUrl(rawTarget)
  1198. if (!target || target.endsWith('#')) {
  1199. return
  1200. }
  1201. event.preventDefault()
  1202. jQuery('.selected-card').removeClass('selected-card')
  1203. jQuery(card).closest('.thumb-card').addClass('selected-card')
  1204. const iframe_elem = ensureMainFrame()
  1205. if (target.endsWith('.pdf')) {
  1206. iframe_elem.removeAttribute('sandbox')
  1207. } else {
  1208. iframe_elem.sandbox = "allow-same-origin allow-top-navigation-by-user-activation allow-scripts allow-forms"
  1209. }
  1210. if (link) {
  1211. window.location.hash = getPreviewTypeFromPath(link)
  1212. }
  1213. iframe_elem.src = target
  1214. }
  1215. for (const card of [...document.querySelectorAll('.thumb-card')]) {
  1216. card.addEventListener('click', function(event) {
  1217. handleCardClick(card, event)
  1218. })
  1219. for (const link of card.querySelectorAll('a')) {
  1220. link.addEventListener('click', function(event) {
  1221. handleCardClick(card, event)
  1222. })
  1223. }
  1224. }
  1225. function hideSnapshotHeader() {
  1226. console.log('Collapsing Snapshot header...')
  1227. jQuery('.header-toggle').text('▸')
  1228. jQuery('.header-bottom').hide()
  1229. jQuery('#main-frame').addClass('iframe-large')
  1230. try {
  1231. localStorage.setItem("archivebox-snapshot-header-visible", "false")
  1232. } catch (e) {
  1233. console.log('Could not use localStorage to persist header collapse state', e)
  1234. }
  1235. }
  1236. function showSnapshotHeader() {
  1237. console.log('Expanding Snapshot header...')
  1238. jQuery('.header-toggle').text('▾')
  1239. jQuery('.header-bottom').show()
  1240. jQuery('#main-frame').removeClass('iframe-large')
  1241. try {
  1242. localStorage.setItem("archivebox-snapshot-header-visible", "true")
  1243. } catch (e) {
  1244. console.log('Could not use localStorage to persist header collapse state', e)
  1245. }
  1246. }
  1247. function loadSnapshotHeaderState() {
  1248. // collapse snapshot header if user has previously hidden it
  1249. let snapshotHeaderIsExpanded = 'false'
  1250. try {
  1251. snapshotHeaderIsExpanded = localStorage.getItem("archivebox-snapshot-header-visible") || 'false'
  1252. } catch (e) {
  1253. console.log('Could not use localStorage to get header collapse state', e)
  1254. }
  1255. if (snapshotHeaderIsExpanded === 'false') {
  1256. hideSnapshotHeader()
  1257. }
  1258. }
  1259. function handleSnapshotHeaderToggle() {
  1260. if (jQuery('.header-toggle').text().includes('▾')) {
  1261. hideSnapshotHeader()
  1262. } else {
  1263. showSnapshotHeader()
  1264. }
  1265. return true
  1266. }
  1267. // hide header when collapse icon is clicked
  1268. jQuery('.header-toggle').on('click', handleSnapshotHeaderToggle)
  1269. jQuery('.header-toggle-trigger').on('click', handleSnapshotHeaderToggle)
  1270. // check URL for hash e.g. #git and load relevant preview
  1271. jQuery(document).ready(function() {
  1272. if (window.location.hash) {
  1273. for (const link of jQuery('a[target=preview]')) {
  1274. console.log(link.pathname)
  1275. if (getPreviewTypeFromPath(link) == window.location.hash.slice(1).toLowerCase()) {
  1276. jQuery(link).closest('.thumb-card').click()
  1277. jQuery(link).click()
  1278. link.click()
  1279. }
  1280. }
  1281. }
  1282. loadSnapshotHeaderState()
  1283. })
  1284. // hide all preview iframes on small screens
  1285. // if (window.innerWidth < 1091) {
  1286. // jQuery('.card a[target=preview]').attr('target', '_self')
  1287. // }
  1288. </script>
  1289. </body>
  1290. </html>