Page Landing Example

Ecosistema completo para organización y gestión de contenido con interfaces espaciales

Landing Page Example

Description

This example shows a complete implementation of a responsive landing page using the widget system. The structure is defined in JSON format and can serve as a starting point for creating your own pages.

Example Features

JSON Structure

The example JSON file defines:

  1. Page Metadata: ID, title, slug, version, etc.
  2. General Layout: Layout type, background colors, dimensions
  3. Widget Definitions: Collection of widgets that make up the page
  4. Responsive Settings: Specific configurations for different screen sizes

Sample Code

{
  "id": "landing-example-01",
  "title": "Landing Page Example",
  "slug": "landing-example",
  "version": "1.0.0",
  "layout": {
    "type": "fluid",
    "backgroundColor": "#f5f5f5",
    "maxWidth": 1200,
    "minHeight": 800
  },
  "widgets": [
    {
      "id": "header-section",
      "type": "container",
      "position": {
        "base": { "x": 0, "y": 0 }
      },
      "size": {
        "base": { "width": "100%", "height": "auto" },
      },
      "styles": {
        "base": {
          "backgroundColor": "#ffffff",
          "boxShadow": "0 2px 4px rgba(0,0,0,0.1)"
        }
      },
      "children": [
        // Logo, navigation items, etc.
      ]
    },
    {
      "id": "hero-section",
      "type": "container",
      "position": {
        "base": { "x": 0, "y": 80 }
      },
      "size": {
        "base": { "width": "100%", "height": "500px" },
        "md": { "height": "600px" },
        "lg": { "height": "700px" }
      },
      "styles": {
        "base": {
          "backgroundImage": "url(/assets/images/hero-bg.jpg)",
          "backgroundSize": "cover",
          "backgroundPosition": "center"
        }
      },
      "children": [
        // Hero content, CTA buttons, etc.
      ]
    }
    // Additional sections...
  ]
}

How to Use This Example

  1. Copy the JSON structure
  2. Modify it to fit your needs
  3. Import it using the API method widgetService.importPage(jsonData)
  4. The system will automatically create all widgets and apply responsive settings

Best Practices

Included Widgets

Widget Description Quantity
Container Containers to organize the layout 6
Text Text with different styles and sizes 9
Button Call to action button (CTA) 1
Image Logo image 1
Icon Icons for features 3

Responsiveness

The example implements a responsive design using:

View the Code

You can view the complete JSON code for this example here.

Visualization

To visualize this example:

import { WidgetPageRendererComponent } from '@widgets-editor/widgets';

@Component({
  selector: 'app-example',
  standalone: true,
  imports: [WidgetPageRendererComponent],
  template: `
    <lib-widget-page-renderer [pageData]="landingPageExample"></lib-widget-page-renderer>
  `
})
export class ExampleComponent {
  landingPageExample = // Imported JSON from the example
}