Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5.16 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Astrology</title>
  5. <link rel="stylesheet" href="projectcss.css">
  6. </head>
  7. <body>
  8. <ul>
  9. <li><a href="home.html">Home</a></li>
  10.  <li><a class="active" href="Astrology.html">Astrology</a></li>
  11.   <li><a href="Numerology.html">Numerology</a></li>
  12.   <li><a href="Tarot.html">Tarot</a></li>
  13.   <li><a href="Maigc8ball.html">Magic 8 Ball</a></li>
  14. </ul>
  15. <div class="container">
  16. <form name="menu">
  17. <div class="right">
  18.         <h1>Astrology</h1>
  19.         <div style="width: 30%;">
  20.         <div style=" width: 80; float: left; color: white; font-size:large; ">
  21.                
  22.                 <fieldset>
  23.  
  24.                     <h3>Choose the month of your birth: </h3>
  25.                     <label class="container">
  26.                     <input type="radio" name="month" id="January" value="January">January<br/>
  27.                     <input type="radio" name="month" id="February" value="February">February<br />
  28.                     <input type="radio" name="month" id="March" value="March">March<br />
  29.                     <input type="radio" name="month" id="April" value="April">April<br /><br />
  30.                     <input type="radio" name="month" id="May" value="May">May<br />
  31.                     <input type="radio" name="month" id="June" value="June">June<br />
  32.                     <input type="radio" name="month" id="July" value="July">July<br />
  33.                     <input type="radio" name="month" id="August" value="August">August<br /><br />
  34.                     <input type="radio" name="month" id="September" value="September">September<br />
  35.                     <input type="radio" name="month" id="October" value="October">October<br />
  36.                     <input type="radio" name="month" id="November" value="November">November<br />
  37.                     <input type="radio" name="month" id="December" value="December">December<br /><br />
  38.                     </label>
  39.                 </fieldset>
  40.             </div>
  41.             </div>
  42.        
  43.         <div style=" color: white; font-size:large; ">
  44.                 <fieldset>
  45.                    
  46.                     <h3>Enter the date of your birth:</h3>
  47.                     </label> <input type="text" name="birthdate" id="birthdate" size = "30" value = ""/>
  48.                     <input type="button" id='button1' value = "ok"/>
  49.                     <h3>Enter the year of your birth:</h3>
  50.                     </label><input type="text" name="birthyear" id="birthyear" size="30" value = ""/></label>
  51.                     <input type="button" id='button2' value = "ok"/><br />
  52.                     <h3>Your birth month: <span  id = "birth_month"></span> </h3>
  53.                     <h3>Your birth date: <span  id = "birth_date"></span> </h3>
  54.                     <h3>Your birth year: <span  id = "birth_year"></span> </h3>
  55.                     <br/>
  56.                    <input type="button" id="zodiac" onclick="getZodiac()" value="Click here to discover your zodiac"><br />
  57.                
  58.             </fieldset>
  59.         </div>
  60.         </div
  61.     </form>
  62.     <div style="width: 600px; margin: auto; margin-top:1%; margin-bottom:1% border: 1px solid black; padding: 5px;>
  63.                 <span id="zodiac1">
  64.                  <img class="zodiac" src="magic/zodiac.jpg" class="middle" > </img>
  65.                  </span>
  66.     </div>
  67.     <script>
  68.    
  69.        
  70.     function birthMonth()
  71.     {
  72.    
  73.    
  74.     return document.querySelector('input[name = "month"]:checked').value;
  75.    
  76.     }
  77.    
  78.     document.querySelector('#button1').addEventListener('click',birthDate);
  79.     document.querySelector('#button2').addEventListener('click',birthYear);
  80.    
  81.    
  82.     function birthDate()
  83.     {
  84.    
  85.     return document.getElementById('birthdate').value;
  86.            
  87.     }
  88.    
  89.    
  90.    
  91.     function birthYear()
  92.     {
  93.     var birthYear =  document.getElementById('birthyear').value;
  94.             document.getElementById('birth_year').innerHTML = birthYear;   
  95.     }
  96.    
  97.     function getZodiac()
  98.     {
  99.     console.log("birthDate =" + birthDate())
  100.     console.log("birthMonth =" + birthMonth())
  101.     var b_month = birthMonth();
  102.     var b_date = birthDate();  
  103.    
  104.     if((b_month == "January" && b_date <= 20) || (b_month == "December" && b_date >=22))
  105.     {
  106.    alert("You are a Capricorn");
  107.     }
  108.     else if ((b_month == "January" && b_date >= 21) || (b_month == "February" && b_date <= 18))
  109.     {
  110.    alert("You are an Aquarius");
  111.     }
  112.     else if((b_month == "February" && b_date >= 19) || (b_month == "March" && b_date <= 20))
  113.     {
  114.     alert("You are a Pisces");
  115.     }
  116.     else if((b_month == "March" && b_date >= 21) || (b_month == "April" && b_date <= 20))
  117.     {
  118.     alert("You are a Aries");
  119.     }
  120.     else if((b_month == "April" && b_date >= 21) || (b_month == "May" && b_date <= 20))
  121.     {
  122.     alert("You are a Taurus");
  123.     }
  124.     else if((b_month == "May" && b_date >= 21) || (b_month == "June" && b_date <= 20))
  125.     {
  126.    alert("You are a Gemini");
  127.     }
  128.      else if((b_month == "June" && b_date >= 22) || (b_month == "July" && b_date <= 22))
  129.     {
  130.    alert("You are a Cancer");
  131.     }
  132.     else if((b_month == "July" && b_date >= 23) || (b_month == "August" && b_date <= 23))
  133.     {
  134.    alert("You are a Leo");
  135.     }
  136.     else if((b_month == "August" && b_date >= 24) || (b_month == "September" && b_date <= 23))
  137.     {
  138.    alert("You are a Virgo");
  139.     }
  140.     else if((b_month == "September" && b_date >= 24) || (b_month == "October" && b_date <= 23))
  141.     {
  142.    alert("You are a Libra");
  143.     }
  144.     else if((b_month == "October" && b_date >= 24) || (b_month == "November" && b_date <= 22))
  145.    {
  146.    alert("You are a Scorpio");
  147.     }
  148.     else if((b_month == "November" && b_date >= 23) || (b_month == "December" && b_date <= 21))
  149.     {
  150.    alert ("You are a Sagitarius");
  151.     }
  152. }
  153.  
  154.    
  155.     </script>
  156.  
  157.  
  158.  
  159. <div class="footer">
  160.   <p>For Entertainment Purposes Only</p>
  161. </div>
  162. </body>
  163. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement