Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zbryikt committed Jan 30, 2019
0 parents commit 074edce
Show file tree
Hide file tree
Showing 25 changed files with 1,396 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.*.swp
23 changes: 23 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
The MIT License (MIT)

Copyright (c) 2018, Kirby T. Wu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ldSlider

tiny range slider library.


## Usage

TBD.


## License

MIT
12 changes: 12 additions & 0 deletions build
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
mkdir -p dist
echo "build src/ldrs.ls -> dist/ldrs.js ..."
./node_modules/.bin/lsc -cbp src/ldrs.ls > dist/ldrs.js
echo "build src/ldrs.styl -> dist/ldrs.css ..."
./node_modules/.bin/stylus -p src/ldrs.styl > dist/ldrs.css
echo "minifying ldrs.js ..."
./node_modules/.bin/uglifyjs dist/ldrs.js > dist/ldrs.min.js
echo "minifying ldrs.css ..."
./node_modules/.bin/uglifycss dist/ldrs.css > dist/ldrs.min.css
echo "done."

1 change: 1 addition & 0 deletions demo/assets/ldq.min.js
Empty file added demo/favicon.ico
Empty file.
Empty file added demo/index.css
Empty file.
1 change: 1 addition & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html><head><link rel="stylesheet" type="text/css" href="ldrs.css"><link rel="stylesheet" type="text/css" href="index.css"><script src="assets/ldq.min.js"></script><script src="ldrs.js"></script></head><body><div style="margin:100px"><div class="ldrs up"></div></div><div style="margin:100px"><div class="ldrs"></div></div></body><script src="index.js"></script></html>
18 changes: 18 additions & 0 deletions demo/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions demo/index.ls
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

ldrs = new ldSlider root: '.ldrs', min: 20
ldrs.on \change, -> console.log 'changed:', it
ldrs.set 30

ldrs = new ldSlider root: ld$.find(document,'.ldrs',1), min: 20
ldrs.on \change, -> console.log 'changed:', it
ldrs.set 50
12 changes: 12 additions & 0 deletions demo/index.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
doctype html
html
head
link(rel="stylesheet",type="text/css",href="ldrs.css")
link(rel="stylesheet",type="text/css",href="index.css")
script(src="assets/ldq.min.js")
script(src="ldrs.js")
body
div(style="margin:100px"): .ldrs.up
div(style="margin:100px"): .ldrs

script(src="index.js")
Empty file added demo/index.styl
Empty file.
119 changes: 119 additions & 0 deletions demo/ldrs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
.ldrs {
position: relative;
height: 34px;
}
.ldrs .bar,
.ldrs .fg,
.ldrs .bk,
.ldrs .cap {
height: 12px;
}
.ldrs .bar {
width: 100%;
position: relative;
padding: 0 0;
background: #ff0;
}
.ldrs .bar .cap {
background: #f00;
width: 10px;
position: absolute;
}
.ldrs .bar .cap:first-child {
border-radius: 5px 0 0 5px;
top: 0;
left: 0;
}
.ldrs .bar .cap:last-child {
border-radius: 0 5px 5px 0;
background: #eee;
top: 0;
right: 0;
}
.ldrs .bar .fg {
width: 50%;
background: #f00;
position: absolute;
left: 10px;
right: 50px;
width: auto;
top: 0;
}
.ldrs .bar .bk {
background: #eee;
position: absolute;
top: 0;
left: 10px;
right: 10px;
width: auto;
}
.ldrs .ptr {
position: absolute;
width: 9px;
height: 18px;
top: -3px;
left: 10px;
margin-left: -3px;
cursor: pointer;
background: rgba(255,255,255,0.01);
}
.ldrs .ptr:after {
content: " ";
display: block;
width: 3px;
height: 100%;
margin-left: 3px;
background: #f00;
border-radius: 12x;
}
.ldrs .hint {
background: #eee;
color: #aaa;
font-family: sans-serif;
padding: 0 4px 0;
font-size: 10px;
display: inline-block;
border-radius: 3px;
position: absolute;
top: 15px;
user-select: none;
}
.ldrs .hint.l {
left: 0;
}
.ldrs .hint.r {
right: 0;
}
.ldrs .hint.p {
background: #f00;
color: #fff;
cursor: pointer;
}
.ldrs .hint.p:after {
box-sizing: border-box;
position: absolute;
content: " ";
display: block;
top: 0;
left: 50%;
width: 0px;
height: 0px;
transform: translate(-3px, -3px) rotate(45deg);
border: 3px solid #f00;
border-color: #f00 transparent transparent #f00;
}
.ldrs.up .ptr {
top: 12px;
}
.ldrs.up .bar {
top: 15px;
}
.ldrs.up .hint {
top: 0;
}
.ldrs.up .hint.p:after {
top: auto;
bottom: 0;
transform: translate(-3px, 3px) rotate(45deg);
border-color: transparent #f00 #f00 transparent;
}
117 changes: 117 additions & 0 deletions demo/ldrs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions demo/ldrs.ls
1 change: 1 addition & 0 deletions demo/ldrs.styl
Loading

0 comments on commit 074edce

Please sign in to comment.