<html lang="en">
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width,maximum-scale=1.0,minimum-scale=1.0'>
<meta http-equiv='X-UA-Compatible' content='ie=edge'>
<title>国庆节红旗专属头像一键生成网页-我爱资源网提供源码www.12580sky.com</title>
<meta name="keywords" content="在线一键生成国庆红旗风头像网站">
<meta name="description" content="在线一键生成国庆红旗风头像网站"/>
<link rel="shortcut icon" href="https://www.52zyw.com/favicon.ico" type="image/x-icon"/>
<style>
a:link{color:#fff;text-decoration: none;}
a:visited{color:#fff;}
#export{display:none;margin:0 auto;width:250px;height:250px;margin-top:50px;margin-bottom:50px}
.operation-btns .o-btn1{background-size:11.6rem 4.325rem}
.operation-btns .o-btn2{background-size:11.6rem 3.75rem}
center{color: #fff;}
</style>
<link rel="stylesheet" type="text/css" href="img/strap.min.css">
</head>
<body>
<div class="wrapper">
<img src="" alt="" class="img-load" style="width: 9.5rem; position: fixed; top: 0px; left: -9999px;">
<div class="operation-header">
<div class="h-title">
</div>
</div>
<div class="operation-box">
<a class="prev" onClick='changeHat()'></a>
<div class="operation-img">
<div class="cropper-content" id="content">
<canvas class="" id='cvs'></canvas>
</div>
</div>
<a class="next" onClick='changeHat()'></a>
</div>
<img id='export' alt='国庆专属头像' src='' />
<div class="operation-btns">
<a class="o-btn1">
<input class="o-btn1" id='upload' type='file' onchange='viewer()' style='opacity: 0;'>
</a>
<a class="o-btn2" onClick='exportFunc()' style="display: none;">
</a>
</div>
<div class="operation-done">
<img src="img/act-done-happy.png" class="act-done-happy">
</div>
<div>
<center>
<a href="http://zhongwangpp.com/" target="_blank"><img src="img/163296214936538432.png" style="margin-bottom:1.5rem;height:2rem;"></a>
</center>
</div>
<div>
<center>
<a href="http://52zyw.com" target="_blank"><img src="img/163289263332916427.png" style="margin-bottom:1.5rem;height:2rem;"></a>
</center>
</div>
</div>
<div style='display: none'>
<img id='img' src='' alt='' />
<img class='hide' id='hat0' src='img/hat6.png' />
<img class='hide' id='hat1' src='img/hat0.png' />
<img class='hide' id='hat2' src='img/hat2.png' />
<img class='hide' id='hat3' src='img/hat3.png' />
<img class='hide' id='hat4' src='img/hat1.png' />
<img class='hide' id='hat5' src='img/hat4.png' />
<img class='hide' id='hat6' src='img/hat5.png' />
<img class='hide' id='hat7' src='img/hat7.png' />
<img class='hide' id='hat8' src='img/hat8.png' />
<img class='hide' id='hat9' src='img/hat9.png' />
<img class='hide' id='hat10' src='img/hat10.png' />
<img class='hide' id='hat11' src='img/hat11.png' />
<img class='hide' id='hat12' src='img/hat12.png' />
<img class='hide' id='hat13' src='img/hat13.png' />
<img class='hide' id='hat14' src='img/hat14.png' />
<img class='hide' id='hat15' src='img/hat15.png' />
<img class='hide' id='hat16' src='img/hat16.png' />
<img class='hide' id='hat17' src='img/hat17.png' />
<img class='hide' id='hat18' src='img/hat18.png' />
<img class='hide' id='hat19' src='img/hat19.png' />
<img class='hide' id='hat20' src='img/hat20.png' />
<img class='hide' id='hat21' src='img/hat21.png' />
<img class='hide' id='hat22' src='img/hat22.png' />
<img class='hide' id='hat23' src='img/hat23.png' />
</div>
<script src="img/fabric.min.js"></script>
<script>
var cvs = document.getElementById("cvs");
var ctx = cvs.getContext("2d");
var exportImage = document.getElementById("export");
var img = document.getElementById("img");
var hat = "hat0";
var canvasFabric;
var hatInstance;
//var screenWidth = window.screen.width < 500 ? window.screen.width : 300;
var screenWidth = document.getElementById("content").scrollHeight;
function viewer() {
var file = document.getElementById("upload").files[0];
console.log(file);
var reader = new FileReader;
if (file) {
reader.readAsDataURL(file);
reader.onload = function(e) {
img.src = reader.result;
img.onload = function() {
img2Cvs(img)
}
}
} else {
img.src = ""
}
}
function img2Cvs(img) {
cvs.width = img.width;
cvs.height = img.height;
cvs.style.display = "block";
canvasFabric = new fabric.Canvas("cvs", {
width: screenWidth,
height: screenWidth,
backgroundImage: new fabric.Image(img, {
scaleX: screenWidth / img.width,
scaleY: screenWidth / img.height
})
});
changeHat();
document.getElementsByClassName("o-btn1")[0].style.display = "none";
document.getElementsByClassName("o-btn2")[0].style.display = "block";
//document.getElementById("tip").style.opacity = 1
}
function changeHat() {
document.getElementById(hat).style.display = "none";
var hats = document.getElementsByClassName("hide");
hat = "hat" + (+hat.replace("hat", "") + 1) % hats.length;
var hatImage = document.getElementById(hat);
hatImage.style.display = "block";
if (hatInstance) {
canvasFabric.remove(hatInstance)
}
console.log(hatImage.width);
console.log(100 / hatImage.width);
hatInstance = new fabric.Image(hatImage, {
top: 0,
left: 0,
scaleX: screenWidth / hatImage.width,
scaleY: screenWidth / hatImage.height,
cornerColor: "#0b3a42",
cornerStrokeColor: "#fff",
cornerStyle: "circle",
transparentCorners: false,
rotatingPointOffset: 30
});
hatInstance.setControlVisible("bl", false);
hatInstance.setControlVisible("tr", false);
hatInstance.setControlVisible("tl", false);
hatInstance.setControlVisible("mr", false);
hatInstance.setControlVisible("mt", false);
canvasFabric.add(hatInstance)
}
function exportFunc() {
document.getElementsByClassName("operation-box")[0].style.display = "none";
document.getElementsByClassName("operation-btns")[0].style.display = "none";
/*document.getElementById("exportBtn").style.display = "none";
document.getElementById("tip").innerHTML = "长按图片保存或分享";
document.getElementById("change").style.display = "none";*/
cvs.style.display = "none";
exportImage.style.display = "block";
exportImage.src = canvasFabric.toDataURL({
width: screenWidth,
height: screenWidth
});
alert('长按图片保存或分享');
}
</script>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
在线一键生成国庆红旗风头像网站源码

共32个文件
png:27个
url:2个
css:1个

1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 47 浏览量
2023-12-23
16:14:16
上传
评论
收藏 1.74MB 7Z 举报
温馨提示
在线一键生成国庆红旗风头像网站源码 源码介绍: 抖音微信超火国庆节国旗头像生成源码,静态页前端生成速度超快!源码直接上传到服务器即可使用。 1、打开地址后点击上传->选一张你喜欢的头像->然后点右边箭头符合选款式->最后点保存头像->按照提示 2、保存到手机即可->十几种款式肯定有一款你喜欢的->记得分享给小伙伴,一起换喜气洋洋的头像迎国庆! 直接上传服务器即可使用,引流必备~
资源推荐
资源详情
资源评论




格式:zip 资源大小:531.6KB



























收起资源包目录




































共 32 条
- 1
资源评论


Qshen
- 粉丝: 1728
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 网络安全工程实验书.doc
- 第3章-建筑安装工程定额.ppt
- 污水处理厂运营维护方案p.doc
- BIM技术在铁路隧道工程施工管理中的应用.doc
- 大数据时代数据新闻的实践浅析-以财新网数字说为例.docx
- 做高级软件工程师首选计算器学校一度教育软工培训.doc
- 大数据时代的医学院校数据结构课程教学改革初探.docx
- 涂膜防水屋面施工工艺标准.docx
- 公路土方路基施工方法.doc
- 关于水头损失根源的水力学理论探讨.docx
- 万科在给排水设计阶段的44个成本优化点.docx
- 工程质量管理关键控制点研究.doc
- 桥梁施工质量控制要点.ppt
- 天津某医院外科大楼外墙保温施工方案.doc
- [江苏]电厂机组烟气脱硫工程磨机房施工作业指导书.doc
- 大数据时代下公共管理的效用与效率研究.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
