Skip to content

Commit

Permalink
feat:icon
Browse files Browse the repository at this point in the history
  • Loading branch information
shanhexi committed Jan 9, 2024
1 parent 2c51e63 commit 94483bd
Show file tree
Hide file tree
Showing 10 changed files with 217 additions and 11 deletions.
144 changes: 141 additions & 3 deletions chat2db-client/src/assets/font/demo_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,42 @@ <h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" targ
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">

<li class="dib">
<span class="icon iconfont">&#xe671;</span>
<div class="name">minimize21</div>
<div class="code-name">&amp;#xe671;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#xe66b;</span>
<div class="name">restore</div>
<div class="code-name">&amp;#xe66b;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#xe66e;</span>
<div class="name">resize</div>
<div class="code-name">&amp;#xe66e;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#xe66f;</span>
<div class="name">close</div>
<div class="code-name">&amp;#xe66f;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#xe66a;</span>
<div class="name">筛选</div>
<div class="code-name">&amp;#xe66a;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#xe69a;</span>
<div class="name">排序</div>
<div class="code-name">&amp;#xe69a;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#xe8e8;</span>
<div class="name">305信息-线性圆框</div>
Expand Down Expand Up @@ -1236,9 +1272,9 @@ <h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</co
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.woff2?t=1703676613329') format('woff2'),
url('iconfont.woff?t=1703676613329') format('woff'),
url('iconfont.ttf?t=1703676613329') format('truetype');
src: url('iconfont.woff2?t=1704776684062') format('woff2'),
url('iconfont.woff?t=1704776684062') format('woff'),
url('iconfont.ttf?t=1704776684062') format('truetype');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
Expand All @@ -1264,6 +1300,60 @@ <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面
<div class="content font-class">
<ul class="icon_lists dib-box">

<li class="dib">
<span class="icon iconfont icon-minimize21"></span>
<div class="name">
minimize21
</div>
<div class="code-name">.icon-minimize21
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-restore_button2"></span>
<div class="name">
restore
</div>
<div class="code-name">.icon-restore_button2
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-resize_button2"></span>
<div class="name">
resize
</div>
<div class="code-name">.icon-resize_button2
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-close_button2"></span>
<div class="name">
close
</div>
<div class="code-name">.icon-close_button2
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-shaixuan"></span>
<div class="name">
筛选
</div>
<div class="code-name">.icon-shaixuan
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-a-44tubiao-122"></span>
<div class="name">
排序
</div>
<div class="code-name">.icon-a-44tubiao-122
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-xinxi-xianxingyuankuang"></span>
<div class="name">
Expand Down Expand Up @@ -3037,6 +3127,54 @@ <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h
<div class="content symbol">
<ul class="icon_lists dib-box">

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-minimize21"></use>
</svg>
<div class="name">minimize21</div>
<div class="code-name">#icon-minimize21</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-restore_button2"></use>
</svg>
<div class="name">restore</div>
<div class="code-name">#icon-restore_button2</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-resize_button2"></use>
</svg>
<div class="name">resize</div>
<div class="code-name">#icon-resize_button2</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-close_button2"></use>
</svg>
<div class="name">close</div>
<div class="code-name">#icon-close_button2</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-shaixuan"></use>
</svg>
<div class="name">筛选</div>
<div class="code-name">#icon-shaixuan</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-44tubiao-122"></use>
</svg>
<div class="name">排序</div>
<div class="code-name">#icon-a-44tubiao-122</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-xinxi-xianxingyuankuang"></use>
Expand Down
30 changes: 27 additions & 3 deletions chat2db-client/src/assets/font/iconfont.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 3633546 */
src: url('iconfont.woff2?t=1703676613329') format('woff2'),
url('iconfont.woff?t=1703676613329') format('woff'),
url('iconfont.ttf?t=1703676613329') format('truetype');
src: url('iconfont.woff2?t=1704776684062') format('woff2'),
url('iconfont.woff?t=1704776684062') format('woff'),
url('iconfont.ttf?t=1704776684062') format('truetype');
}

.iconfont {
Expand All @@ -13,6 +13,30 @@
-moz-osx-font-smoothing: grayscale;
}

.icon-minimize21:before {
content: "\e671";
}

.icon-restore_button2:before {
content: "\e66b";
}

.icon-resize_button2:before {
content: "\e66e";
}

.icon-close_button2:before {
content: "\e66f";
}

.icon-shaixuan:before {
content: "\e66a";
}

.icon-a-44tubiao-122:before {
content: "\e69a";
}

.icon-xinxi-xianxingyuankuang:before {
content: "\e8e8";
}
Expand Down
2 changes: 1 addition & 1 deletion chat2db-client/src/assets/font/iconfont.js

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions chat2db-client/src/assets/font/iconfont.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,48 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "38873585",
"name": "minimize21",
"font_class": "minimize21",
"unicode": "e671",
"unicode_decimal": 58993
},
{
"icon_id": "38872025",
"name": "restore",
"font_class": "restore_button2",
"unicode": "e66b",
"unicode_decimal": 58987
},
{
"icon_id": "38872027",
"name": "resize",
"font_class": "resize_button2",
"unicode": "e66e",
"unicode_decimal": 58990
},
{
"icon_id": "38872028",
"name": "close",
"font_class": "close_button2",
"unicode": "e66f",
"unicode_decimal": 58991
},
{
"icon_id": "8721198",
"name": "筛选",
"font_class": "shaixuan",
"unicode": "e66a",
"unicode_decimal": 58986
},
{
"icon_id": "38644725",
"name": "排序",
"font_class": "a-44tubiao-122",
"unicode": "e69a",
"unicode_decimal": 59034
},
{
"icon_id": "1727525",
"name": "305信息-线性圆框",
Expand Down
Binary file modified chat2db-client/src/assets/font/iconfont.ttf
Binary file not shown.
Binary file modified chat2db-client/src/assets/font/iconfont.woff
Binary file not shown.
Binary file modified chat2db-client/src/assets/font/iconfont.woff2
Binary file not shown.
3 changes: 2 additions & 1 deletion chat2db-client/src/blocks/AppTitleBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default memo<IProps>((props) => {

const handleDoubleClick = () => {
window.electronApi?.setMaximize();
setIsMaximize(!isMaximized);
};

const handelMinimizeWindow = (e) => {
Expand Down Expand Up @@ -54,7 +55,7 @@ export default memo<IProps>((props) => {
{isWin && (
<div className={styles.windowsCloseBar}>
<div className={styles.windowsCloseBarItem} onClick={handelMinimizeWindow}>
<Iconfont code="&#xe644;" />
<Iconfont code="&#xe671;" />
</div>
<div className={styles.windowsCloseBarItem} onClick={handelMaximize}>
{isMaximized ? <Iconfont code="&#xe66e;" /> : <Iconfont code="&#xe66b;" />}
Expand Down
6 changes: 3 additions & 3 deletions chat2db-client/src/components/Iconfont/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ if (__ENV__ === 'local') {
/* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
@font-face {
font-family: 'iconfont'; /* Project id 3633546 */
src: url('//at.alicdn.com/t/c/font_3633546_vmsq4yq8hw9.woff2?t=1704769259060') format('woff2'),
url('//at.alicdn.com/t/c/font_3633546_vmsq4yq8hw9.woff?t=1704769259060') format('woff'),
url('//at.alicdn.com/t/c/font_3633546_vmsq4yq8hw9.ttf?t=1704769259060') format('truetype');
src: url('//at.alicdn.com/t/c/font_3633546_ahqjb5vaa0m.woff2?t=1704776615855') format('woff2'),
url('//at.alicdn.com/t/c/font_3633546_ahqjb5vaa0m.woff?t=1704776615855') format('woff'),
url('//at.alicdn.com/t/c/font_3633546_ahqjb5vaa0m.ttf?t=1704776615855') format('truetype');
}
`;
const style = document.createElement('style');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const WorkspaceTabs = memo(() => {
dataSourceId: currentConnectionDetails.id,
dataSourceName: currentConnectionDetails.alias,
databaseType: currentConnectionDetails.type,
// databaseName: currentConnectionDetails.databaseName,
});
}
};
Expand Down

0 comments on commit 94483bd

Please sign in to comment.