当前位置: 首页 > news >正文

DW做的网站都能打开吗网站如何宣传推广

DW做的网站都能打开吗,网站如何宣传推广,推广做黄页网站,四川省住建厅考试报名官网使用场景 在生产环境中#xff0c;遇到一个需求#xff0c;需要在一个深色风格的大屏页面中#xff0c;嵌入 Google Maps。为了减少违和感#xff0c;希望地图四边能够淡出过渡。 这里的“淡出过渡”#xff0c;关键是淡出#xff0c;而非降低透明度。 基于 Google Ma…使用场景 在生产环境中遇到一个需求需要在一个深色风格的大屏页面中嵌入 Google Maps。为了减少违和感希望地图四边能够淡出过渡。 这里的“淡出过渡”关键是淡出而非降低透明度。 基于 Google Maps 的深色示例中附加上述需求效果如下 简单的说就是中间放地图四周放标题和其它展板内容。 CSS mask-image SVG 简化一下把地图换成图片实现一个示例。 示例中注释掉“mask”标记的内容恢复“svg test”标记的内容可以查看 svg 。 准备工作定义一个“容器”和“目标”层 div idcontainerimg idtarget srchttps://cdn.pixabay.com/photo/2024/07/28/09/04/mountain-8927018_1280.jpg!-- svg test --!-- div idtarget stylewidth:1920px;height:1080px;/div -- /div基础样式 body {margin: 0;background-color: black; }#container {position: absolute;width: 100%;height: 100%;background-repeat: repeat;display: flex;align-items: center;justify-content: center; }#target {max-width: 80%;max-height: 80%;/* mask */-webkit-mask-mode: alpha;mask-mode: alpha;mask-repeat: no-repeat;mask-size: 100% 100%;/* svg test *//* background-repeat: no-repeat;background-size: 100% 100%; */ } 给“容器”添加一个波点背景为了验证淡出过渡区域可以透视背景这里直接用 svg 实现 (function() {const container document.querySelector(#container);const containerBg svg xmlnshttp://www.w3.org/2000/svg width30 height30circle fillrgba(255,255,255,0.1) cx15 cy15 r10 //svg;container.style.backgroundImage url(data:image/svgxml;utf8,${encodeURIComponent(containerBg)});// 略 })();接着给“目标”准备一个处理方法如果目标是一个图片为了获得图片大小将在图片的 onload 中执行 (function() {// 略const target document.querySelector(#target);function setTargetBg() {// 略}target.onload setTargetBgsetTargetBg() })();为了实现淡出过渡效果需要准备一个 svg 分为 41 块上下左右 4 个梯形 path中间 1 个矩形 rect。 4 个梯形分别设置了 4 个方向的 linearGradient 渐变。 这里用代码绘制上面的 svg svg 的宽高是基于“目标”的宽高淡入过渡区域大小 padding 基于“目标”短边的 20%。 特别地patch 和 rect 中的加减“1”目的是为了消除 path 之间的缝隙。 function setTargetBg() {const svgWidth target.offsetWidth,svgHeight target.offsetHeight,padding Math.floor(Math.min(target.offsetWidth, target.offsetHeight) * 0.2),fill white,patch 0.2;const targetMask svg xmlnshttp://www.w3.org/2000/svgxmlns:xlinkhttp://www.w3.org/1999/xlink version1.1width${svgWidth}height${svgHeight} viewBox0 0 ${svgWidth} ${svgHeight}defslinearGradient idmask-bottom-to-top x10 x20 y10 y21stop offset0% stop-colortransparent /stop offset100% stop-color${fill} //linearGradientlinearGradient idmask-top-to-bottom x10 x20 y10 y21stop offset0% stop-color${fill} /stop offset100% stop-colortransparent //linearGradientlinearGradient idmask-rigth-to-left x10 x21 y10 y20stop offset0% stop-colortransparent /stop offset100% stop-color${fill} //linearGradientlinearGradient idmask-left-to-right x10 x21 y10 y20stop offset0% stop-color${fill} /stop offset100% stop-colortransparent //linearGradient/defspath fillurl(#mask-bottom-to-top) dM0,0 L${svgWidth},0 L${svgWidth - padding patch},${padding patch} L${padding - patch},${padding patch} Z/pathpath fillurl(#mask-top-to-bottom) dM0,${svgHeight} L${padding - patch},${svgHeight - padding - patch} L${svgWidth - padding patch},${svgHeight - padding - patch} L${svgWidth},${svgHeight} Z/pathpath fillurl(#mask-rigth-to-left) dM0,0 L${padding patch},${padding} L${padding patch},${svgHeight - padding} L0,${svgHeight} Z/pathpath fillurl(#mask-left-to-right) dM${svgWidth},0 L${svgWidth - padding - patch},${padding} L${svgWidth - padding - patch},${svgHeight - padding} L${svgWidth},${svgHeight} Z/pathrect x${padding - 1} y${padding - 1} width${svgWidth - padding * 2 1 * 2} height${svgHeight - padding * 2 1 * 2} fill${fill}/rect/svg ;// masktarget.style.maskImage url(data:image/svgxml;utf8,${encodeURIComponent(targetMask.replace(/\n/g, ))});// svg test// target.style.backgroundImage url(data:image/svgxml;utf8,${encodeURIComponent(targetMask.replace(/\n/g, ))});}最终效果 在线Demo
http://www.hkea.cn/news/14389096/

相关文章:

  • 网站建设流程时间表阜阳网站开发招聘
  • 网站建设困难吗北京公司网站怎么制作
  • 纯html5网站营销型网站维护费用
  • 毕业设计资源网站做设计找素材都有什么网站
  • 电子商务网站建设规划心得做百度移动端网站优化
  • 微网站 demo网站开发现在用什么
  • 介绍学校网站怎么做没有下载功能的网页视频怎么下载
  • 有没有做那事的网站德州网站怎样建设
  • 新闻自动采集网站源码网站的域名和空间
  • 网站开发时app打开很慢曲靖市住房和城乡建设局网站
  • 如何用网站做课件公司注册类型
  • seo网站代码优化网站空间的权限
  • 成都网站运营衡阳网站建设报价方案
  • 珠海美容网站建设网站如何seo
  • 常州网站seo唐山网站制作案例
  • 贵港免费的网站建设淘宝运营的基础知识
  • 怎么学php网站开发初识网站开发流程图
  • 太原做网站价格小广告设计
  • 淘宝网络营销方案南昌seo营销
  • 美食网站网页设计论文广州市门户网站建设
  • 如何设计网站做网站用什么软件中国网站建设网
  • 广告宣传网站设计之家室内设计
  • 网站建设解析怎么在电脑安装wordpress
  • 网站解析后怎么做镇江网站推广优化
  • 网站建设客户沟通模块换服务器后网站首页不收录
  • 太原网站建设价格wordpress统计人数插件
  • 临沂网站推广wordpress清除缓存
  • 工程信息网站哪家做的较好正规的网站建设公司
  • 网站风格的设计企业关键词大全
  • 网站英文地图怎么做网页设计如何收费