JSDM

HTML

 
1
<header>
2
  <label for="rem-size">root font size:</label>
3
  <input id="rem-size" type="number" min="10" max="300" value="100"/>
4
</header>
5
6
7
<div class="hexagon four rounded"></div>
8
!

CSS

xxxxxxxxxx
64
 
1
*, *::before, *::after {
2
  margin: 0;
3
  padding: 0;
4
  box-sizing: border-box;
5
}
6
body {
7
  color: white;
8
  background-color: hsl(0, 0%, 12%);
9
  padding: 20px;
10
}
11
header {
12
  font-size: 16px;
13
  padding: 5px;
14
}
15
.hexagon {
16
  position: relative;
17
  display: inline-block;
18
  margin: 0 .5rem;
19
  width: 1rem;
20
  height: calc(1rem * 1.732);
21
  background-color: hsl(0, 75%, 50%);
22
}
23
.hexagon::before {
24
  width: inherit;
25
  height: inherit;
26
  background-color: inherit;
27
  content: "";
28
  position: absolute;
29
  left: 0;
30
  transform: rotate(-60deg);
31
}
32
.hexagon::after {
33
  width: inherit;
34
  height: inherit;
35
  background-color: inherit;
36
  content: "";
37
  position: absolute;
38
  left: 0;
39
  transform: rotate(60deg);
40
}
41
42
43
.four {
44
  background-color: hsl(180, 75%, 50%);
45
  width: 4rem;
46
  height: calc(4rem * 1.732);
47
  margin: 0 2rem;
48
}
49
50
.rounded, .rounded::before, .rounded::after {
51
  border-radius: .75rem/.25rem;
52
}
53
54
@keyframes selfRotate{
55
  0%{
56
    transform: rotate(0)
57
  }
58
  50%{
59
    transform: rotate(180deg)
60
  }
61
  100{
62
    transform:rotate(360deg)
63
  }
64
}
!
? ?
? ?
必须是有效的URL
+ 添加另一个资源

JS

xxxxxxxxxx
3
 
1
$('#rem-size').on("input", function() {
2
  $('html').css({'font-size': $('#rem-size').val() + 'px'});
3
});
!
必须是有效的URL
+ 添加另一个资源
Close

文件管理 点击文件查看URL

图片

  1. 暂无文件

CSS

  1. 暂无文件

JavaScript

  1. 暂无文件

其他

  1. 暂无文件
拖动文件到上面的区域或者:
加载中 ..................