16slowly / some-components Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
图例:
dom:
<div class="root">
<div class="mask mask-left" />
<div class="content">{content}</div>
<
</div>
js:
// 保存 currentIndex
this.previousIndex = currentIndex
leave: {
leaveInLeft: this.previousIndex < currentIndex // 向左
leaveInRight: this.previousIndex > currentIndex // 向右,previousIndex = 5,currentIndex = 1 时向左
}
css:
.root {
width: 100%;
position: relative;
}
.content {
width: 50%;
position: absolute;
top: 0;
left: 0;
}
.contentEnter {
}
.contentLeave {
}
.mask {
width: 50%;
opacity: 1;
position: absolute;
top: 0;
}
// 决定 mask 是放在左边还是右边
.maskRight {
left: 50%;
}
.maskLeft {
left: -50%;
}
.maskLeave {
left: 0%;
opacity: 0;
}
视频播放器弹幕功能
<Danmuku />
<Screen message={} />
关键点:
<ControlPannel sendMessage={} onClear={} />
关键点:
将组件放置在整个应用的根组件 <App />
中, 通过 redux store 存储 showDialog
及其他信息 ,在 App 中监听该属性,有对话框的页面通过对该值进行操作,达到控制对话框显示或隐藏的目的。
<div class="wrapper">
{... content }
</div>
<Dialog>
<div> title </div>
<div>content</div>
{....}
</Dialog>
关闭对话框事件为对话框自身的缺省事件,如果外界未传入,则默认为【关闭】仅是关闭对话框
Dialog({
content: DomTree, // 对话框的 content, 需要自定义
... another
}).then(() => {
// 点击【确定】之后的需要执行的事件, 如果有【确定】
})
React.createPortals(this.props.children, domNode)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.