-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslider-panel.php
executable file
·278 lines (242 loc) · 9.68 KB
/
slider-panel.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<?php
/**
* Plugin Name: Slider Panel!
* Description: HTML Code.
* Author: Raymond Thompson.
* Version: 1.0.
* Author URI: http://www.raythompsonwebdev.co.uk.
*
* @package Slider Panel
*/
/**
* Slider Panel Shortcode *
*
* @param array $atts array of values.
* @return mixed
*
*/
function raythompsonwebdev_plugin_slider_enqueue_style() {
wp_enqueue_style( 'raythompsonwebdev_plugin_slider_style', plugins_url('/css/slider-panel.css',__FILE__ ) );
}
add_action( 'wp_enqueue_scripts', 'raythompsonwebdev_plugin_slider_enqueue_style' );
function sliderpanel_callback( $atts ) {
wp_enqueue_script( 'raythompsonwebdev_plugin_slider_script', plugins_url('/js/slider-panel-ES6.js', __FILE__ ) );
$raythompsonwebdev_plugin_slider_panel_text = '[
{
"id": "0",
"hash":"panel-1" ,
"title": "Adobe Certified Associates",
"header": "Visual Communication: Photoshop CS4",
"subheader": "Topics",
"task1": "Setting project requirements",
"task2": "Identifying Design Elements",
"task3": "Understanding Photoshop Interface",
"task4": "Manipulating Images",
"task5": "Evaluating Digital Images",
"buttonname": "Adobe",
"bgimage": "wp-content/themes/raythompsonwebdev-com/images/certificates/Large-Photoshop-Certicate.webp"
}, {
"id": "1",
"hash":"panel-2" ,
"title": "ELATT",
"header": "City & Guilds ITQ Level 1,2,3 Web Design",
"subheader": "Topics",
"task1": "Improving productivity using IT",
"task2": "IT Communication Fundementals",
"task3": "Adding Content",
"task4": "IT User fundementals",
"task5": "Organizing Content",
"buttonname": "ELATT",
"bgimage": "wp-content/themes/raythompsonwebdev-com/images/certificates/ITQ-USERS-LEVEL3-LARGE.webp"
}, {
"id": "2",
"hash":"panel-3" ,
"title": "Codepen",
"header": "Various",
"subheader": "Topics",
"task1": "Product Landing Page",
"task2": "Technical Documentation Page",
"task3": "WeatherApp",
"task4": "Random Quote Generator",
"task5": "Personal Portfolio",
"buttonname": "Codepen",
"bgimage": "wp-content/themes/raythompsonwebdev-com/images/certificates/codepen-io-your-work-2020-10-17-22.webp"
}, {
"id": "3",
"hash":"panel-4" ,
"title": "FreeCodeCamp",
"header": "Frontend Developer Certificate",
"subheader": "Topics",
"task1": "Basic HTML and HTML 5",
"task2": "Basic CSS",
"task3": "CSS Flexbox",
"task4": "CSS Grids",
"task5": "Responsive Web Design Principles",
"buttonname": "FreeCodeCamp",
"bgimage": "wp-content/themes/raythompsonwebdev-com/images/certificates/freecodecamp-org-certification-raythompsonwebdev-responsive-web-design.webp"
}, {
"id": "4",
"hash":"panel-5" ,
"title": "Lynda.com",
"header": "Lynda.com",
"subheader": "Topics",
"task1": "Become a Front-End Web Developer",
"task2": "Become a Junior Developer",
"task3": "Programming Fundementals",
"task4": "CSS Fundementals",
"task5": "Javascript Essentials",
"buttonname": "Lynda.com",
"bgimage": "wp-content/themes/raythompsonwebdev-com/images/certificates/CertificateOfCompletion_Javascript-Essential-Training-2011.webp"
}, {
"id": "5",
"hash":"panel-6" ,
"title": "Codewars",
"header": "Codewars",
"subheader": "Topics",
"task1": "5th Kyu Katas",
"task2": "6th Kyu Katas",
"task3": "7th Kyu Katas",
"task4": "8th Kyu Katas",
"task5": "random Katas",
"buttonname": "Codewars",
"bgimage": "wp-content/themes/raythompsonwebdev-com/images/certificates/large.png"
}, {
"id": "6",
"hash":"panel-7" ,
"title": "Code Academy",
"header": "Javascript",
"subheader": "Topics",
"task1": "Data Types",
"task2": "Loops",
"task3": "Array Methods",
"task4": "Objects",
"task5": "Conditionals",
"buttonname": "Code Academy",
"bgimage": "wp-content/themes/raythompsonwebdev-com/images/certificates/codecademy-profiles-raythompsonwebdev-certificates.webp"
}, {
"id": "7",
"hash":"panel-8" ,
"title": "FreeCode Camp",
"header": "JavaScript Algorithms and Data Structures",
"subheader": "Topics",
"task1": "Basic Javascript",
"task2": "ES6",
"task3": "Regular Expressions",
"task4": "Basic Data Structures",
"task5": "Basic Algorithim Scripting",
"buttonname": "Udacity",
"bgimage": "wp-content/themes/raythompsonwebdev-com/images/certificates/freecodecamp-org-certification-raythompsonwebdev-javascript-algorithms-and-data-structures.webp"
}, {
"id": "8",
"hash":"panel-9" ,
"title": "Digital Futures 2017",
"header": "Interactive Programming",
"subheader": "Topics",
"task1": "Debate Skills with DebateMate.",
"task2": "Musical Composition.",
"task3": "Block programming using Crumble.",
"task4": "Negotiation skills with CitizenUK.",
"task5": "Music creation using Sonic Pi",
"buttonname": "Digital Futures",
"bgimage": "wp-content/themes/raythompsonwebdev-com/images/certificates/Digital-Futures-2017-Certificate-of-Participation-large.webp"
},{
"id": "9",
"hash":"panel-10" ,
"title": "Code Academy",
"header": "Ruby",
"subheader": "Topics",
"task1": "Arrays",
"task2": "Data Types",
"task3": "Classes",
"task4": "Methods",
"task5": "Conditionals",
"buttonname": "Code Academy",
"bgimage": "wp-content/themes/raythompsonwebdev-com/images/certificates/codecademy-profiles-raythompsonwebdev-certificates-ruby.webp"
}
]';
$raythompsonwebdev_plugin_slider_buttons = '[
{
"id": "1",
"buttonname": "Adobe"
}, {
"id": "2",
"buttonname": "ELATT"
}, {
"id": "3",
"buttonname": "Codepen"
}, {
"id": "4",
"buttonname": "FreeCodeCamp"
}, {
"id": "5",
"buttonname": "Lynda.com"
}, {
"id": "6",
"buttonname": "Codewars"
}, {
"id": "7",
"buttonname": "Code Academy"
}, {
"id": "8",
"buttonname": "Udacity"
}, {
"id": "9",
"buttonname": "Digital Futures"
}
]';
$raythompsonwebdev_plugin_slider_panels = json_decode( $raythompsonwebdev_plugin_slider_panel_text, true );
$raythompsonwebdev_plugin_courses_tabs = json_decode( $raythompsonwebdev_plugin_slider_buttons, true );
ob_start();
?>
<section id="prof_cont-a">
<h1><?php esc_html_e( 'Web Development Activities', 'raythompsonwebdev-com' ); ?></h1>
<!-- #hero-slider -->
<article class="hero-slider">
<!-- <ul id="list">
<?php foreach ( $raythompsonwebdev_plugin_courses_tabs as $raythompsonwebdev_plugin_courses_tab ) : ?>
<li>
<a href="#" rel="#panel-<?php printf( '%s', esc_html( $raythompsonwebdev_plugin_courses_tab['id'] ), 'raythompsonwebdev-com' ); ?>" class="hero-btn active" title="<?php printf( '%s', esc_html( $raythompsonwebdev_plugin_courses_tab['buttonname'] ), 'raythompsonwebdev-com' ); ?>" ><?php printf( '%s', esc_html( $raythompsonwebdev_plugin_courses_tab['buttonname'] ), 'raythompsonwebdev-com' ); ?></a>
</li>
<?php endforeach; ?>
</ul> -->
<!--mask-->
<div class="mask">
<!--slider body -->
<div class="slider-body">
<?php foreach ( $raythompsonwebdev_plugin_slider_panels as $raythompsonwebdev_plugin_slider_panel ) : ?>
<article class="panel" id="<?php printf( '%s', esc_html( $raythompsonwebdev_plugin_slider_panel['hash'] ), 'raythompsonwebdev-com' ); ?>">
<h2><?php printf( '%s', esc_html( $raythompsonwebdev_plugin_slider_panel['title'] ), 'raythompsonwebdev-com' ); ?> </h2>
<figure class="slider-panel">
<a
href="<?php echo esc_url( home_url( '/' ) ); ?><?php printf( '%s', esc_html( $raythompsonwebdev_plugin_slider_panel['bgimage'] ), 'raythompsonwebdev-com' ); ?>"
class="fancybox"
title="<?php printf( '%s', esc_html( $raythompsonwebdev_plugin_slider_panel['title'] ), 'raythompsonwebdev-com' ); ?>">
<span style="background-image: url('<?php echo esc_url( home_url( '/' ) ); ?><?php printf( '%s', esc_html( $raythompsonwebdev_plugin_slider_panel['bgimage'] ), 'raythompsonwebdev-com' ); ?>') " > </span>
</a>
<figcaption>
<h3><?php printf( '%s', esc_html( $raythompsonwebdev_plugin_slider_panel['header'] ), 'raythompsonwebdev-com' ); ?></h3>
<h4><?php printf( '%s', esc_html( $raythompsonwebdev_plugin_slider_panel['subheader'] ), 'raythompsonwebdev-com' ); ?></h4>
<ul>
<li class="dashicons-before"><?php printf( '%s', esc_html( $raythompsonwebdev_plugin_slider_panel['task1'] ), 'raythompsonwebdev-com' ); ?></li>
<li class="dashicons-before"><?php printf( '%s', esc_html( $raythompsonwebdev_plugin_slider_panel['task2'] ), 'raythompsonwebdev-com' ); ?></li>
<li class="dashicons-before"><?php printf( '%s', esc_html( $raythompsonwebdev_plugin_slider_panel['task3'] ), 'raythompsonwebdev-com' ); ?></li>
<li class="dashicons-before"><?php printf( '%s', esc_html( $raythompsonwebdev_plugin_slider_panel['task4'] ), 'raythompsonwebdev-com' ); ?></li>
<li class="dashicons-before"><?php printf( '%s', esc_html( $raythompsonwebdev_plugin_slider_panel['task5'] ), 'raythompsonwebdev-com' ); ?></li>
</ul>
<div class="clearfix"></div>
</figcaption>
</figure>
</article>
<?php endforeach; ?>
</div>
<!--slider body end-->
</div>
<!-- .mask end -->
</article>
<!-- hero-slider end -->
<div id="slids"><a href="#" id="next">Next</a><a href="#" id="prev">Prev</a></div>
</section>
<?php
return ob_get_clean();
}
add_shortcode( 'sliderpanel', 'sliderpanel_callback' );