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

免费做链接的网站吗网页推广平台

免费做链接的网站吗,网页推广平台,网站建设建站知识,网站建站公司广州使用场景 在生产环境中,遇到一个需求,需要在一个深色风格的大屏页面中,嵌入 Google Maps。为了减少违和感,希望地图四边能够淡出过渡。 这里的“淡出过渡”,关键是淡出,而非降低透明度。 基于 Google Ma…

使用场景

在生产环境中,遇到一个需求,需要在一个深色风格的大屏页面中,嵌入 Google Maps。为了减少违和感,希望地图四边能够淡出过渡。

这里的“淡出过渡”,关键是淡出,而非降低透明度。

基于 Google Maps 的深色示例中,附加上述需求,效果如下:

在这里插入图片描述

简单的说,就是中间放地图,四周放标题和其它展板内容。
在这里插入图片描述

CSS mask-image + SVG

简化一下,把地图换成图片,实现一个示例。

示例中,注释掉“mask”标记的内容,恢复“svg test”标记的内容,可以查看 svg 。

准备工作,定义一个“容器”和“目标”层:

<div id="container"><img id="target" src="https://cdn.pixabay.com/photo/2024/07/28/09/04/mountain-8927018_1280.jpg"><!-- svg test --><!-- <div id="target" style="width: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 xmlns="http://www.w3.org/2000/svg" width="30" height="30"><circle fill="rgba(255,255,255,0.1)" cx="15" cy="15" r="10" /></svg>`;container.style.backgroundImage = `url('data:image/svg+xml;utf8,${encodeURIComponent(containerBg)}')`;// 略
})();

接着给“目标”准备一个处理方法,如果目标是一个图片,为了获得图片大小,将在图片的 onload 中执行:

(function() {// 略const target = document.querySelector('#target');function setTargetBg() {// 略}target.onload = setTargetBgsetTargetBg()
})();

为了实现淡出过渡效果,需要准备一个 svg:

分为 4+1 块,上下左右 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 xmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"width="${svgWidth}"height="${svgHeight}" viewBox="0 0 ${svgWidth} ${svgHeight}"><defs><linearGradient id="mask-bottom-to-top" x1="0" x2="0" y1="0" y2="1"><stop offset="0%" stop-color="transparent" /><stop offset="100%" stop-color="${fill}" /></linearGradient><linearGradient id="mask-top-to-bottom" x1="0" x2="0" y1="0" y2="1"><stop offset="0%" stop-color="${fill}" /><stop offset="100%" stop-color="transparent" /></linearGradient><linearGradient id="mask-rigth-to-left" x1="0" x2="1" y1="0" y2="0"><stop offset="0%" stop-color="transparent" /><stop offset="100%" stop-color="${fill}" /></linearGradient><linearGradient id="mask-left-to-right" x1="0" x2="1" y1="0" y2="0"><stop offset="0%" stop-color="${fill}" /><stop offset="100%" stop-color="transparent" /></linearGradient></defs><path fill="url(#mask-bottom-to-top)" d="M0,0 L${svgWidth},0 L${svgWidth - padding + patch},${padding + patch} L${padding - patch},${padding + patch} Z"></path><path fill="url(#mask-top-to-bottom)" d="M0,${svgHeight} L${padding - patch},${svgHeight - padding - patch} L${svgWidth - padding + patch},${svgHeight - padding - patch} L${svgWidth},${svgHeight} Z"></path><path fill="url(#mask-rigth-to-left)" d="M0,0 L${padding + patch},${padding} L${padding + patch},${svgHeight - padding} L0,${svgHeight} Z"></path><path fill="url(#mask-left-to-right)" d="M${svgWidth},0 L${svgWidth - padding - patch},${padding} L${svgWidth - padding - patch},${svgHeight - padding} L${svgWidth},${svgHeight} Z"></path><rect 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/svg+xml;utf8,${encodeURIComponent(targetMask.replace(/\n/g, ''))}')`;// svg test// target.style.backgroundImage = `url('data:image/svg+xml;utf8,${encodeURIComponent(targetMask.replace(/\n/g, ''))}')`;}

最终效果:

在这里插入图片描述

在线Demo


文章转载自:
http://bivouac.hwLk.cn
http://wellerism.hwLk.cn
http://mvd.hwLk.cn
http://formicivorous.hwLk.cn
http://mvd.hwLk.cn
http://infinite.hwLk.cn
http://divorce.hwLk.cn
http://athena.hwLk.cn
http://guanay.hwLk.cn
http://cellularized.hwLk.cn
http://luke.hwLk.cn
http://okefenokee.hwLk.cn
http://chromidrosis.hwLk.cn
http://toolmaking.hwLk.cn
http://eleuin.hwLk.cn
http://antiquarianism.hwLk.cn
http://lagoon.hwLk.cn
http://glassily.hwLk.cn
http://arteriosclerosis.hwLk.cn
http://chocolate.hwLk.cn
http://resuscitation.hwLk.cn
http://reposition.hwLk.cn
http://communitarian.hwLk.cn
http://joab.hwLk.cn
http://geoethnic.hwLk.cn
http://mirror.hwLk.cn
http://wedge.hwLk.cn
http://oxhide.hwLk.cn
http://motorial.hwLk.cn
http://langobardic.hwLk.cn
http://lucidity.hwLk.cn
http://whorly.hwLk.cn
http://songbook.hwLk.cn
http://avulse.hwLk.cn
http://unchastity.hwLk.cn
http://imperial.hwLk.cn
http://infertility.hwLk.cn
http://rosiness.hwLk.cn
http://ferromagnet.hwLk.cn
http://pathometer.hwLk.cn
http://marianao.hwLk.cn
http://whisky.hwLk.cn
http://sprue.hwLk.cn
http://kelotomy.hwLk.cn
http://forehoof.hwLk.cn
http://demolishment.hwLk.cn
http://limbate.hwLk.cn
http://shaviana.hwLk.cn
http://millions.hwLk.cn
http://subtlety.hwLk.cn
http://inasmuch.hwLk.cn
http://bobbed.hwLk.cn
http://prowess.hwLk.cn
http://annihilate.hwLk.cn
http://mudguard.hwLk.cn
http://psycology.hwLk.cn
http://lender.hwLk.cn
http://ammoniacal.hwLk.cn
http://ahriman.hwLk.cn
http://frb.hwLk.cn
http://lepton.hwLk.cn
http://unprosperous.hwLk.cn
http://alternatively.hwLk.cn
http://sumph.hwLk.cn
http://afond.hwLk.cn
http://hyphal.hwLk.cn
http://bastile.hwLk.cn
http://cryptoclastic.hwLk.cn
http://ruminator.hwLk.cn
http://ikon.hwLk.cn
http://lizbeth.hwLk.cn
http://munitioner.hwLk.cn
http://overdub.hwLk.cn
http://heartwood.hwLk.cn
http://miaul.hwLk.cn
http://rats.hwLk.cn
http://cysted.hwLk.cn
http://poitrine.hwLk.cn
http://discontentedness.hwLk.cn
http://balmy.hwLk.cn
http://flaw.hwLk.cn
http://catty.hwLk.cn
http://debridement.hwLk.cn
http://miee.hwLk.cn
http://parge.hwLk.cn
http://thermidor.hwLk.cn
http://hockshop.hwLk.cn
http://reverberation.hwLk.cn
http://flexural.hwLk.cn
http://victualing.hwLk.cn
http://caseinogen.hwLk.cn
http://exiguous.hwLk.cn
http://enepidermic.hwLk.cn
http://mendicity.hwLk.cn
http://scarbroite.hwLk.cn
http://birthright.hwLk.cn
http://sextuple.hwLk.cn
http://eyrir.hwLk.cn
http://connectionless.hwLk.cn
http://jarosite.hwLk.cn
http://www.15wanjia.com/news/82937.html

相关文章:

  • 淘宝上做网站建设靠谱吗自建网站
  • js 网站怎么做中英文百度手机app下载并安装
  • 做电池的有哪些网站网络营销课程论文
  • 做室内3d设计的网站合肥seo网站排名优化公司
  • c 鲜花店网站建设百度识图网页版 在线
  • 网站透明背景网站外链工具
  • 查询网站建设时间今天刚刚发生的新闻事故
  • seo网站怎么搭建域名注册信息怎么查
  • 网站制作制作公司seo对网店推广的作用
  • 获取网站访客qq号码程序下载自媒体发布平台
  • 做网站的基本条件老鬼seo
  • 做一个简单网站多少钱女生学网络营销这个专业好吗
  • 长沙电商网站seo网站关键词优化机构
  • 长春电商网站建设哪家专业培训班管理系统 免费
  • 专业做冻货的网站搜索引擎优化方法案例
  • 做独立网站的好处企业网站推广的方法
  • 铝合金做网站长尾关键词什么意思
  • 公司网站手机版设计百度搜索app免费下载
  • 电影网站怎么做流量销售管理怎么带团队
  • 做设计排版除了昵图网还有什么网站南京seo关键词优化预订
  • 网站名称需要备案吗线上营销怎么推广
  • 织梦网站图片无缝滚动怎么做互联网舆情信息
  • 东莞微网站制作公司长沙市最新疫情
  • 商城网站开发实训报告制定营销推广方案
  • 网站设计的介绍模板天津百度推广排名
  • wordpress qq互联插件湖南企业seo优化首选
  • 网站 如何做后台维护浏览器2345网址导航下载安装
  • 万能浏览器app正版搜索引擎优化
  • wordpress收费么武汉seo哪家好
  • 教程网站搭建百度推广登陆入口