'封装步骤引导类,并对步骤引导状态做处理'

This commit is contained in:
stacker 2021-07-07 01:42:47 +08:00
parent c646d51411
commit d4539ab313
6 changed files with 601 additions and 1084 deletions

View File

@ -0,0 +1,80 @@
#guide-box{
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
z-index: 998;
}
#guide-box > .guide-area{
box-shadow: 1px 1px 100000px 100000px rgb(124 152 209 / 50%);
position: fixed;
transition: all 500ms;
/* padding: 10px 0px; */
}
#guide-box > .guide-area > .guide-tip-box{
height: 36px;
position: absolute;
bottom:-60px;
left: 60px;
box-sizing: border-box;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content{
height: 100%;
background-color: white;
border-radius: 12px;
position: relative;
box-sizing: border-box;
padding: 0px 8px;
display: flex;
align-items: center;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .triangle{
/*content:'';
display: block;*/
position: absolute;
width: 0;
height: 0;
border-left: 12px solid transparent;
border-right: 12px solid transparent;
border-bottom: 12px solid white;
top: -12px;
/*left: 30px;*/
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .circle{
width: 8px;
height: 8px;
border-radius: 8px;
background-color: #FDF151;
margin: 14px 10px 14px 0px;
float: left;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info{
height: 100%;
line-height: 36px;
display: inline-block;
white-space:nowrap;
margin-right: 10px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info > span{
font-size: 14px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box{
height: 100%;
display: flex;
align-items: center;
white-space:nowrap;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box > .step-btn{
padding: 0px 8px;
height: 24px;
border: 1px solid #ccc;
margin: 5px 0px;
border-radius: 6px;
line-height: 24px;
cursor: pointer;
margin-right: 10px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box > .step-btn > span{
font-size: 14px;
}

View File

@ -0,0 +1,184 @@
/*
* @Author: stacker
* @Date: 2021-07-06 23:20:58
* @LastEditTime: 2021-07-07 00:57:07
* @LastEditors: Please set LastEditors
* @Description: 步骤引导文件
* @FilePath: \bebras-tasks\_common\modules\integrationAPI.01\installationAPI.01\pemFioi\stepGuidance.js
*/
class StepGuidance{
/**
* elementStepList 步骤元素列表
* 元素参数
* {
* target: 目标元素:String
* tip: 提示信息:String
* tips_position:{ 提示信息框位置控制:String
* bottom: 提示信息框距离选中框下部位置:String
* left: 提示信息框距离选中框左侧位置:String
* t_left: 提示信息框三角形位置:String
* }
* padding: 选中框padding大小:String
* level: 元素所属于难度:Array
* step:{ 元素所属步骤
* easy: 元素在easy难度下数以第几部:Number
* medium: 元素在medium难度下数以第几部:Number
* hard: 元素在hard难度下数以第几部:Number
* }
* borderRadius: 选中框圆角大小:Number
* isSVG: 元素是否属于SVG元素:Boolean
* }
*/
elementStepList = []
level = "easy"
guidanceName = ""
stepIndex = 0
constructor(stepList,guidanceName){
let levelHash = window.location.hash?window.location.hash.replace('#',''):'easy'
this.level = ['easy','medium','hard'].includes(levelHash)?levelHash:'easy'
this.elementStepList = stepList.filter(item=>item.level.includes(this.level))
this.guidanceName = guidanceName
}
init(){
if(this.getCookie()){
console.log('页面已经加载过指导,不再加载')
}else{
window.onload = ()=>{
this.guidanceBegin()
this.updateGuidanceStep()
$('#btn-box').on('click','#next-step-btn',()=>{
this.stepIndex += 1
this.updateGuidanceStep()
})
$('#btn-box').on('click','#last-step-btn',()=>{
this.stepIndex -= 1
this.updateGuidanceStep()
})
$('#btn-box').on('click','#complete-btn',()=>{
$('#guide-box').remove()
this.setCookie()
})
$(window).resize(()=>{
this.updateGuidanceStep()
})
$(document).scroll(()=>{
this.updateGuidanceStep()
})
}
}
}
guidanceBegin(){
//载入引导主体
if($("#guide-box").length==0){
$('body').append(`<div id="guide-box">
<div class="guide-area">
<div class="guide-tip-box" id="guide-tip">
<div class="guide-tip-content">
<div class="triangle"></div>
<div class="circle"></div>
<div class="tip-info">
<span></span>
</div>
<div class="button-box" id="btn-box"></div>
</div>
</div>
</div>
</div>`)
}
}
updateGuidanceStep(){
let elementTarget = this.elementStepList[this.elementStepList.findIndex(item=>item.step[this.level]==this.stepIndex)]
$('#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .triangle').css('left',elementTarget.tip_position.t_left)
$('#guide-box > .guide-area').css('width',this.getTargetWidth(elementTarget)+'px')
.css('height',this.getTargetHeight(elementTarget)+'px')
.css('top',this.getTargetTop(elementTarget)+'px')
.css('left',this.getTargetLeft(elementTarget)+'px')
.css('border-radius',elementTarget.borderRadius+'px')
.css('padding',elementTarget.padding)
for(let key in elementTarget.tip_position){
$('#guide-tip').css(key,elementTarget.tip_position[key])
}
$('#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info > span').text(elementTarget.tips)
$('#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box').html(`
${this.stepIndex!=0?'<div id="last-step-btn" class="step-btn"><span>上一步</span></div>':''}
${this.stepIndex!=this.elementStepList.length-1?'<div id="next-step-btn" class="step-btn"><span>下一步</span></div>':''}
${this.elementStepList.length-1==this.stepIndex?'<div id="complete-btn" class="step-btn" style="background-color:#FDF151;border:none;"><span>我知道了!</span></div>':''}
`)
}
getCookie(cookieName=this.guidanceName){
var name = cookieName + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca[i].trim();
if (c.indexOf(name)==0) { return c.substring(name.length,c.length); }
}
return false;
}
setCookie(cookieName=this.guidanceName,value='true'){
var expdate = new Date(); //初始化时间
expdate.setTime(expdate.getTime() + 5 * 60 * 1000); //时间单位毫秒
document.cookie = cookieName+"="+value+";expires="+expdate.toGMTString()+";path=/";
}
getTargetWidth(elementTarget){
if(typeof elementTarget.target == 'object'){
let value = 0;
let leftValue = [2000,0]
for(let elementItem of elementTarget.target){
let elementLeft = $(elementItem).offset().left
if(elementLeft<leftValue[0]){
leftValue[0] = elementLeft
}
if(elementLeft>leftValue[1]){
leftValue[1] = elementLeft
value = 0
value += $(elementItem).width()
}
}
return value + leftValue[1] - leftValue[0]
}
return elementTarget.isSVG?$(elementTarget.target).get(0).getBBox().width:$(elementTarget.target).outerWidth()
}
getTargetHeight(elementTarget) {
if(typeof elementTarget.target == 'object'){
let value = 0;
let topValue = [2000,0]
for(let elementItem of elementTarget.target){
let elementTop = $(elementItem).offset().top
if(elementTop<topValue[0]){
topValue[0] = elementTop
}
if(elementTop>topValue[1]){
topValue[1] = elementTop
value = 0
value += $(elementItem).height()
}
}
return value + topValue[1] - topValue[0]
}
return elementTarget.isSVG?$(elementTarget.target).get(0).getBBox().height:$(elementTarget.target).outerHeight()
}
getTargetTop(elementTarget) {
if(typeof elementTarget.target == 'object'){
let value = 2000
for(let elementItem of elementTarget.target){
value = $(elementItem).offset().top<value?$(elementItem).offset().top:value
}
return value - parseFloat(elementTarget.padding.split(' ')[0].replace('px')) - $(document).scrollTop()
}
return $(elementTarget.target).offset().top - parseFloat(elementTarget.padding.split(' ')[0].replace('px')) - $(document).scrollTop()
}
getTargetLeft(elementTarget) {
if(typeof elementTarget.target == 'object'){
let value = 2000
for(let elementItem of elementTarget.target){
value = $(elementItem).offset().left<value?$(elementItem).offset().left:value
}
return value - parseFloat(elementTarget.padding.split(' ')[1].replace('px'))
}
return $(elementTarget.target).offset().left - parseFloat(elementTarget.padding.split(' ')[1].replace('px'))
}
}

View File

@ -56,208 +56,89 @@
}; };
</script> </script>
<script type="text/javascript" src="task.js"></script> <script type="text/javascript" src="task.js"></script>
<script type="text/javascript" src="../../../_common/modules/integrationAPI.01/installationAPI.01/pemFioi/stepGuidance.js"></script>
<script type="text/javascript"> <script type="text/javascript">
window.onload = function(){ let elementList = [{
target:['#displayHelper_validate','#displayHelper_cancel'],
let levelHash = window.location.hash?window.location.hash.replace('#',''):'easy' tips:'您可以验证答案是否正确或重新开始',
let level = ['easy','medium','hard'].includes(levelHash)?levelHash:'easy' tip_position:{
let stepIndex = 0 bottom:'-62px',
$('body').append(`<div id="guide-box"> left:'30px',
<div class="guide-area"> t_left:'30px'
<div class="guide-tip-box" id="guide-tip"> },
<div class="guide-tip-content"> padding:'10px 0px',
<div class="triangle"></div> level:['easy','medium','hard'],
<div class="circle"></div> step:{
<div class="tip-info"> easy:2,
<span></span> medium:2,
</div> hard:2
<div class="button-box" id="btn-box"></div> },
</div> borderRadius:16,
</div> },{
</div> target:'#paper > svg > circle:nth-of-type(4)',
</div>`) tips:'点击空白小圆圈,可以把小石子放进去',
let elementList = [{ tip_position:{
target:['#displayHelper_validate','#displayHelper_cancel'], bottom:'-62px',
tips:'您可以验证答案是否正确或重新开始', left:'0px',
tip_position:{ t_left:'30px'
bottom:'-62px', },
left:'30px', padding:'10px 10px',
t_left:'30px' level:['easy'],
}, step:{
padding:'10px 0px', easy:0,
level:['easy','medium','hard'], },
step:{ borderRadius:16,
easy:2, isSVG:true
medium:2, },{
hard:2 target:'#paper > svg > circle:nth-of-type(19)',
}, tips:'点击空白小圆圈,可以把小石子放进去',
borderRadius:16, tip_position:{
},{ bottom:'-62px',
target:'#paper > svg > circle:nth-of-type(4)', left:'0px',
tips:'点击空白小圆圈,可以把小石子放进去', t_left:'30px'
tip_position:{ },
bottom:'-62px', padding:'10px 10px',
left:'0px', level:['hard'],
t_left:'30px' step:{
}, hard:0
padding:'10px 10px', },
level:['easy'], borderRadius:16,
step:{ isSVG:true
easy:0, },{
}, target:'#paper > svg > circle:nth-of-type(8)',
borderRadius:16, tips:'点击空白小圆圈,可以把小石子放进去',
isSVG:true tip_position:{
},{ bottom:'-62px',
target:'#paper > svg > circle:nth-of-type(19)', left:'0px',
tips:'点击空白小圆圈,可以把小石子放进去', t_left:'30px'
tip_position:{ },
bottom:'-62px', padding:'10px 10px',
left:'0px', level:['medium'],
t_left:'30px' step:{
}, medium:0
padding:'10px 10px', },
level:['hard'], borderRadius:16,
step:{ isSVG:true
hard:0 },{
}, target:'#undo',
borderRadius:16, tips:'点击取消,或者点击放有石子的小圆圈可以把小石子取回储备库。',
isSVG:true tip_position:{
},{ bottom:'-62px',
target:'#paper > svg > circle:nth-of-type(8)', left:'-320px',
tips:'点击空白小圆圈,可以把小石子放进去', t_left:'360px'
tip_position:{ },
bottom:'-62px', padding:'10px 10px',
left:'0px', level:['easy','medium','hard'],
t_left:'30px' step:{
}, easy:1,
padding:'10px 10px', medium:1,
level:['medium'], hard:1
step:{ },
medium:0 borderRadius:16,
}, }]
borderRadius:16, let stepGuidance = new StepGuidance(elementList,'registers')
isSVG:true stepGuidance.init()
},{
target:'#undo',
tips:'点击取消,或者点击放有石子的小圆圈可以把小石子取回储备库。',
tip_position:{
bottom:'-62px',
left:'-320px',
t_left:'360px'
},
padding:'10px 10px',
level:['easy','medium','hard'],
step:{
easy:1,
medium:1,
hard:1
},
borderRadius:16,
}]
elementList = elementList.filter(item=>item.level.includes(level))
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
$('#btn-box').on('click','#next-step-btn',()=>{
stepIndex += 1
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
})
$('#btn-box').on('click','#last-step-btn',()=>{
stepIndex -= 1
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
})
$('#btn-box').on('click','#complete-btn',()=>{
$('#guide-box').remove()
})
$(window).resize(()=>{
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
})
$(document).scroll(()=>{
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
})
}
function updateGuide(elementList,itemIndex,stepIndex){
let elementItem = elementList[itemIndex]
$('#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .triangle').css('left',elementItem.tip_position.t_left)
$('#guide-box > .guide-area').css('width',getTargetWidth(elementItem.target,elementItem.isSVG)+'px')
.css('height',getTargetHeight(elementItem.target,elementItem.isSVG)+'px')
.css('top',getTargetTop(elementItem.target,parseFloat(elementItem.padding.split(' ')[0].replace('px')),elementItem.isSVG)+'px')
.css('left',getTargetLeft(elementItem.target,parseFloat(elementItem.padding.split(' ')[1].replace('px')),elementItem.isSVG)+'px')
.css('border-radius',elementItem.borderRadius+'px')
.css('padding',elementItem.padding)
for(let key in elementItem.tip_position){
$('#guide-tip').css(key,elementItem.tip_position[key])
}
$('#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info > span').text(elementItem.tips)
$('#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box').html(`
${stepIndex!=0?'<div id="last-step-btn" class="step-btn"><span>上一步</span></div>':''}
${stepIndex!=elementList.length-1?'<div id="next-step-btn" class="step-btn"><span>下一步</span></div>':''}
${elementList.length-1==stepIndex?'<div id="complete-btn" class="step-btn" style="background-color:#FDF151;border:none;"><span>我知道了!</span></div>':''}
`)
}
function getTargetWidth(targetElement,isSVG){
if(typeof targetElement == 'object'){
let value = 0;
let leftValue = [2000,0]
for(let elementItem of targetElement){
let elementLeft = $(elementItem).offset().left
if(elementLeft<leftValue[0]){
leftValue[0] = elementLeft
}
if(elementLeft>leftValue[1]){
leftValue[1] = elementLeft
value = 0
value += $(elementItem).width()
}
}
return value + leftValue[1] - leftValue[0]
}
return isSVG?$(targetElement).get(0).getBBox().width:$(targetElement).outerWidth()
}
function getTargetHeight(targetElement,isSVG) {
if(typeof targetElement == 'object'){
let value = 0;
let topValue = [2000,0]
for(let elementItem of targetElement){
let elementTop = $(elementItem).offset().top
if(elementTop<topValue[0]){
topValue[0] = elementTop
}
if(elementTop>topValue[1]){
topValue[1] = elementTop
value = 0
value += $(elementItem).height()
}
}
return value + topValue[1] - topValue[0]
}
return isSVG?$(targetElement).get(0).getBBox().height:$(targetElement).outerHeight()
}
function getTargetTop(targetElement,padding,isSVG) {
if(typeof targetElement == 'object'){
let value = 2000
for(let elementItem of targetElement){
value = $(elementItem).offset().top<value?$(elementItem).offset().top:value
}
return value - padding - $(document).scrollTop()
}
return $(targetElement).offset().top - padding - $(document).scrollTop()
}
function getTargetLeft(targetElement,padding,isSVG) {
if(typeof targetElement == 'object'){
let value = 2000
for(let elementItem of targetElement){
value = $(elementItem).offset().left<value?$(elementItem).offset().left:value
}
return value - padding
}
return $(targetElement).offset().left - padding
}
</script> </script>
<style> <style>
#paper { #paper {
@ -274,88 +155,9 @@
display: block; display: block;
margin: auto; margin: auto;
} }
#guide-box{
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
z-index: 998;
}
#guide-box > .guide-area{
box-shadow: 1px 1px 100000px 100000px rgb(124 152 209 / 50%);
position: fixed;
transition: all 500ms;
/* padding: 10px 0px; */
}
#guide-box > .guide-area > .guide-tip-box{
height: 36px;
position: absolute;
bottom:-60px;
left: 60px;
box-sizing: border-box;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content{
height: 100%;
background-color: white;
border-radius: 12px;
position: relative;
box-sizing: border-box;
padding: 0px 8px;
display: flex;
align-items: center;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .triangle{
/*content:'';
display: block;*/
position: absolute;
width: 0;
height: 0;
border-left: 12px solid transparent;
border-right: 12px solid transparent;
border-bottom: 12px solid white;
top: -12px;
/*left: 30px;*/
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .circle{
width: 8px;
height: 8px;
border-radius: 8px;
background-color: #FDF151;
margin: 14px 10px 14px 0px;
float: left;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info{
height: 100%;
line-height: 36px;
display: inline-block;
white-space:nowrap;
margin-right: 10px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info > span{
font-size: 14px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box{
height: 100%;
display: flex;
align-items: center;
white-space:nowrap;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box > .step-btn{
padding: 0px 8px;
height: 24px;
border: 1px solid #ccc;
margin: 5px 0px;
border-radius: 6px;
line-height: 24px;
cursor: pointer;
margin-right: 10px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box > .step-btn > span{
font-size: 14px;
}
</style> </style>
<link rel="stylesheet" type="text/css" href="../public-style.css"> <link rel="stylesheet" type="text/css" href="../public-style.css">
<link rel="stylesheet" type="text/css" href="../../../_common/modules/integrationAPI.01/installationAPI.01/pemFioi/stepGuidance.css">
</head> </head>
<body> <body>

View File

@ -55,213 +55,96 @@
}; };
</script> </script>
<script type="text/javascript" src="task.js"></script> <script type="text/javascript" src="task.js"></script>
<script type="text/javascript" src="../../../_common/modules/integrationAPI.01/installationAPI.01/pemFioi/stepGuidance.js"></script>
<script type="text/javascript"> <script type="text/javascript">
window.onload = function(){ let elementList = [{
let levelHash = window.location.hash?window.location.hash.replace('#',''):'easy' target:'#displayHelper_validate',
let level = ['easy','medium','hard'].includes(levelHash)?levelHash:'easy' tips:'点击“试一试”来验证你的想法,不限次数~',
let stepIndex = 0 tip_position:{
$('body').append(`<div id="guide-box"> bottom:'-62px',
<div class="guide-area"> left:'30px',
<div class="guide-tip-box" id="guide-tip"> },
<div class="guide-tip-content"> padding:'10px 0px',
<div class="circle"></div> level:['easy'],
<div class="tip-info"> step:{
<span></span> easy:2,
</div> },
<div class="button-box" id="btn-box"></div> borderRadius:16
</div> },{
</div> target:'#nbStamps_select',
</div> tips:'点击选择邮票数量',
</div>`) padding:'10px 20px',
let elementList = [{ tip_position:{
target:'#displayHelper_validate', bottom:'-62px',
tips:'点击“试一试”来验证你的想法,不限次数~', left:'30px',
tip_position:{ },
bottom:'-62px', level:['easy','medium','hard'],
left:'30px', step:{
}, easy:0,
padding:'10px 0px', medium:1,
level:['easy'], hard:1
step:{ },
easy:2, borderRadius:16
}, },{
borderRadius:16 target:'#stampsPaper > svg',
},{ tips:'点击改变每张邮票颜色',
target:'#nbStamps_select', padding:'10px 10px',
tips:'点击选择邮票数量', tip_position:{
padding:'10px 20px', bottom:'-62px',
tip_position:{ left:'30px',
bottom:'-62px', },
left:'30px', level:['easy','medium','hard'],
}, step:{
level:['easy','medium','hard'], easy:1,
step:{ medium:2,
easy:0, hard:2
medium:1, },
hard:1 borderRadius:16
}, },{
borderRadius:16 target:['#paper > svg > rect:nth-of-type(1)','#paper > svg > rect:nth-of-type(2)'],
},{ tips:'点击滚筒,可以选中其中的一个,再去修改它的参数。',
target:'#stampsPaper > svg', padding:'10px 10px',
tips:'点击改变每张邮票颜色', tip_position:{
padding:'10px 10px', bottom:'-62px',
tip_position:{ left:'30px',
bottom:'-62px', },
left:'30px', level:['medium','hard'],
}, step:{
level:['easy','medium','hard'], medium:0,
step:{ hard:0
easy:1, },
medium:2, borderRadius:16
hard:2 },{
}, target:'#parameters > tbody > tr:nth-of-type(3)',
borderRadius:16 tips:'点击选择当前选中的滚筒滚动的起始和终止位置',
},{ padding:'10px 10px',
target:['#paper > svg > rect:nth-of-type(1)','#paper > svg > rect:nth-of-type(2)'], tip_position:{
tips:'点击滚筒,可以选中其中的一个,再去修改它的参数。', bottom:'-62px',
padding:'10px 10px', left:'30px',
tip_position:{ },
bottom:'-62px', level:['medium','hard'],
left:'30px', step:{
}, medium:3,
level:['medium','hard'], hard:3
step:{ },
medium:0, borderRadius:16
hard:0 },{
}, target:['#displayHelper_validate','#displayHelper_cancel'],
borderRadius:16 tips:'当你设置好每个滚筒的参数之后,可以点击“试一试”验证你的答案,也可以重新开始。',
},{ padding:'10px 10px',
target:'#parameters > tbody > tr:nth-of-type(3)', tip_position:{
tips:'点击选择当前选中的滚筒滚动的起始和终止位置', bottom:'-62px',
padding:'10px 10px', left:'30px',
tip_position:{ },
bottom:'-62px', level:['medium','hard'],
left:'30px', step:{
}, medium:4,
level:['medium','hard'], hard:4
step:{ },
medium:3, borderRadius:16
hard:3 }]
}, let stepGuidance = new StepGuidance(elementList,'roller')
borderRadius:16 stepGuidance.init()
},{
target:['#displayHelper_validate','#displayHelper_cancel'],
tips:'当你设置好每个滚筒的参数之后,可以点击“试一试”验证你的答案,也可以重新开始。',
padding:'10px 10px',
tip_position:{
bottom:'-62px',
left:'30px',
},
level:['medium','hard'],
step:{
medium:4,
hard:4
},
borderRadius:16
}]
elementList = elementList.filter(item=>item.level.includes(level))
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
$('#btn-box').on('click','#next-step-btn',()=>{
stepIndex += 1
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
})
$('#btn-box').on('click','#last-step-btn',()=>{
stepIndex -= 1
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
})
$('#btn-box').on('click','#complete-btn',()=>{
$('#guide-box').remove()
})
$(window).resize(()=>{
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
})
$(document).scroll(()=>{
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
})
}
function updateGuide(elementList,itemIndex,stepIndex){
let elementItem = elementList[itemIndex]
$('#guide-box > .guide-area').css('width',getTargetWidth(elementItem.target)+'px')
.css('height',getTargetHeight(elementItem.target)+'px')
.css('top',getTargetTop(elementItem.target,parseFloat(elementItem.padding.split(' ')[0].replace('px')))+'px')
.css('left',getTargetLeft(elementItem.target,parseFloat(elementItem.padding.split(' ')[1].replace('px')))+'px')
.css('border-radius',elementItem.borderRadius+'px')
.css('padding',elementItem.padding)
for(let key in elementItem.tip_position){
$('#guide-tip').css(key,elementItem.tip_position[key])
}
$('#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info > span').text(elementItem.tips)
$('#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box').html(`
${stepIndex!=0?'<div id="last-step-btn" class="step-btn"><span>上一步</span></div>':''}
${stepIndex!=elementList.length-1?'<div id="next-step-btn" class="step-btn"><span>下一步</span></div>':''}
${elementList.length-1==stepIndex?'<div id="complete-btn" class="step-btn" style="background-color:#FDF151;border:none;"><span>我知道了!</span></div>':''}
`)
}
function getTargetWidth(targetElement){
if(typeof targetElement == 'object'){
let value = 0;
let leftValue = [2000,0]
for(let elementItem of targetElement){
let elementLeft = $(elementItem).offset().left
if(elementLeft<leftValue[0]){
leftValue[0] = elementLeft
}
if(elementLeft>leftValue[1]){
leftValue[1] = elementLeft
value = 0
value += $(elementItem).width()
}
}
return value + leftValue[1] - leftValue[0]
}
return $(targetElement).width()
}
function getTargetHeight(targetElement) {
if(typeof targetElement == 'object'){
let value = 0;
let topValue = [2000,0]
for(let elementItem of targetElement){
let elementTop = $(elementItem).offset().top
if(elementTop<topValue[0]){
topValue[0] = elementTop
}
if(elementTop>topValue[1]){
topValue[1] = elementTop
value = 0
value += $(elementItem).height()
}
}
return value + topValue[1] - topValue[0]
}
return $(targetElement).height()
}
function getTargetTop(targetElement,padding) {
if(typeof targetElement == 'object'){
let value = 2000
for(let elementItem of targetElement){
value = $(elementItem).offset().top<value?$(elementItem).offset().top:value
}
return value - padding - $(document).scrollTop()
}
return $(targetElement).offset().top - padding - $(document).scrollTop()
}
function getTargetLeft(targetElement,padding) {
if(typeof targetElement == 'object'){
let value = 2000
for(let elementItem of targetElement){
value = $(elementItem).offset().left<value?$(elementItem).offset().left:value
}
return value - padding
}
return $(targetElement).offset().left - padding
}
</script> </script>
<style> <style>
#parameters { #parameters {
@ -293,88 +176,9 @@
width: 4em; width: 4em;
height: 2em; height: 2em;
} }
#guide-box{
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
z-index: 998;
}
#guide-box > .guide-area{
box-shadow: 1px 1px 100000px 100000px rgb(124 152 209 / 50%);
position:absolute;
transition: all 500ms;
/* padding: 10px 0px; */
}
#guide-box > .guide-area > .guide-tip-box{
height: 36px;
position: absolute;
bottom:-60px;
left: 60px;
box-sizing: border-box;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content{
height: 100%;
background-color: white;
border-radius: 12px;
position: relative;
box-sizing: border-box;
padding: 0px 8px;
display: flex;
align-items: center;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content::before{
content:'';
display: block;
position: absolute;
width: 0;
height: 0;
border-left: 12px solid transparent;
border-right: 12px solid transparent;
border-bottom: 12px solid white;
top: -12px;
left: 30px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .circle{
width: 8px;
height: 8px;
border-radius: 8px;
background-color: #FDF151;
margin: 14px 10px 14px 0px;
float: left;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info{
height: 100%;
line-height: 36px;
display: inline-block;
white-space:nowrap;
margin-right: 10px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info > span{
font-size: 14px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box{
height: 100%;
display: flex;
align-items: center;
white-space:nowrap;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box > .step-btn{
padding: 0px 8px;
height: 24px;
border: 1px solid #ccc;
margin: 5px 0px;
border-radius: 6px;
line-height: 24px;
cursor: pointer;
margin-right: 10px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box > .step-btn > span{
font-size: 14px;
}
</style> </style>
<link rel="stylesheet" type="text/css" href="../public-style.css"> <link rel="stylesheet" type="text/css" href="../public-style.css">
<link rel="stylesheet" type="text/css" href="../../../_common/modules/integrationAPI.01/installationAPI.01/pemFioi/stepGuidance.css">
</head> </head>
<body> <body>

View File

@ -56,208 +56,87 @@
}; };
</script> </script>
<script type="text/javascript" src="task.js"></script> <script type="text/javascript" src="task.js"></script>
<script type="text/javascript" src="../../../_common/modules/integrationAPI.01/installationAPI.01/pemFioi/stepGuidance.js"></script>
<script type="text/javascript"> <script type="text/javascript">
window.onload = function(){ let elementList = [{
let levelHash = window.location.hash?window.location.hash.replace('#',''):'easy' target:'#paper > svg > circle:nth-of-type(8)',
let level = ['easy','medium','hard'].includes(levelHash)?levelHash:'easy' tips:'点击转动杠杆,改变轨道方向',
let stepIndex = 0 tip_position:{
$('body').append(`<div id="guide-box"> bottom:'-62px',
<div class="guide-area"> left:'30px',
<div class="guide-tip-box" id="guide-tip"> t_left:'30px'
<div class="guide-tip-content"> },
<div class="triangle"></div> padding:'10px 10px',
<div class="circle"></div> level:['easy'],
<div class="tip-info"> step:{
<span></span> easy:0
</div> },
<div class="button-box" id="btn-box"></div> borderRadius:16,
</div> isSVG:true
</div> },{
</div> target:'#paper > svg > circle:nth-of-type(11)',
</div>`) tips:'点击转动杠杆,改变轨道方向',
tip_position:{
bottom:'-62px',
let elementList = [{ left:'30px',
target:'#paper > svg > circle:nth-of-type(8)', t_left:'30px'
tips:'点击转动杠杆,改变轨道方向', },
tip_position:{ padding:'10px 10px',
bottom:'-62px', level:['medium'],
left:'30px', step:{
t_left:'30px' medium:0
}, },
padding:'10px 10px', borderRadius:16,
level:['easy'], isSVG:true
step:{ },{
easy:0 target:'#paper > svg > circle:nth-of-type(23)',
}, tips:'点击转动杠杆,改变轨道方向',
borderRadius:16, tip_position:{
isSVG:true bottom:'-62px',
},{ left:'30px',
target:'#paper > svg > circle:nth-of-type(11)', t_left:'30px'
tips:'点击转动杠杆,改变轨道方向', },
tip_position:{ padding:'10px 10px',
bottom:'-62px', level:['hard'],
left:'30px', step:{
t_left:'30px' hard:0
}, },
padding:'10px 10px', borderRadius:16,
level:['medium'], isSVG:true
step:{ },{
medium:0 target:'#paper > svg > circle:nth-of-type(5)',
}, tips:'点击单个轮子,使其断开或连接单个轮子',
borderRadius:16, tip_position:{
isSVG:true bottom:'-62px',
},{ left:'30px',
target:'#paper > svg > circle:nth-of-type(23)', t_left:'30px'
tips:'点击转动杠杆,改变轨道方向', },
tip_position:{ padding:'10px 10px',
bottom:'-62px', level:['easy','medium'],
left:'30px', step:{
t_left:'30px' easy:1,
}, medium:1,
padding:'10px 10px', },
level:['hard'], borderRadius:16,
step:{ isSVG:true
hard:0 },{
}, target:'#paper > svg > circle:nth-of-type(12)',
borderRadius:16, tips:'点击单个轮子,使其断开或连接单个轮子',
isSVG:true tip_position:{
},{ bottom:'-62px',
target:'#paper > svg > circle:nth-of-type(5)', left:'30px',
tips:'点击单个轮子,使其断开或连接单个轮子', t_left:'30px'
tip_position:{ },
bottom:'-62px', padding:'10px 10px',
left:'30px', level:['hard'],
t_left:'30px' step:{
}, hard:1
padding:'10px 10px', },
level:['easy','medium'], borderRadius:16,
step:{ isSVG:true
easy:1, }]
medium:1, let stepGuidance = new StepGuidance(elementList,'align-strips')
}, stepGuidance.init()
borderRadius:16,
isSVG:true
},{
target:'#paper > svg > circle:nth-of-type(12)',
tips:'点击单个轮子,使其断开或连接单个轮子',
tip_position:{
bottom:'-62px',
left:'30px',
t_left:'30px'
},
padding:'10px 10px',
level:['hard'],
step:{
hard:1
},
borderRadius:16,
isSVG:true
}]
elementList = elementList.filter(item=>item.level.includes(level))
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
$('#btn-box').on('click','#next-step-btn',()=>{
stepIndex += 1
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
})
$('#btn-box').on('click','#last-step-btn',()=>{
stepIndex -= 1
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
})
$('#btn-box').on('click','#complete-btn',()=>{
$('#guide-box').remove()
})
$(window).resize(()=>{
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
})
$(document).scroll(()=>{
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex)
})
}
function updateGuide(elementList,itemIndex,stepIndex){
let elementItem = elementList[itemIndex]
$('#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .triangle').css('left',elementItem.tip_position.t_left)
$('#guide-box > .guide-area').css('width',getTargetWidth(elementItem.target,elementItem.isSVG)+'px')
.css('height',getTargetHeight(elementItem.target,elementItem.isSVG)+'px')
.css('top',getTargetTop(elementItem.target,parseFloat(elementItem.padding.split(' ')[0].replace('px')),elementItem.isSVG)+'px')
.css('left',getTargetLeft(elementItem.target,parseFloat(elementItem.padding.split(' ')[1].replace('px')),elementItem.isSVG)+'px')
.css('border-radius',elementItem.borderRadius+'px')
.css('padding',elementItem.padding)
for(let key in elementItem.tip_position){
$('#guide-tip').css(key,elementItem.tip_position[key])
}
$('#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info > span').text(elementItem.tips)
$('#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box').html(`
${stepIndex!=0?'<div id="last-step-btn" class="step-btn"><span>上一步</span></div>':''}
${stepIndex!=elementList.length-1?'<div id="next-step-btn" class="step-btn"><span>下一步</span></div>':''}
${elementList.length-1==stepIndex?'<div id="complete-btn" class="step-btn" style="background-color:#FDF151;border:none;"><span>我知道了!</span></div>':''}
`)
}
function getTargetWidth(targetElement,isSVG){
if(typeof targetElement == 'object'){
let value = 0;
let leftValue = [2000,0]
for(let elementItem of targetElement){
let elementLeft = $(elementItem).offset().left
if(elementLeft<leftValue[0]){
leftValue[0] = elementLeft
}
if(elementLeft>leftValue[1]){
leftValue[1] = elementLeft
value = 0
value += $(elementItem).width()
}
}
return value + leftValue[1] - leftValue[0]
}
return isSVG?$(targetElement).get(0).getBBox().width:$(targetElement).outerWidth()
}
function getTargetHeight(targetElement,isSVG) {
if(typeof targetElement == 'object'){
let value = 0;
let topValue = [2000,0]
for(let elementItem of targetElement){
let elementTop = $(elementItem).offset().top
if(elementTop<topValue[0]){
topValue[0] = elementTop
}
if(elementTop>topValue[1]){
topValue[1] = elementTop
value = 0
value += $(elementItem).height()
}
}
return value + topValue[1] - topValue[0]
}
return isSVG?$(targetElement).get(0).getBBox().height:$(targetElement).outerHeight()
}
function getTargetTop(targetElement,padding,isSVG) {
if(typeof targetElement == 'object'){
let value = 2000
for(let elementItem of targetElement){
value = $(elementItem).offset().top<value?$(elementItem).offset().top:value
}
return value - padding - $(document).scrollTop()
}
return $(targetElement).offset().top - padding - $(document).scrollTop()
}
function getTargetLeft(targetElement,padding,isSVG) {
if(typeof targetElement == 'object'){
let value = 2000
for(let elementItem of targetElement){
value = $(elementItem).offset().left<value?$(elementItem).offset().left:value
}
return value - padding
}
return $(targetElement).offset().left - padding
}
</script> </script>
<style> <style>
#paper { #paper {
@ -269,88 +148,9 @@
.actions-descr li { .actions-descr li {
margin-top: 1em; margin-top: 1em;
} }
#guide-box{
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
z-index: 998;
}
#guide-box > .guide-area{
box-shadow: 1px 1px 100000px 100000px rgb(124 152 209 / 50%);
position: fixed;
transition: all 500ms;
/* padding: 10px 0px; */
}
#guide-box > .guide-area > .guide-tip-box{
height: 36px;
position: absolute;
bottom:-60px;
left: 60px;
box-sizing: border-box;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content{
height: 100%;
background-color: white;
border-radius: 12px;
position: relative;
box-sizing: border-box;
padding: 0px 8px;
display: flex;
align-items: center;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .triangle{
/*content:'';
display: block;*/
position: absolute;
width: 0;
height: 0;
border-left: 12px solid transparent;
border-right: 12px solid transparent;
border-bottom: 12px solid white;
top: -12px;
/*left: 30px;*/
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .circle{
width: 8px;
height: 8px;
border-radius: 8px;
background-color: #FDF151;
margin: 14px 10px 14px 0px;
float: left;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info{
height: 100%;
line-height: 36px;
display: inline-block;
white-space:nowrap;
margin-right: 10px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info > span{
font-size: 14px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box{
height: 100%;
display: flex;
align-items: center;
white-space:nowrap;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box > .step-btn{
padding: 0px 8px;
height: 24px;
border: 1px solid #ccc;
margin: 5px 0px;
border-radius: 6px;
line-height: 24px;
cursor: pointer;
margin-right: 10px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box > .step-btn > span{
font-size: 14px;
}
</style> </style>
<link rel="stylesheet" type="text/css" href="../public-style.css"> <link rel="stylesheet" type="text/css" href="../public-style.css">
<link rel="stylesheet" type="text/css" href="../../../_common/modules/integrationAPI.01/installationAPI.01/pemFioi/stepGuidance.css">
</head> </head>
<body> <body>

View File

@ -51,253 +51,100 @@
}; };
</script> </script>
<script type="text/javascript" src="task.js"></script> <script type="text/javascript" src="task.js"></script>
<script type="text/javascript" src="../../../_common/modules/integrationAPI.01/installationAPI.01/pemFioi/stepGuidance.js"></script>
<script type="text/javascript"> <script type="text/javascript">
window.onload = function(){ let elementList = [{
let levelHash = window.location.hash?window.location.hash.replace('#',''):'easy' target:['#displayHelper_validate','#displayHelper_cancel'],
let level = ['easy','medium','hard'].includes(levelHash)?levelHash:'easy' tips:'点击“验证一下”验证你的答案是否正确,或重新开始~',
let stepIndex = 0 tip_position:{
$('body').append(`<div id="guide-box"> bottom:'-62px',
<div class="guide-area"> left:'30px',
<div class="guide-tip-box" id="guide-tip"> t_left:'30px'
<div class="guide-tip-content"> },
<div class="triangle"></div> padding:'10px 0px',
<div class="circle"></div> level:['easy','medium','hard'],
<div class="tip-info"> step:{
<span></span> easy:1,
</div> medium:2,
<div class="button-box" id="btn-box"></div> hard:2
</div> },
</div> borderRadius:16,
</div> },{
</div>`) target:'#paper > svg > rect:nth-of-type(17)',
let elementList = [{ tips:'点击形状可以变为不同的形状',
target:'#displayHelper_validate', tip_position:{
tips:'点击“试一试”来验证你的想法,不限次数~', bottom:'-62px',
tip_position:{ left:'30px',
bottom:'-62px', t_left:'30px'
left:'30px', },
t_left:'30px' padding:'10px 10px',
}, level:['easy'],
padding:'10px 0px', step:{
level:['easy','medium','hard'], easy:0,
step:{ },
easy:1, borderRadius:16,
medium:1, isSVG:true
hard:1 },{
}, target:['#paper > svg > rect:nth-of-type(2)','#paper > svg > rect:nth-of-type(3)'],
borderRadius:16, tips:'点击形状可以变为不同的形状',
},{ tip_position:{
target:'#paper > svg > rect:nth-of-type(17)', bottom:'-62px',
tips:'点击形状可以变为不同的形状', left:'30px',
tip_position:{ t_left:'30px'
bottom:'-62px', },
left:'30px', padding:'10px 10px',
t_left:'30px' level:['medium','hard'],
}, step:{
padding:'10px 10px', medium:0,
level:['easy','medium','hard'], hard:0
step:{ },
easy:0, borderRadius:16,
medium:0, isSVG:true
hard:0 },{
}, target:['#paper > svg > rect:nth-of-type(12)','#paper > svg > rect:nth-of-type(13)'],
borderRadius:16, tips:'点击“+”或“-”,增加或减少形状',
isSVG:true tip_position:{
}] bottom:'-62px',
elementList = elementList.filter(item=>item.level.includes(level)) left:'30px',
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex) t_left:'30px'
$('#btn-box').on('click','#next-step-btn',()=>{ },
stepIndex += 1 padding:'10px 10px',
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex) level:['medium'],
}) step:{
$('#btn-box').on('click','#last-step-btn',()=>{ medium:1,
stepIndex -= 1 },
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex) borderRadius:16,
}) isSVG:true
$('#btn-box').on('click','#complete-btn',()=>{ },{
$('#guide-box').remove() target:['#paper > svg > rect:nth-of-type(14)','#paper > svg > rect:nth-of-type(15)'],
}) tips:'点击“+”或“-”,增加或减少形状',
$(window).resize(()=>{ tip_position:{
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex) bottom:'-62px',
}) left:'30px',
$(document).scroll(()=>{ t_left:'30px'
updateGuide(elementList,elementList.findIndex(item=>item.step[level]==stepIndex),stepIndex) },
}) padding:'10px 10px',
} level:['hard'],
function updateGuide(elementList,itemIndex,stepIndex){ step:{
let elementItem = elementList[itemIndex] hard:1,
$('#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .triangle').css('left',elementItem.tip_position.t_left) },
$('#guide-box > .guide-area').css('width',getTargetWidth(elementItem.target,elementItem.isSVG)+'px') borderRadius:16,
.css('height',getTargetHeight(elementItem.target,elementItem.isSVG)+'px') isSVG:true
.css('top',getTargetTop(elementItem.target,parseFloat(elementItem.padding.split(' ')[0].replace('px')),elementItem.isSVG)+'px') }]
.css('left',getTargetLeft(elementItem.target,parseFloat(elementItem.padding.split(' ')[1].replace('px')),elementItem.isSVG)+'px') let stepGuidance = new StepGuidance(elementList,'align-strips')
.css('border-radius',elementItem.borderRadius+'px') stepGuidance.init()
.css('padding',elementItem.padding)
for(let key in elementItem.tip_position){
$('#guide-tip').css(key,elementItem.tip_position[key])
}
$('#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info > span').text(elementItem.tips)
$('#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box').html(`
${stepIndex!=0?'<div id="last-step-btn" class="step-btn"><span>上一步</span></div>':''}
${stepIndex!=elementList.length-1?'<div id="next-step-btn" class="step-btn"><span>下一步</span></div>':''}
${elementList.length-1==stepIndex?'<div id="complete-btn" class="step-btn" style="background-color:#FDF151;border:none;"><span>我知道了!</span></div>':''}
`)
}
function getTargetWidth(targetElement,isSVG){
if(typeof targetElement == 'object'){
let value = 0;
let leftValue = [2000,0]
for(let elementItem of targetElement){
let elementLeft = $(elementItem).offset().left
if(elementLeft<leftValue[0]){
leftValue[0] = elementLeft
}
if(elementLeft>leftValue[1]){
leftValue[1] = elementLeft
value = 0
value += $(elementItem).width()
}
}
return value + leftValue[1] - leftValue[0]
}
return isSVG?$(targetElement).get(0).getBBox().width:$(targetElement).outerWidth()
}
function getTargetHeight(targetElement,isSVG) {
if(typeof targetElement == 'object'){
let value = 0;
let topValue = [2000,0]
for(let elementItem of targetElement){
let elementTop = $(elementItem).offset().top
if(elementTop<topValue[0]){
topValue[0] = elementTop
}
if(elementTop>topValue[1]){
topValue[1] = elementTop
value = 0
value += $(elementItem).height()
}
}
return value + topValue[1] - topValue[0]
}
return isSVG?$(targetElement).get(0).getBBox().height:$(targetElement).outerHeight()
}
function getTargetTop(targetElement,padding,isSVG) {
if(typeof targetElement == 'object'){
let value = 2000
for(let elementItem of targetElement){
value = $(elementItem).offset().top<value?$(elementItem).offset().top:value
}
return value - padding - $(document).scrollTop()
}
return $(targetElement).offset().top - padding - $(document).scrollTop()
}
function getTargetLeft(targetElement,padding,isSVG) {
if(typeof targetElement == 'object'){
let value = 2000
for(let elementItem of targetElement){
value = $(elementItem).offset().left<value?$(elementItem).offset().left:value
}
return value - padding
}
return $(targetElement).offset().left - padding
}
</script> </script>
<style> <style>
#paper { #paper {
margin-top: 1em; margin-top: 1em;
} }
#error { #error {
text-align: center; text-align: center;
}
#guide-box{
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
z-index: 998;
}
#guide-box > .guide-area{
box-shadow: 1px 1px 100000px 100000px rgb(124 152 209 / 50%);
position: fixed;
transition: all 500ms;
/* padding: 10px 0px; */
}
#guide-box > .guide-area > .guide-tip-box{
height: 36px;
position: absolute;
bottom:-60px;
left: 60px;
box-sizing: border-box;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content{
height: 100%;
background-color: white;
border-radius: 12px;
position: relative;
box-sizing: border-box;
padding: 0px 8px;
display: flex;
align-items: center;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .triangle{
/*content:'';
display: block;*/
position: absolute;
width: 0;
height: 0;
border-left: 12px solid transparent;
border-right: 12px solid transparent;
border-bottom: 12px solid white;
top: -12px;
/*left: 30px;*/
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .circle{
width: 8px;
height: 8px;
border-radius: 8px;
background-color: #FDF151;
margin: 14px 10px 14px 0px;
float: left;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info{
height: 100%;
line-height: 36px;
display: inline-block;
white-space:nowrap;
margin-right: 10px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .tip-info > span{
font-size: 14px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box{
height: 100%;
display: flex;
align-items: center;
white-space:nowrap;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box > .step-btn{
padding: 0px 8px;
height: 24px;
border: 1px solid #ccc;
margin: 5px 0px;
border-radius: 6px;
line-height: 24px;
cursor: pointer;
margin-right: 10px;
}
#guide-box > .guide-area > .guide-tip-box > .guide-tip-content > .button-box > .step-btn > span{
font-size: 14px;
} }
</style> </style>
<link rel="stylesheet" type="text/css" href="../public-style.css"> <link rel="stylesheet" type="text/css" href="../public-style.css">
<link rel="stylesheet" type="text/css" href="../../../_common/modules/integrationAPI.01/installationAPI.01/pemFioi/stepGuidance.css">
</head> </head>
<body> <body>