Advertisement
manufm97

Untitled

May 5th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.30 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="es">
  3. <head>
  4. <meta charset='utf-8' />
  5. <title>Ejemplo JS.</title>
  6. <style>
  7. .contenedor{width: 1024px;
  8. margin: auto;
  9. }
  10. .conborde{border: 10px #8000FF inset;
  11. border-radius: 10px;
  12. text-align: center;
  13. padding: 30px;
  14. box-shadow: 3px -2px 6px rgba(0, 0, 0, 0.6);
  15. }
  16. .tam{position: relative;
  17. top: 10px;
  18. left: 50px;
  19. padding: 10px;
  20. background-color: #D9FFFF;
  21. border: 2px grey outset;
  22. width: 270px;
  23. font-family: Chewy;
  24. font-size: 20px;
  25. box-shadow: 3px -2px 6px rgba(0, 0, 0, 0.6);
  26. }
  27. .size{width: 75px;
  28. font-family: Chewy;
  29. padding: 5px;
  30. background-color:#E1E1E1;
  31. border: 2px grey outset;
  32. font-size: 20px;
  33. }
  34. .fuente{position: relative;
  35. left: 150px;
  36. top: -32px;
  37. font-family: Chewy;
  38. padding: 5px;
  39. background-color:#80FF80;
  40. border: 2px #008000 outset;
  41. font-size: 20px;
  42. width: 320px;
  43. box-shadow: 3px -2px 6px rgba(0, 0, 0, 0.6);
  44. }
  45. .font{width: 300px;
  46. padding: 5px;
  47. background-color:#E1E1E1;
  48. border: 2px grey outset;
  49. font-size: 24px;
  50. font-family: Chewy;
  51. }
  52. .cajafondo{width:30px;
  53. height:30px;
  54. border:1px gray solid;
  55. font-size:0px;
  56. border-radius:5px;
  57. text-align:center;
  58. float:left;
  59. margin:5px;
  60. }
  61. .colores{position: relative;
  62. top: 300px
  63. width: 1024px;
  64. }
  65. .fondo{position: float;
  66. float: left;
  67. width: 500px;
  68. }
  69. .color{position: float;
  70. float: left;
  71. width: 500px;
  72. }
  73. @font-face {
  74. font-family:"orange juice";
  75. src: url("fonts/orange juice 2.0.ttf");
  76. }
  77. .orange{font-family: "orange juice";
  78. }
  79. @font-face {
  80. font-family:"Coming Soon";
  81. src: url("fonts/ComingSoon.ttf");
  82. }
  83. .coming
  84. {font-family: "Coming Soon";
  85. }
  86. @font-face {
  87. font-family:"Chewy";
  88. src: url("fonts/Chewy.ttf");
  89. }
  90. .arial{font-family: Arial;
  91. }
  92. .comic{font-family: "Comic Sans MS";
  93. }
  94. .forte{font-family: Forte;
  95. }
  96. .cambria{font-family: Cambria;
  97. }
  98. .time{font-family: "Times News Roman";
  99. }
  100. </style>
  101. <script>
  102. function Cambiar_letra(size)
  103. {var elobjeto=document.getElementById("lacaja");
  104. var valor=document.formulario1.tam.value+"pt";
  105. if(elobjeto)
  106. {elobjeto.style.fontSize=valor;
  107. }
  108. else
  109. {alert("No se puede seleccionar el objeto.");
  110. }
  111. }
  112.  
  113. function Cambiar_fuente(size)
  114. {var elobjeto=document.getElementById("lacaja");
  115. var valor=document.formulario2.tam.value;
  116. if(elobjeto)
  117. {elobjeto.style.fontFamily=valor;
  118. }
  119. else
  120. {alert("No se puede seleccionar el objeto.");
  121. }
  122. }
  123.  
  124. function Cambiar_Color(r,g,b)
  125. {var elobjeto=document.getElementById("lacaja");
  126. if(elobjeto)
  127. {elobjeto.style.color="rgb("+r+","+g+","+b+")";
  128. }
  129. else
  130. {alert("No se pudo seleccionar el objeto.");
  131. }
  132. }
  133.  
  134. function Cambiar_fondo(r,g,b)
  135. {var elobjeto=document.getElementById("lacaja");
  136. if(elobjeto)
  137. {elobjeto.style.backgroundColor="rgb("+r+","+g+","+b+")";
  138. }
  139. else
  140. {alert("No se pudo seleccionar el objeto.");
  141. }
  142. }
  143. </script>
  144. </head>
  145. <body>
  146. <br /><br />
  147. <div class="contenedor">
  148. <div class="conborde" id="lacaja">
  149. Este es el contenido de la caja
  150. </div>
  151. <div class="tam">
  152. Selecciona el tamaño de la letra:
  153. <form name="formulario1">
  154. <select name="tam" onchange="Cambiar_letra();" class="size">
  155. <script>
  156. for(i=10;i<=40;i=i+2)
  157. {document.write("<option>"+i+"</option>");
  158. }
  159. </script>
  160. </script>
  161. </select>
  162. </form>
  163. </div>
  164. <div class="fuente">
  165. Selecciona el tipo de fuente:
  166. <form name="formulario2">
  167. <select name="tam" onchange="Cambiar_fuente();" class="font">
  168. <option class="time">Times News Roman</option>
  169. <option class="arial">Arial</option>
  170. <option class="comic">Comic Sans MS</option>
  171. <option>Chewy</option>
  172. <option class="coming">Coming Soon</option>
  173. <option class="orange">orange juice</option>
  174. <option class="forte">Forte</option>
  175. <option class="cambria">Cambria</option>
  176. </select>
  177. </form>
  178. </div>
  179. <br />
  180. <div class="colores">
  181. <div class="color">
  182. <h1 class="comic">Color de texto</h1>
  183. <script>
  184. for(r=0;r<255;r=r+50)
  185. for(g=0;g<255;g=g+50)
  186. for(b=0;b<255;b=b+50)
  187. {document.write("<div class='cajafondo' style='background-color:rgb("+r+","+g+","+b+");' onclick='Cambiar_Color("+r+","+g+","+b+");'>"+r+","+g+","+b+"</div>");
  188. }
  189. </script>
  190. </div>
  191. <div class="fondo">
  192. <h1 class="comic">Color del fondo</h1>
  193. <script>
  194. for(r=0;r<255;r=r+50)
  195. for(g=0;g<255;g=g+50)
  196. for(b=0;b<255;b=b+50)
  197. {document.write("<div class='cajafondo' style='background-color:rgb("+r+","+g+","+b+");' onclick='Cambiar_fondo("+r+","+g+","+b+");'>"+r+","+g+","+b+"</div>");
  198. }
  199. </script>
  200. </div>
  201. </div>
  202. <div class="cajavolver">
  203. <a href="..\index.html"><img src="img\volver.png" title="Volver a la página principal"></a>
  204. </div>
  205. </div>
  206. </body>
  207. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement