mirror of https://gitee.com/cf-fz/WebCAD.git
parent
dd7980b1c5
commit
78f82eedd8
File diff suppressed because one or more lines are too long
@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
#实例
|
||||
https://github.com/Quramy/typescript-css-modules-demo
|
||||
https://github.com/css-modules/css-modules/issues/61
|
||||
|
||||
|
||||
#.Loader
|
||||
https://github.com/olegstepura/typed-css-modules-loader
|
||||
|
@ -0,0 +1,130 @@
|
||||
import * as React from "react";
|
||||
|
||||
import "./AppUI.less"
|
||||
import { CSSProperties } from "react";
|
||||
import * as THREE from "three";
|
||||
//界面数据
|
||||
export class AppUi extends React.Component<{}, null> {
|
||||
css: CSSProperties = {
|
||||
width: "100%",
|
||||
height: "100%"
|
||||
}
|
||||
render()
|
||||
{
|
||||
return (
|
||||
<div className="AppUi" style={this.css}>
|
||||
<TopPanel name="Cx" date="Sv" />
|
||||
<Contain />
|
||||
<DownPanel />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
interface Data
|
||||
{
|
||||
name?: string;
|
||||
age?: number;
|
||||
date: string;
|
||||
}
|
||||
|
||||
export class TopPanel extends React.Component<Data, object>{
|
||||
timerID: any;
|
||||
|
||||
tick()
|
||||
{
|
||||
|
||||
}
|
||||
constructor(props)
|
||||
{
|
||||
super(props);
|
||||
this.state = {
|
||||
date: ""
|
||||
}
|
||||
|
||||
window["setg"] = (o) =>
|
||||
{
|
||||
this.setState(
|
||||
{
|
||||
date: o
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount()
|
||||
{
|
||||
this.timerID = setInterval(
|
||||
() => this.tick(),
|
||||
1000
|
||||
);
|
||||
}
|
||||
|
||||
componentWillUnmount()
|
||||
{
|
||||
clearInterval(this.timerID);
|
||||
}
|
||||
render()
|
||||
{
|
||||
return (
|
||||
<div className="panel b-bot topsize" >
|
||||
<span className="logo" >
|
||||
webCAD
|
||||
<sup>dev</sup>
|
||||
{this.state["date"]}
|
||||
</span>
|
||||
<Btn />
|
||||
<Btn />
|
||||
<Btn />
|
||||
<Btn />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
window["sb"] = "你是不是傻";
|
||||
|
||||
export class DownPanel extends React.Component<{}, null>
|
||||
{
|
||||
style: CSSProperties = {
|
||||
width: "100%",
|
||||
height: "30px",
|
||||
}
|
||||
render()
|
||||
{
|
||||
return (
|
||||
<div className="panel" style={this.style}></div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class Btn extends React.Component<{}, null>{
|
||||
divStyle: CSSProperties = {
|
||||
};
|
||||
render()
|
||||
{
|
||||
// act-undo
|
||||
return (
|
||||
<button className="btn tbtn sep" style={this.divStyle}>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export class Contain extends React.Component<{}, null>{
|
||||
css: CSSProperties =
|
||||
{
|
||||
width: "100%",
|
||||
height: "calc(100% - 59px)"
|
||||
}
|
||||
render()
|
||||
{
|
||||
return (
|
||||
<div style={this.css} id="webgl">
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,62 @@
|
||||
.topsize
|
||||
{
|
||||
width: 100%;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
|
||||
body {
|
||||
.sans-serif;
|
||||
font-size: 11px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
html, body {
|
||||
background: gray;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.sans-serif {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
.panel {
|
||||
background: #444;
|
||||
border: 0px solid black;
|
||||
text-align: right
|
||||
}
|
||||
|
||||
.b-top { border-top-width: 1px; }
|
||||
|
||||
.logo {
|
||||
color: #bbb;
|
||||
font-size: 18px;
|
||||
padding: 3px 0 0 10px;
|
||||
cursor: alias;
|
||||
float: left
|
||||
}
|
||||
|
||||
|
||||
.btn {
|
||||
border:1px solid #808080;
|
||||
background: #606060 no-repeat center;
|
||||
border-radius: 4px;
|
||||
color: white;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.tbtn {
|
||||
width:31px;
|
||||
height:31px;
|
||||
margin: 2px 2px;
|
||||
font-size: 20px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.sep {
|
||||
margin-right: 1px;
|
||||
}
|
Loading…
Reference in new issue