A Pen by Nahom Ebssa

Thumbnail
This awesome code was written by enahom99, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright enahom99 ©

Technologies

  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>A Pen by  Nahom Ebssa</title>
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Product+Sans' rel='stylesheet'>

<link href="https://fonts.googleapis.com/css?family=Indie+Flower" rel="stylesheet">
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <!-- <p class="click-me">Click Me!</p> -->

<div class="app-icon">
  <img src="https://cdn4.iconfinder.com/data/icons/new-google-logo-2015/400/new-google-favicon-512.png" alt="" />
  <span>Google</span>
</div>


<main>
  <div class="window-bar">
    <i class="material-icons">remove</i>
    <i class="material-icons maximize">crop_din</i>
    <i class="material-icons close">close</i>
  </div>
</main>

<div class="promo">Click me!</div>
  <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>

  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/enahom99/a-pen-by-nahom-ebssa-OMNYdL */
* {
  margin: 0;
  padding: 0;
}

body {
  background: #EEEEEE;
}

.app-icon {
  position: fixed;
  top: 50%;
  left: 50%;
  height: 100px;
  width: 100px;
  transform: translate(-50%,-50%);
  border-radius: 25px;
  border: 1px solid #E0E0E0;
  background: white;
  cursor: pointer;
}

.app-icon img {
  position: relative;
  top: 50%;
  left: 50%;
  height: 75px;
  width: 75px;
  transform: translate(-50%,-50%);
}

.app-icon span {
  position: relative;
  top: 30px;
  left: 50%;
  margin-left: -35%;
  font-family: 'Product Sans', sans-serif;
  font-size: 24px;
}

main {
  position: fixed;
  top: 50%;
  left: 50%;
  height: 0vh;
  width: 0vw;
  transform: translate(-50%,-50%);
  border-radius: 3px;
  background: #FAFAFA;
  overflow: hidden;
  transition: height .3s, width .4s;
}

main.window {
  height: 90vh;
  width: 90vw;
}

main.maximize {
  height: 100vh;
  width: 100vw;
}

main.window .window-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}

main.window .window-bar i { 
  margin-left: 10px;
  font-size: 16px;
  cursor: pointer;
}


p.click-me {
  position: absolute;
  top: 50vh;
  left: 50vw;
  transform: translate(100%,-200%);
  z-index: 100;
  font-family: 'Product Sans', sans-serif;
  text-transform: uppercase;
  font-weight: 700;
}
p.click-me:before {
  content: '';
  display: block;
  position: relative;
  top: 25px;
  left: -15px;
  height: 20px;
  width: 20px;
  border-top: 0;
  border-right: 0;
  border-bottom: 3px solid #212121;
  border-left: 3px solid #212121;
  transform: rotate(15deg);
  border-radius: 7px;
}

.promo {
  position: absolute;
  font-family: "Indie Flower", sans-serif;
  font-size: 36px;
  top: calc(50% - 90px);
  left: calc(50% + 150px);
  transform: translate(-50%,-50%);
}
.promo:before {
  content: '';
  display: block;
  position: relative;
  height: 2px;
  width: 30px;
  background-color: #000;
  top: 55px;
  left: -30px;
  transform: rotate(-45deg);
}

/*Downloaded from https://www.codeseek.co/enahom99/a-pen-by-nahom-ebssa-OMNYdL */
$(document).ready(function() {
  var appIcon = $('.app-icon');
  var mainWindow = $('main')
  var btnClose = $('i.close')
  var btnMaximize = $('i.maximize')
  appIcon.click(function() {
    mainWindow.addClass('window');
  });
  btnClose.click(function() {
    mainWindow.removeClass('window');
  });
  btnMaximize.click(function() {
    mainWindow.toggleClass('maximize');
  });  
});

Comments