Skip to content

Commit 88ddd1d

Browse files
feat: improve chart creation interface (#1292)
1 parent e8c8e7f commit 88ddd1d

2 files changed

Lines changed: 142 additions & 68 deletions

File tree

classes/Visualizer/Render/Page/Types.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ protected function _toHTML() {
5252
* @access protected
5353
*/
5454
protected function _renderContent() {
55-
echo '<div id="type-picker">';
5655
echo '<div id="chart-select">' . $this->render_chart_selection() . '</div>';
56+
echo '<div id="type-picker">';
5757
foreach ( $this->types as $type => $array ) {
5858
// add classes to each box that identifies the libraries this chart type supports.
5959
$lib_classes = '';

css/frame.css

Lines changed: 141 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
right: 0;
6262
bottom: 60px;
6363
width: 350px;
64-
border-left: 1px solid #dfdfdf;
65-
background: whitesmoke;
64+
border-left: 1px solid #ddd;
65+
background: #f8f9fa;
6666
overscroll-behavior: contain;
6767
}
6868

@@ -83,11 +83,11 @@
8383
}
8484

8585
.viz-group-wrapper ul .viz-group-title {
86-
border-top: 1px solid #ddd;
86+
border-top: 1px solid #e5e5e5;
8787
}
8888

8989
.viz-group-wrapper ul li {
90-
border-top: 1px solid #ddd;
90+
border-top: 1px solid #e5e5e5;
9191
}
9292

9393
.viz-group-wrapper ul ul li.viz-subsection {
@@ -98,17 +98,17 @@
9898
.viz-group-wrapper .viz-group .viz-group .viz-group-title {
9999
position: relative;
100100
margin: 0;
101-
padding: 10px 10px 11px 14px;
101+
padding: 12px 36px 12px 16px;
102102
border-top: none;
103103
border-bottom: none;
104-
border-left: 4px solid #fff;
104+
border-left: 4px solid transparent;
105105
color: #555d66;
106106
background-color: #fff;
107-
font-size: 14px;
107+
font-size: 13px;
108108
font-weight: 600;
109-
line-height: 21px;
109+
line-height: 1.4;
110110
cursor: pointer;
111-
transition: 0.15s color ease-in-out,0.15s background-color ease-in-out,0.15s border-color ease-in-out;
111+
transition: 0.15s color ease-in-out, 0.15s background-color ease-in-out, 0.15s border-color ease-in-out;
112112
}
113113

114114
.viz-title-small {
@@ -125,11 +125,13 @@
125125
.viz-group-wrapper .viz-group .viz-group .viz-group-title:after {
126126
position: absolute;
127127
z-index: 1;
128-
top: 11px;
129-
right: 10px;
130-
color: #a0a5aa;
131-
font: 400 20px/1 dashicons;
128+
top: 50%;
129+
right: 12px;
130+
transform: translateY(-50%);
131+
color: inherit;
132+
font: 400 18px/1 dashicons;
132133
content: "\f345";
134+
opacity: 0.6;
133135
}
134136

135137
.viz-group-wrapper .viz-group .viz-group.open .viz-group-title:after {
@@ -200,7 +202,7 @@
200202
display: none;
201203
margin: 0;
202204
padding: 0;
203-
background-color: #fdfdfd;
205+
background-color: #fff;
204206
}
205207

206208
div.viz-group-content {
@@ -235,37 +237,44 @@ div.viz-group-content .viz-group-description {
235237
.viz-section-title {
236238
display: block;
237239
position: relative;
238-
margin-bottom: 5px;
239-
padding: 4px 20px;
240-
border-top: 1px solid #eee;
241-
border-bottom: 1px solid #eee;
242-
background-color: rgba(0, 0, 0, 0.02);
243-
box-shadow: 0 4px 4px -4px rgba(0, 0, 0, 0.1);
244-
font-weight: bold;
240+
margin-bottom: 0;
241+
padding: 10px 36px 10px 16px;
242+
border-top: 1px solid #e5e5e5;
243+
border-left: 3px solid transparent;
244+
background-color: #f8f9fa;
245+
font-size: 12px;
246+
font-weight: 600;
247+
color: #555d66;
248+
text-transform: uppercase;
249+
letter-spacing: 0.4px;
245250
cursor: pointer;
251+
transition: border-left-color 0.15s ease-in-out, color 0.15s ease-in-out, background-color 0.15s ease-in-out;
252+
}
253+
254+
.viz-section-title:hover,
255+
.viz-section-title.open {
256+
border-left-color: #0073aa;
257+
color: #0073aa;
258+
background-color: #f0f6fb;
246259
}
247260

248261
.viz-group-wrapper ul ul li .viz-section-title {
249-
margin-bottom: 0;
250-
border: none;
251-
box-shadow: none;
262+
border-left: 3px solid transparent;
252263
}
253264

254265
.viz-section-title::after {
255266
position: absolute;
256-
z-index: 1;
257-
top: 13px;
258-
right: 20px;
259-
width: 0;
260-
height: 0;
261-
border-width: 4px 4px 0;
262-
border-style: solid;
263-
border-color: #ccc transparent;
264-
content: "";
267+
top: 50%;
268+
right: 10px;
269+
transform: translateY(-50%);
270+
color: inherit;
271+
font: 400 16px/1 dashicons;
272+
content: "\f345";
273+
opacity: 0.6;
265274
}
266275

267276
.viz-section-title.open::after {
268-
border-width: 0 4px 4px;
277+
content: "\f347";
269278
}
270279

271280
.section-items,
@@ -313,7 +322,7 @@ div.viz-group-content .viz-group-description {
313322
.section-delimiter,
314323
.viz-section-delimiter {
315324
margin: 15px 0;
316-
border-top: 1px dashed #ccc;
325+
border-top: 1px solid #e5e5e5;
317326
}
318327

319328
.viz-section-table-column {
@@ -353,7 +362,7 @@ div.viz-group-content .viz-group-description {
353362
#rate-the-plugin {
354363
margin-top: 40px;
355364
padding: 20px;
356-
border-top: 1px dashed #ddd;
365+
border-top: 1px solid #e5e5e5;
357366
text-align: center;
358367
}
359368

@@ -395,14 +404,71 @@ div.viz-group-content .viz-group-description {
395404
}
396405

397406
#viz-tabs .wp-color-picker {
398-
width: 4rem !important;
407+
width: 4rem !important;
408+
}
409+
410+
/* Modern flat tab nav */
411+
#viz-tabs .ui-tabs-nav {
412+
display: flex;
413+
padding: 0;
414+
margin: 0;
415+
background: #fff;
416+
border: none;
417+
border-bottom: 2px solid #e5e5e5;
418+
border-radius: 0;
419+
box-shadow: none;
420+
}
421+
422+
#viz-tabs .ui-tabs-nav li {
423+
flex: 1;
424+
margin: 0;
425+
border: none;
426+
border-bottom: 2px solid transparent;
427+
border-radius: 0;
428+
background: transparent;
429+
top: 2px;
430+
transition: border-color 0.15s ease-in-out;
431+
}
432+
433+
#viz-tabs .ui-tabs-nav li a {
434+
display: block;
435+
width: 100%;
436+
padding: 10px 0;
437+
color: #555d66;
438+
font-size: 13px;
439+
font-weight: 500;
440+
text-align: center;
441+
box-sizing: border-box;
442+
}
443+
444+
#viz-tabs .ui-tabs-nav li:hover a {
445+
color: #0073aa;
446+
}
447+
448+
#viz-tabs .ui-tabs-nav .ui-state-active {
449+
border-bottom-color: #0073aa;
450+
background: transparent;
451+
}
452+
453+
#viz-tabs .ui-tabs-nav .ui-state-active a {
454+
color: #0073aa;
455+
font-weight: 600;
456+
}
457+
458+
#viz-tabs .ui-tabs-nav li a:focus,
459+
#viz-tabs .ui-tabs-nav li.ui-state-focus a {
460+
outline: none;
461+
box-shadow: none;
462+
border-radius: 2px;
399463
}
400464

401465
.viz-info-panel {
402466
display: flex;
403467
flex-direction: column;
404-
padding: 10px;
405-
gap: 10px;
468+
padding: 16px;
469+
gap: 14px;
470+
background: #fff;
471+
border-bottom: 1px solid #e5e5e5;
406472
}
407473

408474
.viz-info-panel label {
@@ -486,74 +552,82 @@ div.viz-group-content .viz-group-description {
486552
display: block;
487553
position: absolute;
488554
right: 0;
489-
bottom: -6px;
555+
bottom: 0;
490556
width: 100%;
491-
padding: 4px 0;
492-
border-top: 1px dashed #ddd;
493-
border-bottom: 1px dashed #ddd;
494-
background: #e0e0e0;
495-
background-color: #efefef;
496-
box-shadow: 0 0 8px #ddd;
497-
font-weight: bold;
557+
padding: 6px 0;
558+
border-top: 1px solid #e5e5e5;
559+
background-color: #fff;
560+
font-weight: 600;
561+
font-size: 12px;
498562
text-align: center;
563+
color: #555d66;
499564
}
500565

501566
.type-box .pro-upsell {
502-
color: #c55555;
567+
color: #d63638;
503568
}
504569

505570
#type-picker {
506-
width: 954px;
507-
margin: 50px auto;
571+
max-width: 960px;
572+
margin: 30px auto;
573+
padding: 0 16px;
574+
display: flex;
575+
flex-wrap: wrap;
576+
gap: 16px;
508577
}
509578

510579
.type-box {
511-
float: left;
512580
position: relative;
513-
margin: 0 20px 20px 0;
514-
border: 1px dashed #ddd;
515-
background-color: #efefef;
516-
box-shadow: 0 0 8px #ddd;
581+
border: 1px solid #ddd;
582+
border-left: 3px solid transparent;
583+
background-color: #fff;
584+
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
585+
border-radius: 2px;
586+
overflow: hidden;
587+
transition: border-left-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
517588
}
518589

519-
.type-box.viz-hidden {
520-
display: none;
590+
.type-box:hover,
591+
.type-box:has(.type-label-selected) {
592+
border-left-color: #0073aa;
593+
box-shadow: 0 2px 6px rgba(0,114,170,0.15);
521594
}
522595

523596
.type-box.viz-hidden {
524597
display: none;
525598
}
526599

527-
.type-box:nth-child(3n+1) {
528-
margin-right: 0;
529-
}
530-
531600
.type-box .pro-upsell .visualizder-pro-label {
532601
display: inline;
533602
position: absolute;
534603
top: 0;
535604
width: 74px;
536-
height: 10px;
537605
height: 17px;
538606
border: none;
539607
color: #fff;
540608
z-index: 4;
541-
background: #c55555;
609+
background: #d63638;
610+
font-size: 10px;
611+
font-weight: 600;
612+
letter-spacing: 0.5px;
613+
line-height: 17px;
614+
text-align: center;
542615
}
543616

544617
.type-label {
545618
display: block;
546619
width: 270px;
547620
height: 205px;
548621
padding: 15px;
549-
border: 1px solid #e0e0e0;
550-
background-color: white;
622+
border: none;
623+
background-color: #f9f9f9;
551624
background-image: url(../images/chart_types_v395.png);
552625
background-repeat: no-repeat;
553626
background-position: center center;
554627
background-size: 900px 1150px;
555628
filter: grayscale(100%);
556629
cursor: pointer;
630+
transition: filter 0.15s ease-in-out, background-color 0.15s ease-in-out;
557631
}
558632

559633
#type-picker.lib-ChartJS .type-label {
@@ -566,8 +640,8 @@ div.viz-group-content .viz-group-description {
566640

567641
.type-label-selected,
568642
.type-box .type-label:hover {
569-
/* background-image: url(../images/chart_types_v340.png);*/
570643
filter: grayscale(0);
644+
background-color: #f0f7fb;
571645
}
572646

573647
.type-label:focus,
@@ -1228,7 +1302,7 @@ button#editor-chart-button {
12281302
}
12291303

12301304
span.viz-section-error {
1231-
color: #ff000;
1305+
color: #ff0000;
12321306
}
12331307

12341308
#visualizer-error-manual {

0 commit comments

Comments
 (0)