1+ /* Set the colour and the position of the background and the elements */
2+ body {
3+ display : flex;
4+ justify-content : center;
5+ align-items : center;
6+ height : 100vh ;
7+ background-color : # d64e39 ;
8+ }
9+
10+ .container {
11+ position : relative;
12+ }
13+ .valentines {
14+ position : relative;
15+ top : 50px ;
16+ cursor : pointer;
17+ animation : up 3s linear infinite;
18+ }
19+
20+ /* Style the envelope and the card */
21+ .envelope {
22+ position : relative;
23+ width : 300px ;
24+ height : 200px ;
25+ background-color : # f08080 ;
26+ }
27+
28+ .envelope : before {
29+ background-color : # f08080 ;
30+ content : "" ;
31+ position : absolute;
32+ width : 212px ;
33+ height : 212px ;
34+ transform : rotate (45deg );
35+ top : -105px ;
36+ left : 44px ;
37+ border-radius : 30px 0 0 ;
38+ }
39+
40+ .card {
41+ position : absolute;
42+ background-color : # eae2b7 ;
43+ width : 270px ;
44+ height : 170px ;
45+ top : 5px ;
46+ left : 15px ;
47+ box-shadow : -5px -5px 100px rgba (0 , 0 , 0 , 0.4 );
48+ }
49+
50+ .card : before {
51+ content : "" ;
52+ position : absolute;
53+ border : 3px solid # 003049 ;
54+ border-style : dotted;
55+ width : 240px ;
56+ height : 140px ;
57+ left : 12px ;
58+ top : 12px ;
59+ }
60+
61+ .text {
62+ position : absolute;
63+ font-family : 'Brush Script MT' , cursive;
64+ font-size : 28px ;
65+ text-align : center;
66+ line-height : 25px ;
67+ top : 19px ;
68+ left : 85px ;
69+ color : # 003049 ;
70+ }
71+
72+ .heart {
73+ background-color : # 930505 ;
74+ display : inline-block;
75+ height : 30px ;
76+ margin : 0 10px ;
77+ position : relative;
78+ top : 110px ;
79+ left : 105px ;
80+ transform : rotate (-45deg );
81+ width : 30px ;
82+ }
83+
84+ .heart : before ,
85+ .heart : after {
86+ content : "" ;
87+ background-color : # e83e3e ;
88+ border-radius : 50% ;
89+ height : 30px ;
90+ position : absolute;
91+ width : 30px ;
92+ }
93+
94+ .heart : before {
95+ top : -15px ;
96+ left : 0 ;
97+ }
98+
99+ .heart : after {
100+ left : 15px ;
101+ top : 0 ;
102+ }
103+ .front {
104+ position : absolute;
105+ border-right : 180px solid # dda9a4 ;
106+ border-top : 95px solid transparent;
107+ border-bottom : 100px solid transparent;
108+ left : 120px ;
109+ top : 5px ;
110+ width : 0 ;
111+ height : 0 ;
112+ z-index : 10 ;
113+ }
114+
115+ .front : before {
116+ position : absolute;
117+ content : "" ;
118+ border-left : 300px solid # d98c7b ;
119+ border-top : 195px solid transparent;
120+ left : -120px ;
121+ top : -95px ;
122+ width : 0 ;
123+ height : 0 ;
124+ }
125+
126+
127+ .shadow {
128+ position : absolute;
129+ width : 330px ;
130+ height : 25px ;
131+ border-radius : 50% ;
132+ background-color : rgba (0 , 0 , 0 , 0.3 );
133+ bottom : 250px ;
134+ left : 650px ;
135+ animation : scale 3s linear infinite;
136+ z-index : -1 ;
137+ }
138+
139+
140+ @keyframes up {
141+ 0% ,
142+ 100% {
143+ transform : translateY (0 );
144+ }
145+ 50% {
146+ transform : translateY (-30px );
147+ }
148+ }
149+
150+ @keyframes scale {
151+ 0% ,
152+ 100% {
153+ transform : scaleX (1 );
154+ }
155+ 50% {
156+ transform : scaleX (0.85 );
157+ }
158+ }
0 commit comments