Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <html>
<head>
  <meta charset="UTF-8">
  <title>ITL-Time</title>
      <link rel="stylesheet" href="css/style.css">
</head>
<body>
  <html>
<head>
</head>
<body>
<h1 class="upText">IT-Лицей <font id="kfu">КФУ</font> - <font id="kabinet">Каб. 212</font></h1>
<h1 class="time"><div id="timedisplay"></div></h1>
<h1 class="downText">Урок: <div id="urok"></div></h1>
</body>    
</html>
    <script src="js/index.js"></script>
</body>
</html>

              
            
!

CSS

              
                body{
margin-top: 200px;
background-color: black;
color: white;
}
.time{
font-size: 100pt;
text-align: center;
}
#kabinet {
color: #aefd6c;
}
#kfu{
color: #00b8d9;
}
.upText{
font-size: 48pt;
}
.downText{
color: yellow;
text-align: right;
font-size:48pt;
}
#urok{
display: inline;
}
              
            
!

JS

              
                function isInRange(hourstart, minstart, hourend, minend) {
    var date = new Date();
    var hoursnow = date.getHours();
    var minutesnow = date.getMinutes();
    if(hourstart <= hoursnow && minstart <= minutesnow && hoursnow <= hourend && minutesnow <= minend) return true;
    else return false;
}
function getDate()
{
    var date = new Date();
    var hours = date.getHours();
    var minutes = date.getMinutes();
    var seconds = date.getSeconds();
    var day = date.getDay();
    if(seconds < 10)
    {
        seconds = '0' + seconds;
    }
    if(hours < 10)
    {
        hours = '0' + hours;
    }
    if(minutes < 10)
    {
        minutes = '0' + minutes;
    }
    document.getElementById('timedisplay').innerHTML = hours + ':' + minutes + ':' + seconds;
    
    switch(day){
        case 0:
            document.getElementById('urok').innerHTML = 'Выходной день';
        break;
        case 1:
            
            //Основные уроки
            
            if (isInRange(7, 0, 8, 39))
                document.getElementById('urok').innerHTML = 'Алгебра';
            if (isInRange(8, 40, 9, 30))
                document.getElementById('urok').innerHTML = 'Геометрия';
            else if (hours >= 9 && minutes >= 30 && hours <= 10 && minutes < 20)
                document.getElementById('urok').innerHTML = 'География';
            else if (hours >= 10 && minutes >= 20 && hours <= 11 && minutes < 30)
                document.getElementById('urok').innerHTML = 'Татарский язык';
            else if (hours >= 11 && minutes >= 30 && hours <= 12 && minutes < 20)
                document.getElementById('urok').innerHTML = 'ОДНК';
            else if (hours >= 12 && minutes >= 20 && hours <= 13 && minutes < 10)
                document.getElementById('urok').innerHTML = 'Физика';
            
            //Допы
            
            if (hours >= 13 && minutes >= 10 && hours <= 15 && minutes < 20)
                document.getElementById('urok').innerHTML = 'Информатика';
            else if (hours >= 15 && minutes >= 20 && hours <= 16 && minutes < 10)
                document.getElementById('urok').innerHTML = 'Информатика';
    
            //Воспитательное время
    
            if (hours >= 16 && minutes >= 10 && hours <= 16 && minutes < 40)
                document.getElementById('urok').innerHTML = 'Полдник';
            else if (hours >= 16 && minutes >= 40 && hours <= 18 && minutes < 10)
                document.getElementById('urok').innerHTML = 'Кружки';
            else if (hours >= 18 && minutes >= 10 && hours <= 18 && minutes < 30)
                document.getElementById('urok').innerHTML = 'Ужин';
            else if (hours >= 18 && minutes >= 30 && hours <= 21 && minutes < 30)
                document.getElementById('urok').innerHTML = 'Воспитательное время(выполнение д/з)';
            else if (hours >= 21 && minutes >= 30 && hours <= 22 && minutes < 0)
                document.getElementById('urok').innerHTML = 'Conversation class';
            else if (hours >= 22 && minutes >= 0 && hours <= 22 && minutes < 30)
                document.getElementById('urok').innerHTML = 'Подготовка ко сну';
            else if (hours >= 22 && minutes >= 30 && hours <= 0 && minutes < 0)
                document.getElementById('urok').innerHTML = 'Сон';
            
        break;
        default:
            document.getElementById('urok').innerHTML = '-';
        break;
    }
    
}
setInterval(getDate, 0);
              
            
!
999px

Console