Projeto: slides de progresso de 05/11 e animacao do circuito
Deck curto com o teste dos motores na bateria, a troca pelo UNO com Wi-Fi, a animacao SVG do circuito, a base 35x35 e o que falta. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ce32b92335
commit
68c7dab989
32 files changed
+20422
No files matched your search
@@ -0,0 +1,308 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-BR">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Pronto para montar · Robô Móvel de Carga</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Archivo+Black&family=Space+Grotesk:wght@400;500;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--stage-bg, #000); }
|
||||
.deck-viewport { position: fixed; inset: 0; overflow: hidden; background: var(--stage-bg, #000); }
|
||||
.deck-stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: hidden; transform-origin: 0 0; background: var(--slide-bg, #fff); }
|
||||
.slide { position: absolute; inset: 0; width: 1920px; height: 1080px; overflow: hidden; display: block; visibility: hidden; opacity: 0; pointer-events: none; background: var(--slide-bg, #fff); }
|
||||
.slide.active, .slide.visible { visibility: visible; opacity: 1; pointer-events: auto; z-index: 1; }
|
||||
img, video, canvas, svg { max-width: 100%; max-height: 100%; }
|
||||
.deck-controls { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 1000; }
|
||||
.so-impressao { display: none !important; }
|
||||
@media print {
|
||||
html, body { width: 1920px; height: auto; overflow: visible; background: #fff; }
|
||||
.deck-viewport { position: static; overflow: visible; background: #fff; }
|
||||
.deck-stage { position: static; width: auto; height: auto; transform: none !important; background: none; }
|
||||
.slide { position: relative; display: block !important; visibility: visible !important; opacity: 1 !important; pointer-events: auto !important; width: 1920px; height: 1080px; break-after: page; page-break-after: always; }
|
||||
.slide:last-child { break-after: auto; page-break-after: auto; }
|
||||
.deck-controls { display: none !important; }
|
||||
.reveal { opacity: 1 !important; transform: none !important; }
|
||||
video { display: none !important; }
|
||||
.so-impressao { display: block !important; }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.2s !important; }
|
||||
}
|
||||
|
||||
:root {
|
||||
--cream: #EFE9D9; --cream-2: #E4DCC4; --ink: #0F0F0F; --ink-2: #2A2A2A;
|
||||
--green: #1F8A4C; --pink: #F06CA8; --orange: #E85A1F; --yellow: #F5C518;
|
||||
--display: "Archivo Black", sans-serif;
|
||||
--body: "Space Grotesk", sans-serif;
|
||||
--mono: "JetBrains Mono", monospace;
|
||||
--stage-bg: #0F0F0F; --slide-bg: var(--cream);
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
.slide { transition: opacity .35s ease, visibility .35s; color: var(--ink); font-family: var(--body); }
|
||||
.slide.fim { background: var(--green); color: var(--cream); }
|
||||
|
||||
.topbar { position: absolute; left: 64px; right: 64px; top: 48px; display: flex; justify-content: space-between; align-items: center; font: 400 24px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
|
||||
.pill { border: 2px solid var(--ink); border-radius: 999px; padding: 6px 14px; white-space: nowrap; }
|
||||
.fim .pill { border-color: var(--cream); }
|
||||
.meta { position: absolute; left: 64px; right: 64px; bottom: 40px; display: flex; justify-content: space-between; align-items: center; font: 400 24px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
|
||||
.meta .n { display: flex; align-items: center; gap: 14px; }
|
||||
.meta .n i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; display: inline-block; }
|
||||
|
||||
.kicker { display: inline-block; background: var(--ink); color: var(--cream); font: 400 24px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; padding: 8px 16px; width: max-content; }
|
||||
.d { font-family: var(--display); font-weight: 400; line-height: .92; text-transform: uppercase; letter-spacing: -.01em; margin: 0; }
|
||||
.corpo { font: 400 28px/1.35 var(--body); margin: 0; }
|
||||
.tag { font: 400 20px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
|
||||
|
||||
.abs { position: absolute; }
|
||||
.panel { position: absolute; border: 4px solid var(--ink); background: var(--cream-2); overflow: hidden; }
|
||||
.panel img, .panel video { display: block; width: 100%; height: 100%; object-fit: cover; max-width: none; max-height: none; }
|
||||
.shadow-orange { box-shadow: 24px 24px 0 var(--orange), 24px 24px 0 4px var(--ink); }
|
||||
.caption { position: absolute; font: 400 20px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--cream); padding: 7px 10px; }
|
||||
.badge { position: absolute; background: var(--yellow); border: 4px solid var(--ink); padding: 12px 20px; font: 400 28px/1 var(--display); text-transform: uppercase; transform: rotate(-4deg); }
|
||||
.stat { border: 4px solid var(--ink); padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; background: var(--cream-2); }
|
||||
.stat b { font: 400 44px/.95 var(--display); text-transform: uppercase; }
|
||||
.stat span { font: 400 20px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
|
||||
.stat.green { background: var(--green); color: var(--cream); }
|
||||
.stat.pink { background: var(--pink); }
|
||||
.stat.yellow { background: var(--yellow); }
|
||||
|
||||
.tela-cheia { position: absolute; inset: 0; width: 1920px; height: 1080px; max-width: none; max-height: none; display: block; }
|
||||
|
||||
svg.circuito text { fill:#0F0F0F; }
|
||||
.cir-mono { font-family:"JetBrains Mono",monospace; letter-spacing:.06em; text-transform:uppercase; }
|
||||
.cir-disp { font-family:"Archivo Black",sans-serif; text-transform:uppercase; }
|
||||
.cir-corpo { font-family:"Space Grotesk",sans-serif; }
|
||||
|
||||
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .55s cubic-bezier(.16,1,.3,1), transform .55s cubic-bezier(.16,1,.3,1); }
|
||||
.slide.visible .reveal { opacity: 1; transform: translateY(0); }
|
||||
|
||||
.tabela { position: absolute; left: 1290px; top: 360px; width: 534px; height: 373px; border: 4px solid var(--ink); background: var(--cream-2); border-collapse: collapse; }
|
||||
.tabela th { background: var(--ink); color: var(--cream); font: 400 26px/1 var(--display); text-transform: uppercase; padding: 16px 14px; text-align: left; }
|
||||
.tabela td { border-top: 3px solid var(--ink); padding: 15px 14px; font: 400 22px/1.15 var(--body); }
|
||||
.tabela td:not(:first-child) { white-space: nowrap; }
|
||||
.tabela td:first-child { font: 400 18px/1.15 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
|
||||
.tabela td:last-child { background: var(--green); color: var(--cream); font-weight: 700; }
|
||||
.tabela th:last-child { background: var(--green); }
|
||||
|
||||
.status { position: absolute; left: 96px; right: 96px; top: 330px; width: 1728px; border: 4px solid var(--ink); border-collapse: collapse; background: var(--cream-2); }
|
||||
.status th { background: var(--ink); color: var(--cream); font: 400 28px/1 var(--display); text-transform: uppercase; text-align: left; padding: 18px 26px; }
|
||||
.status td { border-top: 3px solid var(--ink); padding: 26px; font: 500 32px/1.15 var(--body); height: 134px; }
|
||||
.status td + td, .status th + th { border-left: 3px solid var(--ink); }
|
||||
.status th:last-child { background: var(--orange); color: var(--cream); }
|
||||
.status th + th { border-left-color: var(--cream); }
|
||||
.status td:first-child { font: 400 38px/1 var(--display); text-transform: uppercase; width: 460px; }
|
||||
.status td:nth-child(2) { width: 500px; }
|
||||
.status td:last-child { background: var(--cream); font-weight: 700; }
|
||||
.status .ok { display: inline-block; width: 22px; height: 22px; background: var(--green); border: 3px solid var(--ink); margin-right: 14px; vertical-align: -2px; }
|
||||
.status .pend { display: inline-block; width: 22px; height: 22px; background: var(--cream); border: 3px solid var(--ink); margin-right: 14px; vertical-align: -2px; }
|
||||
|
||||
.stamp { position: absolute; left: 1430px; top: 240px; width: 340px; height: 340px; background: var(--pink); border: 4px solid var(--cream); transform: rotate(-6deg); display: flex; align-items: center; justify-content: center; }
|
||||
.stamp div { width: 260px; height: 260px; border: 4px solid var(--cream); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink); text-align: center; }
|
||||
|
||||
.deck-controls { font: 400 14px/1 var(--mono); color: #bbb; background: rgba(0,0,0,.55); padding: 8px 14px; border-radius: 999px; opacity: 0; transition: opacity .4s; letter-spacing: .06em; }
|
||||
.deck-controls.show { opacity: 1; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="deck-viewport">
|
||||
<main class="deck-stage" id="deckStage">
|
||||
|
||||
<section class="slide active" data-label="Capa">
|
||||
<div class="topbar"><span>Robô Móvel de Carga · UNICAP</span><span class="pill">05 NOV 2026</span></div>
|
||||
<div class="abs" style="left:96px; top:170px; width:1000px;">
|
||||
<span class="kicker reveal">Progresso · Novembro 2026</span>
|
||||
<h1 class="d reveal" style="font-size:156px; margin-top:28px;">PRONTO<br>PARA<br><span style="color:var(--orange)">MONTAR</span></h1>
|
||||
<p class="corpo reveal" style="width:860px; margin-top:32px; font-size:30px;">Testamos as partes do robô com a bateria. O próximo passo é montar e demonstrar.</p>
|
||||
</div>
|
||||
<div class="panel shadow-orange reveal" style="left:1110px; top:190px; width:714px; height:402px;"><img src="img/rodinhas.jpg" alt="Quatro motores com rodas mecanum girando na bancada"></div>
|
||||
<span class="caption reveal" style="left:1110px; top:636px;">Bancada · 05/11</span>
|
||||
<div class="abs reveal" style="left:96px; bottom:120px; width:1500px;">
|
||||
<span class="tag" style="display:block; margin-bottom:10px;">Equipe · Robótica Inclusiva · MINF 0104</span>
|
||||
<p class="corpo" style="font-size:24px;">Marcel Guinhos de Menezes Feitosa · Ronaldo Ramos · Maria Luísa Jordão de Moura · Inaldo Neto</p>
|
||||
</div>
|
||||
<div class="meta"><span>Robótica Inclusiva · MINF 0104</span><span class="n">01 <i></i> 08</span></div>
|
||||
</section>
|
||||
|
||||
<section class="slide" data-label="Teste com a bateria">
|
||||
<div class="topbar"><span>Teste de bancada</span><span class="pill">Bateria 4S</span></div>
|
||||
<div class="panel shadow-orange reveal" style="left:96px; top:170px; width:1120px; height:631px; background:#111;">
|
||||
<video src="rodinhas.mp4" poster="img/rodinhas.jpg" autoplay muted loop playsinline></video>
|
||||
<img class="so-impressao" src="img/rodinhas.jpg" alt="Quatro motores com rodas mecanum girando na bancada">
|
||||
</div>
|
||||
<span class="caption reveal" style="left:96px; top:850px;">Vídeo · os 4 motores girando juntos</span>
|
||||
<div class="abs" style="left:1290px; top:170px; width:534px;">
|
||||
<span class="kicker reveal">Essa semana</span>
|
||||
<h2 class="d reveal" style="font-size:66px; margin:20px 0 28px;">AS RODAS<br>GIRARAM NA<br>BATERIA</h2>
|
||||
<div class="reveal" style="display:flex; flex-direction:column; gap:14px;">
|
||||
<div class="stat green"><b>4 motores</b><span>NEMA 17 + rodas mecanum</span></div>
|
||||
<div class="stat yellow"><b>14,8 V</b><span>Li-ion 4S · 2600 mAh</span></div>
|
||||
<div class="stat pink"><b>Nada queimou</b><span>Motores, drivers e bateria</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="abs corpo reveal" style="left:96px; top:908px; width:1728px; font-size:24px;">Sem carga nas rodas. Ainda falta medir a corrente e fazer um teste longo.</p>
|
||||
<div class="meta"><span>Teste com a bateria</span><span class="n">02 <i></i> 08</span></div>
|
||||
</section>
|
||||
|
||||
<section class="slide" data-label="Eletrônica">
|
||||
<div class="topbar"><span>Eletrônica</span><span class="pill">Placa e drivers</span></div>
|
||||
<div class="abs" style="left:96px; top:130px; width:1728px;">
|
||||
<span class="kicker reveal">Troca de placa</span>
|
||||
<h2 class="d reveal" style="font-size:84px; margin-top:18px;">UNO COM WI-FI: FUNCIONOU</h2>
|
||||
</div>
|
||||
<div class="panel reveal" style="left:96px; top:310px; width:600px; height:450px;"><img src="img/placa_uno_wifi.jpg" alt="Arduino UNO com Wi-Fi ligado por USB"></div>
|
||||
<span class="caption reveal" style="left:96px; top:778px;">Arduino UNO com Wi-Fi</span>
|
||||
<div class="panel reveal" style="left:724px; top:310px; width:450px; height:450px;"><img src="img/placa_uno_wifi_verso.jpg" alt="Verso da placa: ATmega328P, ESP8266 e CH340G" style="object-position:50% 45%"></div>
|
||||
<span class="caption reveal" style="left:724px; top:778px;">Verso · ATmega328P + ESP8266</span>
|
||||
<p class="abs corpo reveal" style="left:96px; top:840px; width:1078px; font-size:26px;">Trocamos o Arduino UNO normal por um UNO com Wi-Fi na mesma placa, e funcionou.</p>
|
||||
<div class="abs" style="left:1230px; top:310px; width:594px;">
|
||||
<span class="tag reveal" style="display:block; margin-bottom:16px; font-size:22px;">Vref medido em cada A4988</span>
|
||||
<div class="reveal" style="display:grid; grid-template-columns:1fr 1fr; gap:16px;">
|
||||
<div class="stat yellow"><b>0,63 V</b><span>Driver A</span></div>
|
||||
<div class="stat yellow"><b>0,60 V</b><span>Driver Y</span></div>
|
||||
<div class="stat yellow"><b>0,68 V</b><span>Driver X</span></div>
|
||||
<div class="stat yellow"><b>0,63 V</b><span>Driver Z</span></div>
|
||||
</div>
|
||||
<p class="corpo reveal" style="font-size:26px; margin-top:24px;">Os quatro ficaram próximos: só 0,08 V entre o maior e o menor. Primeiro testamos os motores em fonte de 13 V. Depois, na bateria.</p>
|
||||
</div>
|
||||
<div class="meta"><span>Eletrônica</span><span class="n">03 <i></i> 08</span></div>
|
||||
</section>
|
||||
|
||||
<section class="slide" data-label="Circuito completo">
|
||||
<svg class="circuito tela-cheia" id="circuitoSvg" viewBox="0 0 1920 1080" width="1920" height="1080" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Animação do circuito completo do robô: bateria, LM2596, CNC Shield, ESP32-CAM e quatro motores com rodas mecanum"></svg>
|
||||
</section>
|
||||
|
||||
<section class="slide" data-label="Base 35×35">
|
||||
<div class="topbar"><span>Fabricação</span><span class="pill">Versão 35×35 cm</span></div>
|
||||
<div class="abs" style="left:96px; top:130px; width:1728px;">
|
||||
<span class="kicker reveal">Menos MDF</span>
|
||||
<h2 class="d reveal" style="font-size:84px; margin-top:18px;">ROBÔ MENOR, METADE DAS CHAPAS</h2>
|
||||
</div>
|
||||
<div class="panel reveal" style="left:96px; top:360px; width:560px; height:373px; background:var(--cream);"><img src="img/chapa_base_1_900x600.svg" alt="Plano de corte da chapa da base" style="object-fit:contain"></div>
|
||||
<span class="caption reveal" style="left:96px; top:751px;">Chapa 1 · base</span>
|
||||
<div class="panel reveal" style="left:680px; top:360px; width:560px; height:373px; background:var(--cream);"><img src="img/chapa_prateleiras_1_900x600.svg" alt="Plano de corte da chapa das prateleiras" style="object-fit:contain"></div>
|
||||
<span class="caption reveal" style="left:680px; top:751px;">Chapa 2 · prateleiras</span>
|
||||
<p class="abs corpo reveal" style="left:96px; top:820px; width:1144px; font-size:26px;">Reduzimos a base para gastar menos MDF. Os calços agora saem dos recortes das nervuras, e a fiação foi refeita no modelo.</p>
|
||||
<table class="tabela reveal">
|
||||
<tr><th></th><th>Antes</th><th>Agora</th></tr>
|
||||
<tr><td>Base</td><td>50×50 cm</td><td>35×35 cm</td></tr>
|
||||
<tr><td>Chapas 90×60</td><td>4</td><td>2</td></tr>
|
||||
<tr><td>Custo MDF</td><td>R$ 80</td><td>R$ 40</td></tr>
|
||||
<tr><td>Massa est.</td><td>7,2 kg</td><td>5,6 kg</td></tr>
|
||||
<tr><td>Tombamento sem carga</td><td>31°</td><td>21,6°</td></tr>
|
||||
</table>
|
||||
<div class="meta"><span>Base 35×35</span><span class="n">05 <i></i> 08</span></div>
|
||||
</section>
|
||||
|
||||
<section class="slide" data-label="Próximos passos">
|
||||
<div class="topbar"><span>Onde estamos</span><span class="pill">Próximos passos</span></div>
|
||||
<div class="abs" style="left:96px; top:130px; width:1728px;">
|
||||
<span class="kicker reveal">O que falta</span>
|
||||
<h2 class="d reveal" style="font-size:96px; margin-top:18px;">MONTAR E DEMONSTRAR</h2>
|
||||
</div>
|
||||
<table class="status reveal">
|
||||
<tr><th>Parte</th><th>Hoje</th><th>Falta</th></tr>
|
||||
<tr><td>Tração</td><td><i class="ok"></i>Funciona na bancada</td><td>Fixar na base e testar com carga</td></tr>
|
||||
<tr><td>Firmware</td><td><i class="ok"></i>Código de teste roda</td><td>Ajustar à 35×35 e ligar ao servidor</td></tr>
|
||||
<tr><td>Visão</td><td><i class="ok"></i>Roda no simulador</td><td>Melhorar V-SLAM e usar a câmera real</td></tr>
|
||||
<tr><td>Demonstração</td><td><i class="pend"></i>Próxima etapa</td><td>Juntar tudo e mostrar o robô</td></tr>
|
||||
</table>
|
||||
<div class="meta"><span>Hardware testado · software simulado · agora, o robô</span><span class="n">06 <i></i> 08</span></div>
|
||||
</section>
|
||||
|
||||
<section class="slide" data-label="O que falta?">
|
||||
<div class="topbar"><span>Robô Móvel de Carga · UNICAP</span><span class="pill">Reta final</span></div>
|
||||
<div class="abs" style="left:96px; top:170px; width:1728px;">
|
||||
<span class="kicker reveal">Reta final</span>
|
||||
<h2 class="d reveal" style="font-size:190px; margin-top:28px;">O QUE <span style="color:var(--orange)">FALTA?</span></h2>
|
||||
</div>
|
||||
<div class="abs reveal shadow-orange" style="left:96px; top:510px; background:var(--pink); border:4px solid var(--ink); padding:26px 36px;">
|
||||
<span class="d" style="font-size:84px;">APENAS ENCAIXAR AS PARTES</span>
|
||||
</div>
|
||||
<p class="abs corpo reveal" style="left:96px; top:740px; width:1400px; font-size:40px; line-height:1.25;">E o projeto estará pronto para a demonstração e a entrega.</p>
|
||||
<div class="meta"><span>O que falta?</span><span class="n">07 <i></i> 08</span></div>
|
||||
</section>
|
||||
|
||||
<section class="slide fim" data-label="Obrigado">
|
||||
<div class="topbar"><span>Robô Móvel de Carga · UNICAP</span><span class="pill">05 NOV 2026</span></div>
|
||||
<h2 class="d abs" style="left:96px; top:140px; font-size:220px;">OBRIGADO</h2>
|
||||
<p class="abs corpo" style="left:96px; top:390px; font-size:34px;">Perguntas? Na próxima, o robô montado.</p>
|
||||
<div class="abs" style="left:96px; top:540px; width:1200px;">
|
||||
<span class="tag" style="display:block; margin-bottom:10px;">Equipe</span>
|
||||
<p class="corpo" style="font-size:25px; margin-bottom:18px;">Marcel Guinhos de Menezes Feitosa · Ronaldo Ramos · Maria Luísa Jordão de Moura · Inaldo Neto</p>
|
||||
<span class="tag" style="display:block; margin-bottom:10px;">Orientação</span>
|
||||
<p class="corpo" style="font-size:25px;">Prof. Emmanuel Barreto de Carvalho · Prof. Wilmer Yecid Cordoba Camacho</p>
|
||||
</div>
|
||||
<p class="abs corpo" style="left:96px; top:830px; width:1200px; font-size:20px;">Agradecimentos à UNICAP, pelo espaço e pela infraestrutura; ao Laboratório de Física, pelo apoio; aos orientadores, pelo acompanhamento; e a todos que ajudaram na bancada.</p>
|
||||
<div class="stamp"><div><span style="font:400 64px/.9 var(--display);">NOV<br>2026</span><span class="tag" style="font-size:18px;">Pronto<br>para montar</span></div></div>
|
||||
<div class="meta"><span>Robótica Inclusiva · MINF 0104</span><span class="n">08 <i></i> 08</span></div>
|
||||
</section>
|
||||
|
||||
</main>
|
||||
</div>
|
||||
<div class="deck-controls" id="ctrl">← → navegar · F tela cheia</div>
|
||||
|
||||
<script src="circuito/circuito.js"></script>
|
||||
<script>
|
||||
const stage = document.getElementById("deckStage");
|
||||
function ajustar() {
|
||||
const s = Math.min(innerWidth / 1920, innerHeight / 1080);
|
||||
stage.style.transform = `translate(${(innerWidth - 1920 * s) / 2}px, ${(innerHeight - 1080 * s) / 2}px) scale(${s})`;
|
||||
}
|
||||
addEventListener("resize", ajustar); ajustar();
|
||||
|
||||
const svgCircuito = document.getElementById("circuitoSvg");
|
||||
const desenharCircuito = initCircuito(svgCircuito);
|
||||
const QUADRO_PDF = 28, DURACAO_CIRCUITO = 36;
|
||||
let idCircuito = null;
|
||||
function tocarCircuito() {
|
||||
if (idCircuito !== null) return;
|
||||
const inicio = performance.now();
|
||||
const passo = (agora) => {
|
||||
desenharCircuito((Math.max(0, agora - inicio) / 1000) % DURACAO_CIRCUITO);
|
||||
idCircuito = requestAnimationFrame(passo);
|
||||
};
|
||||
idCircuito = requestAnimationFrame(passo);
|
||||
}
|
||||
function pararCircuito() {
|
||||
if (idCircuito !== null) cancelAnimationFrame(idCircuito);
|
||||
idCircuito = null;
|
||||
desenharCircuito(QUADRO_PDF);
|
||||
}
|
||||
addEventListener("beforeprint", pararCircuito);
|
||||
addEventListener("afterprint", () => { if (slides[atual].contains(svgCircuito)) tocarCircuito(); });
|
||||
|
||||
const slides = [...document.querySelectorAll(".slide")];
|
||||
let atual = 0;
|
||||
const ctrl = document.getElementById("ctrl");
|
||||
let t;
|
||||
function mostrarCtrl() { ctrl.classList.add("show"); clearTimeout(t); t = setTimeout(() => ctrl.classList.remove("show"), 1800); }
|
||||
function ir(i) {
|
||||
atual = Math.max(0, Math.min(slides.length - 1, i));
|
||||
slides.forEach((s, k) => {
|
||||
s.classList.toggle("active", k === atual);
|
||||
s.classList.toggle("visible", k === atual);
|
||||
});
|
||||
history.replaceState(null, "", "#" + (atual + 1));
|
||||
slides[atual].contains(svgCircuito) ? tocarCircuito() : pararCircuito();
|
||||
ctrl.textContent = `${atual + 1} / ${slides.length} · ← → navegar · F tela cheia`;
|
||||
mostrarCtrl();
|
||||
}
|
||||
addEventListener("keydown", (e) => {
|
||||
if (["ArrowRight", "PageDown", " ", "Enter"].includes(e.key)) { e.preventDefault(); ir(atual + 1); }
|
||||
else if (["ArrowLeft", "PageUp", "Backspace"].includes(e.key)) { e.preventDefault(); ir(atual - 1); }
|
||||
else if (e.key === "Home") ir(0);
|
||||
else if (e.key === "End") ir(slides.length - 1);
|
||||
else if (/^[1-9]$/.test(e.key)) ir(+e.key - 1);
|
||||
else if (e.key.toLowerCase() === "f") { document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen(); }
|
||||
});
|
||||
addEventListener("click", (e) => { (e.clientX > innerWidth / 3 ? ir(atual + 1) : ir(atual - 1)); });
|
||||
let x0 = null;
|
||||
addEventListener("touchstart", (e) => { x0 = e.touches[0].clientX; }, { passive: true });
|
||||
addEventListener("touchend", (e) => { if (x0 === null) return; const dx = e.changedTouches[0].clientX - x0; if (Math.abs(dx) > 40) ir(atual + (dx < 0 ? 1 : -1)); x0 = null; });
|
||||
addEventListener("wheel", (e) => { if (Math.abs(e.deltaY) > 20) ir(atual + (e.deltaY > 0 ? 1 : -1)); }, { passive: true });
|
||||
ir(Math.max(0, (parseInt(location.hash.slice(1)) || 1) - 1));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user