mdui实现一个拖动时钟指针选择事件效果代码
代码语言:html
所属分类:选择器
代码描述:mdui实现一个拖动时钟指针选择事件效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/mdui.min.css">
<style>
html, body {
height: 100%;
}
body {
margin: 0;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
overflow-y: auto;
}
/*好看的更新动画*/
mdui-replaceable {
position: relative;
display: block;
}
mdui-replaceable > div {
box-sizing: border-box;
width: 100%;
}
mdui-replaceable > .replacement-wrapper {
position: absolute;
left: 0;
top: 0;
right: 0;
text-align: inherit;
}
/*选择器公用样式*/
.picker {
width: 330px;
box-shadow: 0 39px 56px 4px rgba(0, 0, 0, .24);
border-radius: 2px;
overflow: hidden;
background: white;
/*控件颜色*/
--preferred-color: #009688;
}
.picker > header {
width: 100%;
background: var(--preferred-color, #009688);
color: white;
}
.picker > header button {
text-align: left;
box-sizing: border-box;
border: none;
padding: 0;
background: none;
color: rgba(255, 255, 255, .7);
font-family: Roboto, -apple-system, PingFang SC, Noto Sans CJK SC, sans-serif;
font-size: 16px;
font-weight: 500;
height: 16px;
transition: all .3s cubic-bezier(0.2, 0.9, 0.4, 1);
}
.picker > header button.picker-toggle-active {
color: white;
}
.picker > footer > button {
color: var(--preferred-color, #009688)!important; /*MDUI对按钮的颜色设置会覆盖此属性*/
}
/*时间选择器*/
.picker.time-picker {
user-select: none;
}
.picker.time-picker > header {
box-sizing: border-box;
padding: 28px 48px 23px;
display: flex;
align-items: center;
justify-content: flex-end;
color: rgba(255, 255, 255, .7);
}
.picker.time-picker .time-picker--time-hour-switch, .picker.time-picker .time-picker--time-hour-switch >.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0