PluginProbe
Image Hotspot – Map Image Annotation / 3.8
Image Hotspot – Map Image Annotation v3.8
3.8 3.7 3.6 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 All 30 releases
image-map-hotspots / settings / annotation.php

annotation.php in Image Hotspot – Map Image Annotation 3.8, at settings/annotation.php

225 lines 9.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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-text">In the free version, you can add a maximum of four tooltip/pointer.</span>
13
14 <?php
15 if(isset($_GET['styleid'])) {
16 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=&quot;'.esc_attr($_GET['styleid']).'&quot;]"></div>';
17 }
18 ?>
19 <hr />
20 </div>
21 <div class="imh-6310-annotation-box">
22 <img src="<?php echo isset($cssData['main_image']) ? $cssData['main_image'] : '' ?>" class="imh-6310-main-image" />
23 <?php
24 if ($jsonData) {
25 $counter = 1;
26 foreach ($jsonData as $js) {
27 $jsonCode = json_encode($js);
28 $imagePointer = "";
29 if($js->iconType == 1){
30 if(!$js->fontAwesomeIcon && !$js->fontAwesomeHoverIcon){
31 return;
32 }
33 if(!$js->fontAwesomeIcon){
34 $fontAwesomeIcon = $js->fontAwesomeHoverIcon;
35 $fontAwesomeHoverIcon = $js->fontAwesomeHoverIcon;
36 }
37 else if(!$js->fontAwesomeHoverIcon){
38 $fontAwesomeIcon = $js->fontAwesomeIcon;
39 $fontAwesomeHoverIcon = $js->fontAwesomeIcon;
40 } else {
41 $fontAwesomeIcon = $js->fontAwesomeIcon;
42 $fontAwesomeHoverIcon = $js->fontAwesomeHoverIcon;
43 }
44 $points= "
45 <i class='{$fontAwesomeIcon} imh-6310-pin-main-img imh-6310-blinking-{$counter}'></i>
46 <i class='{$fontAwesomeHoverIcon} imh-6310-pin-hover-img imh-6310-blinking-hover-{$counter}'></i>
47 ";
48 }else if ($js->iconType == 2){
49 if(!$js->customFirstImg && !$js->customSecondImg){
50 return;
51 }
52 else if(!$js->customFirstImg){
53 $customFirstImg = $js->customSecondImg;
54 $customSecondImg = $js->customSecondImg;
55 }
56 else if(!$js->customSecondImg){
57 $customFirstImg = $js->customFirstImg;
58 $customSecondImg = $js->customFirstImg;
59 }
60 else {
61 $customFirstImg = $js->customFirstImg;
62 $customSecondImg = $js->customSecondImg;
63 }
64 $imagePointer = "imh-6310-point-icons-".esc_attr($counter);
65 $points = "
66 <img src='{$customFirstImg}' class='imh-6310-pin-main-img imh-6310-blinking-{$counter}' />
67 <img src='{$customSecondImg}' class='imh-6310-pin-hover-img imh-6310-blinking-hover-{$counter}' />
68 ";
69 }else {
70 if(!$js->customText && !$js->customText){
71 return;
72 }else{
73 $customText = $js->customText;
74 }
75 $points = "
76 <div class='imh-6310-customtext imh-6310-blinking-{$counter}'>".esc_attr($customText)."</div>
77 ";
78 }
79
80 $tHeight = 0;
81 if(isset($js->tHeight)){
82 $tHeight = $js->tHeight;
83 }
84
85 echo "
86 <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}-{$tHeight}'>
87 <div class='imh-6310-point-editor'>
88 <div class='imh-6310-point-edit' title='Edit'><i class='far fa-edit'></i></div>
89 <div class='imh-6310-point-clone' title='Clone/Duplicate'><i class='fas fa-clone'></i></div>
90 <div class= 'imh-6310-point-remove' title='Delete'><i class='fas fa-trash-alt'></i></div>
91 </div>
92 <div class='imh-6310-point-icons {$imagePointer}'>
93 {$points}
94 </div>
95 </div>";
96 $pointCssCode = "
97 .imh-6310-point-{$counter} .imh-6310-tooltip{
98 background: #FFF;
99 color: #000;
100 font-size: 16px;
101 }
102 ";
103 if ($js->iconType == 1) {
104 $pointCssCode .= "
105 .imh-6310-point-{$counter} .imh-6310-pin-main-img {
106 color: ".esc_attr($js->fontAwesomeIconColor)." !important;
107 font-size:".esc_attr($js->fontAwesomIconSize)."px !important;
108 }
109 .imh-6310-point-{$counter} .imh-6310-pin-hover-img {
110 color: ".esc_attr($js->fontAwesomeIconHoverColor)." !important;
111 font-size:".esc_attr($js->fontAwesomIconSize)."px !important;
112 }
113 ";
114 if(isset($js->blinkTooltip) && $js->blinkTooltip == 1){
115 $pointCssCode .= "
116 i.imh-6310-blinking-{$counter},
117 i.imh-6310-blinking-hover-{$counter} {
118 position: relative;
119 display: block;
120 }
121
122 i.imh-6310-blinking-{$counter}::after,
123 i.imh-6310-blinking-hover-{$counter}::after {
124 content: '';
125 position: absolute;
126 width: ".esc_attr($js->fontAwesomIconSize + 10)."px;
127 height: ".esc_attr($js->fontAwesomIconSize + 10)."px;
128 box-shadow: 0 0 1px 3px white;
129 animation: pulse-animation-{$counter} 2s infinite;
130 display: block;
131 border-radius: 50%;
132 transform: translate(-50%, -50%);
133 top: 50%;
134 left: 50%;
135 pointer-events: none;
136 }
137
138 @keyframes pulse-animation-{$counter} {
139 0% {
140 box-shadow: 0 0 0 0px {$js->glowColor};
141 }
142 100% {
143 box-shadow: 0 0 0 8px rgba(0, 0, 0, 0);
144 }
145 }
146 ";
147 }
148 }else if ($js->iconType == 2) {
149 $pointCssCode .= "
150 .imh-6310-point-{$counter} .imh-6310-pin-main-img {
151 width:".esc_attr($js->imgOrIconSize)."px !important;
152 height:".esc_attr($js->imgOrIconSize)."px !important;
153 border-radius: 50%;
154 }
155 .imh-6310-point-{$counter} .imh-6310-pin-hover-img {
156 width:".esc_attr($js->imgOrIconSize)."px !important;
157 height: ".esc_attr($js->imgOrIconSize)."px !important;
158 border-radius: 50%;
159 }
160 ";
161 if(isset($js->blinkTooltip) && $js->blinkTooltip == 1){
162 $pointCssCode .= "
163 .imh-6310-point-icons-".esc_attr($counter)."::after {
164 content: '';
165 position: absolute;
166 width: ".esc_attr($js->imgOrIconSize + 10)."px;
167 height: ".esc_attr($js->imgOrIconSize + 10)."px;
168 box-shadow: 0 0 1px 3px white;
169 animation: pulse-animation-{$counter} 2s infinite;
170 display: block;
171 border-radius: 50%;
172 transform: translate(-50%, -50%);
173 top: 50%;
174 left: 50%;
175 pointer-events: none;
176 }
177
178 @keyframes pulse-animation-{$counter} {
179 0% {
180 box-shadow: 0 0 0 0px {$js->glowColor};
181 }
182 100% {
183 box-shadow: 0 0 0 8px rgba(0, 0, 0, 0);
184 }
185 }
186 ";
187 }
188 }else if ($js->iconType == 3) {
189 $pointCssCode .= "
190 .imh-6310-point-{$counter} .imh-6310-customtext {
191 font-size:".esc_attr($js->customTextSize)."px !important;
192 color: ".esc_attr($js->customTextColor)." !important;
193 background-color:".esc_attr($js->customTextBgColor)." !important;
194 padding: 5px 10px;
195 }
196 ";
197 if(isset($js->blinkTooltip) && $js->blinkTooltip == 1){
198 $pointCssCode .=".imh-6310-blinking-{$counter} {
199 animation: pulse-animation-{$counter} 2s infinite;
200 }
201
202 @keyframes pulse-animation-{$counter} {
203 0% {
204 box-shadow: 0 0 0 0px {$js->glowColor};
205 }
206 100% {
207 box-shadow: 0 0 0 8px rgba(0, 0, 0, 0);
208 }
209 }";
210 }
211 }
212
213 wp_register_style( "imh-6310-template-".esc_attr($counter)."-css", "" );
214 wp_enqueue_style( "imh-6310-template-".esc_attr($counter)."-css" );
215 wp_add_inline_style( "imh-6310-template-".esc_attr($counter)."-css", $pointCssCode );
216 $counter++;
217 }
218
219 }
220
221
222 ?>
223 </div>
224 </div>
225 </div>