PageSourceSearch

https://www.studio-fruehauf.de/system/widgets/widgets.js?4934f67a

js studio-fruehauf.de collected 2026-10-05 23:02:43 UTC 11,309 bytes, 109 lines download raw bytes

1function updateWidgetImages(n){function k(a,e,b,d,f=50,c=50,g=100,h=100){e=e||"";b=parseInt(b,10);d=parseInt(d,10);f=parseFloat(f);c=parseFloat(c);g=parseFloat(g);h=parseFloat(h);0===b||0===d||50===f&&100===g&&50===c&&100===h||(b=b.toString()+(10*f).toString().padStart(4,"0")+(10*g).toString().padStart(4,"0"),d=d.toString()+(10*c).toString().padStart(4,"0")+(10*h).toString().padStart(4,"0"));""!==a&&(f="/",c="_",-1!==a.indexOf("/")&&(f="https://resources.page4.com/img/",c="__"),""!== e||0!==b||0!==d?(a=a.split("."),a=f+a[0]+c+e+b+c+d+"."+a[1]):a=f+a);return a}function l(a){640<screen.width&&(a=a.replace(".webp",".jpg"));a=a.replace("url(","").replace(")","").replace("__c100__100","").replace("_c100_100","").replace('"',"").split("/");return a.slice(2<a.length?-2:-1).join("/").replace('"',"")}document.querySelectorAll("#cnt"+n+" [data-image-size]").forEach(a=>{var e=getComputedStyle(a),b=a.getAttribute("data-image-size"),d=a.clientWidth,f=a.clientHeight,c="g";let g=d,h=f;if(!(100> d||100>f)||a.complete){var m=f=50;e.objectPosition&&(e=e.objectPosition.split(" "),"%"===e[0].slice(-1)&&"%"===e[1].slice(-1)&&(f=parseFloat(e[0]),m=parseFloat(e[1])));"auto"===b&&(c="",h=g=0);"width"===b&&(c="",g=d,h=0,a.style.width=a.style.maxWidth=d+"px");"auto"!==b&&"cover"!==b&&"width"!==b&&(c="c","contain"!==b&&(g=Math.floor(d*(parseInt("0"+b,10)/100)),h=2E3));window.devicePixelRatio&&(g*=Math.min(2,window.devicePixelRatio),h*=Math.min(2,window.devicePixelRatio));"img"===a.tagName.toLowerCase()? a.setAttribute("src",k(l(a.getAttribute("src")),c,g,h,f,m,100,100)):(b=a.getAttribute("data-image-var"),e=(d=!!b)?getComputedStyle(a).getPropertyValue("--wdg-"+b):getComputedStyle(a).backgroundImage,c="url("+k(l(e),c,g,Math.min(h,2*screen.width))+")",d?a.style.setProperty("--wdg-"+b,c):a.style.backgroundImage=c);a.removeAttribute("data-image");a.removeAttribute("data-image-size");a.removeAttribute("data-image-var")}})};
2function ready(h){screen.width<500||(document.readyState!=="loading"?h():document.addEventListener("DOMContentLoaded",h))}
3function onYouTubeIframeAPIReady(){ready(()=>{const h=document.querySelectorAll("[data-background-video]");for(let k=0;k<h.length;k++){const l=h[k],[a,e]=l.getAttribute("data-background-video").split(",");if(a==="youtube"){const c=Math.random().toString(36).substring(2,10);l.innerHTML='<div id="'+c+'"></div>';const f=new YT.Player(c,{height:"360",width:"640",videoId:e,playerVars:{modestbranding:0,autoplay:1,mute:1,controls:0,showinfo:0,wmode:"transparent",branding:0,rel:0,autohide:0,loop:1,playsInline:1, origin:window.location.origin},events:{onStateChange:function(b){this.timers||(this.timers={});const d=b.target;d.g.classList.add("playing");b.data===1&&(b=d.getDuration()-d.getCurrentTime(),this.timers[c]&&clearTimeout(this.timers[c]),this.timers[c]=setTimeout(function(){d.seekTo(0)},(b-1)*1E3))}}});setTimeout(()=>{const b=l.querySelector("iframe");b&&!b.classList.contains("playing")&&(f.seekTo(0),b.classList.add("playing"))},5E3)}}})}
4ready(()=>{const h=document.querySelectorAll("[data-background-video]");for(let k=0;k<h.length;k++){const l=h[k],[a,e]=l.getAttribute("data-background-video").split(",");a==="vimeo"&&(l.innerHTML='<iframe src="https://player.vimeo.com/video/'+e+'?background=1&controls=0&autoplay=1&mute=1&playsinline=1&loop=1"></iframe>');a==="youtube"&&(l.innerHTML='<iframe src="https://www.youtube.com/embed/'+e+"?background=1&controls=0&autoplay=1&mute=1&playsinline=1&playlist="+e+'&loop=1"></iframe>')}});
5const initWidgetGallery=e=>{let t=null,l=!1;const r=parseInt("0"+e.getAttribute("data-autorun-time")),n=e.querySelectorAll('input[type="radio"]'),a=e.querySelectorAll(".gallery-slide");n.forEach(((e,t)=>{e.addEventListener("change",(()=>{a.forEach((e=>{e.classList.remove("active")})),a[t].classList.add("active")}))}));const o=e=>{n[e].click()},c=()=>{let e=0;return n.forEach(((t,l)=>{t.checked&&(e=l)})),e},i=()=>{0===r||window.matchMedia("(prefers-reduced-motion)").matches?e.querySelector(".gallery-play-control").remove():t?(clearInterval(t),t=null,e.querySelector(".gallery-play-control").classList.remove("playing")):(e.querySelector(".gallery-play-control").classList.add("playing"),t=setInterval((()=>{l||o((c()+1)%n.length)}),r))};e.addEventListener("mouseenter",(()=>{l=!0})),e.addEventListener("mouseleave",(()=>{l=!1})),e.querySelector(".gallery-prev-button").addEventListener("click",(function(){o((c()+n.length-1)%n.length)})),e.querySelector(".gallery-next-button").addEventListener("click",(function(){o((c()+1)%n.length)})),e.querySelector(".gallery-play-control").addEventListener("click",(function(){i()})),a.length<2?(e.querySelector(".gallery-prev-button").remove(),e.querySelector(".gallery-next-button").remove(),e.querySelector(".gallery-nav").remove(),e.querySelector(".gallery-play-control").remove()):i()};
6// const initWidgetTextBlendGroup=t=>{let[e=100,l=2e3,s="wave",i=!1,a=!1]=t.getAttribute("data-text-blend").split(",").map((t,e)=>e<2?parseInt(t,10):e>2?"1"===t:t),n=Array.from(t.querySelectorAll(":scope > *")),c=n.length,d=Array(c),r=Array(c),o=Array(c),f=0,h=0,p=-1,g=-1,x=-1,$=null;function _(){t.removeAttribute("data-text-blend"),t.classList.add("text-blend-group","text-blend-animation__"+s),n.forEac
6h((t,e)=>{let l=Math.ceil(t.offsetWidth)+1,s=Math.ceil(t.offsetHeight)+1;d[e]=l,f=Math.max(f,l),h=Math.max(h,s)}),t.style.height=h+"px",n.forEach((t,e)=>{t.classList.add("text-blend-item"),t.style.width=f+"px",t.style.height=h+"px";let l=t.innerHTML,s=l.split("").map(t=>{let e=document.createElement("span");return e.classList.add("text-blend-letter"),e.innerHTML=t.replace(/\s/g,"&nbsp;"),e});o[e]=s;let i=document.createDocumentFragment();s.forEach(t=>i.appendChild(t)),t.innerHTML="",t.appendChild(i),r[e]=s.map(t=>t.offsetWidth)})}function m(s,h=!1){if(g=p,p=s,n.forEach((t,e)=>{t.classList.toggle("text-blend-active",e===p),t.classList.toggle("text-blend-previous",e===g)}),-1!==g||a||n[p].classList.add("first"),0===g&&n[g].classList.remove("first"),t.style.width=(i?d[p]:f)+"px",o[p].forEach(t=>t.classList.remove("text-blend-active")),x=0,h)b(1e3),setTimeout(()=>m((p+1)%c,0===e),l);else{let _=()=>{x>=Math.max(r[p].length,-1!==g?r[g].length:0)?($&&cancelAnimationFrame($),$=null,setTimeout(()=>m((p+1)%c,0===e),l)):(b(x+1),$=requestAnimationFrame(_))};$=requestAnimationFrame(_)}}function b(t){let e=0;if(x=t,o[p].forEach((l,s)=>{l.classList.toggle("text-blend-active",s<t),s<t&&(e+=r[p][s])}),-1!==g){let l=0;o[g].forEach((s,i)=>{let a=l>e&&i>t;s.classList.toggle("text-blend-active",a),l+=r[g][i]})}}_(),m(0,!a)};
7
8const initWidgetTextBlendGroup = (groupElement) => {
9    const [letterDelay = 100, itemDelay = 2000, animationType = "wave", animateWidth = false, startEmpty = false] = groupElement.getAttribute("data-text-blend").split(",").map((value, index) => index < 2 ? parseInt(value, 10) : index > 2 ? value === "1" : value);
10    const items = Array.from(groupElement.querySelectorAll(":scope > *"));
11    const itemCount = items.length;
12    let itemWidths = new Array(itemCount);
13    let letterWidths = new Array(itemCount);
14    let letterSpans = new Array(itemCount);
15    let maxWidth = 0;
16    let maxHeight = 0;
17    let currentItem = -1;
18    let previousItem = -1;
19    let currentLetter = -1;
20    let letterIntervalHandle = null;
21
22    function init() {
23        groupElement.removeAttribute("data-text-blend");
24        groupElement.classList.add("text-blend-group", "text-blend-animation__" + animationType);
25        items.forEach((item, i) => {
26            const itemWidth = Math.ceil(item.offsetWidth) + 1;
27            const itemHeight = Math.ceil(item.offsetHeight);
28            itemWidths[i] = itemWidth;
29            maxWidth = Math.max(maxWidth, itemWidth);
30            maxHeight = Math.max(maxHeight, itemHeight);
31        });
32        groupElement.style.height = maxHeight + "px";
33        items.forEach((item, itemIndex) => {
34            item.classList.add("text-blend-item");
35            item.style.width = maxWidth + "px";
36            item.style.height = maxHeight + "px";
37
38            const text = item.innerHTML;
39            const textSpans = text.split("").map(letter => {
40                const span = document.createElement("span");
41                span.classList.add("text-blend-letter");
42                span.innerHTML = letter.replace(/\s/g, "&nbsp;");
43                return span;
44            });
45
46            letterSpans[itemIndex] = textSpans;
47            const fragment = document.createDocumentFragment();
48            textSpans.forEach(span => fragment.appendChild(span));
49            item.innerHTML = "";
50            item.appendChild(fragment);
51            letterWidths[itemIndex] = textSpans.map(span => span.offsetWidth);
52        });
53    }
54
55    function setActiveItem(index, noLetterAnimation = false) {
56        previousItem = currentItem;
57        currentItem = index;
58        items.forEach((item, i) => {
59            item.classList.toggle("text-blend-active", i === currentItem);
60            item.classList.toggle("text-blend-previous", i === previousItem);
61        });
62
63        if (previousItem === -1 && !startEmpty) items[currentItem].classList.add("first");
64        if (previousItem === 0) items[previousItem].classList.remove("first");
65
66        groupElement.style.width = (animateWidth ? itemWidths[currentItem] : maxWidth) + "px";
67
68        letterSpans[currentItem].forEach(span => span.classList.remove("text-blend-active"));
69        currentLetter = 0;
70        if (noLetterAnimation) {
71            setActiveLetter(1000);
72            setTimeout(() => setActiveItem((currentItem + 1) % itemCount, letterDelay === 0), itemDelay);
73        } else {
74            const animateLetters = () => {
75                if (currentLetter >= Math.max(letterWidths[currentItem].length, previousItem !== -1 ? letterWidths[previousItem].length : 0)) {
76                    if (letterIntervalHandle) cancelAnimationFrame(letterIntervalHandle);
77                    letterIntervalHandle = null;
78                    setTimeout(() => setActiveItem((currentItem + 1) % itemCount, letterDelay === 0), itemDelay);
79                } else {
80                    setActiveLetter(currentLetter + 1);
81                    setTimeout(() => requestAnimationFrame(animateLetters), letterDelay);
82                }
83            };
84            letterIntervalHandle = requestAnimationFrame(animateLetters);
85        }
86    }
87
88    function setActiveLetter(index) {
89        let currentLetterWidth = 0;
90        currentLetter = index;
91        letterSpans[currentItem].forEach((span, i) => {
92            span.classList.toggle("text-blend-active", i < index);
93            if (i < index) currentLetterWidth += letterWidths[currentItem][i];
94        });
95        if (previousItem !== -1) {
96            let previousLetterWidth = 0;
97            letterSpans[previousItem].forEach((span, i) => {
98                const previousLetterVisible = previousLetterWidth > currentLetterWidth && i > index;
99                span.classList.toggle("text-blend-active", previousLetterVisible);
100                previousLetterWidth += letterWidths[previousItem][i];
101            });
102        }
103    }
104
105    setTimeout(() => {
106        init();
107        setActiveItem(0, !startEmpty);
108    }, 200);
109};

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.