JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
HTML Settings
Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
<div class="loading">
<span><i class="fa fa-spinner fa-pulse"></i></span>
</div>
<div class="app">
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="opening">
<h1>myDegree</h1>
<p>It's a small tool to calculate your grade and percentage of a subject or a total degree of a half-year term or a full-year. Anyway, Just insert your degree and the total degree and press "Calculate"</p>
<form>
<input type="number" id="your-degree" placeholder="Your Degree">
<input type="number" id="total-degree" placeholder="Total Degree">
<input type="button" id="calculate" value="Calculate">
</form>
<div class="error">
We are not kidding here ! 😏
</div>
</div>
</div>
<div class="col-md-6">
<div class="circle">
<div class="chat">
<div class="chat-head">
<div class="col-md-12 col-xs-12">
<span>Congrats ^_^</span>
<span class="pull-right"><i class="fa fa-bell-o"></i></span>
</div>
</div>
<div class="chat-body">
<div class="col-md-12">
<div class="locked">
<i class="fa fa-lock"></i>
<h3>Enter Data to get the result !</h3>
</div>
<div class="percentage">
<div class="img" style="background-image: url(http://mydegree.engtechnos.com/img/dribbs.png);"></div>
<span>Your Percentage:</span>
<div class="message">78%</div>
</div>
<div class="grade">
<div class="img" style="background-image: url(http://mydegree.engtechnos.com/img/red_two.png);"></div>
<span>Your Grade:</span>
<div class="message">Very Good "B+"</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="container">
<div class="col-md-12">
<span>© 2018 Copywrights | myDegree</span>
<span class="pull-right">Powered by <a target="_blank" href="http://engtechnos.com">Eng Techno</a> 🌍</span>
</div>
</div>
</footer>
</div>
<!--Scripts-->
<script src="js/jquery-3.2.1.min.js" charset="utf-8"></script>
<script src="js/bootstrap.min.js" charset="utf-8"></script>
<script src="js/custom.js" charset="utf-8"></script>
/* Embadded Fonts */
@font-face {
font-family: 'font-awesome';
src: url(fonts/fontawesome-webfont.ttf);
}
@font-face {
font-family: 'glyphicons';
src: url(fonts/glyphicons-halflings-regular.ttf);
}
@font-face {
font-family: 'muli';
src: url(fonts/muliular.ttf);
}
@font-face {
font-family: 'poppins';
src: url(fonts/Poppins-Medium.ttf);
}
@font-face {
font-family: 'muli';
src: url(fonts/Muli-SemiBold.ttf);
}
@font-face {
font-family: 'poppins';
src: url(fonts/Poppins-Regular.ttf);
}
@font-face {
font-family: 'shuri';
src: url('http://mydegree.engtechnos.com/fonts/ShurikenStd-Boy.otf');
}
/* End Embadded Fonts */
body {
background-color: #F6F6F6;
}
/* Error */
.error {
padding: 7px 17px;
color: #ffffff;
font-family: 'muli';
margin-left: 5px;
display: none;
position: relative;
margin-top: 20px;
border-radius: 7px;
background-color: #d44343;
}
.error::before {
content: '';
border: 7px solid transparent;
position: absolute;
top: -13px;
border-color: transparent transparent #d44343 #d44343;
left: 7px;
}
/* Eng Error */
/* Loadind */
.loading {
width: 100%;
height: 100%;
background-color: #8D6AC2;
position: fixed;
z-index: 999;
top: 0;
}
.loading i {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
color: #fff;
font-size: 50px;
}
/* End Loadind */
.app {
background-color: #fff;
width: 92%;
margin: 0 auto;
height: 85vh;
box-shadow: 0px 3px 6px #b5b5b5;
vertical-align: middle;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
@media (max-width: 992px) {
.app {
height: auto;
margin: 40px auto;
position: relative;
transform: unset;
top: unset;
left: unset;
padding-bottom: 20px;
}
}
.opening {
margin: 150px 19px 0;
}
.opening h1 {
font-family: 'shuri';
color: #8D6AC2;
}
.opening p {
font-family: 'poppins';
color: #AFAFAF;
margin: 20px 0;
}
.opening form {
margin: 33px 0 0;
}
.opening form input {
background-color: #EBEBEB;
border: none;
padding: 13px 20px;
border-radius: 50px;
outline: none;
width: 30%;
margin: 0 4px;
transition: all 0.3s;
font-family: 'poppins';
}
.opening form input#your-degree:focus,
.opening form input#total-degree:focus {
background-color: #d2d2d2;
}
.opening form input#calculate {
background-color: #8D6AC2;
width: 22%;
color: #fff;
}
@media (max-width: 992px) {
.opening form input {
width: 100%;
margin-bottom: 15px;
}
.opening form input#calculate {
margin: 0 auto;
display: -webkit-box;
width: auto;
}
}
.opening form input#calculate:hover {
background-color: #7c7c7c;
}
.app footer {
position: absolute;
left: 50%;
bottom: 23px;
transform: translateX(-50%);
margin-top: 10px;
}
@media (max-width: 992px) {
.app footer {
position: unset;
transform: unset;
}
.app footer span {
text-align: center;
display: block;
float: unset !important;
margin-bottom: 15px;
}
}
.app footer span {
color: #707070;
font-family: 'muli';
}
.app .circle {
background-color: #F5F5F5;
width: 410px;
height: 410px;
margin: 32px auto;
position: relative;
border-radius: 50%;
}
@media (max-width: 992px) {
.opening {
margin-top: 70px;
}
.app .circle {
width: auto;
margin: 40px 0;
}
.app .circle .chat {
width: 75% !important;
height: auto !important;
padding-bottom: 22px;
}
.app .circle .chat .chat-body .grade {
display: inline-block;
margin: 16px 0;
float: right;
}
.app .circle .chat .chat-body span {
font-size: 12px;
}
.app .circle .chat .chat-body .message,
.app .circle .chat .chat-body span {
width: 68% !important;
}
.app .circle .chat .chat-body .img {
width: 45px !important;
height: 45px !important;
margin-top: 20px;
}
.app .circle .chat .chat-body .grade .message {
margin-left: 7px;
}
.app .circle .chat .chat-body .grade .message,
.app .circle .chat .chat-body .grade span {
float: right !important;
margin-right: 15px !important;
}
.app .circle .chat .chat-body .percentage .message,
.app .circle .chat .chat-body .percentage span {
margin: 3px 0 5px 15px; !important;
float: left !important;
}
}
@media (min-width: 768px) and (max-width: 800px) {
.container {
width: 680px !important;
}
}
@media (max-width: 427px) {
.app .circle .chat .chat-body .message,
.app .circle .chat .chat-body span {
width: 60% !important;
}
.app .circle .chat .chat-body .grade .message,
.app .circle .chat .chat-body .grade span {
float: left!important;
margin-right: 15px !important;
}
.app .circle .chat .chat-body .percentage .message,
.app .circle .chat .chat-body .percentage span {
margin: 3px 0 5px 15px; !important;
float: right !important;
}
}
.app .circle .chat {
width: 300px;
height: 271px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
background-color: #fff;
box-shadow: 0px 3px 6px #b5b5b5;
}
.app .circle .chat .chat-head {
background-color: #D6D6D6;
width: 100%;
padding: 11px;
box-sizing: border-box;
display: -webkit-box;
}
.app .circle .chat .chat-head span {
font-family: 'shuri';
color: #808080;
}
.app .circle .chat .chat-body {
padding: 0 10px;
}
.app .circle .chat .locked {
text-align: center;
margin-top: 40px;
}
.app .circle .chat .locked i {
font-size: 60px;
color: #7c7c7c;
}
.app .circle .chat .locked h3 {
font-size: 19px;
font-family: 'poppins';
color: #949494;
line-height: 27px;
}
.app .circle .chat .chat-body .percentage {
margin: 25px 0;
display: none;
}
.app .circle .chat .chat-body .img {
width: 70px;
background-repeat: no-repeat;
height: 70px;
background-size: contain;
background-position: center;
border-radius: 50%;
float: left;
border: 1px solid #707070;
}
.app .circle .chat .chat-body span {
font-family: 'muli';
color: #BBBBBB;
margin: 3px 45px 5px 0;
float: right;
display: -webkit-inline-box;
}
.app .circle .chat .chat-body .message {
display: -webkit-inline-box;
background-color: #8D6AC2;
color: #fff;
float: right;
padding: 7px 15px;
font-family: 'muli';
border-radius: 8px;
position: relative;
width: 155px;
text-align: center;
}
.app .circle .chat .chat-body .message::before {
content: '';
border: 9px solid transparent;
position: absolute;
left: -16px;
border-color: transparent #8d6ac2 transparent transparent;
}
.app .circle .chat .chat-body .grade {
display: none;
margin: 16px 0;
}
.app .circle .chat .chat-body .grade .img {
float: right;
}
.app .circle .chat .chat-body .grade span {
float: left;
}
.app .circle .chat .chat-body .grade .message {
background-color: #DFDFDF;
float: left;
color: #959595;
}
.app .circle .chat .chat-body .grade .message::before {
border-color: transparent transparent transparent #dfdfdf;
right: -16px;
left: unset;
}
// loading Page
$(window).on( 'load' , function(){
$('.loading').fadeOut('fast');
});
$(document).ready(function (){
'use-strict';
$('[placeholder]').focus(function (){
$(this).attr('data-text', $(this).attr('placeholder'));
$(this).attr('placeholder', '');
}).blur(function(){
$(this).attr('placeholder', $(this).attr('data-text'));
});
// make square
var width = $('.app .circle').width();
$('.app .circle').each(function(){
$(this).css('height', width);
});
// Start Programing ^_^
$('#calculate').click(function(e){
var currentDegree = parseFloat($('#your-degree').val());
var totalDegree = parseFloat($('#total-degree').val());
if (currentDegree < totalDegree) {
$('.error').fadeOut('fast');
var sum = (currentDegree / totalDegree) * 100;
$('.percentage .message').text(sum.toFixed(2) + '%');
if (sum >= 85) {
$('.grade .message').text('Excellent (A+)');
} else if (sum < 85 && sum >= 75) {
$('.grade .message').text('Very Good (B+)');
} else if (sum < 75 && sum >= 65) {
$('.grade .message').text('Good (B)');
} else if (sum < 65 && sum >= 50) {
$('.grade .message').text('Pass (C)');
} else if (sum < 50 && sum >= 35) {
$('.grade .message').text('Weak (D)');
} else if (sum < 35 && sum >= 0) {
$('.grade .message').text('Fail (F)');
}
$('.locked').fadeOut('fast', function(){
$('.percentage').fadeIn('fast', function(){
$('.grade').fadeIn('fast').css('display', 'flow-root');
}).css('display', 'flow-root');
});
} else {
$('.error').fadeIn('fast').css('display', '-webkit-inline-box');
$('.percentage').fadeOut('fast', function(){
$('.grade').fadeOut('fast', function(){
$('.locked').fadeIn('fast');
});
});
}
});
});
Also see: Tab Triggers