保存页面

dev
陈博文 4 years ago
parent 00f67bc7c6
commit 9237cdc572

@ -105,6 +105,11 @@ export default defineConfig({
{ component: '@/pages/HttpStatus/404' },
],
},
{
path: '/simulation',
component: '@/pages/Simulation',
exact: true,
},
{ component: '@/pages/HttpStatus/404' },
],
},

@ -0,0 +1,38 @@
.page {
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.iframe {
width: 100%;
flex: 1;
}
.wrap {
height: 300px;
position: relative;
width: 100%;
.bar {
height: 2px;
width: 100%;
background: #000;
cursor: ns-resize;
position: absolute;
top: -1px;
left: 0;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
i {
color: #000000;
font-size: 12px;
margin-top: 4px;
}
}
}
}

@ -0,0 +1,87 @@
import styles from './index.less';
import { message, Input, Button, Row, Modal, Form, Tabs } from 'antd';
import Fetch from '@/utils/fetch';
import { useEffect, useState, FC, Fragment, useRef } from 'react';
import { cloneDeep } from 'lodash';
const Page = () => {
const [data, setData] = useState<any>([]);
const resizeBar = useRef<any>(null);
const resizeBox = useRef<any>(null);
useEffect(() => {
window.addEventListener('message', getData, false);
return () => {
window.removeEventListener('message', getData, false);
};
}, []);
const getData = (e: any) => {
if (e.origin === 'https://edu-xnfz.educoder.net') {
const newData = e.data ? JSON.parse(e.data) : [];
setData(newData);
console.log('111', newData, '222');
}
};
useEffect(() => {
if (resizeBar.current) {
let h = 0;
let dragging = false;
let startY = 0;
function onMouseDown(e: any) {
h = resizeBox.current.offsetHeight;
console.log(h, 2222);
dragging = true;
startY = e.pageY;
document.onselectstart = function () {
return false;
};
}
function onMouseUp() {
dragging = false;
document.onselectstart = null;
}
function onMouseMove(e: any) {
if (dragging) {
let delta = startY - e.pageY;
let resizeH = h + delta;
if (resizeH < 200) {
resizeH = 200;
}
if (resizeH > window.innerHeight - 130) {
resizeH = window.innerHeight - 130;
}
resizeBox.current.style.height = resizeH + 'px';
}
}
const dom: any = resizeBar.current;
dom.addEventListener('mousedown', onMouseDown);
document.addEventListener('mousemove', onMouseMove);
document.addEventListener('mouseup', onMouseUp);
return () => {
const dom: any = resizeBar.current;
dom.removeEventListener('mousedown', onMouseDown);
document.removeEventListener('mousemove', onMouseMove);
document.removeEventListener('mouseup', onMouseUp);
};
}
}, [resizeBar]);
return (
<div className={styles.page}>
<iframe
className={styles.iframe}
src="https://edu-xnfz.educoder.net/Test/Hejidong/SheBeiChuZhuang/index.html"
frameBorder={0}
></iframe>
<div ref={resizeBox} className={styles.wrap}>
<div className={styles.bar} ref={resizeBar} draggable={false}>
<i className="iconfont icon-guangbiao" draggable={false}></i>
</div>
<div className={styles.list}></div>
</div>
</div>
);
};
export default Page;

@ -54,6 +54,12 @@
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe7c4;</span>
<div class="name">光标</div>
<div class="code-name">&amp;#xe7c4;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe670;</span>
<div class="name">下载</div>
@ -360,12 +366,12 @@
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.eot?t=1660727403452'); /* IE9 */
src: url('iconfont.eot?t=1660727403452#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff2?t=1660727403452') format('woff2'),
url('iconfont.woff?t=1660727403452') format('woff'),
url('iconfont.ttf?t=1660727403452') format('truetype'),
url('iconfont.svg?t=1660727403452#iconfont') format('svg');
src: url('iconfont.eot?t=1660800866982'); /* IE9 */
src: url('iconfont.eot?t=1660800866982#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff2?t=1660800866982') format('woff2'),
url('iconfont.woff?t=1660800866982') format('woff'),
url('iconfont.ttf?t=1660800866982') format('truetype'),
url('iconfont.svg?t=1660800866982#iconfont') format('svg');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@ -391,6 +397,15 @@
<div class="content font-class">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-guangbiao"></span>
<div class="name">
光标
</div>
<div class="code-name">.icon-guangbiao
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-xiazai"></span>
<div class="name">
@ -850,6 +865,14 @@
<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-guangbiao"></use>
</svg>
<div class="name">光标</div>
<div class="code-name">#icon-guangbiao</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-xiazai"></use>

@ -1,11 +1,11 @@
@font-face {
font-family: "iconfont"; /* Project id 3579477 */
src: url('iconfont.eot?t=1660727403452'); /* IE9 */
src: url('iconfont.eot?t=1660727403452#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff2?t=1660727403452') format('woff2'),
url('iconfont.woff?t=1660727403452') format('woff'),
url('iconfont.ttf?t=1660727403452') format('truetype'),
url('iconfont.svg?t=1660727403452#iconfont') format('svg');
src: url('iconfont.eot?t=1660800866982'); /* IE9 */
src: url('iconfont.eot?t=1660800866982#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff2?t=1660800866982') format('woff2'),
url('iconfont.woff?t=1660800866982') format('woff'),
url('iconfont.ttf?t=1660800866982') format('truetype'),
url('iconfont.svg?t=1660800866982#iconfont') format('svg');
}
.iconfont {
@ -16,6 +16,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-guangbiao:before {
content: "\e7c4";
}
.icon-xiazai:before {
content: "\e670";
}

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -5,6 +5,13 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "17272329",
"name": "光标",
"font_class": "guangbiao",
"unicode": "e7c4",
"unicode_decimal": 59332
},
{
"icon_id": "31306044",
"name": "下载",

@ -14,6 +14,8 @@
/>
<missing-glyph />
<glyph glyph-name="guangbiao" unicode="&#59332;" d="M0 541.675558m59.054074 0l1653.514063 0q59.054074 0 59.054074-59.054074l0 0q0-59.054074-59.054074-59.054074l-1653.514063 0q-59.054074 0-59.054074 59.054074l0 0q0 59.054074 59.054074 59.054074ZM874.827048 891.629999a29.527037 29.527037 0 0 0 21.909061 0l437.000145-174.859113a29.527037 29.527037 0 0 0-10.925003-56.987181h-874.000291a29.527037 29.527037 0 0 0-10.984058 56.928127zM896.795163 73.61297a29.527037 29.527037 0 0 0-21.909061 0l-437.000146 174.859112a29.527037 29.527037 0 0 0 10.925004 56.987181h874.000291a29.527037 29.527037 0 0 0 10.984057-56.928127z" horiz-adv-x="2194" />
<glyph glyph-name="xiazai" unicode="&#58992;" d="M620.8 51.2c-6.4 0-12.8 0-19.2 6.4l-172.8 128 32 32 160-121.6 160 121.6 38.4-32-179.2-128c-6.4-6.4-12.8-6.4-19.2-6.4zM268.8 96H128c-51.2 0-96 44.8-96 96V768C32 819.2 76.8 864 128 864h576c51.2 0 96-44.8 96-96v-140.8h-64V768c0 19.2-12.8 32-32 32H128c-19.2 0-32-12.8-32-32v-576c0-19.2 12.8-32 32-32h140.8v-64zM896-96H320c-51.2 0-96 44.8-96 96V576c0 51.2 44.8 96 96 96h576c51.2 0 96-44.8 96-96v-576c0-51.2-44.8-96-96-96z m-576 704c-19.2 0-32-12.8-32-32v-576c0-19.2 12.8-32 32-32h576c19.2 0 32 12.8 32 32V576c0 19.2-12.8 32-32 32H320zM582.4 480h64v-403.2h-64z" horiz-adv-x="1024" />
<glyph glyph-name="xuanzeshebei" unicode="&#58990;" d="M279.272727 616.727273h279.272728v-93.090909H279.272727zM651.636364 616.727273h93.090909v-93.090909H651.636364zM651.636364 430.545455h93.090909v-93.09091H651.636364zM279.272727 430.545455h279.272728v-93.09091H279.272727zM763.345455-72.145455H130.327273c-46.545455 0-83.781818 37.236364-83.781818 74.472728V765.672727c0 46.545455 37.236364 83.781818 83.781818 83.781818h1238.109091c46.545455 0 74.472727-37.236364 74.472727-83.781818v-279.272727h-93.090909V756.363636h-1210.181818v-735.418181h623.709091v-93.09091zM1284.654545-81.454545c-9.309091 0-27.927273 9.309091-37.236363 18.618181L912.290909 356.072727c-18.618182 18.618182-18.618182 46.545455 0 65.163637 27.927273 18.618182 55.854545 9.309091 74.472727-9.309091l335.127273-418.909091c18.618182-18.618182 9.309091-46.545455-9.309091-65.163637-9.309091-9.309091-18.618182-9.309091-27.927273-9.30909zM949.527273 67.490909c-27.927273 0-46.545455 18.618182-46.545455 46.545455V384c0 9.309091 9.309091 27.927273 18.618182 37.236364 9.309091 9.309091 18.618182 9.309091 27.927273 9.309091l297.890909-55.854546c27.927273 0 46.545455-27.927273 37.236363-55.854545-9.309091-27.927273-27.927273-37.236364-55.854545-37.236364l-232.727273 46.545455v-214.109091c0-27.927273-27.927273-46.545455-46.545454-46.545455z" horiz-adv-x="1489" />

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save