altraviolence

page 09 - generator

Jan 2nd, 2018
875
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 10.50 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <!--
  4.  
  5. GENERATOR page (09) by PEACHTHMS | peachthms.tumblr.com
  6. V1.0
  7.  
  8. - do not claim this page or any of the code as your own
  9. - do not redistribute this page or any of the code as your own
  10. - do not mix my code with another theme maker's code
  11. - do not remove or edit the credit in anyway; it must remain visible in the code and on the page
  12.  
  13. saturnthms - credit icon
  14.  
  15. HOW TO EDIT
  16.  
  17. Please keep in mind that this generator will require a lot of manual editing.
  18.  
  19. TO EDIT CURRENT ARRAYS
  20.  
  21. var var1 = [
  22.    'Fantasy',
  23.    'Adventure',
  24.    'Science Fiction',
  25.    'Horror',
  26.    'Romance'
  27. ]
  28.  
  29. This is the first array you will come across. In my example I have the items inside as different genres.
  30.  
  31. To edit the items that are currently there, just change what's in the single quotes to what you want.
  32.  
  33. E.G.
  34.  
  35. var var1 = [
  36.    'Fantasy'
  37. ]
  38.  
  39. to
  40.  
  41. var var1 = [
  42.    'Drama'
  43. ]
  44.  
  45. If you would like to add extra items make sure
  46.    - you keep your data in single quotes
  47.    - you add a comma to the very end of the line (outside the quotes!)
  48.    - you don't leave a comma for the last item
  49.  
  50. E.G.
  51.  
  52. var var1 = [
  53.    'Fantasy',
  54.    'Adventure',
  55.    'Science Fiction',
  56.    'Horror',
  57.    'Romance',
  58.    'Drama',
  59.    'Thriller',
  60.    'Action'
  61. ]
  62.  
  63. Notice how after action there is no comma?
  64.  
  65. TO ADD NEW ARRAY
  66.  
  67. If you want to add a new array, copy and paste this template below the last array
  68.  
  69. var var#= [
  70.    'CONTENT'
  71. ]
  72.  
  73. Change # to the next corresponding number, e.g. 5. This will make keeping track easier.
  74.  
  75. E.G.
  76.  
  77. var var5= [
  78.    'CONTENT'
  79. ]
  80.  
  81. Fill out the items as you see fit.
  82.  
  83. Next, find
  84.  
  85. function generate() {
  86.    there will already be code within this function/curly brackets
  87. }
  88.  
  89. copy and paste this template below the last line in the function, making sure to keep it above the last curly bracket, }.
  90.  
  91. var random = Math.floor(Math.random() * (var#.length));
  92. document.getElementById('var#').innerHTML = var#[random];
  93.  
  94. Change # to the number you gave the new array, e.g. 5.
  95.  
  96. E.G.
  97.  
  98. var random = Math.floor(Math.random() * (var5.length));
  99. document.getElementById('var5').innerHTML = var5[random];
  100.  
  101. The very last step is to add in the new HTML. Go to the table and copy and paste this template just above </table>
  102.  
  103. <tr>
  104.    <td>var#</td>
  105.    <td id="var#"></td>
  106. </tr>
  107.  
  108. Change var# in the SECOND LINE to the name you want displayed in the left column, e.g. Word Count.
  109.  
  110. Change var# in the THIRD LINE to the same number you used earlier on in the code, e.g. 5. This is where the items you added earlier will appear when generated.
  111.  
  112. <tr>
  113.    <td>Word Count</td>
  114.    <td id="var5"></td>
  115. </tr>
  116.  
  117. -->
  118.  
  119. <head>
  120.  
  121. <title>random generator</title>
  122.  
  123. <meta charset="UTF-8">
  124. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  125.  
  126. <link rel="shortcut icon" href="{Favicon}">
  127.  
  128. <link href="https://fonts.googleapis.com/css?family=Karla|Playfair+Display" rel="stylesheet">
  129. <link href="//dl.dropbox.com/s/50g6fbds3rh4m0j/saturnicons.css" rel="stylesheet">
  130. <link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css" rel="stylesheet">
  131. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  132.  
  133. <style type="text/css">
  134.  
  135. * {
  136.     margin: 0;
  137.     padding: 0;
  138. }
  139.  
  140. ::-moz-selection {
  141.     background-color: #a1b895; /** accent colour **/
  142. }
  143.  
  144. ::selection {
  145.     background-color: #a1b895; /** accent colour **/
  146. }
  147.  
  148. ::-webkit-scrollbar {
  149.     width: 7px;
  150.     height: 7px;
  151. }
  152.  
  153. ::-webkit-scrollbar-thumb {
  154.     background: #a1b895; /** accent colour **/
  155. }
  156.  
  157. ::-webkit-scrollbar-track {
  158.     background: #ffffff;
  159. }
  160.  
  161. a {
  162.     color: #686868;
  163.     text-decoration: none;
  164.     -webkit-transition: 0.4s ease-in-out;
  165.     -moz-transition: 0.4s ease-in-out;
  166.     transition: 0.4s ease-in-out;
  167. }
  168.  
  169. a:hover {
  170.     color: #a1b895; /** accent colour **/
  171. }
  172.  
  173. body {
  174.     background: #f1f1f1;
  175.     color: #686868;
  176.     font-family: 'Karla', sans-serif;
  177.     font-size: 13px;
  178.     line-height: 1.8em;
  179. }
  180.  
  181. h1, h2, h3, h4, h5, h6 {
  182.     font-family: 'Playfair Display', Times New Roman, serif;
  183. }
  184.  
  185. section {
  186.     margin: 100px auto;
  187.     padding-bottom: 20px;
  188.     width: 70%;
  189.     height: 80%;
  190.     background: #ffffff;
  191. }
  192.  
  193. header {
  194.     width: calc(100% - 100px);
  195.     padding: 10px 50px 20px;
  196.     text-align: center;
  197.     border-bottom: 2px solid #f1f1f1;
  198. }
  199.  
  200. #generator-wrapper {
  201.     margin: 0 auto;
  202.     width: 80%;
  203.     text-align: center;
  204. }
  205.  
  206. #generator-prompts {
  207.     margin: 50px auto;
  208.     padding: 20px;
  209. }
  210.  
  211. #links {
  212.     margin: 10px;
  213. }
  214.  
  215. #links a {
  216.     margin: 0 10px;
  217.     color: #a1b895; /** accent colour **/
  218. }
  219.  
  220. #links a:hover {
  221.     color: initial;
  222. }
  223.  
  224. button {
  225.     margin: 30px auto;
  226.     padding: 9px 10px 8px 10px;
  227.     width: auto;
  228.     font-family: 'Karla', Helvetica, sans-serif;
  229.     text-transform: lowercase;
  230.     box-sizing: border-box;
  231.     border: none;
  232.     -webkit-border-radius: 4px;
  233.     -moz-border-radius: 4px;
  234.     border-radius: 4px;
  235.     background: #f1f1f1;
  236.     -webkit-transition: 0.4s ease-in-out;
  237.     -moz-transition: 0.4s ease-in-out;
  238.     transition: 0.4s ease-in-out;
  239. }
  240.  
  241. button:focus{
  242.     outline: none
  243. }
  244.  
  245. button:hover {
  246.     color: #ffffff;
  247.     background: #a1b895; /** accent colour **/
  248. }
  249.  
  250. table {
  251.     width: 100%;
  252.     border-collapse: collapse;
  253.     border-spacing: 0;
  254. }
  255.  
  256. table, th, td {
  257.     margin: 20px 0;
  258.     border: 2px solid #f1f1f1;
  259. }
  260.  
  261. th {
  262.     padding: 5px 3px;
  263.     background: #f1f1f1;
  264.     font-weight: normal;
  265.     text-transform: uppercase;
  266. }
  267.  
  268. td {
  269.     padding: 10px;
  270.     vertical-align: middle;
  271. }
  272.  
  273. td:first-of-type {
  274.     width: 100px;
  275.     background: #f1f1f1;
  276.     text-transform: uppercase;
  277. }
  278.  
  279. td:last-of-type {
  280.     padding: 10px 50px;
  281.     width: calc(100% - 100px);
  282. }
  283.  
  284. #back {
  285.     position: fixed;
  286.     top: 7px;
  287.     left: 10px;
  288.     text-transform: uppercase;
  289. }
  290.  
  291. .credit {
  292.     position: fixed;
  293.     bottom: 10px;
  294.     left: 17px;
  295.     font-size: 14px;
  296. }
  297.  
  298. .credit a {
  299.     font-weight: normal;
  300. }
  301.  
  302. .credit span {
  303.     font-size: 10px;
  304.     background: #a1b895; /** accent colour **/
  305.     color: #ffffff;
  306.     padding: 6px 9px;
  307.     border-radius: 6px;
  308.     opacity: 0;
  309.     transition-duration: 0.5s;
  310.     -moz-transition-duration: 0.5s;
  311.     -webkit-transition-duration: 0.5s;
  312. }
  313.  
  314. .credit:hover span {
  315.     margin-left: 15px;
  316.     opacity: 1;
  317. }
  318.  
  319. .credit:before {
  320.     content: '\e2b0';
  321.     font-family: 'saturnicons';
  322. }
  323.  
  324. .credit:hover:before {
  325.     color: #a1b895; /** accent colour **/
  326. }
  327.  
  328. @media only screen and (min-width : 737px) (max-width : 1400px) {
  329.     section {
  330.         margin: 25px auto;
  331.     }
  332. }
  333.  
  334. @media only screen and (min-width : 319px) and (max-width : 736px) {
  335.     section {
  336.         width: 90%;
  337.     }
  338. }
  339. </style>
  340.  
  341. <script>
  342.  
  343. var var1 = [
  344.     'Fantasy',
  345.     'Adventure',
  346.     'Science Fiction',
  347.     'Horror',
  348.     'Romance'
  349. ]
  350.  
  351. var var2 = [
  352.     'Royalty',
  353.     'Pirate',
  354.     'College',
  355.     'Zombie Apocalypse',
  356.     'Reincarnation'
  357. ]
  358.  
  359. var var3 = [
  360.     'Space',
  361.     'Victorian Era',
  362.     'Ancient Egypt',
  363.     'Modern Paris',
  364.     'Middle Ages'
  365. ]
  366.  
  367. var var4 = [
  368.     'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas mollis, arcu vitae viverra scelerisque, orci mi rutrum magna, et imperdiet urna odio ut tellus. Nulla auctor, justo pretium consequat aliquet, mi tortor convallis tortor, a consequat ipsum lorem eu est. Etiam lobortis, sem ac tempor venenatis, erat velit efficitur est, quis aliquet tellus dolor et metus.',
  369.     'Vivamus ultricies turpis sem, vitae rutrum erat ultricies quis. Nunc efficitur elit eu blandit auctor. Sed sagittis velit nisl, feugiat tincidunt urna rutrum vitae. Sed in rutrum tellus. Maecenas quis lorem enim. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.',
  370.     'Integer odio massa, tempus eu eleifend eget, porttitor at erat. Ut ut quam ut magna feugiat pharetra in sed augue. Pellentesque id dictum diam. Praesent faucibus lobortis porta. Aenean faucibus turpis ac odio posuere varius. Nunc et facilisis leo.',
  371.     'Vivamus consectetur, quam quis viverra elementum, dolor dolor ultrices purus, nec auctor erat est eget orci. Etiam a bibendum dolor. Quisque nec auctor justo. Donec sit amet leo dapibus arcu vulputate finibus. Donec aliquet ex vel quam mollis volutpat. Aenean sed erat sapien. Quisque ullamcorper, diam a auctor fringilla, ex metus volutpat neque, quis placerat augue leo sit amet orci.',
  372.     'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus a leo tincidunt, consectetur sapien vitae, volutpat justo. Praesent tempor id nisl a laoreet. Etiam varius mauris sem, tincidunt luctus ante condimentum id.'
  373. ]
  374.  
  375. function generate() {
  376.     var random = Math.floor(Math.random() * (var1.length));
  377.     document.getElementById('var1').innerHTML = var1[random];
  378.     var random = Math.floor(Math.random() * (var2.length));
  379.     document.getElementById('var2').innerHTML = var2[random];
  380.     var random = Math.floor(Math.random() * (var3.length));
  381.     document.getElementById('var3').innerHTML = var3[random];
  382.     var random = Math.floor(Math.random() * (var4.length));
  383.     document.getElementById('var4').innerHTML = var4[random];
  384. }
  385. </script>
  386.  
  387. </head>
  388.  
  389. <body>
  390.  
  391. <section>
  392. <header>
  393.     <h1>random generator</h1>
  394.    
  395.     <div id="links">
  396.         <a href="/">home</a>
  397.         <a href="/ask">message</a>
  398.         <a href="#">link</a>
  399.         <a href="#">link</a>
  400.     </div>
  401.    
  402.     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
  403. </header>
  404.  
  405. <article id="generator-wrapper">
  406.  
  407.     <button id="generate-button" onclick="generate()">generate story details</button>
  408.  
  409.     <table id="generated" cellspacing="0">
  410.         <tr>
  411.             <td>genre</td>
  412.             <td id="var1"></td>
  413.         </tr>
  414.         <tr>
  415.             <td>au</td>
  416.             <td id="var2"></td>
  417.         </tr>
  418.         <tr>
  419.             <td>setting</td>
  420.             <td id="var3"></td>
  421.         </tr>
  422.         <tr>
  423.             <td>prompt</td>
  424.             <td id="var4"></td>
  425.         </tr>
  426.     </table>
  427.  
  428. </article>
  429.  
  430. </section>
  431.  
  432. <div class="credit"><a href="http://peachthms.tumblr.com"><span>page by peachthms</span></a></div>
  433.  
  434. </body>
  435.  
  436. </html>
Advertisement
Add Comment
Please, Sign In to add comment