Skip to content

Commit 848e6d0

Browse files
committed
Addng flipping card video
1 parent d4cad0f commit 848e6d0

File tree

2 files changed

+97
-15
lines changed

2 files changed

+97
-15
lines changed

index.html

+18-10
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,27 @@ <h2>What is this Site?</h2>
2323

2424
</section>
2525

26+
2627
<section>
27-
<h2>Upload Files</h2>
28+
<h2>Uploaded Files</h2>
2829
<div>
29-
30-
31-
<!-- Optional: some overlay text to describe the video -->
3230
<div class="content">
33-
<h3>Videos</h3>
34-
<p>Like this one can be stored in the decentralized IPFS</p>
35-
<video autoplay muted id="myVideo">
36-
<source src="https://ipfs.io/ipfs/QmVFkjFK1Q3ZFQ59qmjBhVrpA2nELn8NPNWhsms7wckCu8/" type="video/mp4">
37-
</video>
38-
<!-- Use a button to pause/play the video with JavaScript -->
31+
<div class="flip-card">
32+
<div class="flip-card-inner">
33+
<div class="flip-card-front">
34+
<video autoplay muted id="myVideo">
35+
<source src="https://ipfs.io/ipfs/QmVFkjFK1Q3ZFQ59qmjBhVrpA2nELn8NPNWhsms7wckCu8/" type="video/mp4">
36+
</video>
37+
38+
</div>
39+
<div class="flip-card-back">
40+
This is a video generated with AI: The photo of a person who does not exist with artificial
41+
voice and processed to move the mouth, according to a given (written) message
42+
</div>
43+
44+
</div>
45+
46+
</div>
3947
<button id="myBtn" onclick="onPause()">Play</button>
4048
<button id="myMute" onclick="onMute()">Mute</button>
4149
</div>

style.css

+79-5
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ blockquote {
8484
#myVideo {
8585
width: 100%;
8686
height: 100%;
87-
8887
right: 0;
8988
bottom: 0;
89+
border: #000;
90+
border-radius: 10px;
9091
}
9192

9293
/* Add some content at the bottom of the video/page */
@@ -100,33 +101,106 @@ blockquote {
100101

101102
/* Style the button used to pause/play the video */
102103
#myBtn {
103-
width: 200px;
104-
font-size: 18px;
104+
width: 148px;
105+
font-size: 10px;
105106
padding: 10px;
106107
border: none;
107108
background: #000;
108109
color: #fff;
109110
cursor: pointer;
111+
position: relative;
110112
}
111113

112114
#myBtn:hover {
113115
background: #ddd;
114116
color: black;
117+
115118
}
116119

117120
#myMute {
118-
width: 200px;
119-
font-size: 18px;
121+
width: 148px;
122+
font-size: 10px;
120123
padding: 10px;
121124
border: none;
122125
background: #000;
123126
color: #fff;
124127
cursor: pointer;
128+
position: relative;
125129
}
126130

127131
#myMute:hover {
128132
background: #ddd;
129133
color: black;
130134
}
131135

136+
.card {
137+
/* Add shadows to create the "card" effect */
138+
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
139+
transition: 0.3s;
140+
}
141+
142+
/* On mouse-over, add a deeper shadow */
143+
.card:hover {
144+
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
145+
}
146+
147+
/* Add some padding inside the card container */
148+
.container {
149+
padding: 2px 16px;
150+
}
151+
152+
/* The flip card container - set the width and height to whatever you want. We have added the border property to demonstrate that the flip itself goes out of the box on hover (remove perspective if you don't want the 3D effect */
153+
.flip-card {
154+
background-color: transparent;
155+
width: 300px;
156+
height: 200px;
157+
perspective: 1000px; /* Remove this if you don't want the 3D effect */
158+
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
159+
transition: 0.3s;
160+
border-radius: 5px;
161+
}
162+
163+
/* This container is needed to position the front and back side */
164+
.flip-card-inner {
165+
position: relative;
166+
width: 100%;
167+
height: 100%;
168+
text-align: center;
169+
transition: transform 0.8s;
170+
transform-style: preserve-3d;
171+
}
172+
173+
/* Do an horizontal flip when you move the mouse over the flip box container */
174+
.flip-card:hover .flip-card-inner {
175+
transform: rotateY(180deg);
176+
}
177+
178+
/* Position the front and back side */
179+
.flip-card-front, .flip-card-back {
180+
position: absolute;
181+
width: 100%;
182+
height: 100%;
183+
-webkit-backface-visibility: hidden; /* Safari */
184+
backface-visibility: hidden;
185+
}
186+
187+
/* Style the front side (fallback if image is missing) */
188+
.flip-card-front {
189+
background-color:none;
190+
align-items: center;
191+
color: black;
192+
}
193+
194+
/* Style the back side */
195+
.flip-card-back {
196+
background-color:#0a1aa8a8;
197+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
198+
font-size: small;
199+
color: gold;
200+
filter: grayscale(100%);
201+
align-items: stretch;
202+
transform: rotateY(180deg);
203+
}
204+
205+
132206
#VRButton{ bottom: auto !important; top: 10px; }

0 commit comments

Comments
 (0)