JSDM

HTML

10
1
<div class="page-container">
2
  <div class="flex-container">
3
    <div class="country netherlands"><div>Netherlands</div></div>
4
    <div class="country belgium"><div>Belgium</div></div>
5
   <!-- <div class="country france"><div>France</div></div>
6
    <div class="country germany"><div>Germany</div></div>
7
    <div class="country england"><div>England</div></div>-->
8
  </div>
9
</div>
10
!

CSS

xxxxxxxxxx
87
 
1
@mixin bg($url, $pos: center)
2
  &:after
3
    background-image: url($url)
4
    background-position: $pos
5
6
div
7
  box-sizing: border-box
8
  
9
html, body, .page-container
10
  height: 100%
11
  overflow: hidden
12
  
13
.page-container
14
  transition: padding .2s ease-in
15
  padding: 80px
16
  &.opened
17
    padding: 0
18
    .flex-container
19
      .country:not(.active)
20
        opacity: 0
21
        flex: 0
22
        div
23
          opacity: 0
24
      .active:after
25
        filter: grayscale(0%) !important 
26
    
27
28
.flex-container
29
  display: flex
30
  height: 100%
31
  @media all and (max-width: 900px)
32
    flex-direction: column
33
    
34
.country
35
  position: relative
36
  flex-grow: 1
37
  flex: 1
38
  transition: .5s ease-in-out
39
  cursor: pointer
40
  font-family: 'Bree Serif', serif
41
    
42
  text-align: center
43
  color: #fff
44
  font-size: 22px
45
  text-shadow: 0 0 3px #000
46
  div
47
    position: absolute
48
    width: 100%
49
    z-index: 10
50
    top: 50%
51
    text-align: center
52
    transition: .1s
53
    transform: translateY(-50%)
54
    filter: none
55
  &:after
56
    content: " "
57
    position: absolute
58
    top: 0
59
    left: 0
60
    right: 0
61
    bottom: 0
62
    background-size: cover
63
    transition: .5s ease-in-out
64
    filter: grayscale(100%)
65
  &:hover
66
    flex-grow: 6
67
    &:after
68
      filter: grayscale(0%)
69
  @media all and (max-width: 900px)
70
    height: auto
71
    
72
.netherlands
73
  @include bg('http://cdn.jsdm.com/2/Netherlands.png')
74
75
.belgium
76
  @include bg('http://cdn.jsdm.com/2/belgium-307_3.jpg')
77
78
.france
79
  @include bg('http://cdn.jsdm.com/2/paris-france-contemporary-french-studies-studying-abroad-seine-30.jpg')
80
    
81
.germany
82
  @include bg('http://cdn.jsdm.com/2/neuschwanstein-castle-tour-germany-vacation.jpg')
83
    
84
.england
85
  @include bg('http://cdn.jsdm.com/2/interesting-facts-about-england-1024x640.jpg')
86
    
87
!
? ?
? ?
必须是有效的URL
+ 添加另一个资源

JS

4
 
1
$(".country").click(function() {
2
  $(this).toggleClass("active");
3
  $(".page-container").toggleClass("opened");
4
});
!
必须是有效的URL
+ 添加另一个资源
Close

文件管理 点击文件查看URL

图片

  1. 暂无文件

CSS

  1. 暂无文件

JavaScript

  1. 暂无文件

其他

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