Permalink
Browse files

added sliders and integrate then with caman.js

  • Loading branch information...
1 parent 33ead21 commit ab31a7efdbaeb3e62dcd4b616d9cc51e815f2a18 @mgallego committed Jan 19, 2013
View
@@ -3,6 +3,7 @@ web/bundles/
web/HtmlMockups
web/uploads/*
web/css/*
+web/js/*
app/config/parameters.yml
app/bootstrap*
app/cache/*
@@ -0,0 +1,48 @@
+$(document).ready(function() {
+
+ $(function() {
+ $( ".slider" ).slider(
+ {
+ min: -100,
+ max:100,
+ value: 0,
+ step: 1,
+ slide: showValue,
+ change: applyFilter
+ }
+ );
+ });
+
+
+ function applyFilter(){
+
+ var vBrightness = $( "#slider-brightness" ).slider( "value" );
+ var vContrast = $( "#slider-contrast" ).slider( "value" );
+ var vSaturation = $( "#slider-saturation" ).slider( "value" );
+ var vExposure = $( "#slider-exposure" ).slider( "value" );
+
+ Caman("#image-to-modify", function () {
+ this.revert(function(){
+ this.brightness(vBrightness).contrast(vContrast).saturation(vSaturation).exposure(vExposure).render();
+ });
+ });
+ };
+
+
+
+
+ function showValue(){
+ console.log('entrando');
+
+ var vBrightness = $( "#slider-brightness" ).slider( "value" );
+ // var vContrast = $( "#slider-contrast" ).slider( "value" );
+ // var vSaturation = $( "#slider-saturation" ).slider( "value" );
+ // var vExposure = $( "#slider-exposure" ).slider( "value" );
+
+ console.log('Brightness: '.vBrightness);
+ // console.log('Contrast: '.vContrast);
+ // console.log('Saturation: '.vSaturation);
+ // console.log('Exposure: '.vExposure);
+ };
+
+})
@@ -56,7 +56,14 @@
margin-bottom: 20px;
}
+#img-controls div.control-data {
+ padding: 10px 0;
+}
+#img-controls span.control-title {
+ color: @darkGrey;
+ font-weight: bold;
+}
// ////////////////////////////////////
Oops, something went wrong.

0 comments on commit ab31a7e

Please sign in to comment.