ahmed0saber

Photo Editor in HTML , CSS , JS

Nov 29th, 2020 (edited)
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3. <title>Photo Editor</title>
  4. <style>
  5. #d1{
  6. position:absolute;
  7. top:15%;
  8. left:30%;
  9. text-align:center;
  10. display: flex;
  11. justify-content: center;
  12. align-items: center;
  13. border:1px solid #000000;
  14. box-shadow:5px 5px 10px #777777;
  15. width:400;}
  16. #d2{
  17. position:absolute;
  18. top:25%;
  19. left:30%;
  20. width:400;
  21. height:400;
  22. text-align:center;
  23. display: flex;
  24. justify-content: center;
  25. align-items: center;
  26. border:1px solid #000000;
  27. box-shadow:5px 5px 10px #777777;}
  28. #d3{
  29. position:absolute;
  30. top:25%;
  31. left:10%;
  32. text-align:center;
  33. border:1px solid #000000;
  34. box-shadow:5px 5px 10px #777777;
  35. height:400;}
  36. #r1{
  37. margin: 0px 10px 0px 10px;}
  38. #r2{
  39. margin: 0px 10px 0px 10px;}
  40. #r3{
  41. margin: 0px 10px 0px 10px;}
  42. #r4{
  43. margin: 0px 10px 0px 10px;}
  44. #r5{
  45. margin: 0px 10px 0px 10px;}
  46. #r6{
  47. margin: 0px 10px 0px 10px;}
  48. #r7{
  49. margin: 0px 10px 0px 10px;}
  50. #r8{
  51. margin: 0px 10px 0px 10px;}
  52. #r9{
  53. margin: 0px 10px 0px 10px;}
  54. #r10{
  55. margin: 0px 10px 0px 10px;}
  56. #d4{
  57. position:absolute;
  58. top:25%;
  59. left:75%;
  60. text-align:center;
  61. border:1px solid #000000;
  62. box-shadow:5px 5px 10px #777777;
  63. height:400;}
  64. </style>
  65. <script>
  66. function change(){document.getElementById("i1").src=document.getElementById("t1").value;}
  67. function r1(x){document.getElementById("i1").style.filter="blur("+(x/20)+"px)";}
  68. function r2(x){document.getElementById("i1").style.filter="brightness("+(x)+"%)";}
  69. function r3(x){document.getElementById("i1").style.filter="contrast("+(x*1.8)+"%)";}
  70. function r4(x){document.getElementById("i1").style.filter="grayscale("+(x)+"%)";}
  71. function r5(x){document.getElementById("i1").style.filter="hue-rotate("+(x*3.6)+"deg)";}
  72. function r6(x){document.getElementById("i1").style.filter="invert("+(x)+"%)";}
  73. function r7(x){document.getElementById("i1").style.filter="opacity("+(x)+"%)";}
  74. function r8(x){document.getElementById("i1").style.filter="saturate("+(x/10)+")";}
  75. function r9(x){document.getElementById("i1").style.filter="sepia("+(x)+"%)";}
  76. function r10(x){document.getElementById("d2").style.backgroundColor=x;}
  77. </script>
  78. </head>
  79. <body>
  80. <div id="d1">
  81. <input type="text" placeholder="  Enter url of a photo" id="t1"/><br/><br/>
  82. <button onclick="change()">Start</button>
  83. </div>
  84. <div id="d2">
  85. <img src="" alt="Your Image" width="399px" height="399px" id="i1">
  86. </div>
  87. <div id="d3">
  88. <br/>
  89. <p>blur</p>
  90. <input type="range" id="r1" value="0" min="0" max="100" step="10" oninput="r1(this.value)" onchange="r1(this.value)"/><br/>
  91. <p>brightness</p>
  92. <input type="range" id="r2" value="0" min="0" max="100" step="10" oninput="r2(this.value)" onchange="r2(this.value)"/><br/>
  93. <p>contrast</p>
  94. <input type="range" id="r3" value="0" min="0" max="100" step="10" oninput="r3(this.value)" onchange="r3(this.value)"/><br/>
  95. <p>grayscale</p>
  96. <input type="range" id="r4" value="0" min="0" max="100" step="10" oninput="r4(this.value)" onchange="r4(this.value)"/><br/>
  97. <p>huerotate</p>
  98. <input type="range" id="r5" value="0" min="0" max="100" step="10" oninput="r5(this.value)" onchange="r5(this.value)"/><br/>
  99. </div>
  100. <div id="d4">
  101. <br/>
  102. <p>invert</p>
  103. <input type="range" id="r6" value="0" min="0" max="100" step="10" oninput="r6(this.value)" onchange="r6(this.value)"/><br/>
  104. <p>opacity</p>
  105. <input type="range" id="r7" value="0" min="0" max="100" step="10" oninput="r7(this.value)" onchange="r7(this.value)"/><br/>
  106. <p>saturate</p>
  107. <input type="range" id="r8" value="0" min="0" max="100" step="10" oninput="r8(this.value)" onchange="r8(this.value)"/><br/>
  108. <p>sepia</p>
  109. <input type="range" id="r9" value="0" min="0" max="100" step="10" oninput="r9(this.value)" onchange="r9(this.value)"/><br/>
  110. <p>color</p>
  111. <input type="text" id="r10" onchange="r10(this.value)" placeholder="  type color here"/><br/>
  112. </div>
  113. </body>
  114. </html>
Advertisement
Add Comment
Please, Sign In to add comment