├── DPXGithubRating.js ├── DevelopixProjects.json └── index.html /DPXGithubRating.js: -------------------------------------------------------------------------------- 1 | (async () => { 2 | 3 | const repository = document.currentScript.getAttribute('repository'); 4 | const icon_star = document.currentScript.getAttribute('star') ?? null; 5 | const text = document.currentScript.getAttribute('text') ?? null; 6 | 7 | if (repository) { 8 | 9 | let request = await fetch(`https://api.github.com/repos/${ repository }`); 10 | 11 | try { 12 | 13 | let data = await request.json(); 14 | 15 | if (document.querySelector(".dpxgithubrating")) { 16 | 17 | let elements; 18 | 19 | if (document.querySelector(`.dpxgithubrating[repository='${ repository }']`)) { 20 | 21 | elements = document.querySelectorAll(`.dpxgithubrating[repository='${ repository }']`); 22 | 23 | }else{ 24 | 25 | elements = document.querySelectorAll(`.dpxgithubrating`); 26 | 27 | } 28 | 29 | for (let i = 0; i < elements.length; i++) { 30 | 31 | elements[i].appendChild(DPXCreateGithubRatingElement(data.html_url, data.stargazers_count, data.full_name, text, icon_star)); 32 | 33 | } 34 | 35 | }else{ 36 | 37 | document.body.appendChild(DPXCreateGithubRatingElement(data.html_url, data.stargazers_count, data.full_name, text, icon_star)); 38 | 39 | } 40 | 41 | }catch(e) { 42 | 43 | console.log("DPXGithubRating Error : ", e); 44 | 45 | } 46 | 47 | } 48 | 49 | })(); 50 | 51 | const DPXCreateGithubRatingElement = (repository_url, stargazers_count, title, text = null, star = null) => { 52 | 53 | let anchor = document.createElement('a'); 54 | anchor.href = repository_url; 55 | anchor.title = title; 56 | anchor.target = "_blank"; 57 | anchor.rel = "noopener"; 58 | anchor.classList.add('DPXGithubRatingButton'); 59 | 60 | if (star) { 61 | 62 | let i = document.createElement('i'); 63 | i.classList.add(star); 64 | anchor.appendChild(i); 65 | 66 | } 67 | 68 | if (text) { 69 | 70 | let span = document.createElement('span'); 71 | span.innerText = text; 72 | anchor.appendChild(span); 73 | 74 | } 75 | 76 | let b = document.createElement('b'); 77 | b.innerText = stargazers_count; 78 | anchor.appendChild(b); 79 | 80 | return anchor; 81 | 82 | }; -------------------------------------------------------------------------------- /DevelopixProjects.json: -------------------------------------------------------------------------------- 1 | { 2 | "ronio" : { 3 | "title" : "رونیو", 4 | "title_en" : "Ronio", 5 | "link" : "https://ronio.ir", 6 | "link_en" : "https://ronio.ir/en", 7 | "colors" : [ "#E91E63", "#AB47BC" ], 8 | "status" : true 9 | }, 10 | "codilo" : { 11 | "title" : "کدیلو", 12 | "title_en" : "Codilo", 13 | "link" : "https://codilo.ir", 14 | "link_en" : "https://codilo.ir", 15 | "colors" : [ "#B71C1C", "#EF9A9A" ], 16 | "status" : true 17 | }, 18 | "projino" : { 19 | "title" : "پروژینو", 20 | "title_en" : "Projino", 21 | "link" : "https://projino.ir", 22 | "link_en" : "https://projino.ir", 23 | "colors" : [ "#9FA8DA", "#1A237E" ], 24 | "status" : false 25 | }, 26 | "smusher" : { 27 | "title" : "اسموشر", 28 | "title_en" : "Smusher", 29 | "link" : "https://smusher.ir", 30 | "link_en" : "https://smusher.ir/en", 31 | "colors" : [ "#F44336", "#3F51B5" ], 32 | "status" : true 33 | }, 34 | "filito" : { 35 | "title" : "فایلیتو", 36 | "title_en" : "Filito", 37 | "link" : "https://filito.ir", 38 | "link_en" : "https://filito.ir/en", 39 | "colors" : [ "#B71C1C", "#FFC107" ], 40 | "status" : true 41 | }, 42 | "htmhell" : { 43 | "title" : "جهنم وب", 44 | "title_en" : "HTMHell", 45 | "link" : "https://htmhell.ir", 46 | "link_en" : "https://htmhell.ir", 47 | "colors" : [ "#263238", "#B0BEC5" ], 48 | "status" : true 49 | }, 50 | "nojquery" : { 51 | "title" : "جی‌کوئری لازم نیست", 52 | "title_en" : "No JQuery", 53 | "link" : "https://nojquery.ir", 54 | "link_en" : "https://nojquery.ir", 55 | "colors" : [ "#0D47A1", "#42A5F5" ], 56 | "status" : true 57 | }, 58 | "theperfectsite" : { 59 | "title" : "بهترین سایت دنیا", 60 | "title_en" : "The Perfect Site", 61 | "link" : "https://theperfectsite.ir", 62 | "link_en" : "https://theperfectsite.ir", 63 | "colors" : [ "#9E9D24", "#E6EE9C" ], 64 | "status" : true 65 | }, 66 | "thebestlanguage" : { 67 | "title" : "بهترین زبان برنامه‌نویسی", 68 | "title_en" : "The Best Language", 69 | "link" : "https://thebestlanguage.ir", 70 | "link_en" : "https://thebestlanguage.ir", 71 | "colors" : [ "#00695C", "#4DB6AC" ], 72 | "status" : true 73 | }, 74 | "dontasktoask" : { 75 | "title" : "نپرس که بپرسم، فقط بپرس", 76 | "title_en" : "Don't Ask To Ask", 77 | "link" : "https://dontasktoask.ir", 78 | "link_en" : "https://dontasktoask.ir", 79 | "colors" : [ "#c2185b", "#f48fb1" ], 80 | "status" : true 81 | }, 82 | "pixoro" : { 83 | "title" : "پیکسورو", 84 | "title_en" : "Pixoro", 85 | "link" : "https://pixoro.ir", 86 | "link_en" : "https://pixoro.ir/en", 87 | "colors" : [ "#EE5CC1", "#72E5F7" ], 88 | "status" : true 89 | }, 90 | "urixo" : { 91 | "title" : "یوریکسو", 92 | "title_en" : "Urixo", 93 | "link" : "https://urixo.ir", 94 | "link_en" : "https://urixo.ir", 95 | "colors" : [ "#04DFBA", "#509BD4" ], 96 | "status" : true 97 | }, 98 | "qiblafinder" : { 99 | "title" : "قبله نما آنلاین", 100 | "title_en" : "Online Qibla Finder", 101 | "link" : "https://qiblafind.net/fa/qibla-finder", 102 | "link_en" : "https://qiblafind.net", 103 | "colors" : [ "#1E88E5", "#42A5F5" ], 104 | "status" : true 105 | }, 106 | "developix" : { 107 | "title" : "مجموعه دولوپیکس", 108 | "title_en" : "Developix", 109 | "link" : "https://developix.ir", 110 | "link_en" : "https://developix.ir", 111 | "colors" : [ "#006064", "#81d4fa" ], 112 | "status" : true 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | --------------------------------------------------------------------------------