Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Rotorua
Known for it’s geothermal activity, geysers and mud pools, the air of Rotorua smells constantly of sulphur.
Fiordland
A variant spelling of the Scandinavian word for the deep valleys plunging into the ocean and bays, typical of the area, Fiordland occupies the lower third of the west coast of New Zealand’s South Island. The most famous area of the thinly occupied region is Milford Sound.
Taranaki
Taranaki is located on the lower third of the west coast of the North Island, and is named for the stratovolcano that is its central feature. The region is exceptionally fertile due to the heavy rainfall and rich volcanic soil.
css
@font-face { src: url(http://thenewcode.com/assets/fonts/libertad.woff); font-family: Libertad; } * { box-sizing: border-box; } body { margin: 0; background: #006994; min-height: 100vh; font-family: Libertad, sans-serif; } svg { margin-left: 2rem; width: 33%; height: auto; display: inline-block; } #description { display: inline-block; background: rgba(0, 0, 0, 0.6); color: #fff; width: 50%; margin: 1rem 3rem 0; vertical-align: top; -webkit-transition: 0.8s cubic-bezier(0.14, 0.39, 0.41, 1.29); transition: 0.8s cubic-bezier(0.14, 0.39, 0.41, 1.29); } #description * { opacity: 0; } #description p { margin-bottom: 2rem; } #description.active * { -webkit-animation: fadein 3s forwards; animation: fadein 3s forwards; } #description.active img { -webkit-animation-delay: .4s; animation-delay: .4s; } #description.active h1 { -webkit-animation-delay: 1s; animation-delay: 1s; } #description.active p { -webkit-animation-delay: 2s; animation-delay: 2s; } @-webkit-keyframes fadein { to { opacity: 1; } } @keyframes fadein { to { opacity: 1; } } #description h1, #description p { margin-left: 2rem; margin-right: 2rem; } #description img { width: 100%; } @-webkit-keyframes lookit { to { stroke-width: 20px; stroke: rgba(255, 255, 255, 0.2); } } @keyframes lookit { to { stroke-width: 20px; stroke: rgba(255, 255, 255, 0.2); } } text { font-family: Libertad, sans-serif; font-size: 48px; font-weight: 400; fill: #fff; } circle { fill: #000; } circle.outline { fill: none; stroke-width: 5px; stroke: #fff; -webkit-transition: .4s; transition: .4s; -webkit-animation: lookit 1.8s infinite alternate cubic-bezier(0.85, 0, 0.32, 0.83); animation: lookit 1.8s infinite alternate cubic-bezier(0.85, 0, 0.32, 0.83); } a:hover circle:not(.outline), a:focus circle { fill: #f00; } .travel { fill: none; stroke: #f00; stroke-width: 12px; -webkit-transition: .4s opacity; transition: .4s opacity; } #ni { stroke-dasharray: 240; stroke-dashoffset: 240; } #si { stroke-dasharray: 1250; stroke-dashoffset: 1250; } .hide { opacity: 0; } @media all and (max-width: 790px) { #nzmap { display: none; } #description { width: 100%; margin: 0; } #description * { opacity: 1; } #description > div { -webkit-box-flex: 1; -webkit-flex: 1; -ms-flex: 1; flex: 1; } }
JavaScript
var nzmap = document.getElementById("nzmap"), prevLoc, pathDist, locName, si = document.getElementById("si"), ni = document.getElementById("ni"), locale = document.getElementById("locale"), map = document.getElementById("map"), description = document.getElementById("description"); function pathTravel(travelPath, pathDist) { travelPath.animate([{ strokeDashoffset: pathDist }, { strokeDashoffset: '0' }], { duration: pathDist * 5, fill: 'forwards' }); } function fillDesc(locName, desc) { var imageURL = "https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/", fileName = locName.split("."), longDesc = '
'; longDesc += "
" + locName + "
"; longDesc += "
" + desc + "
"; return longDesc; } nzmap.addEventListener("click", function(e) { var loc = e.target.parentNode; e.preventDefault(); var desc = loc.querySelector("desc").textContent; if (loc.nodeName == "a") { var locName = loc.querySelector("text").textContent; if (locName == "Rotorua") { si.classList.add("hide"); ni.classList.add("hide"); } if (locName == "Taranaki") { if (prevLoc == "Fiordland") { si.classList.add("hide"); } if (prevLoc !== "Taranaki") { ni.classList.remove("hide"); travelPath = ni; pathDist = travelPath.pathLength.baseVal; pathTravel(travelPath, pathDist); } } if (locName == "Fiordland" && prevLoc !== "Fiordland") { travelPath = si; travelPath.classList.remove("hide"); pathDist = travelPath.pathLength.baseVal; pathTravel(travelPath, pathDist); } description.classList.remove("active"); description.innerHTML = ""; prevLoc = locName; description.insertAdjacentHTML("afterbegin", fillDesc(locName, desc)); description.classList.add("active"); } }); function showHide() { var locs = nzmap.getElementsByTagName("text"), descs = nzmap.getElementsByTagName("desc"); for (var i = 0; i < locs.length; i++) { description.insertAdjacentHTML("afterbegin", "
" + fillDesc(locs[i].textContent, descs[i].textContent) + "
"); } } var screencheck = window.matchMedia("(max-width: 790px)"); window.addEventListener("load", function() { if (screencheck.matches) { showHide(); } });
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>SVG 交互自驾旅行地图原型-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号