-
Notifications
You must be signed in to change notification settings - Fork 1
/
Masked Image Flag.html
167 lines (155 loc) · 8.2 KB
/
Masked Image Flag.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
162
163
164
165
166
167
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Animate Flag</title>
<style>
.wipes {
opacity: 0;
}
svg {
height: 50vh;
}
svg a {
cursor: pointer;
}
#flag:hover .water {
animation: 1s fade;
opacity: 1;
}
#flag .water {
transition: 0.25s ease-out;
opacity: 0;
}
#flag:hover image.waterBottomRight:nth-child(odd) {
animation: 0.5s moveWaterToTopLeft linear infinite alternate;
}
#flag:hover image.waterTopLeft:nth-child(odd) {
animation: 0.5s moveWaterToBottomRight linear infinite alternate;
}
@keyframes moveWaterToTopLeft {
to {
transform: translate3d(-10px, -10px, 0);
}
}
@keyframes moveWaterToBottomRight {
to {
transform: translate3d(10px, 10px, 0);
}
}
#flag:hover .star + g image {
animation: 1s;
animation-name: moveStar, fade;
opacity: 1;
}
#flag .star + g image {
transition: 0.25s ease-out;
opacity: 0;
}
@keyframes moveStar {
from {
transform: scale3d(0.85, 0.85, 0.85) translate3d(130px, 82px, 0px);
}
}
@keyframes fade {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
</style>
</head>
<body>
<figure>
<svg id="flag" width="100%" height="100%" viewBox="0 0 720 480" version="1.1" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
<defs>
<clipPath id="topFlagBar" >
<rect x="0" y="80" width="720" height="80"></rect>
</clipPath>
<clipPath id="bottomFlagBar" >
<rect x="0" y="320" width="720" height="80"></rect>
</clipPath>
<clipPath id="firstStar">
<path d="M150,180l11,41l41,-11l-30,30l30,30l-41,-11l-11,41l-11,-41l-41,11l30,-30l-30,-30l41,11l11,-41Z"></path>
</clipPath>
<clipPath id="secondStar">
<path d="M290,180l11,41l41,-11l-30,30l30,30l-41,-11l-11,41l-11,-41l-41,11l30,-30l-30,-30l41,11l11,-41Z"></path>
</clipPath>
<clipPath id="thirdStar">
<path d="M430,180l11,41l41,-11l-30,30l30,30l-41,-11l-11,41l-11,-41l-41,11l30,-30l-30,-30l41,11l11,-41Z"></path>
</clipPath>
<clipPath id="fourthStar">
<path d="M570,180l11,41l41,-11l-30,30l30,30l-41,-11l-11,41l-11,-41l-41,11l30,-30l-30,-30l41,11l11,-41Z"></path>
</clipPath>
</defs>
<path d="M0,0l720,0l0,480l-720,0l0,-480Z" style="fill:#fff;fill-rule:nonzero;" aria-hidden="true"></path>
<rect x="0" y="80" width="720" height="80" style="fill:#b3ddf2;" aria-hidden="true"></rect>
<g class="water" aria-hidden="true">
<g clip-path="url(#topFlagBar)">
<image href="image/Chicago River.png" xlink:href="image/Chicago River.png" width="1350" height="247" x="-315" y="-3.5"></image>
</g>
<g clip-path="url(#topFlagBar)">
<image class="waterTopLeft" href="image/Chicago River.png" xlink:href="image/Chicago River.png" width="1350" height="247" x="-320" y="-8.5" opacity="0.5"></image>
</g>
<g clip-path="url(#topFlagBar)">
<image class="waterBottomRight" href="image/Chicago River.png" xlink:href="image/Chicago River.png" width="1350" height="247" x="-310" y="2.5" opacity="0.5"></image>
</g>
</g>
<rect class="wipes" x="0" y="75" width="720" height="90" style="fill:#FFF;" aria-hidden="true"></rect>
<rect x="0" y="320" width="720" height="80" style="fill:#b3ddf2;" aria-hidden="true"></rect>
<g class="water" aria-hidden="true">
<g clip-path="url(#bottomFlagBar)">
<image class="water" href="image/Chicago River.png" xlink:href="image/Chicago River.png" width="1350" height="247" x="-315" y="236.5"></image>
</g>
<g clip-path="url(#bottomFlagBar)">
<image class="waterBottomRight" href="image/Chicago River.png" xlink:href="image/Chicago River.png" width="1350" height="247" x="-310" y="231.5" opacity="0.5"></image>
</g>
<g clip-path="url(#bottomFlagBar)">
<image class="waterTopLeft" href="image/Chicago River.png" xlink:href="image/Chicago River.png" width="1350" height="247" x="-320" y="241.5" opacity="0.5"></image>
</g>
</g>
<rect class="wipes" x="0" y="315" width="720" height="90" style="fill:#FFF;" aria-hidden="true"></rect>
<a href="https://en.wikipedia.org/wiki/Fort_Dearborn" xlink:title="Fort Dearborn" title="Fort Dearborn">
<path class="star" d="M150,180l11,41l41,-11l-30,30l30,30l-41,-11l-11,41l-11,-41l-41,11l30,-30l-30,-30l41,11l11,-41Z" style="fill:#f00;fill-rule:nonzero;"></path>
<g clip-path="url(#firstStar)">
<image href="image/Fort_Dearborn_1831_Kinzie.jpg" xlink:href="image/Fort_Dearborn_1831_Kinzie.jpg" width="400" height="233" x="-20" y="130"></image>
</g>
</a>
<a href="https://en.wikipedia.org/wiki/Great_Chicago_Fire" xlink:title="Great Chicago Fire" title="Great Chicago Fire">
<path class="star" d="M290,180l11,41l41,-11l-30,30l30,30l-41,-11l-11,41l-11,-41l-41,11l30,-30l-30,-30l41,11l11,-41Z" style="fill:#f00;fill-rule:nonzero;"></path>
<g clip-path="url(#secondStar)">
<image href="image/Chicago_in_Flames_by_Currier_&_Ives,_1871.jpg" xlink:href="image/Chicago_in_Flames_by_Currier_&_Ives,_1871.jpg" width="400" height="269" x="-6" y="130"></image>
</g>
</a>
<a href="https://en.wikipedia.org/wiki/World%27s_Columbian_Exposition" xlink:title="World's Columbian Exposition" title="World's Columbian Exposition">
<path class="star" d="M430,180l11,41l41,-11l-30,30l30,30l-41,-11l-11,41l-11,-41l-41,11l30,-30l-30,-30l41,11l11,-41Z" style="fill:#f00;fill-rule:nonzero;"></path>
<g clip-path="url(#thirdStar)">
<image href="image/Brooklyn_Museum_-_Chicago_World's_Fair_-_Thomas_Moran_-_overall.jpg" xlink:href="image/Brooklyn_Museum_-_Chicago_World's_Fair_-_Thomas_Moran_-_overall.jpg" width="400" height="535" x="240" y="-60"></image>
</g>
</a>
<a href="https://en.wikipedia.org/wiki/Century_of_Progress" xlink:title="Century of Progresss Exposition" title="Century of Progresss Exposition">
<path class="star" d="M570,180l11,41l41,-11l-30,30l30,30l-41,-11l-11,41l-11,-41l-41,11l30,-30l-30,-30l41,11l11,-41Z" style="fill:#f00;fill-rule:nonzero;"></path>
<g clip-path="url(#fourthStar)">
<image href="image/Chicago_world's_fair,_a_century_of_progress,_expo_poster.jpg" xlink:href="image/Chicago_world's_fair,_a_century_of_progress,_expo_poster.jpg" width="301" height="449" x="420" y="165"></image>
</g>
</a>
</svg>
<figcaption>Figure 1. Flag of Chicago, Illinois (<a
href="https://commons.wikimedia.org/wiki/File:Flag_of_Chicago,_Illinois.svg">Source: Wikipedia</a>). Blue
stipes embedded with photo of Chicago River (<a
href="https://commons.wikimedia.org/wiki/File:20090524_Buildings_along_Chicago_River_line_the_south_border_of_the_Near_North_Side_and_Streeterville_and_the_north_border_of_Chicago_Loop,_Lakeshore_East_and_Illinois_Center.jpg">Source:
Wikipedia</a>). Stars embedded with illustrations of Fort Dearborn (<a
href="https://en.wikipedia.org/wiki/File:Fort_Dearborn_1831_Kinzie.jpg">Source: Wikipedia</a>), the
Great Chicago Fire (<a
href="https://en.wikipedia.org/wiki/File:Chicago_in_Flames_by_Currier_%26_Ives,_1871_(cropped).jpg">Source:
Wikipedia</a>), World's Columbian Exposition (<a
href="https://en.wikipedia.org/wiki/File:Brooklyn_Museum_-_Chicago_World%27s_Fair_-_Thomas_Moran_-_overall.jpg">Source:
Wikipedia</a>), Century of Progress Exposition (<a
href="https://en.wikipedia.org/wiki/File:Chicago_world%27s_fair,_a_century_of_progress,_expo_poster,_1933,_2.jpg">Source:
Wikipedia</a>).
</figcaption>
</figure>
</body>
</html>