cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              
<head>
  <link href="https://fonts.googleapis.com/css?family=Sancreek" rel="stylesheet">
</head>
<!--<div class = "fortune" id = "fortuneResult"></div>-->

  <div class = "circle">
    <div class = "text">
      Magic <span class = "eight">&nbsp8 </span> ball
    </div>
    <div class = "question">
      state your question
      <p><input type = "form-control" id = "inputQ"></input><button class = "btn btn-primary" id = "getAnswer">Get Answer</button></p>

    </div>
<div class = "fortuneCircle">
      <div class="yourAnswer">Your answer awaits</div>
  <div class = "triFor">
        <div class = "fortune" id = "fortuneResult"></div>
        <div id = "triangle-up">
    </div>
  </div>
</div>
  </div>
<div class = "endStatement">Written and Coded by <a href = "https://jwolfgang.info" target = "_blank">Jim C-M</a> 2018 </div>
            
          
!
            
              body {
  background-color: black;
  font-family: Sancreek;
  color:white;

}

.circle {
  width: 700px;
  height: 700px;
  border-radius: 50%;
  border: 10px solid white;
  margin: 100px auto 50px auto;
  color: white;
  text-align: center;
  /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#666666+1,1c1c1c+74,131313+100 */
background: rgb(102,102,102); /* Old browsers */
background: -moz-radial-gradient(center, ellipse cover,  rgba(102,102,102,1) 1%, rgba(28,28,28,1) 74%, rgba(19,19,19,1) 100%); /* FF3.6-15 */
background: -webkit-radial-gradient(center, ellipse cover,  rgba(102,102,102,1) 1%,rgba(28,28,28,1) 74%,rgba(19,19,19,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: radial-gradient(ellipse at center,  rgba(102,102,102,1) 1%,rgba(28,28,28,1) 74%,rgba(19,19,19,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#666666', endColorstr='#131313',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
}
.fortuneCircle {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 5px solid white;
  margin: 0 auto;
  cursor: pointer;
  transition: background 1s, transform 1s;
  position: relative;
}

.fortuneCircle:hover{
  transform: rotate(2160deg);

}

/*
.tryFor {
  cursor: pointer;
  transition: background 1s, transform 1s;
}

.tryFor:hover {
 transform: rotate(360deg);
}
*/
.text {
  padding-top: 50px;
  font-size: 60px;
}

.eight {
  font-size: 2em;
  color: purple;
}

#getAnswer {
  margin-bottom: 15px;
  margin-left: 30px;
}

.centerer {
  text-align: center;
}

.question {
  font-size: 1.5em;
}

#inputQ {
  background-color: black;
  color: white;
}

#triangle-up { 
  margin: 30px auto;
  width: 0; 
  height: 0; 
  border-left: 100px solid transparent; 
  border-right: 100px solid transparent; 
  border-bottom: 150px solid blue; 
  text-align: left;
}


.yourAnswer{
  margin-top: 30px;
}

#fortuneResult {
  text-align:center;
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 70%;
  transform:translate(-50%,-50%);
}

.endStatement {
  text-align:center;
}
            
          
!
            
              $( document ).ready(function() {
  //Reports to console that the page is ready
    console.log( "ready!" );
  
  var input = document.getElementById("inputQ");

// Execute a function when the user releases a key on the keyboard
input.addEventListener("keyup", function(event) {
  // Cancel the default action, if needed
  event.preventDefault();
  // Number 13 is the "Enter" key on the keyboard
  if (event.keyCode === 13) {
    // Trigger the button element with a click
    document.getElementById("getAnswer").click();
  };
});

  
  $('#getAnswer').click(function(){
    var input = $('#inputQ').val();
    console.log(input);
    
    let randomNumber = Math.floor(Math.random()*8);
    let eightBall = '';
    
     switch (randomNumber) {
  case 0:
    eightBall = 'It is certain';
    break;
  case 1:
    eightBall = 'It is decidely so';
    break;                    
  case 2:
    eightBall = 'I can\'t tell';
    break;
  case 3:
    eightBall = 'Que seran seran';
    break;
  case 4:
    eightBall = 'Don\'t count on it';
    break;
  case 5:
    eightBall = 'Yes indeed';
    break;
  case 6:
    eightBall = 'Not lookin\' like it';
    break;
  case 7:
    eightBall = 'Oh hell yeah!';
    break;
     }
    console.log(eightBall);
    $('#fortuneResult').text(eightBall);
  });
});
            
          
!
999px
Loading ..................

Console