diff --git a/assets/js/app.js b/assets/js/app.js index ccbc2fd..9f9d2c6 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -1,5 +1,47 @@ +function fetchGitHubStars() { + return fetch('https://api.github.com/orgs/CodandoTV/repos') + .then(function (res) { + if (!res.ok) return null; + return res.json(); + }) + .then(function (repos) { + if (!repos || !Array.isArray(repos)) return null; + var map = {}; + repos.forEach(function (r) { map[r.name] = r.stargazers_count; }); + return map; + }) + .catch(function () { return null; }); +} + +function _applyGitHubStars(starMap) { + if (!starMap) return; + + var total = 0; + Object.values(starMap).forEach(function (v) { total += v; }); + + var statEl = document.querySelector('.stat-num'); + if (statEl) statEl.textContent = '⭐ ' + total + '+'; + + [libraryContentData_ptBR, libraryContentData_enUs].forEach(function (dataArr) { + dataArr.forEach(function (lib) { + lib.multirepo.forEach(function (repo) { + if (starMap[repo.name] !== undefined) { + repo.stars = String(starMap[repo.name]); + } + }); + }); + }); + + var activeBtn = document.querySelector('.libs-tab.active'); + if (activeBtn) { + var tabs = Array.from(document.querySelectorAll('.libs-tab')); + var idx = tabs.indexOf(activeBtn); + if (idx >= 0) onLibsContentRender(idx, activeBtn); + } +} + function _onLoadContentCreators() { var cc = document.getElementById('codandotv_creators'); if (!cc) return; @@ -153,4 +195,6 @@ document.addEventListener('DOMContentLoaded', function () { onLibsContentRender(0, document.querySelector('.libs-tab.active')); _onLoadContentCreators(); _onLoadSpeechContent(); + + fetchGitHubStars().then(_applyGitHubStars); }); \ No newline at end of file diff --git a/assets/js/data/library_content_data.js b/assets/js/data/library_content_data.js index 418c5fc..d16d6af 100644 --- a/assets/js/data/library_content_data.js +++ b/assets/js/data/library_content_data.js @@ -5,7 +5,9 @@ const libraryContentData_ptBR = [ desc: 'Um framework para implementar Server-Driven UI de forma rápida e simples em Android, iOS, Flutter e KMP. Permite que as interfaces sejam controladas pelo servidor, tornando as atualizações mais ágeis e sem necessidade de publicar uma nova versão do app.', img: 'assets/images/libs/CraftD.mp4', video: true, - multirepo: [] + multirepo: [ + { name: 'CraftD', stars: '82', url: 'https://github.com/CodandoTV/CraftD' } + ] }, { title: 'Popcorn Guineapig', @@ -24,15 +26,19 @@ const libraryContentData_ptBR = [ desc: 'Uma ferramenta CLI em Dart para enforçar regras de arquitetura em projetos Flutter/Dart. Mantém o código organizado e as dependências sob controle.', img: 'assets/images/libs/eagle-eye.png', video: false, - multirepo: [] + multirepo: [ + { name: 'eagle-eye', stars: '9', url: 'https://github.com/CodandoTV/eagle-eye' } + ] }, { title: 'jujubaSVG', - support: ['Android', 'Flutter'], - desc: 'Uma biblioteca para manipular arquivos SVG em apps Android e Flutter, criada pela CodandoTV para facilitar o uso de SVGs dinâmicos no mobile.', + support: ['Android', 'Flutter', 'CMP'], + desc: 'Uma biblioteca para manipular arquivos SVG em apps Compose Multiplatform, Android e Flutter, criada pela CodandoTV para facilitar o uso de SVGs dinâmicos no mobile.', img: 'assets/images/libs/jujubaSVG.png', video: false, - multirepo: [] + multirepo: [ + { name: 'jujubaSVG', stars: '19', url: 'https://github.com/CodandoTV/jujubaSVG' } + ] }, { title: 'Netflix', @@ -54,7 +60,9 @@ const libraryContentData_enUs = [ desc: 'A framework to implement Server-Driven UI quickly and easily on Android, iOS, Flutter, and KMP. It allows interfaces to be controlled by the server, making updates faster and without the need to publish a new version of the app.', img: 'assets/images/libs/CraftD.mp4', video: true, - multirepo: [] + multirepo: [ + { name: 'CraftD', stars: '82', url: 'https://github.com/CodandoTV/CraftD' } + ] }, { title: 'Popcorn Guineapig', @@ -73,15 +81,19 @@ const libraryContentData_enUs = [ desc: 'A CLI tool in Dart to enforce architecture rules in Flutter/Dart projects. It keeps the code organized and dependencies under control.', img: 'assets/images/libs/eagle-eye.png', video: false, - multirepo: [] + multirepo: [ + { name: 'eagle-eye', stars: '9', url: 'https://github.com/CodandoTV/eagle-eye' } + ] }, { title: 'jujubaSVG', - support: ['Android', 'Flutter'], - desc: 'A library to manipulate SVG files in Android and Flutter apps, created by CodandoTV to facilitate the use of dynamic SVGs in mobile.', + support: ['Android', 'Flutter', 'CMP'], + desc: 'A library to manipulate SVG files in Android, Flutter, and CMP apps, created by CodandoTV to facilitate the use of dynamic SVGs in mobile.', img: 'assets/images/libs/jujubaSVG.png', video: false, - multirepo: [] + multirepo: [ + { name: 'jujubaSVG', stars: '19', url: 'https://github.com/CodandoTV/jujubaSVG' } + ] }, { title: 'Netflix', diff --git a/assets/js/data/speech_content_data.js b/assets/js/data/speech_content_data.js index 212feeb..febe41c 100644 --- a/assets/js/data/speech_content_data.js +++ b/assets/js/data/speech_content_data.js @@ -18,10 +18,10 @@ const speechContentData_ptBR = [ youtubeCategories: ["Android", "Flutter", "iOS"] }, { - youtubeTitle: "Kotzilla no Compose Multiplatform: Setup Completo", + youtubeTitle: "Como Configurar o MCP da Kotzilla na Prática | IA com Contexto Real no Kotlin", youtubeDescription: "Observabilidade gratuita para open source. Analise comportamento, performance e issues do seu app KMP.", - youtubeUrl: "https://www.youtube.com/embed/O9g7RX6OrRI", - youtubeCategories: ["CMP", "Observabilidade"] + youtubeUrl: "https://youtu.be/LyXl3EGrVWw?si=qCIxo-GotkLvktV7", + youtubeCategories: ["CMP", "Observabilidade", "IA"] }, { youtubeTitle: "Mockito no Flutter: Testes Unitários com Mocks", @@ -57,10 +57,10 @@ const speechContentData_enUs = [ youtubeCategories: ["Android", "Flutter", "iOS"] }, { - youtubeTitle: "Kotzilla on Compose Multiplatform: Complete Setup", + youtubeTitle: "How to Set Up Kotzilla's MCP in Practice | AI with Real Context in Kotlin", youtubeDescription: "Free observability for open source. Analyze behavior, performance and issues of your KMP app.", - youtubeUrl: "https://www.youtube.com/embed/O9g7RX6OrRI", - youtubeCategories: ["CMP", "Observability"] + youtubeUrl: "https://youtu.be/LyXl3EGrVWw?si=qCIxo-GotkLvktV7", + youtubeCategories: ["CMP", "Observability", "IA"] }, { youtubeTitle: "Mockito in Flutter: Unit Testing with Mocks",