diff --git a/100_projects/36-create-simple-clock/css.css b/100_projects/36-create-simple-clock/css.css new file mode 100644 index 0000000..c682b0a --- /dev/null +++ b/100_projects/36-create-simple-clock/css.css @@ -0,0 +1,41 @@ +*{ + box-sizing: border-box; + margin: 0; + padding: 0; +} +body{ + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + background-image: url(night.jpg); + background-repeat: no-repeat; + background-size: cover; + background-position: center; +} +#clock{ + display: flex; + align-items: center; + justify-content: center; + font-size:51px; + padding: 10px; + color: #fff; + width: 270px; + height: 150px; + background: rgba(255, 255, 255, .1); + border: 1px solid rgba(255, 255, 255, .1); + backdrop-filter: blur(5px); + box-shadow: + 5px 5px 2px rgba(255, 255, 255, .1), + -5px -5px 2px rgba(255, 255, 255, .1); + border-radius: 10px; + animation: up-down 7s linear infinite; +} +@keyframes up-down{ + 0%, 100%{ + transform: translateY(0) scale(1); + } + 50%{ + transform: translateY(-50px) scale(1.3); + } +} \ No newline at end of file diff --git a/100_projects/36-create-simple-clock/index.html b/100_projects/36-create-simple-clock/index.html new file mode 100644 index 0000000..836992d --- /dev/null +++ b/100_projects/36-create-simple-clock/index.html @@ -0,0 +1,15 @@ + + + + + + + Document + + + +
+ + + + diff --git a/100_projects/36-create-simple-clock/main.js b/100_projects/36-create-simple-clock/main.js new file mode 100644 index 0000000..6fee101 --- /dev/null +++ b/100_projects/36-create-simple-clock/main.js @@ -0,0 +1,23 @@ +function showTime() { + 'use strict'; + + var now = new Date(), + hours = now.getHours(), + minutes = now.getMinutes(), + seconds = now.getSeconds(); + + if (hours < 10){ + hours = '0' + hours; + } + if (minutes < 10){ + minutes = '0' + minutes; + } + if (seconds < 10){ + seconds = '0' + seconds; + } + document.getElementById('clock').textContent = hours + ':' + minutes + ':' + seconds; +}; +window.onload = function(){ + 'use strict'; + setInterval(showTime, 500); +}; \ No newline at end of file diff --git a/100_projects/36-create-simple-clock/night.jpg b/100_projects/36-create-simple-clock/night.jpg new file mode 100644 index 0000000..ad66632 Binary files /dev/null and b/100_projects/36-create-simple-clock/night.jpg differ