TsukiNi22/ai-utils / skills/ai/presentation
presentation
VerifiedMake a presentation from a plan or an idea, with little text like a real talk - per slide a title saying the idea, one visual and a few key words (icons, logos, a big number, a picture beside the points, a full-slide photo, found on the web with their licence and credit), the sentences in the speaker notes; a time (given, or estimated and confirmed) sets the number of slides; the format (PDF, one-file animated HTML, PPTX, several or all) and the style (several proposals for the subject, "White blueprint" by default, or copied from a PPTX / PDF / HTML the user gives) are asked through interactive-questions. One deck.json gives every format plus speaker notes. Use for "fais une présentation / des slides / un ppt / un pdf de présentation".
templates/deck.js
View on GitHub/* Shared deck runtime: navigation, build-steps, chapters, map, hash, fullscreen, swipe, selftest. No look here. */
(function () {
'use strict';
var root = document.documentElement;
var errors = [];
window.addEventListener('error', function (e) { errors.push(String(e.message)); });
root.classList.add('js');
var deck = document.getElementById('deck'), stage = document.getElementById('stage');
var slides = [].slice.call(deck.children).filter(function (e) { return e.classList.contains('slide'); });
var N = slides.length, cur = 0, k = 0;
var maxk = slides.map(function (s) { var m = 0; [].forEach.call(s.querySelectorAll('[data-s]'), function (e) { m = Math.max(m, +e.getAttribute('data-s') || 0); }); return m; });
var $ = function (id) { return document.getElementById(id); };
var chapters = [], chOf = [];
slides.forEach(function (s, i) {
var c = s.getAttribute('data-ch') || '';
if (!chapters.length || chapters[chapters.length - 1].name !== c) chapters.push({ name: c, first: i });
chOf[i] = chapters.length - 1;
});
var chBox = $('chapters'), bar = $('bar'), count = $('count'), dots = $('steps'), map = $('map');
var chBtns = [], widths = [];
function more(side) {
var m = document.createElement('button'); m.type = 'button'; m.className = 'more ' + side; m.textContent = '\u2026'; m.tabIndex = -1;
m.addEventListener('click', function () { var t = +m.getAttribute('data-to'); go(chapters[t].first, 0); m.blur(); });
return m;
}
var moreL = more('l'), moreR = more('r');
chBox.appendChild(moreL);
chapters.forEach(function (c, n) {
var b = document.createElement('button'); b.type = 'button'; b.textContent = c.name; b.setAttribute('data-n', n);
b.addEventListener('click', function () { go(c.first, 0); b.blur(); }); b.tabIndex = -1; chBox.appendChild(b); chBtns.push(b); /* the arrows / the map are the keyboard way: no focus ring left on a chapter */
});
chBox.appendChild(moreR);
/* The bar shows the current chapter in full, then as many neighbours as fit (the coming ones first); what does not fit
folds into one "..." cell on each side, and slides in / out as the talk goes on. */
function measure() {
chBtns.forEach(function (b) { b.classList.remove('off'); }); moreL.classList.remove('off'); moreR.classList.remove('off');
widths = chBtns.map(function (b) { return b.offsetWidth + 1; });
widths.more = Math.max(moreL.offsetWidth, moreR.offsetWidth, 36) + 1;
}
function layoutChapters() {
if (!widths.length) measure();
var hud = $('hud'), used = 0;
[].forEach.call(hud.children, function (e) { if (e !== chBox && e !== bar && e.offsetWidth) used += e.offsetWidth; });
var avail = hud.clientWidth - used - 2, c = chOf[cur], lo = c, hi = c, n = chapters.length;
function fits(a, b) {
var w = 0; for (var i = a; i <= b; i++) w += widths[i];
return w + (a > 0 ? widths.more : 0) + (b < n - 1 ? widths.more : 0) <= avail;
}
var grew = true;
while (grew) {
grew = false;
if (hi < n - 1 && fits(lo, hi + 1)) { hi++; grew = true; }
if (lo > 0 && fits(lo - 1, hi)) { lo--; grew = true; }
}
chBtns.forEach(function (b, i) { b.classList.toggle('off', i < lo || i > hi); });
moreL.classList.toggle('off', lo === 0); moreR.classList.toggle('off', hi === n - 1);
moreL.setAttribute('data-to', Math.max(0, lo - 1)); moreR.setAttribute('data-to', Math.min(n - 1, hi + 1));
moreL.title = chapters.slice(0, lo).map(function (x) { return x.name; }).join(' \u00b7 ');
moreR.title = chapters.slice(hi + 1).map(function (x) { return x.name; }).join(' \u00b7 ');
}
function title(s) { return s.getAttribute('data-title') || (s.querySelector('h1,h2') || {}).textContent || 'Diapo'; }
var fr = /^fr/i.test(document.documentElement.lang || ''), mapBtns = [];
var head = document.createElement('div'); head.className = 'maphead';
head.innerHTML = '<strong></strong><span class="maphint"></span><button type="button" class="mapclose" aria-label="Close"></button>';
head.querySelector('strong').textContent = (fr ? 'Plan' : 'Outline') + ' \u00b7 ' + slides.length + (fr ? ' diapos' : ' slides');
head.querySelector('.maphint').textContent = fr ? 'Cliquer pour aller \u00e0 une diapo \u00b7 \u00c9chap pour fermer \u00b7 H : masquer la barre' : 'Click to jump to a slide \u00b7 Esc to close \u00b7 H: hide the bar';
head.querySelector('.mapclose').textContent = '\u00d7';
head.querySelector('.mapclose').addEventListener('click', function () { toggleMap(false); });
map.appendChild(head);
var grid = document.createElement('div'); grid.className = 'mapgrid'; map.appendChild(grid);
chapters.forEach(function (c, n) {
var g = document.createElement('section'); g.className = 'mapch';
var count = 0; slides.forEach(function (s, i) { if (chOf[i] === n) count++; });
var h = document.createElement('h3');
h.innerHTML = '<span class="chnum"></span><span class="chname"></span><span class="chcount"></span>';
h.querySelector('.chnum').textContent = n + 1; h.querySelector('.chname').textContent = c.name; h.querySelector('.chcount').textContent = count;
g.appendChild(h);
slides.forEach(function (s, i) {
if (chOf[i] !== n) return;
var b = document.createElement('button'); b.type = 'button';
b.innerHTML = '<span class="num"></span><span class="ttl"></span>';
b.querySelector('.num').textContent = i + 1; b.querySelector('.ttl').textContent = title(s);
b.addEventListener('click', function () { toggleMap(false); go(i, 0); b.blur(); }); g.appendChild(b); mapBtns[i] = b;
});
grid.appendChild(g);
});
function fit() {
var w = innerWidth, h = innerHeight, portrait = w / h < 0.9;
var sw = portrait ? 540 : 1280, sh = portrait ? 960 : 720, sc = Math.min(w / sw, h / sh);
root.classList.toggle('portrait', portrait);
stage.style.width = sw + 'px'; stage.style.height = sh + 'px';
stage.style.transform = 'translate(' + ((w - sw * sc) / 2) + 'px,' + ((h - sh * sc) / 2) + 'px) scale(' + sc + ')';
}
var dotEls = [];
for (var q = 0; q <= Math.max.apply(null, maxk); q++) { var dd = document.createElement('i'); dots.appendChild(dd); dotEls.push(dd); }
count.style.minWidth = (String(N).length * 2 + 5) + 'ch';
function render() {
slides.forEach(function (s, i) {
var kk = i === cur ? k : (i < cur ? maxk[i] : 0);
s.setAttribute('data-state', i < cur ? 'past' : i > cur ? 'future' : 'active');
s.setAttribute('data-k', kk); s.setAttribute('aria-hidden', i !== cur);
[].forEach.call(s.querySelectorAll('[data-s]'), function (e) { e.classList.toggle('on', (+e.getAttribute('data-s')) <= kk); });
});
var p = (cur + (maxk[cur] ? k / (maxk[cur] + 1) : 0)) / (N - 1);
bar.style.setProperty('--p', Math.min(1, p).toFixed(4));
count.textContent = (cur + 1) + ' / ' + N;
/* the squares: room kept for the slide with the most steps, so nothing moves from one slide to the next */
for (var i = 0; i < dotEls.length; i++) dotEls[i].className = i > maxk[cur] ? 'off' : (i <= k ? 'on' : '');
chBtns.forEach(function (b, n) { b.classList.toggle('cur', n === chOf[cur]); b.classList.toggle('done', n < chOf[cur]); });
layoutChapters();
root.setAttribute('data-slide', cur + 1); root.setAttribute('data-first', cur === 0); root.setAttribute('data-last', cur === N - 1);
var h = '#' + (cur + 1) + (k ? '.' + k : '');
if (location.hash !== h) { try { history.replaceState(null, '', h); } catch (e) { /* file: pages may refuse */ } }
}
function go(i, kk) { cur = Math.max(0, Math.min(N - 1, i)); k = Math.max(0, Math.min(maxk[cur], kk || 0)); render(); }
function next() { if (k < maxk[cur]) { k++; render(); } else if (cur < N - 1) go(cur + 1, 0); }
function prev() { if (k > 0) { k--; render(); } else if (cur > 0) go(cur - 1, maxk[cur - 1]); }
function toggleMap(on) {
map.hidden = on === undefined ? !map.hidden : !on; root.classList.toggle('mapopen', !map.hidden);
if (!map.hidden) { mapBtns.forEach(function (b, i) { b.classList.toggle('cur', i === cur); b.classList.toggle('seen', i < cur); }); if (mapBtns[cur]) mapBtns[cur].scrollIntoView({ block: 'nearest' }); }
}
function fullscreen() {
if (document.fullscreenElement) { document.exitFullscreen(); return; }
var f = root.requestFullscreen || root.webkitRequestFullscreen; if (f) f.call(root);
}
function parseHash() {
var m = /^#(\d+)(?:\.(\d+))?$/.exec(location.hash); if (!m) return false;
go(+m[1] - 1, +(m[2] || 0)); return true;
}
function key(e) {
if (e.ctrlKey || e.metaKey || e.altKey) return;
if (/^(INPUT|TEXTAREA|SELECT)$/.test((e.target || {}).tagName)) return;
var c = e.key, used = true;
if (c === 'ArrowRight' || c === 'ArrowDown' || c === 'PageDown' || c === 'Enter' || (c === ' ' && !e.shiftKey)) next();
else if (c === 'ArrowLeft' || c === 'ArrowUp' || c === 'PageUp' || c === 'Backspace' || (c === ' ' && e.shiftKey)) prev();
else if (c === 'Home') go(0, 0);
else if (c === 'End') go(N - 1, maxk[N - 1]);
else if (c === 'o' || c === 'O' || c === 'm' || c === 'M') toggleMap();
else if (c === 'Escape') toggleMap(false);
else if (c === 'f' || c === 'F') fullscreen();
else if (c === 'n' || c === 'N') root.classList.toggle('notes');
else if (c === 'h' || c === 'H') { root.classList.toggle('nohud'); if (!root.classList.contains('nohud')) { widths = []; layoutChapters(); } }
else used = false;
if (used) e.preventDefault();
}
window.addEventListener('keydown', key);
window.addEventListener('resize', fit);
window.addEventListener('resize', function () { widths = []; layoutChapters(); });
if (document.fonts && document.fonts.ready) document.fonts.ready.then(function () { widths = []; layoutChapters(); });
window.addEventListener('hashchange', parseHash);
$('prev').addEventListener('click', function (e) { prev(); e.currentTarget.blur(); });
$('next').addEventListener('click', function (e) { next(); e.currentTarget.blur(); });
$('zl').addEventListener('click', prev); $('zr').addEventListener('click', next);
$('ovbtn').addEventListener('click', function (e) { toggleMap(); e.currentTarget.blur(); });
$('fsbtn').addEventListener('click', function (e) { fullscreen(); e.currentTarget.blur(); });
map.addEventListener('click', function (e) { if (e.target === map) toggleMap(false); });
var tx = 0, ty = 0;
stage.addEventListener('touchstart', function (e) { tx = e.changedTouches[0].clientX; ty = e.changedTouches[0].clientY; }, { passive: true });
stage.addEventListener('touchend', function (e) {
var dx = e.changedTouches[0].clientX - tx, dy = e.changedTouches[0].clientY - ty;
if (Math.abs(dx) > 50 && Math.abs(dx) > Math.abs(dy) * 1.5) { if (dx < 0) next(); else prev(); }
}, { passive: true });
deck.addEventListener('click', function (e) {
var o = e.target.closest ? e.target.closest('.opt') : null;
if (o) {
var q = o.parentNode; if (q.getAttribute('data-done')) return;
q.setAttribute('data-done', '1');
[].forEach.call(q.querySelectorAll('.opt'), function (x) { x.classList.add(x.getAttribute('data-ok') === '1' ? 'right' : 'wrong'); });
o.classList.add('picked'); return;
}
var t = e.target.closest ? e.target.closest('.tap') : null;
if (t) { t.classList.toggle('shown'); t.textContent = t.classList.contains('shown') ? (t.getAttribute('data-a') || '') : '?'; }
});
fit();
root.classList.add('noanim');
if (!parseHash()) render();
requestAnimationFrame(function () { requestAnimationFrame(function () { if (!/selftest/.test(location.search)) root.classList.remove('noanim'); }); });
if (/[?&]map\b/.test(location.search)) toggleMap(true); /* ?map opens the outline at once (a link to it, the checks) */
if (/selftest/.test(location.search)) {
var rep = [], seen = {}, states = 0, sr = stage.getBoundingClientRect();
var add = function (kind, i, kk, e) {
var m = kind + ' slide ' + (i + 1) + ' <' + e.tagName.toLowerCase() + ' ' + (e.getAttribute('class') || '') + '> ' + (e.textContent || '').replace(/\s+/g, ' ').slice(0, 24);
if (!seen[m]) { seen[m] = 1; rep.push(m + ' (first at step ' + kk + ')'); }
};
for (var i = 0; i < N; i++) {
for (var kk = 0; kk <= maxk[i]; kk++) {
go(i, kk); states++;
var s = slides[i], all = s.querySelectorAll('*'), r0 = stage.getBoundingClientRect();
for (var j = 0; j < all.length; j++) {
var e = all[j], cs = getComputedStyle(e);
if (cs.display === 'none' || cs.visibility === 'hidden' || +cs.opacity < 0.05 || e.closest('.notes,[data-nocheck]')) continue;
var hid = false, p = e.parentNode; while (p && p !== s) { if (p.nodeType === 1 && +getComputedStyle(p).opacity < 0.05) { hid = true; break; } p = p.parentNode; }
if (hid) continue;
var r = e.getBoundingClientRect(); if (r.width === 0 && r.height === 0) continue;
var tol = 3 * (r0.width / stage.offsetWidth), hr = $('hud').getBoundingClientRect();
if (r.right > hr.left + tol && r.left < hr.right - tol && r.bottom > hr.top + tol && r.top < hr.bottom - tol) add('HUD', i, kk, e);
var bx = e.closest('.col, .flow > li, .k-title .meta li');
if (bx && bx !== e) { var br = bx.getBoundingClientRect(); if (r.right > br.right + tol || r.left < br.left - tol || r.bottom > br.bottom + tol) add('BOX', i, kk, e); }
if (r.left < r0.left - tol || r.right > r0.right + tol || r.top < r0.top - tol || r.bottom > r0.bottom + tol)
add('OUT', i, kk, e);
if (!(e instanceof SVGElement) && cs.overflow !== 'visible' && (e.scrollWidth > e.clientWidth + 2 || e.scrollHeight > e.clientHeight + 2) && !e.classList.contains('slide'))
add('CLIP', i, kk, e);
}
}
}
go(0, 0);
var presses = 0, ev = function (kk) { window.dispatchEvent(new KeyboardEvent('keydown', { key: kk, bubbles: true, cancelable: true })); };
while (!(cur === N - 1 && k === maxk[N - 1]) && presses < 1000) { ev('ArrowRight'); presses++; }
var fwd = presses; while (cur > 0 || k > 0) { ev('ArrowLeft'); presses++; if (presses > 2000) break; }
ev('End'); var endOk = cur === N - 1; ev('Home'); var homeOk = cur === 0 && k === 0; ev(' '); var spaceOk = (cur > 0 || k > 0);
ev('o'); var mapOk = !map.hidden; ev('Escape'); mapOk = mapOk && map.hidden; go(0, 0);
ev('h'); var hudOk = !$('hud').offsetWidth; ev('h'); hudOk = hudOk && $('hud').offsetWidth > 0;
if (fwd !== states - 1 || presses !== 2 * (states - 1) || !endOk || !homeOk || !spaceOk || !mapOk || !hudOk) rep.push('KEYS fwd=' + fwd + ' total=' + presses + ' expected=' + (states - 1) + ' end=' + endOk + ' home=' + homeOk + ' space=' + spaceOk + ' map=' + mapOk + ' hud=' + hudOk);
var out = document.createElement('pre'); out.id = 'selftest';
out.setAttribute('style', 'position:fixed;z-index:99999;left:0;top:0;right:0;margin:0;padding:12px;background:#fff;color:#000;font:16px/1.3 monospace;white-space:pre-wrap;max-height:100vh;overflow:hidden');
out.textContent = 'SELFTEST ' + (rep.length || errors.length ? 'FAIL' : 'OK') + ': ' + N + ' slides, ' + states + ' states, ' + errors.length + ' js errors, ' + rep.length + ' layout issues, keys ' + (fwd === states - 1 ? 'OK' : 'BAD') + '\n' + errors.concat(rep.slice(0, 25)).join('\n');
document.body.appendChild(out); document.title = 'SELFTEST ' + (rep.length || errors.length ? 'FAIL' : 'OK');
}
})();
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |