PageSourceSearch

https://soci-269-w3.netlify.app/index_files/libs/revealjs/plugin/reveal-attribution/attribution.js

js soci-269-w3.netlify.app collected 2026-10-03 11:25:57 UTC 2,295 bytes, 75 lines download raw bytes

1/*****************************************************************
2** Author: Roland Schmehl, [email protected]
3**
4** A plugin for displaying attribution texts sideways along the right
5** edge of the viewport. When resizing the viewport or toggling full
6** screen mode, the attribution text sticks persistently to the right
7** edge of the viewport.
8**
9** The dynamic scaling of the attribution text via CSS transform
10** is adopted from the fullscreen plugin.
11**
12** Version: 1.0
13**
14** License: MIT license (see file LICENSE)
15**
16******************************************************************/
17
18window.RevealAttribution = window.RevealAttribution || {
19  id: 'RevealAttribution',
20  init: function(deck) {
21      initAttribution(deck);
22  }
23};
24
25const initAttribution = function(Reveal){
26
27var ready = false;
28var resize = false;
29var scale = 1;
30
31window.addEventListener( 'ready', function( event ) {
32
33  var content;
34
35  // Remove configured margin of the presentation
36  var attribution = document.getElementsByClassName("attribution");
37  var width = window.innerWidth;
38  var configuredWidth = Reveal.getConfig().width;
39  var configuredHeight = Reveal.getConfig().height;
40
41  scale = 1/(1-Reveal.getConfig().margin);
42
43  for (var i = 0; i < attribution.length; i++) {
44    content = attribution[i].innerHTML;
45    attribution[i].style.width = configuredWidth + "px";
46    attribution[i].style.height = configuredHeight + "px";
47    attribution[i].innerHTML = "<span class='content'>" + content + "</span>";
48    attribution[i].style.transform = 'translate( -50%, -50% ) scale( ' + scale*100 + '% ) rotate(-180deg)';
49  }
50
51  // Scale with cover class to mimic backgroundSize cover
52  resizeCover();
53
54});
55
56window.addEventListener( 'resize', resizeCover );
57
58function resizeCover() {
59
60  // Scale to mimic backgroundSize cover
61  var attribution = document.getElementsByClassName("attribution");
62  var xScale = window.innerWidth / Reveal.getConfig().width;
63  var yScale = window.innerHeight / Reveal.getConfig().height;
64  var s = 1;
65
66  if (xScale > yScale) {
67      // The div fits perfectly in x axis, stretched in y
68      s = xScale/yScale;
69  }
70  for (var i = 0; i < attribution.length; i++) {
71    attribution[i].style.transform = 'translate( -50%, -50% ) scale( ' + s*scale*100 + '% ) rotate(-180deg)';
72  }
73}
74
75};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.