Skip to content

Commit 9ecb357

Browse files
committed
- add simple theme
1 parent 9e4efc7 commit 9ecb357

15 files changed

+134
-20
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## v0.0.2 (upcoming)
44

55
- tweak layout
6+
- add simple theme
67

78

89
## v0.0.1

build

+4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ echo "build src/index.ls -> dist/index.js ..."
55
./node_modules/.bin/lsc -cp --no-header src/index.ls > dist/index.js
66
echo "build src/index.styl -> dist/index.css ..."
77
./node_modules/.bin/stylus -p src/index.styl > dist/index.css
8+
echo "build src/theme.styl -> dist/theme.css ..."
9+
./node_modules/.bin/stylus -p src/theme.styl > dist/theme.css
810

911
echo "minifying index.js ..."
1012
./node_modules/.bin/uglifyjs dist/index.js -m -c > dist/index.min.js
1113
echo "minifying index.css ..."
1214
./node_modules/.bin/uglifycss dist/index.css > dist/index.min.css
15+
echo "minifying theme.css ..."
16+
./node_modules/.bin/uglifycss dist/theme.css > dist/theme.min.css
1317

1418
echo "Copy dist/ to web/ ..."
1519
rm -rf web/static/assets/lib/lddatetimepicker/dev/

dist/index.css

+10
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
flex: 1 0 auto;
1515
text-align: center;
1616
}
17+
.lddtp-a:before,
18+
.lddtp-a:after {
19+
display: block;
20+
}
21+
.lddtp-a:first-child:before {
22+
content: "\25c0";
23+
}
24+
.lddtp-a:last-child:before {
25+
content: "\25ba";
26+
}
1727
.lddtp {
1828
position: absolute;
1929
z-index: 100;

dist/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(function(){
22
var html, lddatetimepicker;
3-
html = '<div class="lddtp">\n <div class="lddtp-h">\n <div data-action="-">&#x25c0;</div>\n <div class="lddtp-f"><select class="lddtp-month-sel"></select></div>\n <div class="lddtp-f"><input class="lddtp-year-sel" type="number"/></div>\n <div data-action="+">&#x25ba;</div>\n </div>\n <div class="lddtp-ds">\n </div>\n <div class="lddtp-t">\n <div class="lddtp-f"><select class="lddtp-hour-sel"></select></div>\n <div><b>:</b></div>\n <div class="lddtp-f"><select class="lddtp-minute-sel"></select></div>\n </div>\n</div>';
3+
html = '<div class="lddtp">\n <div class="lddtp-h">\n <div class="lddtp-a" data-action="-"></div>\n <div class="lddtp-f"><select class="lddtp-month-sel"></select></div>\n <div class="lddtp-f"><input class="lddtp-year-sel" type="number"/></div>\n <div class="lddtp-a" data-action="+"></div>\n </div>\n <div class="lddtp-ds">\n </div>\n <div class="lddtp-t">\n <div class="lddtp-f"><select class="lddtp-hour-sel"></select></div>\n <div><b>:</b></div>\n <div class="lddtp-f"><select class="lddtp-minute-sel"></select></div>\n </div>\n</div>';
44
lddatetimepicker = function(opt){
55
var div, r, ref$, x$, _handler, this$ = this;
66
opt == null && (opt = {});
@@ -91,7 +91,7 @@
9191
minute: r.querySelector('.lddtp-minute-sel')
9292
}
9393
};
94-
this.n.t.style.display = this._enabled.time ? 'block' : 'none';
94+
this.n.t.style.display = this._enabled.time ? '' : 'none';
9595
this.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
9696
this.wdays = ['SUN', 'MON', 'TUE', 'WED', 'THR', 'FRI', 'SAT'];
9797
this.n.ds.innerHTML = [0, 1, 2, 3, 4, 5, 6].map(function(w){

dist/index.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/theme.css

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.lddtp {
2+
padding: 0.5em;
3+
}
4+
.lddtp-ds .dim {
5+
opacity: 0.4;
6+
background: none;
7+
}
8+
.lddtp-d {
9+
font-weight: 400;
10+
}
11+
.lddtp-w {
12+
opacity: 0.3;
13+
}
14+
.lddtp-ds {
15+
border-top: 1px solid transparent;
16+
border-bottom: 1px solid transparent;
17+
}
18+
.lddtp-d.selected {
19+
background: none;
20+
color: inherit;
21+
position: relative;
22+
}
23+
.lddtp-d.selected:after {
24+
display: block;
25+
content: " ";
26+
width: 80%;
27+
height: 3px;
28+
border-radius: 3px;
29+
background: #0cf;
30+
position: absolute;
31+
bottom: 0.15em;
32+
left: 10%;
33+
right: 10%;
34+
}
35+
.lddtp-a:first-child:before {
36+
content: "\00ab";
37+
}
38+
.lddtp-a:last-child:before {
39+
content: "\00bb";
40+
}
41+
.lddtp-t {
42+
padding: 0 0.5em;
43+
}

0 commit comments

Comments
 (0)