Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clickable icons #227

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 186 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,189 @@ for (const icon of iconsDir) {

if (!fs.existsSync('./dist')) fs.mkdirSync('./dist');
fs.writeFileSync('./dist/icons.json', JSON.stringify(icons));

const urls = {
ableton: 'https://www.ableton.com/',
activitypub: 'https://activitypub.rocks/',
actix: 'https://actix.rs/',
aftereffects: 'https://www.adobe.com/in/products/aftereffects.html',
aiscript: 'https://aiscripts.com/',
alpinejs: 'https://alpinejs.dev/',
androidstudio: 'https://developer.android.com/studio',
angular: 'https://angular.io/',
ansible: 'https://www.ansible.com/',
apollo: 'https://www.apollographql.com/',
appwrite: 'https://appwrite.io/',
arduino: 'https://www.arduino.cc/',
astro: 'https://www.astro.build/',
atom: 'https://atom.io/',
audition: 'https://www.adobe.com/it/products/audition.html',
autocad: 'https://www.autodesk.it/products/autocad/overview',
aws: 'https://aws.amazon.com/',
azul: 'https://www.azul.com/',
azure: 'https://azure.microsoft.com/en-in/',
bash: 'https://www.gnu.org/software/bash/',
bevy: 'https://bevyengine.org/',
blender: 'https://www.blender.org/',
bootstrap: 'https://getbootstrap.com/docs/3.4/javascript/',
bsd: 'https://www.freebsd.org/',
c: 'https://www.cprogramming.com/',
cassandra: 'https://cassandra.apache.org/_/index.html',
clojure: 'https://clojure.org/',
cloudflare: 'https://www.cloudflare.com/',
cmake: 'https://cmake.org/',
codepen: 'https://codepen.io/',
coffeescript: 'https://coffeescript.org/',
cpp: 'https://cplusplus.com/',
crystal: 'https://crystal-lang.org/',
cs: 'https://docs.microsoft.com/en-us/dotnet/csharp/',
css: 'https://www.w3schools.com/css/',
d3: 'https://d3js.org/',
dart: 'https://dart.dev/',
deno: 'https://deno.land/',
discord: 'https://discord.com/',
discordbots: 'https://discord.com/developers/docs/intro#bots-and-apps',
django: 'https://www.djangoproject.com/',
docker: 'https://www.docker.com/',
dotnet: 'https://dotnet.microsoft.com/download/dotnet-framework',
dynamodb: 'https://aws.amazon.com/dynamodb/',
eclipse: 'https://www.eclipse.org/',
electron: 'https://www.electronjs.org/',
elixir: 'https://elixir-lang.org/',
emacs: 'https://www.gnu.org/software/emacs/',
ember: 'https://emberjs.com/',
emotion: 'https://emotion.sh/',
expressjs: 'https://expressjs.com/',
fastapi: 'https://fastapi.tiangolo.com/',
fediverse: 'https://en.wikipedia.org/wiki/Fediverse',
figma: 'https://www.figma.com/',
firebase: 'https://firebase.google.com/',
flask: 'https://flask.palletsprojects.com/',
flutter: 'https://flutter.dev/',
forth: 'https://forth-standard.org/',
fortran: 'https://fortran-lang.org/',
gamemakerstudio: 'https://gamemaker.io/gamemaker',
gatsby: 'https://www.gatsbyjs.com/',
gcp: 'https://cloud.google.com/',
gherkin: 'https://cucumber.io/docs/gherkin/',
git: 'https://github.com/',
github: 'https://github.com/',
githubactions: 'https://github.com/features/actions',
gitlab: 'https://about.gitlab.com/',
godot: 'https://godotengine.org/',
golang: 'https://go.dev/',
gradle: 'https://gradle.org/',
grafana: 'https://grafana.com/',
graphql: 'https://graphql.org/',
gtk: 'https://www.gtk.org/',
haskell: 'https://www.haskell.org/',
haxe: 'https://haxe.org/',
haxeflixel: 'https://haxeflixel.com/',
heroku: 'https://www.heroku.com/',
hibernate: 'https://hibernate.org/',
html: 'https://en.wikipedia.org/wiki/HTML5',
idea: 'https://www.jetbrains.com/idea/',
illustrator: 'https://www.adobe.com/in/products/illustrator.html',
instagram: 'https://www.instagram.com/',
java: 'https://www.java.com/',
javascript: 'https://www.javascript.com/',
jenkins: 'https://www.jenkins.io/',
jest: 'https://www.jestjs.io/',
jquery: 'https://jquery.com/',
julia: 'https://julialang.org/',
kotlin: 'https://kotlinlang.org/',
ktor: 'https://ktor.io/',
kubernetes: 'https://kubernetes.io/',
laravel: 'https://laravel.com/',
latex: 'https://www.latex-project.org/',
linkedin: 'https://www.linkedin.com/',
linux: 'https://www.linux.org/',
lit: 'https://lit.dev/',
lua: 'https://www.lua.org/',
markdown: 'https://wikipedia.org/wiki/Markdown',
mastodon: 'https://joinmastodon.org/',
materialui: 'https://mui.com/',
matlab: 'https://mathworks.com/products/matlab.html',
maven: 'https://maven.apache.org/',
misskey: 'https://misskey.page',
mongodb: 'https://www.mongodb.com/',
mysql: 'https://www.mysql.com/',
neovim: 'https://neovim.io/',
nestjs: 'https://nestjs.com/',
netlify: 'https://www.netlify.com/',
nextjs: 'https://nextjs.org/',
nginx: 'https://www.nginx.com/',
nim: 'https://nim-lang.org/',
nodejs: 'https://nodejs.org/',
nuxtjs: 'https://nuxtjs.org/',
ocaml: 'https://ocaml.org/',
octave: 'https://octave.org/',
openshift: 'https://www.okd.io/',
openstack: 'https://www.openstack.org/',
perl: 'https://www.perl.org/',
photoshop: 'https://www.adobe.com/in/products/photoshop.html',
php: 'https://www.php.net/',
plan9: 'https://p9f.org/',
postgresql: 'https://www.postgresql.org/',
powershell: 'https://docs.microsoft.com/en-us/powershell/',
premiere: 'https://www.adobe.com/products/premiere.html',
prisma: 'https://www.prisma.io/',
processing: 'https://processing.org/',
prometheus: 'https://prometheus.io/',
pug: 'https://pugjs.org/',
python: 'https://www.python.org/',
pytorch: 'https://pytorch.org/',
qt: 'https://www.qt.io/',
r: 'https://www.r-project.org/',
rails: 'https://rubyonrails.org/',
raspberrypi: 'https://www.raspberrypi.org/',
react: 'https://reactjs.org/',
reactivex: 'https://reactivex.io/',
redis: 'https://redis.io/',
redux: 'https://redux.js.org/',
regex: 'https://en.wikipedia.org/wiki/Regular_expression',
remix: 'https://remix.run/',
rocket: 'https://rocket.rs/',
rollupjs: 'https://rollupjs.org/',
ros: 'https://www.ros.org/',
ruby: 'https://www.ruby-lang.org/en/',
rust: 'https://www.rust-lang.org/',
sass: 'https://sass-lang.com/',
scala: 'https://www.scala-lang.org/',
selenium: 'https://www.selenium.dev/',
sketchup: 'https://www.sketchup.com/',
solidity: 'https://soliditylang.org/',
spring: 'https://docs.spring.io/spring-framework/docs/3.0.x/reference/expressions.html#:~:text=The%20Spring%20Expression%20Language%20(SpEL,and%20basic%20string%20templating%20functionality.',
sqlite: 'https://www.sqlite.org/',
stackoverflow: 'https://stackoverflow.com/',
styledcomponents: 'https://styled-components.com/',
supabase: 'https://supabase.com/',
svelte: 'https://svelte.dev/',
svg: 'https://wikipedia.org/wiki/Scalable_Vector_Graphics',
swift: 'https://developer.apple.com/swift/',
symfony: 'https://symfony.com/',
tailwindcss: 'https://www.tailwindcss.com/',
tauri: 'https://tauri.app/',
tensorflow: 'https://www.tensorflow.org/',
twitter: 'https://twitter.com/',
typescript: 'https://www.typescriptlang.org/',
unity: 'https://unity.com/',
unrealengine: 'https://www.unrealengine.com/',
v: 'https://vlang.io/',
vala: 'https://vala.dev/',
vercel: 'https://vercel.com/',
vim: 'https://www.vim.org/',
visualstudio: 'https://visualstudio.microsoft.com/',
vite: 'https://vitejs.dev/',
vscode: 'https://code.visualstudio.com/',
vuejs: 'https://vuejs.org/',
webassembly: 'https://webassembly.org/',
webpack: 'https://webpack.js.org/',
windicss: 'https://www.windicss.org/',
wordpress: 'https://wordpress.com/',
workers: 'https://workers.cloudflare.com/',
xd: 'https://www.adobe.com/products/xd.html',
zig: 'https://ziglang.org/',
}

fs.writeFileSync('./dist/urls.json', JSON.stringify(urls));
14 changes: 9 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const icons = require('./dist/icons.json');
const urls = require('./dist/urls.json');
const iconNameList = [...new Set(Object.keys(icons).map(i => i.split('-')[0]))];
const shortNames = {
js: 'javascript',
Expand Down Expand Up @@ -53,6 +54,7 @@ const SCALE = ONE_ICON / (300 - 44);

function generateSvg(iconNames, perLine) {
const iconSvgList = iconNames.map(i => icons[i]);
const iconSvgUrls = iconNames.map(i => urls[i.split('-')[0]]);

const length = Math.min(perLine * 300, iconNames.length * 300) - 44;
const height = Math.ceil(iconSvgList.length / perLine) * 300 - 44;
Expand All @@ -65,11 +67,13 @@ function generateSvg(iconNames, perLine) {
.map(
(i, index) =>
`
<g transform="translate(${(index % perLine) * 300}, ${
Math.floor(index / perLine) * 300
})">
${i}
</g>
<a href="${iconSvgUrls[index]}" rel="nofollow">
<g transform="translate(${(index % perLine) * 300}, ${
Math.floor(index / perLine) * 300
})">
${i}
</g>
</a>
`
)
.join(' ')}
Expand Down