-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
167 lines (158 loc) · 6.76 KB
/
index.html
File metadata and controls
167 lines (158 loc) · 6.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Таймер для перерыва</title>
<style>
* {
box-sizing: border-box;
}
html {
height: 100%;
}
body {
height: 100%;
background-color: #292929;
color: #f0f0f0;
font-family: PT Sans, sans-serif;
font-size: 40px;
margin: 0;
padding: 1em;
overflow: hidden;
}
.timer-wrapper {
display: flex;
flex-wrap: wrap;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
overflow: hidden;
text-align: center;
}
.timer-inner {
padding: 2em;
background-color: #292929;
}
.timer {
width: 100%;
font-size: 60px;
line-height: 1em;
}
.logo {
position: absolute;
z-index: 2;
bottom: 20px;
right: 20px;
padding: 0.5em;
background-color: #292929;
}
.logo svg {
display: block;
}
.time-over {
background: linear-gradient(to left top, rgba(0,0,0, 0) 48.9%, #000 51%, #000 78%, rgba(0,0,0, 0) 80%), linear-gradient(to left top, #000 28%, rgba(0,0,0, 0) 30%);
background-size: 2em 2em;
background-color: #ff0;
}
.time-over .timer {
animation: tada 2s infinite linear;
}
.cat {
display: none;
position: absolute;
z-index: 1;
bottom: 0;
right: -177px;
background: url(img/cat.gif) center no-repeat;
width: 177px;
height: 165px;
}
.time-over .cat {
display: block;
animation: cat 10s 3s infinite linear;
}
@keyframes tada {
from {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
5%, 10% {
-webkit-transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg);
transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg);
}
15%, 25%, 35%, 45% {
-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
}
20%, 30%, 40% {
-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
}
50%, 100% {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@keyframes cat {
0 {
transform: translate3d(0,0,0);
}
50%, 100% {
transform: translate3d(calc(-100vw - 200px),0,0);
}
}
</style>
</head>
<body id="body">
<div class="timer-wrapper">
<div class="timer-inner">
<noscript>Эта страница требует JavaScript для полноценной работы. Вы выключили Javascript. Вы нас пугаете.</noscript>
<div class="text">перерыв</div>
<div id="timer" class="timer">10:00</div>
</div>
</div>
<span class="cat"></span>
<div class="logo"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 316.824 48.498" width="100"><g fill="#f0f0f0"><path d="M11.94 14.809c0 7.034-2.545 8.978-4.073 9.44 1.528.462 4.073 2.545 4.073 9.626 0 6.664 1.434 8.283 4.535 9.487l-3.378 5.136c-3.841-1.296-7.96-4.119-7.96-11.986 0-7.404-2.407-9.255-5.137-9.255v-5.924c2.731 0 5.137-1.897 5.137-9.302 0-7.868 4.119-10.737 7.96-12.032l3.378 5.276c-2.962 1.111-4.535 2.823-4.535 9.534zM316.824 27.211c-2.731 0-5.137 1.897-5.137 9.256 0 7.867-4.119 10.736-7.96 12.032l-3.331-5.276c2.915-1.156 4.488-2.822 4.488-9.486 0-7.035 2.546-9.025 4.072-9.487-1.526-.462-4.072-2.499-4.072-9.58 0-6.663-1.434-8.283-4.488-9.486l3.331-5.184c3.842 1.296 7.96 4.165 7.96 12.032 0 7.404 2.406 9.302 5.137 9.302v5.877z"></path></g><path d="M50.76 8.167v6.525h-16.613v5.784h11.893v6.387h-11.893v7.034h16.613v6.525h-24.064v-32.255h24.064zM55.667 40.422v-32.255h18.003c6.616 0 8.839 4.721 8.839 11.338 0 5.831-2.776 10.875-8.793 10.875h-10.598v10.042h-7.451zm15.41-16.197c1.943 0 3.24-1.342 3.24-4.721 0-3.517-1.112-4.952-3.147-4.952h-8.052v9.672h7.959zM94.772 8.167v32.255h-7.451v-32.255h7.451zM116.106 7.38c3.008 0 6.897.462 9.349 1.157l-1.436 6.571c-1.573-.556-4.304-.88-6.339-.88-6.479 0-8.885.926-8.885 9.858 0 8.885 2.406 10.088 8.885 10.088 2.035 0 4.767-.371 6.339-.879l1.436 6.71c-2.499.648-6.341 1.064-9.349 1.064-10.366 0-15.271-3.933-15.271-17.076-.001-13.188 4.905-16.613 15.271-16.613zM162.57 15.293c-1.945-.555-5.276-1.064-8.84-1.064-4.812 0-6.201.926-6.201 3.147 0 2.036.925 2.776 6.525 3.378 7.359.833 10.645 3.656 10.645 9.811 0 7.96-4.257 10.505-14.3 10.505-3.888 0-7.868-.602-10.46-1.527l1.528-6.387c2.082.556 5.322 1.064 8.839 1.064 4.813 0 6.341-.694 6.341-3.146 0-2.037-.88-3.008-6.942-3.656-6.895-.74-10.136-3.008-10.136-8.978 0-8.006 4.628-11.06 14.208-11.06 3.887 0 7.775.601 10.319 1.527l-1.526 6.386z" fill="#f0f0f0"></path><path d="M177.704 40.422h-7.451v-32.255h7.451v32.255zm12.171 0c-5.832-10.69-10.413-16.29-12.126-17.03 1.76-1.435 6.247-6.895 11.338-15.225h8.885c-5.368 8.33-9.486 13.466-10.921 14.809 1.387 1.064 6.015 6.757 11.8 17.447h-8.976z" fill="#f0f0f0"></path><path d="M209.359 8.167v32.255h-7.451v-32.255h7.451zM224.399 8.167v25.684h14.53v6.571h-21.981v-32.255h7.451zM249.992 8.167v25.684h14.53v6.571h-21.981v-32.255h7.451zM289.236 15.293c-1.945-.555-5.276-1.064-8.84-1.064-4.812 0-6.201.926-6.201 3.147 0 2.036.925 2.776 6.525 3.378 7.359.833 10.645 3.656 10.645 9.811 0 7.96-4.257 10.505-14.3 10.505-3.888 0-7.868-.602-10.46-1.527l1.528-6.387c2.082.556 5.322 1.064 8.839 1.064 4.813 0 6.341-.694 6.341-3.146 0-2.037-.88-3.008-6.942-3.656-6.895-.74-10.136-3.008-10.136-8.978 0-8.006 4.628-11.06 14.208-11.06 3.887 0 7.775.601 10.319 1.527l-1.526 6.386z" fill="#f0f0f0"></path></svg></div>
<script type="text/javascript">
var timerId;
function timer(seconds_in = 600) {
var second_warning = 5;
timerId = setInterval(timerGo, 1000);
dispalyTime(formatTime(seconds_in));
function timerGo() {
dispalyTime(formatTime(seconds_in));
seconds_in--;
if (seconds_in < 0) {
clearInterval(timerId);
document.getElementById('body').classList.add('time-over');
document.getElementById('timer').innerHTML = 'окончен';
}
}
}
function formatTime(seconds_in) {
var minutes = Math.floor(seconds_in / 60);
var seconds = Math.floor(seconds_in - minutes * 60);
var minutes_out = (minutes < 10) ? '0' + minutes : minutes;
var seconds_out = (seconds < 10) ? '0' + seconds : seconds;
return [minutes_out, seconds_out];
}
function dispalyTime(formatTime) {
document.getElementById('timer').innerHTML = formatTime.join(':');
}
function initTimer() {
var seconds = window.location.hash.replace('#', '') * 60 || 600;
timer(seconds);
}
window.onload = function() {
initTimer();
}
window.onhashchange = function() {
clearInterval(timerId);
initTimer();
}
</script>
</body>
</html>