|
| 1 | +<!doctype html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8" /> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 6 | + <title>云规范图标集预览</title> |
| 7 | + <style> |
| 8 | + .hide { |
| 9 | + display: none; |
| 10 | + } |
| 11 | + body { |
| 12 | + padding: 0 24px 48px; |
| 13 | + } |
| 14 | + #list .icon-item { |
| 15 | + display: inline-block; |
| 16 | + text-align: center; |
| 17 | + font-size: 12px; |
| 18 | + color: #575d6c; |
| 19 | + } |
| 20 | + #list i { |
| 21 | + margin: 20px; |
| 22 | + transition: all 0.5s; |
| 23 | + } |
| 24 | + #list i:hover { |
| 25 | + transform: scale(1.5); |
| 26 | + cursor: copy; |
| 27 | + } |
| 28 | + .icon-counts { |
| 29 | + color: #0057c3; |
| 30 | + text-decoration: underline; |
| 31 | + margin-left: 8px; |
| 32 | + cursor: pointer; |
| 33 | + } |
| 34 | + .icons-group { |
| 35 | + margin-bottom: 0; |
| 36 | + margin-top: 32px; |
| 37 | + } |
| 38 | + .icon-title, |
| 39 | + .icon-name { |
| 40 | + cursor: pointer; |
| 41 | + overflow: hidden; |
| 42 | + text-overflow: ellipsis; |
| 43 | + white-space: nowrap; |
| 44 | + } |
| 45 | + #list .base { |
| 46 | + font-size: 32px; |
| 47 | + } |
| 48 | + #list .base ~ div { |
| 49 | + width: 80px; |
| 50 | + } |
| 51 | + #list .svc { |
| 52 | + font-size: 72px; |
| 53 | + } |
| 54 | + #list .svc ~ div { |
| 55 | + width: 108px; |
| 56 | + } |
| 57 | + #list .ext, |
| 58 | + #list .stat { |
| 59 | + font-size: 80px; |
| 60 | + } |
| 61 | + #list .ext ~ div, |
| 62 | + #list .stat ~ div { |
| 63 | + width: 120px; |
| 64 | + } |
| 65 | + .settings { |
| 66 | + display: flex; |
| 67 | + justify-content: space-between; |
| 68 | + } |
| 69 | + .settings label { |
| 70 | + margin: 0 16px 12px; |
| 71 | + } |
| 72 | + .settings label { |
| 73 | + font-weight: bold; |
| 74 | + } |
| 75 | + |
| 76 | + .dlg-root { |
| 77 | + margin: 24px; |
| 78 | + } |
| 79 | + code { |
| 80 | + padding: 4px; |
| 81 | + background-color: #e5e5e5; |
| 82 | + cursor: pointer; |
| 83 | + user-select: all; |
| 84 | + } |
| 85 | + </style> |
| 86 | + <link rel="stylesheet" href="./style/all.css" /> |
| 87 | + </head> |
| 88 | + <body> |
| 89 | + <div id="app"> |
| 90 | + <h1 style="text-align: center">云规范图标集预览</h1> |
| 91 | + <div class="settings"> |
| 92 | + <div> |
| 93 | + <label> 选择图标集:</label> |
| 94 | + <select id="sel-category" is="ui-select"> |
| 95 | + <option value="base">系统图标</option> |
| 96 | + <option value="svc">服务图标</option> |
| 97 | + <option value="ext">扩展图标</option> |
| 98 | + <option value="stat">状态图标</option> |
| 99 | + </select> |
| 100 | + <span class="hide"> |
| 101 | + <label> 引用方式:</label> |
| 102 | + <select id="sel-type" is="ui-select"> |
| 103 | + <option value="ci">class</option> |
| 104 | + <option value="ci">json-data</option> |
| 105 | + </select> |
| 106 | + </span> |
| 107 | + <label> 图标颜色:</label> |
| 108 | + <input id="sel-color" type="color" is="ui-color" value="#000000" /> |
| 109 | + <label> 复制方式:</label> |
| 110 | + <select id="sel-copy" is="ui-select"> |
| 111 | + <option value="all">完整标签</option> |
| 112 | + <option value="only-name">图标类名</option> |
| 113 | + </select> |
| 114 | + <ui-lighttip id="lightTip" type="success">复制成功</ui-lighttip> |
| 115 | + </div> |
| 116 | + <div> |
| 117 | + <button id="btnHelp" type="primary" class="ui-button">使用说明</button> |
| 118 | + </div> |
| 119 | + </div> |
| 120 | + <div id="list"></div> |
| 121 | + |
| 122 | + <dialog id="dlgHelp" is="ui-dialog"> |
| 123 | + <div class="dlg-root"> |
| 124 | + <h3>1、安装</h3> |
| 125 | + <div>在项目中安装: <code>npm i @opentiny/cloud-icons</code></div> |
| 126 | + <h3>2、通过css 引用</h3> |
| 127 | + <div>在工程中引入图标的css文件: <code>import "@opentiny/cloud-icons/style/all.css"</code></div> |
| 128 | + <h3>3、通过 @unocss/preset-icons 插件按需引用</h3> |
| 129 | + <div> |
| 130 | + 例如vite工程中,配置UnoCss的图标插件: |
| 131 | + <pre id="helpCode"></pre> |
| 132 | + </div> |
| 133 | + |
| 134 | + <h3>4、使用图标</h3> |
| 135 | + <ul> |
| 136 | + <li> |
| 137 | + 通过图标名引用所需图标: <code><i class="ci-search"></i></code> 会得到 |
| 138 | + <i class="ci-search"></i> |
| 139 | + </li> |
| 140 | + <li>通过修改图标的 <code>color \ font-size</code> 控制图标的大小和颜色。</li> |
| 141 | + </ul> |
| 142 | + </div> |
| 143 | + </dialog> |
| 144 | + </div> |
| 145 | + |
| 146 | + <script type="module" src="./main.ts"></script> |
| 147 | + </body> |
| 148 | +</html> |
0 commit comments