8000 starting challenge 27. · rohitkrai03/JavaScript30@420942d · GitHub
[go: up one dir, main page]

Skip to content

Commit 420942d

Browse files
committed
starting challenge 27.
1 parent a89ac30 commit 420942d

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed

27 - Click and Drag/index.html

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>

27 - 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)
0