Skip to content

Commit a85de21

Browse files
committed
css - image filter effact
1 parent 59877c5 commit a85de21

File tree

28 files changed

+1105
-0
lines changed

28 files changed

+1105
-0
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"liveServer.settings.port": 5502
3+
}
147 KB
Loading
137 KB
Loading
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
body {
2+
margin: 20px;
3+
}
4+
5+
img {
6+
max-width: 100%;
7+
}
8+
figure {
9+
border: 1px #cccccc solid;
10+
padding: 4px;
11+
margin: auto;
12+
}
13+
14+
figcaption {
15+
background-color: black;
16+
color: white;
17+
font-style: italic;
18+
padding: 2px;
19+
text-align: center;
20+
}
21+
22+
img
23+
24+
/* Brightness */
25+
.brightness0 {
26+
filter: brightness(0%);
27+
}
28+
.brightness60 {
29+
filter: brightness(60%);
30+
}
31+
.brightness100 {
32+
filter: brightness(100%);
33+
}
34+
.brightness150 {
35+
filter: brightness(150%);
36+
}
37+
38+
/* Contrast */
39+
.contrast0 {
40+
filter: contrast(0%);
41+
}
42+
.contrast60 {
43+
filter: contrast(60%);
44+
}
45+
.contrast100 {
46+
filter: contrast(100%);
47+
}
48+
.contrast150 {
49+
filter: contrast(150%);
50+
}
51+
52+
/* Grayscale */
53+
.grayscale0 {
54+
filter: grayscale(0%);
55+
}
56+
.grayscale60 {
57+
filter: grayscale(60%);
58+
}
59+
.grayscale100 {
60+
filter: grayscale(60%);
61+
}
62+
.grayscale150 {
63+
filter: grayscale(150%);
64+
}
65+
66+
/* Saturate */
67+
.saturate0 {
68+
filter: brightness(0%);
69+
}
70+
.saturate60 {
71+
filter: brightness(60%);
72+
}
73+
.saturate100 {
74+
filter: brightness(100%);
75+
}
76+
.saturate150 {
77+
filter: brightness(150%);
78+
}
79+
80+
/* Sepia */
81+
.sepia0 {
82+
filter: sepia(0%);
83+
}
84+
.sepia60 {
85+
filter: sepia(60%);
86+
}
87+
.sepia100 {
88+
filter: sepia(100%);
89+
}
90+
.sepia150 {
91+
filter: sepia(150%);
92+
}
93+
94+
/* hue-rotate(90deg) */
95+
.hue-rotate0 {
96+
filter: hue-rotate(0deg);
97+
}
98+
.hue-rotate60 {
99+
filter: hue-rotate(60deg);
100+
}
101+
.hue-rotate100 {
102+
filter: hue-rotate(100deg);
103+
}
104+
.hue-rotate150 {
105+
filter: hue-rotate(150deg);
106+
}
107+
108+
/* Invert */
109+
.invert0 {
110+
filter: sepia(0%);
111+
}
112+
.invert60 {
113+
filter: sepia(60%);
114+
}
115+
.invert100 {
116+
filter: sepia(100%);
117+
}
118+
.invert150 {
119+
filter: sepia(150%);
120+
}
121+
122+
/* Blur */
123+
.blur0 {
124+
filter: blur(0px);
125+
}
126+
.blur60 {
127+
filter: blur(1px);
128+
}
129+
.blur100 {
130+
filter: blur(0.5em);
131+
}
132+
.blur150 {
133+
filter: blur(1em);
134+
}
135+
136+
/* Opacity */
137+
.opacity0 {
138+
filter: opacity(0%);
139+
}
140+
.opacity30 {
141+
filter: opacity(30%);
142+
}
143+
.opacity80 {
144+
filter: opacity(80%);
145+
}
146+
.opacity100 {
147+
filter: opacity(100%);
148+
}
149+
150+
/* Url() */
151+
.greenish {
152+
filter: url("#greenish");
153+
}
154+
.bluish {
155+
filter: url("#bluish");
156+
}
157+
.redish {
158+
filter: url("#redish");
159+
}
160+
161+
/* Drop Shadow */
162+
.drop-shadow0 {
163+
width: 97%;
164+
}
165+
.drop-shadow1 {
166+
width: 97%;
167+
filter: drop-shadow(50px 50px 50px red);
168+
}
169+
.drop-shadow2 {
170+
width: 97%;
171+
filter: drop-shadow(5px 5px 5px green);
172+
}
173+
.drop-shadow3 {
174+
width: 97%;
175+
filter: drop-shadow(15px 15px 15px blue);
176+
}
177+
178+
/* Combining and Animating Filters */
179+
.hounted {
180+
animation: haunted 3s infinite;
181+
}
182+
@keyframes haunted {
183+
0% {
184+
filter: brightness(20%);
185+
}
186+
48% {
187+
filter: brightness(20%);
188+
}
189+
50% {
190+
filter: sepia(1) contrast(2) brightness(200%);
191+
}
192+
60% {
193+
filter: sepia(1) contrast(2) brightness(200%);
194+
}
195+
62% {
196+
filter: brightness(20%);
197+
}
198+
96% {
199+
filter: brightness(20%);
200+
}
201+
96% {
202+
filter: brightness(400%);
203+
}
204+
}
205+
206+
.iframe1 {
207+
filter: saturate(40);
208+
}
209+
210+
.iframe2 {
211+
filter: saturate(10);
212+
}

0 commit comments

Comments
 (0)