Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <html lang="PL">
- <head>
- <meta charset="UTF-8">
- <style>
- </style>
- </head>
- <body bgColor="#fff">
- <form name="Dane">
- <legend>Wpisz tekst:</legend>
- <input type="text" name="tekst"/>
- <legend>Podaj wielkość czcionki:</legend>
- <input type="range" name="wielkosc" min="5" max="15" step="1" />
- <select name="typ">
- <legend>Wybierz czcionkę</legend>
- <option value="Calibri">Zwykły</option>
- <option value="Gabriola">Gabriola</option>
- <option value="Freestyle Script">Freestyle Script</option>
- <option value="Monotype Corsiva">Monotype Corsiva</option>
- </select>
- <legend>Podaj kolor czcionki:</legend>
- <input type="color" id="kolor">
- <legend>Podaj kolor tła:</legend>
- <input type="color" id="tlo">
- <input type="button" value="Ok" onClick="Dziala()"/>
- </form>
- <div id="Block"></div>
- <script>
- function Dziala()
- {
- var txt=document.Dane.tekst.value
- var w=parseInt(document.Dane.wielkosc.value);
- var t=document.Dane.typ.value;
- var k=document.Dane.kolor.value;
- var backg=document.Dane.tlo.value;
- var txt_w_t_k_backg=new Zamiana(txt,w,t,k,backg);
- txt_w_t_k_backg.pokaz();
- }
- function Zamiana(z_tekst,z_wielkosc,z_typ,z_kolor,z_tlo)
- {
- this.z_tekst=z_tekst;
- this.z_wielkosc=z_wielkosc;
- this.z_typ=z_typ;
- this.z_kolor=z_kolor;
- this.z_tlo=z_tlo;
- this.pokaz=function()
- {
- 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>";
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement