| 1 |
<div class="imh-6310"> |
| 2 |
<div class="imh-6310-sm"> |
| 3 |
<?php |
| 4 |
include imh_6310_plugin_url . 'settings/save.php'; |
| 5 |
include imh_6310_plugin_url . "settings/form.php"; |
| 6 |
?> |
| 7 |
<div class="imh-6310-preview-box"> |
| 8 |
<div class="imh-6310-preview"> |
| 9 |
|
| 10 |
<button class="imh-6310-btn-success imh-6310-upload-image">Upload Image</button> |
| 11 |
<button class="imh-6310-btn-success imh-6310-add-point">Add Point</button> |
| 12 |
<span class='imh-6310-pro'>You can add maximum 6 pointer on free version.</span> |
| 13 |
<?php |
| 14 |
if(isset($_GET['styleid'])) { |
| 15 |
echo '<div class="shortcode">Shortcode <input type="text" class="imh-6310-6330-shortcode" onclick="this.setSelectionRange(0, this.value.length)" value="[imh_6310_image_map id="'.esc_attr($_GET['styleid']).'"]"></div>'; |
| 16 |
} |
| 17 |
?> |
| 18 |
<hr /> |
| 19 |
</div> |
| 20 |
<div class="imh-6310-annotation-box"> |
| 21 |
<img src="<?php echo isset($cssData['main_image']) ? $cssData['main_image'] : '' ?>" class="imh-6310-main-image" /> |
| 22 |
<?php |
| 23 |
if ($jsonData) { |
| 24 |
$counter = 1; |
| 25 |
foreach ($jsonData as $js) { |
| 26 |
$jsonCode = json_encode($js); |
| 27 |
if($js->iconType == 1){ |
| 28 |
if(!$js->fontAwesomeIcon && !$js->fontAwesomeHoverIcon){ |
| 29 |
return; |
| 30 |
} |
| 31 |
if(!$js->fontAwesomeIcon){ |
| 32 |
$fontAwesomeIcon = $js->fontAwesomeHoverIcon; |
| 33 |
$fontAwesomeHoverIcon = $js->fontAwesomeHoverIcon; |
| 34 |
} |
| 35 |
else if(!$js->fontAwesomeHoverIcon){ |
| 36 |
$fontAwesomeIcon = $js->fontAwesomeIcon; |
| 37 |
$fontAwesomeHoverIcon = $js->fontAwesomeIcon; |
| 38 |
} else { |
| 39 |
$fontAwesomeIcon = $js->fontAwesomeIcon; |
| 40 |
$fontAwesomeHoverIcon = $js->fontAwesomeHoverIcon; |
| 41 |
} |
| 42 |
$points= " |
| 43 |
<i class='{$fontAwesomeIcon} imh-6310-pin-main-img imh-6310-blinking-{$counter}'></i> |
| 44 |
<i class='{$fontAwesomeHoverIcon} imh-6310-pin-hover-img imh-6310-blinking-hover-{$counter}'></i> |
| 45 |
"; |
| 46 |
}else if ($js->iconType == 2){ |
| 47 |
if(!$js->customFirstImg && !$js->customSecondImg){ |
| 48 |
return; |
| 49 |
} |
| 50 |
else if(!$js->customFirstImg){ |
| 51 |
$customFirstImg = $js->customSecondImg; |
| 52 |
$customSecondImg = $js->customSecondImg; |
| 53 |
} |
| 54 |
else if(!$js->customSecondImg){ |
| 55 |
$customFirstImg = $js->customFirstImg; |
| 56 |
$customSecondImg = $js->customFirstImg; |
| 57 |
} |
| 58 |
else { |
| 59 |
$customFirstImg = $js->customFirstImg; |
| 60 |
$customSecondImg = $js->customSecondImg; |
| 61 |
} |
| 62 |
$points = " |
| 63 |
<img src='{$customFirstImg}' class='imh-6310-pin-main-img imh-6310-blinking-{$counter}' /> |
| 64 |
<img src='{$customSecondImg}' class='imh-6310-pin-hover-img imh-6310-blinking-hover-{$counter}' /> |
| 65 |
"; |
| 66 |
}else { |
| 67 |
if(!$js->customText && !$js->customText){ |
| 68 |
return; |
| 69 |
}else{ |
| 70 |
$customText = $js->customText; |
| 71 |
} |
| 72 |
$points = " |
| 73 |
<div class='imh-6310-customtext imh-6310-blinking-{$counter}'>".esc_attr($customText)."</div> |
| 74 |
"; |
| 75 |
} |
| 76 |
|
| 77 |
echo " |
| 78 |
<div data-id='".esc_attr($counter)."' data-json='".esc_attr($jsonCode)."' class='imh-6310-drag imh-6310-point-{$counter} ui-widget-content ui-draggable ui-draggable-handle' style='bottom: {$js->yPos}%' data-position='{$js->xPos}-{$js->yPos}-{$js->tWidth}-{$js->iconWidth}'> |
| 79 |
<div class='imh-6310-point-editor'> |
| 80 |
<div class='imh-6310-point-edit'><i class='far fa-edit'></i></div> |
| 81 |
<div class= 'imh-6310-point-remove'><i class='fas fa-trash-alt'></i></div> |
| 82 |
</div> |
| 83 |
<div class='imh-6310-point-icons imh-6310-point-icons-".esc_attr($counter)."'> |
| 84 |
{$points} |
| 85 |
</div> |
| 86 |
</div>"; |
| 87 |
$pointCssCode = " |
| 88 |
.imh-6310-point-{$counter} .imh-6310-tooltip{ |
| 89 |
background: #FFF; |
| 90 |
color: #000; |
| 91 |
font-size: 16px; |
| 92 |
} |
| 93 |
"; |
| 94 |
if ($js->iconType == 1) { |
| 95 |
$pointCssCode .= " |
| 96 |
.imh-6310-point-{$counter} .imh-6310-pin-main-img { |
| 97 |
color: ".esc_attr($js->fontAwesomeIconColor)." !important; |
| 98 |
font-size:".esc_attr($js->fontAwesomIconSize)."px !important; |
| 99 |
} |
| 100 |
.imh-6310-point-{$counter} .imh-6310-pin-hover-img { |
| 101 |
color: ".esc_attr($js->fontAwesomeIconHoverColor)." !important; |
| 102 |
font-size:".esc_attr($js->fontAwesomIconSize)."px !important; |
| 103 |
} |
| 104 |
"; |
| 105 |
if(isset($js->blinkTooltip) && $js->blinkTooltip == 1){ |
| 106 |
$pointCssCode .= " |
| 107 |
i.imh-6310-blinking-{$counter}, |
| 108 |
i.imh-6310-blinking-hover-{$counter} { |
| 109 |
position: relative; |
| 110 |
display: block; |
| 111 |
} |
| 112 |
|
| 113 |
i.imh-6310-blinking-{$counter}::after, |
| 114 |
i.imh-6310-blinking-hover-{$counter}::after { |
| 115 |
content: ''; |
| 116 |
position: absolute; |
| 117 |
width: ".esc_attr($js->fontAwesomIconSize + 10)."px; |
| 118 |
height: ".esc_attr($js->fontAwesomIconSize + 10)."px; |
| 119 |
box-shadow: 0 0 1px 3px white; |
| 120 |
animation: pulse-animation-{$counter} 2s infinite; |
| 121 |
display: block; |
| 122 |
border-radius: 50%; |
| 123 |
transform: translate(-50%, -50%); |
| 124 |
top: 50%; |
| 125 |
left: 50%; |
| 126 |
border-radius: 50%; |
| 127 |
pointer-events: none; |
| 128 |
} |
| 129 |
|
| 130 |
@keyframes pulse-animation-{$counter} { |
| 131 |
0% { |
| 132 |
box-shadow: 0 0 0 0px {$js->glowColor}; |
| 133 |
} |
| 134 |
100% { |
| 135 |
box-shadow: 0 0 0 8px rgba(0, 0, 0, 0); |
| 136 |
} |
| 137 |
} |
| 138 |
"; |
| 139 |
} |
| 140 |
}else if ($js->iconType == 2) { |
| 141 |
$pointCssCode .= " |
| 142 |
.imh-6310-point-{$counter} .imh-6310-pin-main-img { |
| 143 |
width:".esc_attr($js->imgOrIconSize)."px !important; |
| 144 |
height: auto !important; |
| 145 |
border-radius: 50%; |
| 146 |
} |
| 147 |
.imh-6310-point-{$counter} .imh-6310-pin-hover-img { |
| 148 |
width:".esc_attr($js->imgOrIconSize)."px !important; |
| 149 |
height: auto !important; |
| 150 |
border-radius: 50%; |
| 151 |
} |
| 152 |
"; |
| 153 |
if(isset($js->blinkTooltip) && $js->blinkTooltip == 1){ |
| 154 |
$pointCssCode .= " |
| 155 |
.imh-6310-point-icons-".esc_attr($counter)."::after { |
| 156 |
content: ''; |
| 157 |
position: absolute; |
| 158 |
width: ".esc_attr($js->imgOrIconSize + 10)."px; |
| 159 |
height: ".esc_attr($js->imgOrIconSize + 10)."px; |
| 160 |
box-shadow: 0 0 1px 3px white; |
| 161 |
animation: pulse-animation-{$counter} 2s infinite; |
| 162 |
display: block; |
| 163 |
border-radius: 50%; |
| 164 |
transform: translate(-50%, -50%); |
| 165 |
top: 50%; |
| 166 |
left: 50%; |
| 167 |
pointer-events: none; |
| 168 |
} |
| 169 |
|
| 170 |
@keyframes pulse-animation-{$counter} { |
| 171 |
0% { |
| 172 |
box-shadow: 0 0 0 0px {$js->glowColor}; |
| 173 |
} |
| 174 |
100% { |
| 175 |
box-shadow: 0 0 0 8px rgba(0, 0, 0, 0); |
| 176 |
} |
| 177 |
} |
| 178 |
"; |
| 179 |
} |
| 180 |
}else if ($js->iconType == 3) { |
| 181 |
$pointCssCode .= " |
| 182 |
.imh-6310-point-{$counter} span { |
| 183 |
font-size:".esc_attr($js->customTextSize)."px !important; |
| 184 |
color: ".esc_attr($js->customTextColor)." !important; |
| 185 |
background-color:".esc_attr($js->customTextBgColor)." !important; |
| 186 |
padding: 5px 10px; |
| 187 |
} |
| 188 |
"; |
| 189 |
if(isset($js->blinkTooltip) && $js->blinkTooltip == 1){ |
| 190 |
$pointCssCode .=".imh-6310-blinking-{$counter} { |
| 191 |
animation: pulse-animation-{$counter} 2s infinite; |
| 192 |
} |
| 193 |
|
| 194 |
@keyframes pulse-animation-{$counter} { |
| 195 |
0% { |
| 196 |
box-shadow: 0 0 0 0px {$js->glowColor}; |
| 197 |
} |
| 198 |
100% { |
| 199 |
box-shadow: 0 0 0 8px rgba(0, 0, 0, 0); |
| 200 |
} |
| 201 |
}"; |
| 202 |
} |
| 203 |
} |
| 204 |
|
| 205 |
wp_register_style( "imh-6310-template-".esc_attr($counter)."-css", "" ); |
| 206 |
wp_enqueue_style( "imh-6310-template-".esc_attr($counter)."-css" ); |
| 207 |
wp_add_inline_style( "imh-6310-template-".esc_attr($counter)."-css", $pointCssCode ); |
| 208 |
$counter++; |
| 209 |
} |
| 210 |
|
| 211 |
} |
| 212 |
|
| 213 |
|
| 214 |
?> |
| 215 |
</div> |
| 216 |
</div> |
| 217 |
</div> |