Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ab8e906

Browse files
add task18 and update the answer of task 17
1 parent 71a5fc5 commit ab8e906

File tree

3 files changed

+149
-0
lines changed

3 files changed

+149
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Video Speed Scrubber</title>
6+
<link rel="stylesheet" href="style.css">
7+
</head>
8+
<body>
9+
10+
<div class="wrapper">
11+
<video class="flex" width="765" height="430" src="https://s3.cn-north-1.amazonaws.com.cn/tws-courses-resource/Linux%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%9F%BA%E7%A1%80.mp4" loop controls></video>
12+
<div class="speed">
13+
<div class="speed-bar">×ばつ</div>
14+
</div>
15+
</div>
16+
17+
<script>
18+
const speed = document.querySelector('.speed');
19+
const bar = speed.querySelector('.speed-bar');
20+
const video = document.querySelector('.flex');
21+
22+
function handleMove(e) {
23+
const y = e.pageY - this.offsetTop;
24+
const percent = y / this.offsetHeight;
25+
const min = 0.4;
26+
const max = 4;
27+
const height = Math.round(percent * 100) + '%';
28+
const playbackRate = percent * (max - min) + min;
29+
bar.style.height = height;
30+
bar.textContent = playbackRate.toFixed(2) + ×ばつ';
31+
video.playbackRate = playbackRate;
32+
}
33+
34+
speed.addEventListener('mousemove', handleMove);
35+
36+
</script>
37+
</body>
38+
</html>

‎18 - Click and Drag/index-START.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Click and Drag</title>
6+
<link rel="stylesheet" href="style.css">
7+
</head>
8+
<body>
9+
<div class="items">
10+
<div class="item item1">01</div>
11+
<div class="item item2">02</div>
12+
<div class="item item3">03</div>
13+
<div class="item item4">04</div>
14+
<div class="item item5">05</div>
15+
<div class="item item6">06</div>
16+
<div class="item item7">07</div>
17+
<div class="item item8">08</div>
18+
<div class="item item9">09</div>
19+
<div class="item item10">10</div>
20+
<div class="item item11">11</div>
21+
<div class="item item12">12</div>
22+
<div class="item item13">13</div>
23+
<div class="item item14">14</div>
24+
<div class="item item15">15</div>
25+
<div class="item item16">16</div>
26+
<div class="item item17">17</div>
27+
<div class="item item18">18</div>
28+
<div class="item item19">19</div>
29+
<div class="item item20">20</div>
30+
<div class="item item21">21</div>
31+
<div class="item item22">22</div>
32+
<div class="item item23">23</div>
33+
<div class="item item24">24</div>
34+
<div class="item item25">25</div>
35+
</div>
36+
37+
<script>
38+
</script>
39+
40+
</body>
41+
</html>

‎18 - Click and Drag/style.css

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
html {
2+
box-sizing: border-box;
3+
background: url('https://source.unsplash.com/NFs6dRTBgaM/2000x2000') fixed;
4+
background-size: cover;
5+
}
6+
7+
*, *:before, *:after {
8+
box-sizing: inherit;
9+
}
10+
11+
body {
12+
min-height: 100vh;
13+
display: flex;
14+
justify-content: center;
15+
align-items: center;
16+
font-family: sans-serif;
17+
font-size: 20px;
18+
margin: 0;
19+
}
20+
21+
.items {
22+
height:800px;
23+
padding: 100px;
24+
width:100%;
25+
border:1px solid white;
26+
overflow-x: scroll;
27+
overflow-y: hidden;
28+
white-space: nowrap;
29+
user-select: none;
30+
cursor: pointer;
31+
transition: all 0.2s;
32+
transform: scale(0.98);
33+
will-change: transform;
34+
position: relative;
35+
background: rgba(255,255,255,0.1);
36+
font-size: 0;
37+
perspective: 500px;
38+
}
39+
40+
.items.active {
41+
background: rgba(255,255,255,0.3);
42+
cursor: grabbing;
43+
cursor: -webkit-grabbing;
44+
transform: scale(1);
45+
}
46+
47+
.item {
48+
width:200px;
49+
height: calc(100% - 40px);
50+
display: inline-flex;
51+
align-items: center;
52+
justify-content: center;
53+
font-size: 80px;
54+
font-weight: 100;
55+
color:rgba(0,0,0,0.15);
56+
box-shadow: inset 0 0 0 10px rgba(0,0,0,0.15);
57+
}
58+
59+
.item:nth-child(9n+1) { background: dodgerblue;}
60+
.item:nth-child(9n+2) { background: goldenrod;}
61+
.item:nth-child(9n+3) { background: paleturquoise;}
62+
.item:nth-child(9n+4) { background: gold;}
63+
.item:nth-child(9n+5) { background: cadetblue;}
64+
.item:nth-child(9n+6) { background: tomato;}
65+
.item:nth-child(9n+7) { background: lightcoral;}
66+
.item:nth-child(9n+8) { background: darkslateblue;}
67+
.item:nth-child(9n+9) { background: rebeccapurple;}
68+
69+
.item:nth-child(even) { transform: scaleX(1.31) rotateY(40deg); }
70+
.item:nth-child(odd) { transform: scaleX(1.31) rotateY(-40deg); }

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /