Skip to content

Commit

Permalink
Merge branch 'enhance/ai-onboarding' of https://github.com/newfold-la…
Browse files Browse the repository at this point in the history
…bs/wp-module-onboarding-data into api-integration-preview-home-page
  • Loading branch information
ajayadav09 committed Jan 15, 2024
2 parents ab7e371 + 048b3c4 commit 52ad376
Show file tree
Hide file tree
Showing 3 changed files with 157 additions and 128 deletions.
135 changes: 7 additions & 128 deletions includes/Services/SiteGenService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use NewfoldLabs\WP\Module\Onboarding\Data\Data;
use NewfoldLabs\WP\Module\Onboarding\Data\Mustache\Mustache;
use NewfoldLabs\WP\Module\Onboarding\Data\Themes;
use NewfoldLabs\WP\Module\Onboarding\Data\Themes\Colors;
use NewfoldLabs\WP\Module\Onboarding\Data\Themes\Fonts;

/**
* Class SiteGenService
Expand Down Expand Up @@ -695,137 +697,14 @@ public static function get_customize_sidebar_data() {
);

if ( isset( $color_palette['error'] ) || is_wp_error( $color_palette ) ) {
$color_palette = array(
array(
'name' => 'Tropical Dawn',
'base' => '#F0F0F0',
'contrast' => '#333333',
'primary' => '#09728C',
'secondary' => '#C79E10',
'tertiary' => '#F5EBB8',
'header_background' => '#09728C',
'header_foreground' => '#F5EBB8',
'header_titles' => '#F5EBB8',
'secondary_background' => '#09728C',
'secondary_foreground' => '#F5EBB8',
),
array(
'name' => 'Earthy Delight',
'base' => '#EAE2D6',
'contrast' => '#2E2E2E',
'primary' => '#D19858',
'secondary' => '#A1623B',
'tertiary' => '#704238',
'header_background' => '#D19858',
'header_foreground' => '#EAE2D6',
'header_titles' => '#EAE2D6',
'secondary_background' => '#A1623B',
'secondary_foreground' => '#EAE2D6',
),
array(
'name' => 'Cool Breeze',
'base' => '#D9E4E7',
'contrast' => '#1B1B1B',
'primary' => '#3C7A89',
'secondary' => '#5E9EA4',
'tertiary' => '#81BFC5',
'header_background' => '#3C7A89',
'header_foreground' => '#D9E4E7',
'header_titles' => '#D9E4E7',
'secondary_background' => '#5E9EA4',
'secondary_foreground' => '#D9E4E7',
),
array(
'name' => 'Warm Comfort',
'base' => '#F4E1D2',
'contrast' => '#272727',
'primary' => '#D83367',
'secondary' => '#F364A2',
'tertiary' => '#FEA5E2',
'header_background' => '#D83367',
'header_foreground' => '#F4E1D2',
'header_titles' => '#F4E1D2',
'secondary_background' => '#F364A2',
'secondary_foreground' => '#F4E1D2',
),
array(
'name' => 'Classic Elegance',
'base' => '#EDEDED',
'contrast' => '#1C1C1C',
'primary' => '#A239CA',
'secondary' => '#4717F6',
'tertiary' => '#E7DFDD',
'header_background' => '#A239CA',
'header_foreground' => '#EDEDED',
'header_titles' => '#EDEDED',
'secondary_background' => '#4717F6',
'secondary_foreground' => '#EDEDED',
),
);
$color_palette = Colors::get_sitegen_color_palette_data();
}

if ( isset( $font_pair['error'] ) || is_wp_error( $font_pair ) ) {
$font_pair = array(
array(
'aesthetics' => 'modern',
'fonts_heading' => 'Arial',
'fonts_content' => 'Times New Roman',
'spacing' => 6,
'radius' => 4,
),
array(
'aesthetics' => 'vintage',
'fonts_heading' => 'Courier New',
'fonts_content' => 'Georgia',
'spacing' => 5,
'radius' => 3,
),
array(
'aesthetics' => 'minimalist',
'fonts_heading' => 'Verdana',
'fonts_content' => 'Tahoma',
'spacing' => 7,
'radius' => 2,
),
array(
'aesthetics' => 'retro',
'fonts_heading' => 'Lucida Console',
'fonts_content' => 'Palatino Linotype',
'spacing' => 6,
'radius' => 5,
),
array(
'aesthetics' => 'typographic',
'fonts_heading' => 'Impact',
'fonts_content' => 'Comic Sans MS',
'spacing' => 5,
'radius' => 3,
),
); // set default value.
}

$default_design = array(
'name' => 'Modern Foodie',
'style' => array(
'aesthetics' => 'modern',
'fonts_heading' => 'Arial',
'fonts_content' => 'Times New Roman',
'spacing' => 6,
'radius' => 4,
),
'color_palette' => array(
'base' => '#F0F0F0',
'contrast' => '#333333',
'primary' => '#09728C',
'secondary' => '#C79E10',
'tertiary' => '#F5EBB8',
'header_background' => '#09728C',
'header_foreground' => '#F5EBB8',
'header_titles' => '#F5EBB8',
'secondary_background' => '#09728C',
'secondary_foreground' => '#F5EBB8',
),
);
$font_pair = Fonts::get_sitegen_font_data();
}

$default_design = Fonts::get_sitegen_default_design_data();

return array(
'design' => $default_design,
Expand Down
75 changes: 75 additions & 0 deletions includes/Themes/Colors.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,81 @@ protected static function get_theme_colors() {
);
}

/**
* This returns default Color Palette data for Sitegen customize sidebar.
*
* @var string
*/
public static function get_sitegen_color_palette_data() {
return array(
array(
'name' => 'Tropical Dawn',
'base' => '#F0F0F0',
'contrast' => '#333333',
'primary' => '#09728C',
'secondary' => '#C79E10',
'tertiary' => '#F5EBB8',
'header_background' => '#09728C',
'header_foreground' => '#F5EBB8',
'header_titles' => '#F5EBB8',
'secondary_background' => '#09728C',
'secondary_foreground' => '#F5EBB8',
),
array(
'name' => 'Earthy Delight',
'base' => '#EAE2D6',
'contrast' => '#2E2E2E',
'primary' => '#D19858',
'secondary' => '#A1623B',
'tertiary' => '#704238',
'header_background' => '#D19858',
'header_foreground' => '#EAE2D6',
'header_titles' => '#EAE2D6',
'secondary_background' => '#A1623B',
'secondary_foreground' => '#EAE2D6',
),
array(
'name' => 'Cool Breeze',
'base' => '#D9E4E7',
'contrast' => '#1B1B1B',
'primary' => '#3C7A89',
'secondary' => '#5E9EA4',
'tertiary' => '#81BFC5',
'header_background' => '#3C7A89',
'header_foreground' => '#D9E4E7',
'header_titles' => '#D9E4E7',
'secondary_background' => '#5E9EA4',
'secondary_foreground' => '#D9E4E7',
),
array(
'name' => 'Warm Comfort',
'base' => '#F4E1D2',
'contrast' => '#272727',
'primary' => '#D83367',
'secondary' => '#F364A2',
'tertiary' => '#FEA5E2',
'header_background' => '#D83367',
'header_foreground' => '#F4E1D2',
'header_titles' => '#F4E1D2',
'secondary_background' => '#F364A2',
'secondary_foreground' => '#F4E1D2',
),
array(
'name' => 'Classic Elegance',
'base' => '#EDEDED',
'contrast' => '#1C1C1C',
'primary' => '#A239CA',
'secondary' => '#4717F6',
'tertiary' => '#E7DFDD',
'header_background' => '#A239CA',
'header_foreground' => '#EDEDED',
'header_titles' => '#EDEDED',
'secondary_background' => '#4717F6',
'secondary_foreground' => '#EDEDED',
),
);
}

/**
* Retrieves the active theme color variations.
*
Expand Down
75 changes: 75 additions & 0 deletions includes/Themes/Fonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,81 @@ protected static function get_theme_fonts() {
);
}

/**
* This returns the default font data for Sitegen customize sidebar.
*
* @var string
*/
public static function get_sitegen_font_data() {
return array(
array(
'aesthetics' => 'modern',
'fonts_heading' => 'Arial',
'fonts_content' => 'Times New Roman',
'spacing' => 6,
'radius' => 4,
),
array(
'aesthetics' => 'vintage',
'fonts_heading' => 'Courier New',
'fonts_content' => 'Georgia',
'spacing' => 5,
'radius' => 3,
),
array(
'aesthetics' => 'minimalist',
'fonts_heading' => 'Verdana',
'fonts_content' => 'Tahoma',
'spacing' => 7,
'radius' => 2,
),
array(
'aesthetics' => 'retro',
'fonts_heading' => 'Lucida Console',
'fonts_content' => 'Palatino Linotype',
'spacing' => 6,
'radius' => 5,
),
array(
'aesthetics' => 'typographic',
'fonts_heading' => 'Impact',
'fonts_content' => 'Comic Sans MS',
'spacing' => 5,
'radius' => 3,
),
);
}

/**
* This returns the default design data for Sitegen customize sidebar.
*
* @var string
*/
public static function get_sitegen_default_design_data() {
return array(
'name' => 'Modern Foodie',
'style' => array(
'aesthetics' => 'modern',
'fonts_heading' => 'Arial',
'fonts_content' => 'Times New Roman',
'spacing' => 6,
'radius' => 4,
),
'color_palette' => array(
'base' => '#F0F0F0',
'contrast' => '#333333',
'primary' => '#09728C',
'secondary' => '#C79E10',
'tertiary' => '#F5EBB8',
'header_background' => '#09728C',
'header_foreground' => '#F5EBB8',
'header_titles' => '#F5EBB8',
'secondary_background' => '#09728C',
'secondary_foreground' => '#F5EBB8',
),
);
}

/**
* Retrieves the active theme font variations.
*
Expand Down

0 comments on commit 52ad376

Please sign in to comment.