generated from oh-kay-blanket/react-template
/
perspective.html
117 lines (104 loc) · 2.1 KB
/
perspective.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@800&display=swap" rel="stylesheet">
<!-- <script src="../movingShadow.js"></script> -->
<script src="https://unpkg.com/moving-shadow"></script>
<title>Perspective | Moving Shadow</title>
</head>
<body>
<div class="container">
<h1>vinyl bar</h1>
<div class="in-out">
<div class="button">
<h4>out</h4>
</div>
<div class="button">
<h4>in</h4>
</div>
</div>
</div>
</body>
</html>
<style>
html, body {
margin: 0;
overflow-x: hidden;
overflow-y: hidden;
height: 100vh;
font-family: 'Montserrat', sans-serif;
}
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
background-color: #b89714;
color: #e6e1cb;
font-size: 4rem;
}
@media (max-width: 600px) {
.container {
font-size: 2rem;
}
}
h1, h4 {
margin: 10px;
text-align: center;
max-width: 80%;
}
h1 {
margin-bottom: 20vh;
}
.in-out {
display: flex;
justify-content: space-around;
align-items: center;
width: 80%;
}
.button {
padding: 20px;
border-radius: 25px;
background-color: #e6e1cb;
/* transition: 0.35s; */
}
.button:active {
box-shadow: none;
/* transition: 0.35s; */
}
.button h4 {
color: #b89714;
opacity: 1;
transition: color 0.35s;
}
.button:hover h4 {
color: #665200;
transition: color 0.35s;
cursor: pointer;
}
</style>
<script>
const fixedColor = "#665200";
const fixedColor2 = "#222";
const settings = [
{
selector: "h1", // targets class or id
angle: 80,
shadowType: "perspective",
color: fixedColor, // shadow-color
color2: `${fixedColor}22`, // shadow-color
},
{
selector: ".button", // targets class or id
shadowType: "perspective",
angle: 80,
color: fixedColor, // shadow-color
altColor: `${fixedColor}22`, // shadow-color
},
]
movingShadow(settings);
</script>