Brak opisu

FORS&XRF.html 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <!DOCTYPE html>
  2. <style>
  3. .image {
  4. display: block;
  5. margin-left: auto;
  6. margin-right: auto;
  7. margin-top: 150px;
  8. width: 50%;
  9. position: sticky;
  10. }
  11. .floating-menu {
  12. font-family: sans-serif;
  13. border-width:5px;
  14. border-style:solid;
  15. /*background: yellowgreen;*/
  16. padding: 5px;;
  17. width: 170px;
  18. z-index: 100;
  19. margin-left: left;
  20. margin-top: -500px;
  21. }
  22. .show_colors {
  23. border: none;
  24. background-color: inherit;
  25. /*padding: 14px 28px;*/
  26. margin: 0 0.5em;
  27. font-size: 2.5em;
  28. cursor: pointer;
  29. display: inline-block;
  30. }
  31. .show_colors:hover {background: #eee}
  32. .colors {
  33. border: none;
  34. background-color: inherit;
  35. margin: 0 0.5em;
  36. font-size: 1.5em;
  37. cursor: pointer;
  38. display: inline-block;
  39. }
  40. .colors:hover {background: #eee}
  41. .XRF {
  42. font-family: sans-serif;
  43. border-width:5px;
  44. border-style:solid;
  45. display: none;
  46. /*padding: 5px;;*/
  47. width: 140px;
  48. margin-top: -190px;
  49. margin-left: 165px;
  50. }
  51. .FORS {
  52. font-family: sans-serif;
  53. border-width:5px;
  54. border-style:solid;
  55. display: none;
  56. /*padding: 5px;;*/
  57. width: 140px;
  58. margin-top: -125px;
  59. margin-left: 165px;
  60. }
  61. </style>
  62. <html lang="en">
  63. <!-- jQuery first, then Popper.js, then Bootstrap JS -->
  64. <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  65. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
  66. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
  67. <script type="text/javascript">
  68. function Load(){
  69. imageLoad();
  70. create_colors();
  71. }
  72. function imageLoad(){
  73. // var link = getUrlVars()["link"];
  74. var link = "./nier.jpg"
  75. var body = document.getElementById('image');
  76. var image = document.createElement('img');
  77. image.setAttribute("class", "image");
  78. image.src = link;
  79. body.appendChild(image);
  80. }
  81. function getUrlVars() {
  82. var vars = {};
  83. var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
  84. vars[key] = value;
  85. });
  86. return vars;
  87. }
  88. function create_colors(){
  89. var buttons = document.getElementById('XRFcolors');
  90. var newNode = document.createElement('button');
  91. newNode.setAttribute("class", "colors");
  92. newNode.appendChild(document.createTextNode('dynamic'));
  93. buttons.appendChild(newNode);
  94. var buttons = document.getElementById('FORScolors');
  95. var newNode = document.createElement('button');
  96. newNode.setAttribute("class", "colors");
  97. newNode.appendChild(document.createTextNode('dynamic'));
  98. buttons.appendChild(newNode);
  99. var fs = require("fs");
  100. var text = fs.readFileSync("~/Desktop/Proyecto_Oller/FORS&XRF/dummy_colors");
  101. text.toString().split(/\n/).forEach(function(line){
  102. console.log(line)
  103. // aqui va lo que esta arriba
  104. });
  105. }
  106. function show_XRF(){
  107. var x = document.getElementById("XRFcolors");
  108. var y = document.getElementById("FORScolors");
  109. if (x.style.display === "none") {
  110. x.style.display = "block";
  111. y.style.display = "none";
  112. } else {
  113. x.style.display = "none";
  114. }
  115. }
  116. function show_FORS(){
  117. var x = document.getElementById("FORScolors");
  118. var y = document.getElementById("XRFcolors");
  119. if (x.style.display === "none") {
  120. x.style.display = "block";
  121. y.style.display = "none";
  122. } else {
  123. x.style.display = "none";
  124. }
  125. }
  126. </script>
  127. <head>
  128. <!-- Required meta tags -->
  129. <meta charset="utf-8">
  130. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  131. <!-- Link to CSS -->
  132. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
  133. <link rel="stylesheet" type="text/css" href="css/style.css">
  134. <title>XRF & FORS</title>
  135. <!-- Collapse Navbar (needs some work) -->
  136. <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
  137. <a class="navbar-brand" href="#"><img src="https://upload.wikimedia.org/wikipedia/en/thumb/c/c8/Francisco_Oller.jpg/220px-Francisco_Oller.jpg" width="30" height="30" class="d-inline-block align-top" alt=""> Proyecto Oller</a>
  138. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  139. <span class="navbar-toggler-icon"></span>
  140. </button>
  141. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  142. <ul class="navbar-nav mr-auto">
  143. <li class="nav-item active">
  144. <a class="nav-link" href="#">Home</a>
  145. </li>
  146. <li class="nav-item">
  147. <a class="nav-link" href="#">Link</a>
  148. </li>
  149. <li class="nav-item dropdown">
  150. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  151. Dropdown
  152. </a>
  153. <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  154. <a class="dropdown-item" href="#">Action</a>
  155. <a class="dropdown-item" href="#">Another action</a>
  156. <div class="dropdown-divider"></div>
  157. <a class="dropdown-item" href="#">Something else here</a>
  158. </div>
  159. </li>
  160. <li class="nav-item">
  161. <a class="nav-link disabled" href="#">Disabled</a>
  162. </li>
  163. </ul>
  164. <form class="form-inline my-2 my-lg-0">
  165. <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
  166. <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
  167. </form>
  168. </div>
  169. </nav>
  170. </head>
  171. <div id="image"></div>
  172. <body onload="Load();">
  173. <nav class="floating-menu">
  174. <button onclick="show_XRF();" class="show_colors">XRF</button>
  175. <button onclick="show_FORS();" class="show_colors">FORS</button>
  176. <a href="/Users/spider/Desktop/Proyecto_Oller/MSI/msi.html"><button class="show_colors">MSI</button></a>
  177. </nav>
  178. <nav class="XRF" id="XRFcolors"></nav>
  179. <nav class="FORS" id="FORScolors"></nav>
  180. </body>
  181. </html>