source: Klonkt/src/services/PlatformIcons.js@ 7bc636b

main
Last change on this file since 7bc636b was 7bc636b, checked in by Robin <robin@…>, 4 months ago

Initial commit — PrutFolio v1 source (pulled from Hetzner /srv/prutfolio)

  • Property mode set to 100644
File size: 10.8 KB
Line 
1/**
2 * PlatformIcons — curated list of social/streaming platforms for the
3 * profile-header social links. Mirrors v9's pcms_profile_platforms() but
4 * with inline SVG so we don't need an icons.svg sprite.
5 *
6 * Each entry: { key, label, brand, host, svg } where:
7 * - key : stable id used in DB (sites.profile_links[].platform)
8 * - label : human readable name
9 * - brand : hex color for hover/icon background
10 * - host : domain hint (used to autodetect from URL if user pastes one)
11 * - svg : inline path data (single <svg> ready)
12 */
13
14export const PLATFORMS = {
15 spotify: {
16 label: 'Spotify',
17 brand: '#1DB954',
18 host: 'spotify.com',
19 svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.42 1.56-.299.421-1.02.599-1.559.3z"/></svg>',
20 },
21 bandcamp: {
22 label: 'Bandcamp',
23 brand: '#629AA9',
24 host: 'bandcamp.com',
25 svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M0 18.75l7.437-13.5H24l-7.438 13.5H0z"/></svg>',
26 },
27 soundcloud: {
28 label: 'SoundCloud',
29 brand: '#FF5500',
30 host: 'soundcloud.com',
31 svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M1.175 12.225c-.051 0-.094.046-.101.1l-.233 2.154.233 2.105c.007.058.05.098.101.098.05 0 .09-.04.099-.098l.255-2.105-.27-2.154c0-.057-.045-.1-.09-.1m-.899.828c-.06 0-.091.037-.104.094L0 14.479l.165 1.308c0 .055.045.094.09.094.06 0 .091-.039.104-.094l.21-1.308-.21-1.342c-.013-.057-.044-.094-.09-.094m1.83-1.229c-.061 0-.12.045-.12.104l-.21 2.586.21 2.49c0 .06.06.12.12.12.06 0 .12-.06.12-.12l.255-2.49-.27-2.586c0-.06-.045-.104-.105-.104m.945-.089c-.075 0-.135.06-.15.135l-.193 2.679.21 2.475c.016.06.075.12.135.12.075 0 .135-.06.15-.135l.21-2.475-.225-2.679c0-.06-.06-.12-.135-.12m1.155.36c-.005-.09-.075-.149-.159-.149-.09 0-.158.06-.164.149l-.217 2.404.2 2.55c0 .09.075.149.159.149.074 0 .149-.06.149-.149l.255-2.55-.225-2.404m.832-1.738c-.082-.045-.166-.067-.262-.067-.075 0-.15.015-.21.045-.06.045-.105.119-.105.179l-.195 4.014.21 2.4c0 .09.075.165.165.165.105 0 .179-.075.21-.165l.225-2.4-.225-4.041c0-.075-.06-.135-.135-.135m.945-.149c-.075 0-.149.045-.165.105L5.7 14.524l.195 2.34c0 .105.09.181.18.181.105 0 .195-.075.21-.181l.21-2.34-.225-4.184c0-.06-.06-.105-.165-.105m1.064.149c-.075 0-.179.06-.195.179l-.135 4.034.15 2.318c0 .105.09.195.21.195.12 0 .195-.09.21-.195l.18-2.318-.21-4.034c0-.119-.075-.179-.21-.179m1.038-.494c-.045 0-.105.015-.149.045-.045.045-.075.105-.075.165l-.135 4.493.135 2.31c.014.135.119.225.224.225.135 0 .24-.09.255-.225l.165-2.31-.165-4.493c-.014-.135-.12-.21-.255-.21M22.275 13.7c-.42 0-.825.075-1.215.225-.27-2.91-2.7-5.175-5.685-5.175-.735 0-1.439.135-2.085.36-.255.09-.314.179-.314.359v9.524c.014.196.165.346.359.36h8.94c2.13 0 3.825-1.695 3.825-3.81 0-2.116-1.695-3.843-3.825-3.843"/></svg>',
32 },
33 applemusic: {
34 label: 'Apple Music',
35 brand: '#FC3C44',
36 host: 'music.apple.com',
37 svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M23.997 6.124c0-.738-.065-1.47-.24-2.19-.317-1.31-1.062-2.31-2.18-3.043C21.003.517 20.373.285 19.7.164c-.517-.093-1.038-.135-1.564-.15-.04-.003-.083-.01-.124-.013H5.988c-.152.01-.303.017-.455.026C4.786.07 4.043.15 3.34.428 2.004.958 1.04 1.88.475 3.208c-.192.448-.292.925-.363 1.408-.056.392-.088.785-.1 1.18 0 .032-.007.062-.01.093v12.223c.01.14.017.283.027.424.05.815.154 1.624.497 2.373.65 1.42 1.738 2.353 3.234 2.802.42.127.856.187 1.293.228.555.053 1.11.06 1.667.06h11.03c.525 0 1.048-.034 1.57-.1.823-.106 1.597-.35 2.296-.81 1.36-.89 2.193-2.13 2.515-3.728.057-.32.084-.65.104-.978.046-.78.06-1.54.06-2.323-.013-.05-.013-.1-.013-.146 0-.13 0-.26.013-.39 0-.026 0-.04-.013-.067V7.197c0-.35-.023-.7-.05-1.05M17.875 14.7c-.166.48-.37.94-.624 1.38-.504.866-1.197 1.57-2.078 2.057-.36.198-.738.358-1.13.477-.96.292-1.962.353-2.96.158-.978-.193-1.876-.602-2.69-1.184-.83-.595-1.526-1.327-2.09-2.176-.512-.77-.91-1.604-1.196-2.49-.286-.886-.46-1.81-.504-2.74-.044-.94.043-1.87.27-2.78.226-.91.59-1.78 1.085-2.6.494-.82 1.114-1.55 1.85-2.18.736-.628 1.586-1.13 2.522-1.5.936-.37 1.94-.555 2.967-.55.7.003 1.4.094 2.08.27.68.176 1.34.44 1.952.78.04.022.08.043.122.064-.005.046-.012.09-.018.135-.063.514-.158 1.02-.29 1.516-.06.226-.13.45-.21.668-.11.28-.236.555-.376.82-.1.19-.21.376-.327.557-.16.247-.336.482-.524.706-.187.224-.39.435-.598.638-.115.111-.234.218-.355.323-.04.034-.08.066-.118.1-.205.176-.42.337-.642.488-.27.183-.554.346-.852.488l-.044.022c-.003-.005-.005-.01-.008-.013-.002-.005-.005-.01-.008-.014v-.013z"/></svg>',
38 },
39 youtube: {
40 label: 'YouTube',
41 brand: '#FF0000',
42 host: 'youtube.com',
43 svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>',
44 },
45 vimeo: {
46 label: 'Vimeo',
47 brand: '#1AB7EA',
48 host: 'vimeo.com',
49 svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M23.977 6.416c-.105 2.338-1.739 5.543-4.894 9.609-3.268 4.247-6.026 6.37-8.29 6.37-1.409 0-2.578-1.294-3.553-3.881L5.322 11.4C4.603 8.816 3.834 7.522 3.01 7.522c-.179 0-.806.378-1.881 1.132L0 7.197c1.185-1.044 2.351-2.084 3.501-3.128C5.08 2.701 6.266 1.984 7.055 1.91c1.867-.18 3.016 1.1 3.447 3.838.465 2.953.789 4.789.971 5.507.539 2.45 1.131 3.674 1.776 3.674.502 0 1.256-.796 2.265-2.385 1.004-1.589 1.54-2.797 1.612-3.628.144-1.371-.395-2.061-1.614-2.061-.574 0-1.167.121-1.777.391 1.186-3.868 3.434-5.757 6.762-5.637 2.473.06 3.628 1.664 3.493 4.797l-.013.01z"/></svg>',
50 },
51 instagram: {
52 label: 'Instagram',
53 brand: '#E1306C',
54 host: 'instagram.com',
55 svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 0 0 0-12.324zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm6.406-11.845a1.44 1.44 0 1 0 0 2.881 1.44 1.44 0 0 0 0-2.881z"/></svg>',
56 },
57 twitter: {
58 label: 'X (Twitter)',
59 brand: '#000000',
60 host: 'twitter.com',
61 svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>',
62 },
63 mastodon: {
64 label: 'Mastodon',
65 brand: '#6364FF',
66 host: 'mastodon.social',
67 svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M23.268 5.313c-.35-2.578-2.617-4.61-5.304-5.004C17.51.242 15.792 0 11.813 0h-.03c-3.98 0-4.835.242-5.288.309C3.882.692 1.496 2.518.917 5.127.64 6.412.61 7.837.661 9.143c.074 1.874.088 3.745.26 5.611.118 1.24.325 2.47.62 3.68.55 2.237 2.777 4.098 4.96 4.857 2.336.792 4.849.923 7.256.38.265-.061.527-.132.786-.213.585-.184 1.27-.39 1.774-.753a.057.057 0 0 0 .023-.043v-1.809a.052.052 0 0 0-.02-.041.053.053 0 0 0-.046-.01 20.282 20.282 0 0 1-4.709.545c-2.73 0-3.463-1.284-3.674-1.818a5.593 5.593 0 0 1-.319-1.433.053.053 0 0 1 .066-.054c1.517.363 3.072.546 4.632.546.376 0 .75 0 1.125-.01 1.57-.044 3.224-.124 4.768-.422.038-.008.077-.015.11-.024 2.435-.464 4.753-1.92 4.989-5.604.008-.145.03-1.52.03-1.67.002-.512.167-3.63-.024-5.545zm-3.748 9.195h-2.561V8.29c0-1.309-.55-1.976-1.67-1.976-1.23 0-1.846.79-1.846 2.35v3.403h-2.546V8.663c0-1.56-.617-2.35-1.848-2.35-1.112 0-1.668.668-1.67 1.977v6.218H4.822V8.102c0-1.31.337-2.35 1.011-3.12.696-.77 1.608-1.164 2.74-1.164 1.311 0 2.302.5 2.962 1.498l.638 1.06.638-1.06c.66-.999 1.65-1.498 2.96-1.498 1.13 0 2.043.395 2.74 1.164.675.77 1.012 1.81 1.012 3.12z"/></svg>',
68 },
69 github: {
70 label: 'GitHub',
71 brand: '#181717',
72 host: 'github.com',
73 svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>',
74 },
75 website: {
76 label: 'Website',
77 brand: '#999999',
78 host: '',
79 svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm-1 17.93C7.05 17.44 4 14.07 4 10c0-.62.08-1.21.21-1.79L9 13v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V5h2c1.1 0 2-.9 2-2v-.41C17.93 3.93 20 6.72 20 10c0 2.04-.77 3.9-2.1 5.39z"/></svg>',
80 },
81 email: {
82 label: 'Email',
83 brand: '#666666',
84 host: '',
85 svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"/></svg>',
86 },
87};
88
89export const PLATFORM_ORDER = [
90 'spotify','bandcamp','soundcloud','applemusic','youtube','vimeo',
91 'instagram','twitter','mastodon','github','website','email',
92];
93
94export function listPlatforms() {
95 return PLATFORM_ORDER.map(k => ({ key: k, ...PLATFORMS[k] }));
96}
97
98export default { PLATFORMS, PLATFORM_ORDER, listPlatforms };
Note: See TracBrowser for help on using the repository browser.