-
Notifications
You must be signed in to change notification settings - Fork 2
/
tasks_template.html
161 lines (143 loc) · 3.27 KB
/
tasks_template.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
.task {
border: 1px solid #ddd;
margin: 10px;
padding: 10px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.task_header_row {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #ddd;
padding-bottom: 8px;
margin-bottom: 8px;
}
.task__id {
font-weight: bold;
}
.task__title {
flex-grow: 1;
margin-left: 10px;
}
.task__description {
color: #555;
}
/* Responsive Styles */
@media (max-width: 768px) {
.task {
margin: 10px 0;
}
}
.task__priority {
display: inline-block;
padding: 2px 5px;
border-radius: 3px;
font-size: 12px;
margin-right: 10px;
}
.task__author {
font-size: 12px;
color: #555;
}
.header {
position: sticky;
top: 0;
left: 0;
right: 0;
height: 20px;
background-color: #fff;
border-bottom: 1px solid #ddd;
font-weight: bold;
padding: 10px;
}
.task__project {
background-color: #ddd;
padding: 2px 5px;
border-radius: 3px;
font-size: 12px;
margin-right: 5px;
}
.task.important {
border-color: red;
border-width: 4px;
animation: blinker 3s linear infinite;
/* horizontal stripe */
background: linear-gradient(
90deg,
#fff 0px,
#ff000044 50px,
#fff 100px
);
background-position-x: -100px;
}
.task img {
max-height: 100px;
}
.task.important img {
max-height: 50vh;
}
@keyframes blinker {
0% {
border-color: red;
background-position-x: 0px;
}
50% {
border-color: transparent;
background-position-x: 100vw;
}
100% {
border-color: red;
background-position-x: 0px;
}
}
</style>
</head>
<body>
<div class="header">
Tasks
</div>
{{range .}}
<div class="task {{if .IsImportant}}important{{end}}">
<div class="task_header_row">
<div class="task__priority" style="background: {{.PriorityColor }};">{{ .Priority }}</div>
<div class="task__id">#{{.ID}}</div>
<div class="task__title">{{.Title}}</div>
{{range.ProjectNames}}
<div class="task__project">{{.}}</div>
{{end}}
<div class="task__author">Autor: {{.AuthorName}}</div>
</div>
<div class="task__description">{{.RenderedDescription}}</div>
</div>
{{end}}
<script>
let lastActivity = new Date().getTime();
document.addEventListener('scroll', () => {
lastActivity = new Date().getTime();
console.log('scroll');
});
setInterval(() => {
const now = new Date().getTime();
if (now - lastActivity > 1000 * 20) {
// scroll to top
window.scrollTo(0, 0);
window.location.reload();
}
}, 1000 * 60);
</script>
</body>
</html>