终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

553 lines
20 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <title>iconfont Demo</title>
  6. <link rel="shortcut icon" href="//img.alicdn.com/imgextra/i2/O1CN01ZyAlrn1MwaMhqz36G_!!6000000001499-73-tps-64-64.ico" type="image/x-icon"/>
  7. <link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01EYTRnJ297D6vehehJ_!!6000000008020-55-tps-64-64.svg"/>
  8. <link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
  9. <link rel="stylesheet" href="demo.css">
  10. <link rel="stylesheet" href="iconfont.css">
  11. <script src="iconfont.js"></script>
  12. <!-- jQuery -->
  13. <script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
  14. <!-- 代码高亮 -->
  15. <script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script>
  16. <style>
  17. .main .logo {
  18. margin-top: 0;
  19. height: auto;
  20. }
  21. .main .logo a {
  22. display: flex;
  23. align-items: center;
  24. }
  25. .main .logo .sub-title {
  26. margin-left: 0.5em;
  27. font-size: 22px;
  28. color: #fff;
  29. background: linear-gradient(-45deg, #3967FF, #B500FE);
  30. -webkit-background-clip: text;
  31. -webkit-text-fill-color: transparent;
  32. }
  33. </style>
  34. </head>
  35. <body>
  36. <div class="main">
  37. <h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">
  38. <img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01Mn65HV1FfSEzR6DKv_!!6000000000514-55-tps-228-59.svg">
  39. </a></h1>
  40. <div class="nav-tabs">
  41. <ul id="tabs" class="dib-box">
  42. <li class="dib active"><span>Unicode</span></li>
  43. <li class="dib"><span>Font class</span></li>
  44. <li class="dib"><span>Symbol</span></li>
  45. </ul>
  46. </div>
  47. <div class="tab-container">
  48. <div class="content unicode" style="display: block;">
  49. <ul class="icon_lists dib-box">
  50. <li class="dib">
  51. <span class="icon iconfont">&#xe6e2;</span>
  52. <div class="name">节点-子流程</div>
  53. <div class="code-name">&amp;#xe6e2;</div>
  54. </li>
  55. <li class="dib">
  56. <span class="icon iconfont">&#xe64c;</span>
  57. <div class="name">流程</div>
  58. <div class="code-name">&amp;#xe64c;</div>
  59. </li>
  60. <li class="dib">
  61. <span class="icon iconfont">&#xe622;</span>
  62. <div class="name">下载</div>
  63. <div class="code-name">&amp;#xe622;</div>
  64. </li>
  65. <li class="dib">
  66. <span class="icon iconfont">&#xe8cc;</span>
  67. <div class="name">232编辑、输入</div>
  68. <div class="code-name">&amp;#xe8cc;</div>
  69. </li>
  70. <li class="dib">
  71. <span class="icon iconfont">&#xe668;</span>
  72. <div class="name">账号信息</div>
  73. <div class="code-name">&amp;#xe668;</div>
  74. </li>
  75. <li class="dib">
  76. <span class="icon iconfont">&#xe695;</span>
  77. <div class="name">窗口-最大化_line</div>
  78. <div class="code-name">&amp;#xe695;</div>
  79. </li>
  80. <li class="dib">
  81. <span class="icon iconfont">&#xe62b;</span>
  82. <div class="name">密码</div>
  83. <div class="code-name">&amp;#xe62b;</div>
  84. </li>
  85. <li class="dib">
  86. <span class="icon iconfont">&#xe62c;</span>
  87. <div class="name">权限配置</div>
  88. <div class="code-name">&amp;#xe62c;</div>
  89. </li>
  90. <li class="dib">
  91. <span class="icon iconfont">&#xe63f;</span>
  92. <div class="name">下载</div>
  93. <div class="code-name">&amp;#xe63f;</div>
  94. </li>
  95. <li class="dib">
  96. <span class="icon iconfont">&#xe669;</span>
  97. <div class="name">close</div>
  98. <div class="code-name">&amp;#xe669;</div>
  99. </li>
  100. <li class="dib">
  101. <span class="icon iconfont">&#xe67a;</span>
  102. <div class="name">minus</div>
  103. <div class="code-name">&amp;#xe67a;</div>
  104. </li>
  105. <li class="dib">
  106. <span class="icon iconfont">&#xe6a0;</span>
  107. <div class="name">账号中心 账号管理</div>
  108. <div class="code-name">&amp;#xe6a0;</div>
  109. </li>
  110. <li class="dib">
  111. <span class="icon iconfont">&#xe979;</span>
  112. <div class="name">齿轮,设置,设定</div>
  113. <div class="code-name">&amp;#xe979;</div>
  114. </li>
  115. <li class="dib">
  116. <span class="icon iconfont">&#xe6b7;</span>
  117. <div class="name">面性密码锁</div>
  118. <div class="code-name">&amp;#xe6b7;</div>
  119. </li>
  120. <li class="dib">
  121. <span class="icon iconfont">&#xe7ab;</span>
  122. <div class="name">工艺流程_0</div>
  123. <div class="code-name">&amp;#xe7ab;</div>
  124. </li>
  125. <li class="dib">
  126. <span class="icon iconfont">&#xe8e0;</span>
  127. <div class="name">166-NFC</div>
  128. <div class="code-name">&amp;#xe8e0;</div>
  129. </li>
  130. </ul>
  131. <div class="article markdown">
  132. <h2 id="unicode-">Unicode 引用</h2>
  133. <hr>
  134. <p>Unicode 是字体在网页端最原始的应用方式,特点是:</p>
  135. <ul>
  136. <li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
  137. <li>默认情况下不支持多色,直接添加多色图标会自动去色。</li>
  138. </ul>
  139. <blockquote>
  140. <p>注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)</p>
  141. </blockquote>
  142. <p>Unicode 使用步骤如下:</p>
  143. <h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3>
  144. <pre><code class="language-css"
  145. >@font-face {
  146. font-family: 'iconfont';
  147. src: url('iconfont.ttf?t=1659942239310') format('truetype');
  148. }
  149. </code></pre>
  150. <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
  151. <pre><code class="language-css"
  152. >.iconfont {
  153. font-family: "iconfont" !important;
  154. font-size: 16px;
  155. font-style: normal;
  156. -webkit-font-smoothing: antialiased;
  157. -moz-osx-font-smoothing: grayscale;
  158. }
  159. </code></pre>
  160. <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
  161. <pre>
  162. <code class="language-html"
  163. >&lt;span class="iconfont"&gt;&amp;#x33;&lt;/span&gt;
  164. </code></pre>
  165. <blockquote>
  166. <p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
  167. </blockquote>
  168. </div>
  169. </div>
  170. <div class="content font-class">
  171. <ul class="icon_lists dib-box">
  172. <li class="dib">
  173. <span class="icon iconfont icon-jiedianziliucheng"></span>
  174. <div class="name">
  175. 节点-子流程
  176. </div>
  177. <div class="code-name">.icon-jiedianziliucheng
  178. </div>
  179. </li>
  180. <li class="dib">
  181. <span class="icon iconfont icon-liucheng"></span>
  182. <div class="name">
  183. 流程
  184. </div>
  185. <div class="code-name">.icon-liucheng
  186. </div>
  187. </li>
  188. <li class="dib">
  189. <span class="icon iconfont icon-xiazai"></span>
  190. <div class="name">
  191. 下载
  192. </div>
  193. <div class="code-name">.icon-xiazai
  194. </div>
  195. </li>
  196. <li class="dib">
  197. <span class="icon iconfont icon-bianjishuru"></span>
  198. <div class="name">
  199. 232编辑、输入
  200. </div>
  201. <div class="code-name">.icon-bianjishuru
  202. </div>
  203. </li>
  204. <li class="dib">
  205. <span class="icon iconfont icon-zhanghaoxinxi"></span>
  206. <div class="name">
  207. 账号信息
  208. </div>
  209. <div class="code-name">.icon-zhanghaoxinxi
  210. </div>
  211. </li>
  212. <li class="dib">
  213. <span class="icon iconfont icon-window-max_line"></span>
  214. <div class="name">
  215. 窗口-最大化_line
  216. </div>
  217. <div class="code-name">.icon-window-max_line
  218. </div>
  219. </li>
  220. <li class="dib">
  221. <span class="icon iconfont icon-mima"></span>
  222. <div class="name">
  223. 密码
  224. </div>
  225. <div class="code-name">.icon-mima
  226. </div>
  227. </li>
  228. <li class="dib">
  229. <span class="icon iconfont icon-quanxianpeizhi"></span>
  230. <div class="name">
  231. 权限配置
  232. </div>
  233. <div class="code-name">.icon-quanxianpeizhi
  234. </div>
  235. </li>
  236. <li class="dib">
  237. <span class="icon iconfont icon-xiazai1"></span>
  238. <div class="name">
  239. 下载
  240. </div>
  241. <div class="code-name">.icon-xiazai1
  242. </div>
  243. </li>
  244. <li class="dib">
  245. <span class="icon iconfont icon-close"></span>
  246. <div class="name">
  247. close
  248. </div>
  249. <div class="code-name">.icon-close
  250. </div>
  251. </li>
  252. <li class="dib">
  253. <span class="icon iconfont icon-minus"></span>
  254. <div class="name">
  255. minus
  256. </div>
  257. <div class="code-name">.icon-minus
  258. </div>
  259. </li>
  260. <li class="dib">
  261. <span class="icon iconfont icon-zhanghaozhongxinzhanghaoguanli"></span>
  262. <div class="name">
  263. 账号中心 账号管理
  264. </div>
  265. <div class="code-name">.icon-zhanghaozhongxinzhanghaoguanli
  266. </div>
  267. </li>
  268. <li class="dib">
  269. <span class="icon iconfont icon-set"></span>
  270. <div class="name">
  271. 齿轮,设置,设定
  272. </div>
  273. <div class="code-name">.icon-set
  274. </div>
  275. </li>
  276. <li class="dib">
  277. <span class="icon iconfont icon-mianxingmima"></span>
  278. <div class="name">
  279. 面性密码锁
  280. </div>
  281. <div class="code-name">.icon-mianxingmima
  282. </div>
  283. </li>
  284. <li class="dib">
  285. <span class="icon iconfont icon-gongyiliucheng_0"></span>
  286. <div class="name">
  287. 工艺流程_0
  288. </div>
  289. <div class="code-name">.icon-gongyiliucheng_0
  290. </div>
  291. </li>
  292. <li class="dib">
  293. <span class="icon iconfont icon-a-166-NFC"></span>
  294. <div class="name">
  295. 166-NFC
  296. </div>
  297. <div class="code-name">.icon-a-166-NFC
  298. </div>
  299. </li>
  300. </ul>
  301. <div class="article markdown">
  302. <h2 id="font-class-">font-class 引用</h2>
  303. <hr>
  304. <p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p>
  305. <p>与 Unicode 使用方式相比,具有如下特点:</p>
  306. <ul>
  307. <li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li>
  308. <li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li>
  309. </ul>
  310. <p>使用步骤如下:</p>
  311. <h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3>
  312. <pre><code class="language-html">&lt;link rel="stylesheet" href="./iconfont.css"&gt;
  313. </code></pre>
  314. <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
  315. <pre><code class="language-html">&lt;span class="iconfont icon-xxx"&gt;&lt;/span&gt;
  316. </code></pre>
  317. <blockquote>
  318. <p>"
  319. iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
  320. </blockquote>
  321. </div>
  322. </div>
  323. <div class="content symbol">
  324. <ul class="icon_lists dib-box">
  325. <li class="dib">
  326. <svg class="icon svg-icon" aria-hidden="true">
  327. <use xlink:href="#icon-jiedianziliucheng"></use>
  328. </svg>
  329. <div class="name">节点-子流程</div>
  330. <div class="code-name">#icon-jiedianziliucheng</div>
  331. </li>
  332. <li class="dib">
  333. <svg class="icon svg-icon" aria-hidden="true">
  334. <use xlink:href="#icon-liucheng"></use>
  335. </svg>
  336. <div class="name">流程</div>
  337. <div class="code-name">#icon-liucheng</div>
  338. </li>
  339. <li class="dib">
  340. <svg class="icon svg-icon" aria-hidden="true">
  341. <use xlink:href="#icon-xiazai"></use>
  342. </svg>
  343. <div class="name">下载</div>
  344. <div class="code-name">#icon-xiazai</div>
  345. </li>
  346. <li class="dib">
  347. <svg class="icon svg-icon" aria-hidden="true">
  348. <use xlink:href="#icon-bianjishuru"></use>
  349. </svg>
  350. <div class="name">232编辑、输入</div>
  351. <div class="code-name">#icon-bianjishuru</div>
  352. </li>
  353. <li class="dib">
  354. <svg class="icon svg-icon" aria-hidden="true">
  355. <use xlink:href="#icon-zhanghaoxinxi"></use>
  356. </svg>
  357. <div class="name">账号信息</div>
  358. <div class="code-name">#icon-zhanghaoxinxi</div>
  359. </li>
  360. <li class="dib">
  361. <svg class="icon svg-icon" aria-hidden="true">
  362. <use xlink:href="#icon-window-max_line"></use>
  363. </svg>
  364. <div class="name">窗口-最大化_line</div>
  365. <div class="code-name">#icon-window-max_line</div>
  366. </li>
  367. <li class="dib">
  368. <svg class="icon svg-icon" aria-hidden="true">
  369. <use xlink:href="#icon-mima"></use>
  370. </svg>
  371. <div class="name">密码</div>
  372. <div class="code-name">#icon-mima</div>
  373. </li>
  374. <li class="dib">
  375. <svg class="icon svg-icon" aria-hidden="true">
  376. <use xlink:href="#icon-quanxianpeizhi"></use>
  377. </svg>
  378. <div class="name">权限配置</div>
  379. <div class="code-name">#icon-quanxianpeizhi</div>
  380. </li>
  381. <li class="dib">
  382. <svg class="icon svg-icon" aria-hidden="true">
  383. <use xlink:href="#icon-xiazai1"></use>
  384. </svg>
  385. <div class="name">下载</div>
  386. <div class="code-name">#icon-xiazai1</div>
  387. </li>
  388. <li class="dib">
  389. <svg class="icon svg-icon" aria-hidden="true">
  390. <use xlink:href="#icon-close"></use>
  391. </svg>
  392. <div class="name">close</div>
  393. <div class="code-name">#icon-close</div>
  394. </li>
  395. <li class="dib">
  396. <svg class="icon svg-icon" aria-hidden="true">
  397. <use xlink:href="#icon-minus"></use>
  398. </svg>
  399. <div class="name">minus</div>
  400. <div class="code-name">#icon-minus</div>
  401. </li>
  402. <li class="dib">
  403. <svg class="icon svg-icon" aria-hidden="true">
  404. <use xlink:href="#icon-zhanghaozhongxinzhanghaoguanli"></use>
  405. </svg>
  406. <div class="name">账号中心 账号管理</div>
  407. <div class="code-name">#icon-zhanghaozhongxinzhanghaoguanli</div>
  408. </li>
  409. <li class="dib">
  410. <svg class="icon svg-icon" aria-hidden="true">
  411. <use xlink:href="#icon-set"></use>
  412. </svg>
  413. <div class="name">齿轮,设置,设定</div>
  414. <div class="code-name">#icon-set</div>
  415. </li>
  416. <li class="dib">
  417. <svg class="icon svg-icon" aria-hidden="true">
  418. <use xlink:href="#icon-mianxingmima"></use>
  419. </svg>
  420. <div class="name">面性密码锁</div>
  421. <div class="code-name">#icon-mianxingmima</div>
  422. </li>
  423. <li class="dib">
  424. <svg class="icon svg-icon" aria-hidden="true">
  425. <use xlink:href="#icon-gongyiliucheng_0"></use>
  426. </svg>
  427. <div class="name">工艺流程_0</div>
  428. <div class="code-name">#icon-gongyiliucheng_0</div>
  429. </li>
  430. <li class="dib">
  431. <svg class="icon svg-icon" aria-hidden="true">
  432. <use xlink:href="#icon-a-166-NFC"></use>
  433. </svg>
  434. <div class="name">166-NFC</div>
  435. <div class="code-name">#icon-a-166-NFC</div>
  436. </li>
  437. </ul>
  438. <div class="article markdown">
  439. <h2 id="symbol-">Symbol 引用</h2>
  440. <hr>
  441. <p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
  442. 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p>
  443. <ul>
  444. <li>支持多色图标了,不再受单色限制。</li>
  445. <li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li>
  446. <li>兼容性较差,支持 IE9+,及现代浏览器。</li>
  447. <li>浏览器渲染 SVG 的性能一般,还不如 png。</li>
  448. </ul>
  449. <p>使用步骤如下:</p>
  450. <h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3>
  451. <pre><code class="language-html">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;
  452. </code></pre>
  453. <h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3>
  454. <pre><code class="language-html">&lt;style&gt;
  455. .icon {
  456. width: 1em;
  457. height: 1em;
  458. vertical-align: -0.15em;
  459. fill: currentColor;
  460. overflow: hidden;
  461. }
  462. &lt;/style&gt;
  463. </code></pre>
  464. <h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
  465. <pre><code class="language-html">&lt;svg class="icon" aria-hidden="true"&gt;
  466. &lt;use xlink:href="#icon-xxx"&gt;&lt;/use&gt;
  467. &lt;/svg&gt;
  468. </code></pre>
  469. </div>
  470. </div>
  471. </div>
  472. </div>
  473. <script>
  474. $(document).ready(function () {
  475. $('.tab-container .content:first').show()
  476. $('#tabs li').click(function (e) {
  477. var tabContent = $('.tab-container .content')
  478. var index = $(this).index()
  479. if ($(this).hasClass('active')) {
  480. return
  481. } else {
  482. $('#tabs li').removeClass('active')
  483. $(this).addClass('active')
  484. tabContent.hide().eq(index).fadeIn()
  485. }
  486. })
  487. })
  488. </script>
  489. </body>
  490. </html>