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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

              <div class="container ">
  <div class="row">
    <span id="input" class="animated fadeInDownBig"></span> 
  <div class="row" id="button-background">
    <div class="row animated fadeInUpBig"
         style="animation-delay: 100ms;">
      <span><a class="waves-effect waves-light btn red">C</a></span>
      <span><a class="waves-effect waves-light btn grey darken-4">%</a></span>
      <span><a class="waves-effect waves-light btn  grey darken-4">!</a></span>
      <span><a class="waves-effect waves-light btn  grey darken-4">&#960</a></span>
    <div class="row animated fadeInUpBig"
         style="animation-delay: 200ms;">
      <span><a class="waves-effect waves-light btn">7</a></span>
      <span><a class="waves-effect waves-light btn">8</a></span>
      <span><a class="waves-effect waves-light btn">9</a></span>
      <span><a class="waves-effect waves-light btn  grey darken-4">+</a></span></div>
    <div class="row animated fadeInUpBig"
         style="animation-delay: 300ms;">
      <span><a class="waves-effect waves-light btn">4</a></span>
      <span><a class="waves-effect waves-light btn">5</a></span>
      <span><a class="waves-effect waves-light btn">6</a></span>
      <span><a class="waves-effect waves-light btn  grey darken-4">-</a></span>
    <div class="row animated fadeInUpBig"
         style="animation-delay:  400ms;">
      <span><a class="waves-effect waves-light btn">1</a></span>
      <span><a class="waves-effect waves-light btn">2</a></span>
      <span><a class="waves-effect waves-light btn">3</a></span>
      <span><a class="waves-effect waves-light btn grey darken-4">÷</a></span>
    <div class="row animated fadeInUpBig"
         style="animation-delay: 500ms;">
      <span><a class="waves-effect waves-light btn">0</a></span>
      <span><a class="waves-effect waves-light btn">.</a></span>
      <span><a class="waves-effect waves-light btn black">=</a></span>
      <span><a class="waves-effect waves-light btn grey darken-4">x</a></span>
<p>by <strong>Suleyman Tekin</strong></p>
              * {
  margin: 0px;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Roboto Mono', monospace;

body {
  background-color: #b0bec5;
  color: white; 
  -webkit-user-select: none; /* Chrome/Safari */        
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE10+ */

.container {
  width: 304px;
  height: 617px;
  background-image: url(https://www.mobicommerce.net/wp-content/uploads/2017/03/phone_1x.png);
/*  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  border-radius: 40px;
  background-color: #004d40;
  box-shadow: -1px 0 0 #004d40;


#input {
  color: white;
  position: absolute;
  margin: 120px 0px 0px 11px;
  width: 304px;
  font-size: 20px;
  height: 150px;
  padding: 20px 20px;
  background: black;
  overflow: hidden;
  user-select: none;

  padding: 270px 0px 0px 31px;

@media screen and (min-width: 990px) {
  #button-background {


@media screen and (min-width: 1200px) {
  #button-background {

  color: #424242;

 * By Suleyman Tekin

var flag = false;
$("a").click(function() {
  switch ($(this).text()) {
    case ".":
    case "0":
    case "1":
    case "2":
    case "3":
    case "4":
    case "5":
    case "6":
    case "7":
    case "8":
    case "9":
      flag = false;
    case "-":
    case "+":
    case "÷":
    case "x":
    case "%":
      if (checkOperator()) {
    case "=":
      if (checkOperator()) {
        var inputResult = $("#input").text();
        inputResult = inputResult.replace(/÷/g, "/");
        inputResult = inputResult.replace(/x/g, "*");
        var result = eval(inputResult);
        flag = true;
    case "C":
    case 'π':
      var str = $("#input").text();
      var last = str[str.length - 1]
      if("-+x÷%".indexOf(last) != -1){
      flag = true;
    case '!':
      var str = $("#input").text()
          if(!/[\+\-x÷\%]/.test(str) && str.length != 0){
            flag = true;

//Checks if the number is an operator if it is return true else false
function checkOperator() {
  var str = $("#input").text();
  var last = str[str.length - 1];
  var operators = "-+x÷%";
  if (operators.indexOf(last) == -1) {
    if (str.length == 0) {
      return false;
    return true;
  return false;

//Calculates the factoriel of the given number
function factorial (n) {
  var result = 1;
  if (n == 0 || n == 1){
    return 1;
  } else{
    for(var i = 1; i <= n; i++){
      result *= i;
    return result;
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................