cuwebframework 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function c(){const r=document.querySelectorAll("[data-yt-id]");r.length&&r.forEach(async t=>{const e=t.dataset.ytId,o=t.querySelector("img");if(!e||!o)return;const a=await s(e);t.ariaLabel=`Video Abspielen: ${a}`,l(o,e,t.ariaLabel),t.dataset.listenerAdded||(t.addEventListener("click",()=>{const n=t.parentElement;n&&n.replaceChildren(i(e,a))}),t.dataset.listenerAdded="true")})}function l(r,t,e){return r.src=`https://img.youtube.com/vi_webp/${t}/sddefault.webp`,r.alt=e,r.title=e,r.onerror=()=>{r.onerror=null,r.src=`https://img.youtube.com/vi/${t}/sddefault.jpg`},r}function i(r,t){const e=document.createElement("iframe");return e.width="100%",e.height="100%",e.src=`https://www.youtube-nocookie.com/embed/${r}?autoplay=1&rel=0`,e.title=t,e.setAttribute("frameborder","0"),e.allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",e.allowFullscreen=!0,e.loading="lazy",e}async function s(r){const t=`https://www.youtube.com/oembed?url=https://youtu.be/${encodeURIComponent(r)}&format=json`;try{const e=await fetch(t);if(!e.ok)throw new Error(`HTTP-Error: ${e.status}`);return(await e.json()).title}catch(e){return console.error("Fehler beim Abrufen des Titels:",e),"Titel konnte nicht geladen werden"}}c();
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cuwebframework",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Lightweight web framework by Copteruni",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/scripts/main.built.js",
|
|
7
|
+
"files": ["dist"],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"dev": "vite",
|
|
10
|
+
"build": "tsc && vite build",
|
|
11
|
+
"preview": "vite preview",
|
|
12
|
+
"publish:npm": "npm publish --access public"
|
|
13
|
+
},
|
|
14
|
+
"author": "cu-maxe",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "^24.9.1",
|
|
18
|
+
"typescript": "~5.9.3",
|
|
19
|
+
"vite": "^7.1.7",
|
|
20
|
+
"vite-plugin-svg-sprite": "^0.6.3"
|
|
21
|
+
}
|
|
22
|
+
}
|