Advertisement
patryk178

Untitled

Jan 22nd, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2. <html lang="PL">
  3. <head>
  4. <meta charset="UTF-8">
  5. <style>
  6. </style>
  7. </head>
  8. <body bgColor="#fff">
  9. <form name="Dane">
  10. <legend>Wpisz tekst:</legend>
  11. <input type="text" name="tekst"/>
  12. <legend>Podaj wielkość czcionki:</legend>
  13. <input type="range" name="wielkosc" min="5" max="15" step="1" />
  14. <select name="typ">
  15. <legend>Wybierz czcionkę</legend>
  16. <option value="Calibri">Zwykły</option>
  17. <option value="Gabriola">Gabriola</option>
  18. <option value="Freestyle Script">Freestyle Script</option>
  19. <option value="Monotype Corsiva">Monotype Corsiva</option>
  20. </select>
  21. <legend>Podaj kolor czcionki:</legend>
  22. <input type="color" id="kolor">
  23. <legend>Podaj kolor tła:</legend>
  24. <input type="color" id="tlo">
  25. <input type="button" value="Ok" onClick="Dziala()"/>
  26. </form>
  27. <div id="Block"></div>
  28. <script>
  29. function Dziala()
  30. {
  31. var txt=document.Dane.tekst.value
  32. var w=parseInt(document.Dane.wielkosc.value);
  33. var t=document.Dane.typ.value;
  34. var k=document.Dane.kolor.value;
  35. var backg=document.Dane.tlo.value;
  36. var txt_w_t_k_backg=new Zamiana(txt,w,t,k,backg);
  37.  
  38. txt_w_t_k_backg.pokaz();
  39. }
  40.  
  41. function Zamiana(z_tekst,z_wielkosc,z_typ,z_kolor,z_tlo)
  42. {
  43. this.z_tekst=z_tekst;
  44. this.z_wielkosc=z_wielkosc;
  45. this.z_typ=z_typ;
  46. this.z_kolor=z_kolor;
  47. this.z_tlo=z_tlo;
  48. this.pokaz=function()
  49. {
  50. document.getElementById("Block").innerHTML="<span style='font-family:"+z_typ+";font-size:"+z_wielkosc+"px"+";color:"+z_kolor+"; background-color: "+z_tlo+"'>"+z_tekst+"</span>";
  51. }
  52.  
  53. }
  54. </script>
  55.  
  56. </body>
  57. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement