上一版只收录 14 套,把 avataaars、bottts 两个系列漏掉了。原因是 3.2.36 盘点时,这四套的 npm 包里 license 字段写的是「See LICENSE file」,被我 当成「措辞不明、先不收」。点进去看实际条款是 「Free for personal and commercial use」(设计者 Pablo Stanley, 来源 avataaars.com / bottts.com),而且不要求署名 —— 比收录的 CC BY 那十几套还宽松。方向判断反了,这是错误,不是许可限制。 改动: - 新增 inc/avatar-styles/ 四份模板:avataaars、avataaars_neutral、 bottts、bottts_neutral(合计 227 KB,风格总数 14 → 18) - yang_avatar_styles() 注册四套中文名与说明,排在「首字母」之后 - avataaars 的 onPostCreate 三条规则逐条复刻: ① style 组为 circle 时清空背景; ② 背景恰好只剩 65c9ff 一项时清空(判「恰好只有一个」,不是「包含」); ③ 戴头巾且胡子概率非 100 时去掉胡子。 为此 yang_avatar_post_create() 增加 $picked 形参(官方读 components.style.name / components.top.name,不传拿不到), 返回值由 2 项改为 3 项($on 会被改,必须带出来)。 - 后台风格说明由「都是 CC0 或 MIT 许可」改为「都可自由使用与商用, 且不要求署名」—— 加了这四套后前者已不准确 - 文件头许可清单补上「作者自定义许可」一类 验证(先证明判据真能红,再谈通过): - 逐字节 80/0:四套各 20 种种子(含中文、emoji、超长、空串)比对官方 Node 库。第一版 avataaars 20 个全错,差异正是背景那块天蓝,补规则后对齐 - 逐字节反向 3/3:删分支、不清 65c9ff、返回值退 2 项,各红 20 项 - 规则白盒 9/0:circle / 恰好 65c9ff / 多色保留 / 含 65c9ff 不只一项保留 / 头巾 10% 删胡子 / 头巾 100% 保留胡子 / 不戴头巾不受影响 / 别风格不受影响 / 返回 3 项 - 规则反向 6/6:写坏任一分支,都恰好在预期那条上报错 - 原有 14 套回归 108/0(原 84 + 新 24) - 18 套全量冒烟:每套合法 SVG、三种种子互异 - 严格错误级别 PHP 8.4.25 与 8.5.12(线上同版)各 47/0 - 几何+交互 29/0:18 卡片、18 单选、18 缩略图全部解码 - 源码守卫 55/0,反向 17/17 - 包内契约 34/0,反向 8/8 - 后台标签 88/0、CDN 56/0 与 77/0、3.2.28 13/0 - 93 个 php 文件 php -l 全通过 顺带修正两处错误的守卫(都是这次暴露出来的): - _guard336_avatar.py 把 avataaars / bottts 错列进「CC BY 禁止收录」 清单,改按实测许可证重写(CC BY 实为 13 套,不含这两个) - _guard336_falsify.py 的 F2 锚点仍在匹配旧名「自动头像」,3.2.37 改名后恒失效;版本锚点也停在上一个版本
84 lines
9.7 KiB
PHP
84 lines
9.7 KiB
PHP
<?php
|
|
return array(
|
|
'name' => 'bottts-neutral',
|
|
'meta' => array(
|
|
'title' => 'Bottts',
|
|
'creator' => 'Pablo Stanley',
|
|
'source' => 'https://bottts.com/',
|
|
'license_name' => 'Free for personal and commercial use',
|
|
'license_url' => 'https://bottts.com/',
|
|
),
|
|
'view_box' => '0 0 120 120',
|
|
'clip_default' => true,
|
|
'has_pre_create' => false,
|
|
'has_post_create' => false,
|
|
'is_initials' => false,
|
|
'attr_pairs' => array(
|
|
array('viewBox', '0 0 120 120'),
|
|
array('fill', 'none'),
|
|
array('shape-rendering', 'auto'),
|
|
),
|
|
'bg_colors' => array('ffb300', '1e88e5', '546e7a', '6d4c41', '00acc1', 'f4511e', '5e35b1', '43a047', '757575', '3949ab', '039be5', '7cb342', 'c0ca33', 'fb8c00', 'd81b60', '8e24aa', 'e53935', '00897b', 'fdd835'),
|
|
'bg_type' => array('solid'),
|
|
'bg_rotation' => array('0', '360'),
|
|
'body_template' => '<g transform="translate(22 68)">@@k:mouth@@</g><g transform="translate(8 20)">@@k:eyes@@</g>',
|
|
'pick_order' => array('mouth', 'eyes'),
|
|
'bool_order' => array(),
|
|
'color_order' => array(
|
|
),
|
|
'pc_has_ints' => false,
|
|
'pc_meta' => array(
|
|
array(
|
|
'group' => 'mouth',
|
|
'values_opt' => 'mouth',
|
|
'width' => 0,
|
|
'height' => 0,
|
|
'rotation' => array('opt' => null, 'fallback' => array('0')),
|
|
'offsetX' => array('opt' => null, 'fallback' => array('0')),
|
|
'offsetY' => array('opt' => null, 'fallback' => array('0')),
|
|
),
|
|
array(
|
|
'group' => 'eyes',
|
|
'values_opt' => 'eyes',
|
|
'width' => 0,
|
|
'height' => 0,
|
|
'rotation' => array('opt' => null, 'fallback' => array('0')),
|
|
'offsetX' => array('opt' => null, 'fallback' => array('0')),
|
|
'offsetY' => array('opt' => null, 'fallback' => array('0')),
|
|
),
|
|
),
|
|
'defaults' => array(
|
|
'backgroundColor' => array('ffb300', '1e88e5', '546e7a', '6d4c41', '00acc1', 'f4511e', '5e35b1', '43a047', '757575', '3949ab', '039be5', '7cb342', 'c0ca33', 'fb8c00', 'd81b60', '8e24aa', 'e53935', '00897b', 'fdd835'),
|
|
'eyes' => array('bulging', 'dizzy', 'eva', 'frame1', 'frame2', 'glow', 'happy', 'hearts', 'robocop', 'round', 'roundFrame01', 'roundFrame02', 'sensor', 'shade01'),
|
|
'mouth' => array('bite', 'diagram', 'grill01', 'grill02', 'grill03', 'smile01', 'smile02', 'square01', 'square02'),
|
|
),
|
|
'groups' => array(
|
|
'mouth' => array(
|
|
'bite' => '<rect x="4" y="5" width="68" height="22" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="9" width="60" height="14" rx="2" fill="#000" fill-opacity=".6"/><path fill-rule="evenodd" clip-rule="evenodd" d="m20 17 6-8H14l6 8ZM32 17l6-8H26l6 8ZM44 17l6-8H38l6 8ZM56 17l6-8H50l6 8Z" fill="#E1E6E8"/>',
|
|
'diagram' => '<rect x="4" y="4" width="68" height="24" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="8" width="60" height="16" rx="2" fill="#000" fill-opacity=".8"/><path d="M9 17h11l2-4 3 7 4-8 2 9 3-11 3 10 3-3h15l3-4 2 7 3-3h4" stroke="#4EFAC9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',
|
|
'grill01' => '<g fill="#000" fill-opacity=".6"><rect x="12" y="12" width="4" height="8" rx="2"/><rect x="36" y="12" width="4" height="8" rx="2"/><rect x="24" y="12" width="4" height="8" rx="2"/><rect x="48" y="12" width="4" height="8" rx="2"/><rect x="60" y="12" width="4" height="8" rx="2"/></g>',
|
|
'grill02' => '<g fill="#000" fill-opacity=".6"><rect x="28" y="10" width="6" height="14" rx="2"/><rect x="14" y="10" width="6" height="14" rx="2"/><rect x="42" y="10" width="6" height="14" rx="2"/><rect x="56" y="10" width="6" height="14" rx="2"/></g>',
|
|
'grill03' => '<rect x="4" y="5" width="68" height="22" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="9" width="60" height="14" rx="2" fill="#fff"/><path fill="#000" fill-opacity=".1" d="M18 9h4v14h-4zM42 9h4v14h-4zM30 9h4v14h-4zM54 9h4v14h-4z"/>',
|
|
'smile01' => '<path d="M27.05 8.44a2 2 0 1 1 3.9-.88C31.72 10.96 34.4 13 38 13c3.6 0 6.28-2.04 7.05-5.44a2 2 0 1 1 3.9.88C47.75 13.7 43.43 17 38 17s-9.76-3.3-10.95-8.56Z" fill="#000" fill-opacity=".6"/>',
|
|
'smile02' => '<path fill-rule="evenodd" clip-rule="evenodd" d="M18 10.22C18 21.78 24.47 28 38 28c13.52 0 20-6.34 20-17.78C58 9.5 57.17 8 55 8H21c-2.05 0-3 1.38-3 2.22Z" fill="#000" fill-opacity=".8"/><mask id="mouthSmile02-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="18" y="8" width="40" height="20"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 10.22C18 21.78 24.47 28 38 28c13.52 0 20-6.34 20-17.78C58 9.5 57.17 8 55 8H21c-2.05 0-3 1.38-3 2.22Z" fill="#fff"/></mask><g mask="url(#mouthSmile02-a)"><rect x="30" y="2" width="16" height="14" rx="2" fill="#fff"/></g>',
|
|
'square01' => '<rect x="24" y="6" width="27" height="8" rx="4" fill="#000" fill-opacity=".8"/>',
|
|
'square02' => '<rect x="16" y="8" width="44" height="4" rx="2" fill="#000" fill-opacity=".8"/>',
|
|
),
|
|
'eyes' => array(
|
|
'bulging' => '<circle cx="28" cy="24" r="18" fill="#000" fill-opacity=".2"/><circle cx="74" cy="24" r="18" fill="#000" fill-opacity=".2"/><circle cx="28" cy="24" r="15" fill="#F1EEDA"/><circle cx="74" cy="24" r="15" fill="#F1EEDA"/><rect x="26" y="15" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/><rect x="74" y="15" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/>',
|
|
'dizzy' => '<path d="m25 27.2 5.5 5.5c.5.4 1.2.4 1.6 0l1.6-1.6c.4-.5.4-1.2 0-1.6L28.2 24l5.5-5.5c.4-.5.4-1.2 0-1.6l-1.6-1.6c-.5-.4-1.2-.4-1.6 0L25 20.8l-5.5-5.5c-.5-.4-1.2-.4-1.6 0l-1.6 1.6c-.4.4-.4 1.1 0 1.6l5.5 5.5-5.5 5.5c-.4.5-.4 1.2 0 1.6l1.6 1.6c.5.4 1.2.4 1.6 0l5.5-5.5ZM79 27.2l5.5 5.5c.5.4 1.2.4 1.6 0l1.6-1.6c.4-.5.4-1.2 0-1.6L82.2 24l5.5-5.5c.4-.5.4-1.2 0-1.6l-1.6-1.6c-.5-.4-1.2-.4-1.6 0L79 20.8l-5.5-5.5c-.5-.4-1.2-.4-1.6 0l-1.6 1.6c-.4.4-.4 1.1 0 1.6l5.5 5.5-5.5 5.5c-.4.5-.4 1.2 0 1.6l1.6 1.6c.5.4 1.2.4 1.6 0l5.5-5.5Z" fill="#000" fill-opacity=".8"/>',
|
|
'eva' => '<g fill-rule="evenodd" clip-rule="evenodd"><path d="M53 0c34.75 0 49 17.47 49 31 0 13.53-19.59 17-49 17-29.05 0-51-3.47-51-17S17.11 0 53 0Z" fill="#000" fill-opacity=".8"/><path d="M28.82 34.65c-6.53-1.35-11.24-6.34-10.52-11.14.72-4.79 6.6-7.58 13.12-6.23 6.53 1.36 11.24 6.35 10.52 11.15-.72 4.8-6.6 7.59-13.12 6.23ZM75.42 34.65c-6.52 1.36-12.4-1.43-13.12-6.23-.72-4.8 4-9.8 10.52-11.15 6.52-1.35 12.4 1.44 13.12 6.24.72 4.81-4 9.8-10.52 11.15Z" fill="#25A6F5"/></g>',
|
|
'frame1' => '<rect y="4" width="104" height="42" rx="4" fill="#000" fill-opacity=".8"/><rect x="28" y="25" width="10" height="11" rx="2" fill="#8BDDFF"/><rect x="66" y="25" width="10" height="11" rx="2" fill="#8BDDFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M21 4h8L12 46H4L21 4Z" fill="#fff" fill-opacity=".4"/>',
|
|
'frame2' => '<rect x="8" y="10" width="88" height="36" rx="4" fill="#000" fill-opacity=".8"/><rect x="28" y="21" width="10" height="17" rx="2" fill="#5EF2B8"/><rect x="66" y="21" width="10" height="17" rx="2" fill="#5EF2B8"/><path fill-rule="evenodd" clip-rule="evenodd" d="M83 10h5L76 46h-5l12-36Z" fill="#fff" fill-opacity=".4"/>',
|
|
'glow' => '<g fill="#fff"><circle cx="21" cy="30" r="15" fill-opacity=".1"/><circle cx="83" cy="30" r="15" fill-opacity=".1"/><circle cx="21" cy="30" r="12" fill-opacity=".1"/><circle cx="83" cy="30" r="12" fill-opacity=".1"/><circle cx="21" cy="30" r="6" fill-opacity=".8"/><circle cx="83" cy="30" r="6" fill-opacity=".8"/><circle cx="21" cy="30" r="3" fill-opacity=".8"/><circle cx="83" cy="30" r="3" fill-opacity=".8"/></g>',
|
|
'happy' => '<path d="m18 19 12-2M20 31c0-3.31 2.9-6 7-6 3.1 0 6 2.69 6 6M86 20l-12-3M84 31c0-3.31-2.9-6-6-6-4.1 0-7 2.69-7 6" stroke="#000" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>',
|
|
'hearts' => '<path d="M29.27 9.68c-2.55.13-4.96 2.24-6.25 4.15-1.48-1.76-4.1-3.6-6.65-3.47-5.48.28-8.85 3.8-8.63 8.1.3 5.72 4.88 8.89 9.7 12.24 1.71 1.15 5 4.15 5.42 4.82.42.67 2.14.6 2.58-.13a37.8 37.8 0 0 1 4.9-5.36c4.43-3.84 8.66-7.47 8.36-13.2-.23-4.3-3.95-7.44-9.43-7.15ZM87.63 10.36c-2.55-.14-5.17 1.7-6.65 3.47-1.3-1.9-3.7-4.02-6.25-4.15-5.48-.29-9.2 2.86-9.43 7.16-.3 5.72 3.93 9.35 8.36 13.19 1.6 1.32 4.55 4.64 4.9 5.36.35.7 2.06.82 2.58.13.51-.7 3.7-3.67 5.42-4.82 4.81-3.35 9.4-6.52 9.7-12.24.22-4.3-3.15-7.82-8.63-8.1Z" fill="#FF5353" fill-opacity=".8"/>',
|
|
'robocop' => '<rect x="7" y="16" width="91" height="16" rx="4" fill="#000" fill-opacity=".8"/><mask id="eyesRobocop-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="7" y="16" width="91" height="16"><rect x="7" y="16" width="91" height="16" rx="4" fill="#fff"/></mask><g mask="url(#eyesRobocop-a)" fill-rule="evenodd" clip-rule="evenodd" fill="#fff" fill-opacity=".8"><path d="M76 7h18L82 37H64L76 7ZM52 7h9L49 37h-9L52 7Z"/></g>',
|
|
'round' => '<g fill="#fff"><circle cx="24" cy="30" r="6"/><circle cx="80" cy="30" r="6"/></g>',
|
|
'roundFrame01' => '<rect y="12" width="104" height="32" rx="16" fill="#000" fill-opacity=".8"/><rect x="24" y="22" width="10" height="12" rx="2" fill="#F4F4F4"/><rect x="70" y="22" width="10" height="12" rx="2" fill="#F4F4F4"/>',
|
|
'roundFrame02' => '<rect y="11" width="104" height="34" rx="17" fill="#000" fill-opacity=".8"/><circle cx="29" cy="28" r="13" fill="#F1EEDA"/><circle cx="75" cy="28" r="13" fill="#F1EEDA"/><rect x="24" y="23" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/><rect x="70" y="23" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/>',
|
|
'sensor' => '<path d="M28 44a20 20 0 0 0 19.9-18h41.52a5 5 0 1 0 0-4H47.9A20 20 0 1 0 28 44Z" fill="#000" fill-opacity=".2"/><circle cx="94" cy="24" r="2" fill="#fff"/><circle cx="28" cy="24" r="16" fill="#000" fill-opacity=".6"/><circle cx="34" cy="16" r="3" fill="#fff"/>',
|
|
'shade01' => '<path d="M96 2H8c-4.5 0-8 3.5-8 8.03V28c0 4.5 3.5 8 8 8h13c8 0 11 8 18 8h27c7 0 9-8 17-8h13c4.5 0 8-3.5 8-8V10c0-4.5-3.5-8-8-8Z" fill="#000" fill-opacity=".8"/><path d="M87 14H17c-3.5 0-5 3-5 5v2c0 2 1.5 5 5 5h12c6 0 11.62 8 17 8h14c5.38 0 9-8 15-8h12c3.5 0 5-3 5-5v-2c0-2-1.5-5-5-5Z" fill="#FF3D3D"/><path d="M22.44 36.09 37.26 2h11L31.4 40.78l-.76-.58c-2.38-1.82-4.83-3.69-8.2-4.11ZM11.48 36 26.26 2h4L15.48 36h-4Z" fill="#fff" fill-opacity=".2"/>',
|
|
),
|
|
),
|
|
); |