当前位置:网站首页>【无标题】
【无标题】
2022-08-04 11:15:00 【JackieDYH】
七夕来袭!是时候展现专属于程序员的浪漫了!你打算怎么给心爱的人表达爱意?鲜花礼物?代码表白?还是创意DIY?或者…无论那种形式,快来秀我们一脸吧!
效果

html代码
<div class="valentines-day">
<div class="envelope"></div>
<div class="heart"></div>
<div class="text">HAPPY 520 DAY!</div>
<div class="front"></div>
<div class="text2">- hover over the envelope - </div>
</div>css代码
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #f1e3d3;
overflow: hidden;
}
.valentines-day {
position: relative;
cursor: pointer;
}
.envelope {
position: relative;
filter: drop-shadow(0 0 25px rgba(0,0,0,.3));
}
.envelope:before {
content:"";
position: absolute;
width:254px;
height:254px;
background-color: #ff9494;
transform: rotate(-45deg);
border-radius: 0 15px 0 0;
left:-37px;
top:-82px;
}
.envelope:after {
content:"";
position: absolute;
background-color: #ff9494;
width:360px;
height:225px;
left:-90px;
top:45px;
}
.heart {
position: relative;
background-color: #e01911;
display: inline-block;
height: 180px;
top:50px;
left:0;
transform: rotate(-45deg);
width:180px;
filter: drop-shadow(0 -10px 25px rgba(0,0,0,.3));
transition: .5s;
}
.heart:before, .heart:after {
content:"";
background-color: #e01911;
border-radius:50%;
height: 180px;
width: 180px;
position: absolute;
}
.heart:before {
top:-100px;
left:0;}
.heart:after {
left:100px;
top:0;}
.front {
position: absolute;
width:0;
height:0;
border-right: 190px solid #fbd2d2;
border-top: 113px solid transparent;
border-bottom: 113px solid transparent;
top:44px;
left:80px;
z-index:4;
}
.front:before {
content:"";
position: absolute;
width:0;
height:0;
border-left: 190px solid #fbd2d2;
border-top: 113px solid transparent;
border-bottom: 113px solid transparent;
top:-113px;
left:-170px;
}
.front:after {
width:0;
height:0;
position: absolute;
content:"";
border-bottom: 150px solid #fce7e9;
border-right:180px solid transparent;
border-left: 180px solid transparent;
top:-36px;
left:-170px;
}
.text {
position: absolute;
font-family: arial;
letter-spacing:5px;
text-align: center;
color: white;
z-index:2;
top:80px;
left:15px;
transition: .5s;
}
.valentines-day:hover .heart {
transform: translateY(-50px) rotate(-45deg);
}
.valentines-day:hover .text {
transform: translateY(-50px);
}
.text2 {
position: absolute;
top:275px;
color: white;
font-family: brush script mt;
text-align: center;
width:195px;
font-size:20px;
}效果

html代码
<h2>Have Dinner with Me<br/> On Friday?</h2>
<div id="heart">
</div>
<div class="glass-wrapper">
<div class="top">
<div class="liquid">
<div class="shadow">
</div>
</div>
<div class="shadow2"></div>
</div>
<div class="stand"></div>
<div class="bottom"></div>
<div class="heart h1"></div>
<div class="heart h2"></div>
<div class="heart h3"></div>
<div class="heart h4"></div>
<div class="heart h5"></div>
<div class="heart h6"></div>
</div>css代码
body {
background-color: #fe9cd1;
font-family: 'Dancing Script', cursive; }
h2 {
text-align: center;
margin-top: 40px;
font-size: 50px;
color: #333; }
#heart {
position: absolute;
left: calc(50% - 200px);
top: calc(50% - 180px);
width: 400px;
height: 360px;
opacity: 0.2; }
#heart:before,
#heart:after {
position: absolute;
content: "";
left: 200px;
top: 0;
width: 200px;
height: 360px;
background: red;
-moz-border-radius: 100px 1000px 0 0;
border-radius: 100px 100px 0 0;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-transform-origin: 0 100%;
-moz-transform-origin: 0 100%;
-ms-transform-origin: 0 100%;
-o-transform-origin: 0 100%;
transform-origin: 0 100%; }
#heart:after {
left: 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
-o-transform-origin: 100% 100%;
transform-origin: 100% 100%; }
.glass-wrapper {
position: absolute;
left: calc(50% - 150px);
top: calc(50% - 230px);
width: 300px;
height: 500px;
cursor: pointer; }
.glass-wrapper:hover {
animation: shake 1.3s ease; }
.top {
position: absolute;
left: 70px;
top: 80px;
width: 150px;
height: 250px;
overflow: hidden;
border: 5px solid #333;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: 60%;
border-bottom-right-radius: 60%;
z-index: 2; }
.top .liquid {
position: absolute;
bottom: 0;
width: 150px;
height: 150px;
background-color: #c0392b; }
.top .liquid .shadow {
position: absolute;
bottom: -100px;
right: -100px;
width: 300px;
height: 300px;
background-color: transparent;
border-bottom-left-radius: 50%;
border-bottom-right-radius: 50%;
border: 100px solid rgba(0, 0, 0, 0.2); }
.top .shadow2 {
position: absolute;
left: 20px;
top: 10px;
width: 10px;
height: 160px;
background-color: rgba(255, 255, 255, 0.3);
border-bottom-left-radius: 100%; }
.stand {
position: absolute;
left: 142px;
top: 338px;
width: 5px;
height: 100px;
border: 5px solid #333;
border-top-width: 2px;
border-bottom: 0;
background-color: rgba(255, 255, 255, 0.3); }
.bottom {
position: absolute;
left: 90px;
top: 438px;
width: 110px;
height: 5px;
border: 5px solid #333;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
background-color: rgba(255, 255, 255, 0.3); }
.heart {
position: absolute;
width: 100px;
height: 90px;
top: 200px; }
.heart.h1 {
left: 120px;
animation: transition-up 5s ease-in-out 1s infinite; }
.heart.h2 {
left: 150px;
animation: transition-up 5s ease-in-out infinite; }
.heart.h3 {
animation: transition-up 5s ease-in-out 2s infinite;
left: 90px; }
.heart.h4 {
animation: transition-up 5s ease-in-out 3s infinite;
left: 115px; }
.heart.h5 {
animation: transition-up 5s ease-in-out 4s infinite;
left: 135px; }
.heart.h6 {
animation: transition-up 5s ease-in-out 3.5s infinite;
left: 140px; }
.heart:before, .heart:after {
position: absolute;
content: "";
left: 25px;
top: 0;
width: 25px;
height: 40px;
background: #c0392b;
-moz-border-radius: 50px 50px 0 0;
border-radius: 50px 50px 0 0;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-transform-origin: 0 100%;
-moz-transform-origin: 0 100%;
-ms-transform-origin: 0 100%;
-o-transform-origin: 0 100%;
transform-origin: 0 100%; }
.heart:after {
left: 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
-o-transform-origin: 100% 100%;
transform-origin: 100% 100%; }
@keyframes transition-up {
0% {
transform: translate3d(20px, 0, 0); }
20% {
transform: translate3d(-20px, 0, 0); }
40% {
transform: translate3d(20px, 0, 0); }
60% {
opacity: 1;
transform: translate3d(-20px, 0, 0); }
80% {
transform: translate3d(10px, 0, 0); }
100% {
opacity: 0;
top: 10px;
transform: translate3d(-10px, 0, 0); } }
@keyframes shake {
0% {
transform: rotate(0); }
25% {
transform: rotate(10deg); }
50% {
transform: rotate(-10deg); }
75% {
transform: rotate(5deg); }
100% {
transform: rotate(0deg); } }
/*# sourceMappingURL=index.css.map */边栏推荐
- 【励志】复盘的重要性
- 图文手把手教程--ESP32 一键配网(Smartconfig、Airkiss)
- [Flight Control Development Advanced Course 7] Crazy Shell Open Source Formation UAV - Formation Flight
- Graphic and text hands-on tutorial--ESP32 MQTT docking EMQX local server (VSCODE+ESP-IDF)
- win8和win10下,visual studio 2008 调试出现无响应的卡死问题解决
- Graphical Hands-on Tutorial--ESP32 OTA Over-the-Air Upgrade (VSCODE+IDF)
- 小程序实战(三) - head组件的封装与使用
- 网管型交换机比傻瓜交换机多了哪些功能
- Learn to use the basic interface of set and map
- ORB-SLAM3中的优化
猜你喜欢

ECCV 2022 | 清华&腾讯AI Lab提出REALY: 重新思考3D人脸重建的评估方法

8月活动|51CTO十七周年庆,发博文得茶具/笔记本/T恤等礼品!

深度学习100例 —— 卷积神经网络(CNN)天气识别

北京大学,新迎3位副校长!其中一人为中科院院士!

zabbix deployment

MySql数据库入门的基本操作

Leetcode - using sequence traversal features first completed 114. The binary tree to the list

【LeetCode】653. 两数之和 IV - 输入 BST

学会使用set和map的基本接口

美摄问答室|美映 VS 美摄云剪辑
随机推荐
【LeetCode】98.验证二叉搜索树
Camunda整体架构和相关概念
【黄啊码】MySQL入门—1、SQL 的执行流程
Leetcode刷题——构造二叉树(105. 从前序与中序遍历序列构造二叉树、106. 从中序与后序遍历序列构造二叉树)
ORA-00054 资源正忙
【LeetCode】701.二叉搜索树中的插入操作
ECCV 2022 | 清华&腾讯AI Lab提出REALY: 重新思考3D人脸重建的评估方法
iMeta | German National Cancer Center Gu Zuguang published a complex heatmap visualization method
使用.NET简单实现一个Redis的高性能克隆版(二)
网管交换机与非网管交换机如何选择?
The use of DDR3 (Naive) in Xilinx VIVADO (1) to create an IP core
MATLAB程序设计与应用 3.1 特殊矩阵
Meishe Q&A Room | Meiying VS Meishe Cloud Editing
mongo-导出数据到mysql
*SEO*
Redis查询缓存
【飞控开发高级教程7】疯壳·开源编队无人机-编队飞行
少即是多:视觉SLAM的点稀疏化(IROS 2022)
知网网站地址更换
职责链模式(responsibilitychain)