Website for Onza Café in Ciudad Real. This project is optimized to work in Google Chrome browser.
- Node.js (recommended version: 14.x or higher)
- npm (included with Node.js)
- Google Chrome Browser
- Live Server (installed automatically with npm install)
- Clone the repository:
git clone [repository-url]
- Install dependencies:
npm install
To start the development server:
npm run dev
The project will automatically open in your default browser. For the best experience, make sure to use Google Chrome. The server will run on port 2442 by default (http://localhost:2442).
This is a modern web application for Onza Café, featuring:
- Specialty coffee menu
- Artisanal pastries
- Custom ordering system
- Responsive design
- Modern UI components
This project is built using native Web Components for better modularity and code reuse. Here are the main components:
-
header-component
: Main navigation bar- Attributes:
logo
: Logo URLmenu-items
: Array of menu objectstheme
: Header theme ('light'|'dark')
- Attributes:
-
footer-component
: Page footer with contact information- Attributes:
social-links
: Social media linkscontact-info
: Contact informationyear
: Current copyright year
- Attributes:
-
headerfooter-component
: Component that combines header and footer for specific pages- Attributes:
page-title
: Current page titleshow-footer
: Boolean to show/hide footer
- Attributes:
-
section1-component
: Main landing section- Attributes:
img
: Background image URLtitle
: Section titledescription
: Main description textbutton
: Button text
- Attributes:
-
section2-component
: Secondary information section- Attributes:
titulo
: Section titlepPrincipal
: Main paragraphh2Seccion1
: First subsection titlepSeccion1
: First subsection texth2Seccion2
: Second subsection titlepSeccion2
: Second subsection texth2Seccion3
: Third subsection titlepSeccion3
: Third subsection text
- Attributes:
-
form-component
: Form container- Attributes:
form-id
: Unique form IDsubmit-url
: Form submission URLmethod
: HTTP method ('GET'|'POST')
- Attributes:
-
input-component
: Custom input fields- Attributes:
type
: Input type ('text'|'email'|'password'|'number')label
: Field labelrequired
: Required field booleanplaceholder
: Placeholder textvalue
: Input valueerror-message
: Error message
- Attributes:
-
textarea-component
: Custom text areas- Attributes:
rows
: Number of rowslabel
: Field labelrequired
: Required field booleanplaceholder
: Placeholder textvalue
: Textarea value
- Attributes:
-
button-component
: Styled buttons- Attributes:
type
: Button type ('primary'|'secondary'|'danger')disabled
: Disable button booleanloading
: Loading state booleanicon
: Icon name (optional)
- Attributes:
profile-component
: User profile display- Attributes:
user-id
: User IDavatar
: Profile image URLname
: User namerole
: User role
- Attributes:
-
text-component
: Text handling component- Attributes:
variant
: Text type ('title'|'subtitle'|'body'|'caption')color
: Text coloralign
: Alignment ('left'|'center'|'right')
- Attributes:
-
icons-component
: Custom icon system- Attributes:
name
: Icon namesize
: Size ('sm'|'md'|'lg')color
: Icon color
- Attributes:
Each component is encapsulated in its own directory within /src/components/
and contains its independent logic, styles, and HTML structure. Components use Shadow DOM for style encapsulation and Custom Elements to define their behavior.
./
├── src/ # Main source code
│ ├── components/ # Web Components
│ │ ├── headerfooter-component/
│ │ ├── textarea/
│ │ ├── form/
│ │ ├── input/
│ │ ├── button-component/
│ │ ├── icons/
│ │ ├── profile/
│ │ ├── header/
│ │ ├── section2-component/
│ │ ├── section1/
│ │ ├── footer/
│ │ └── text/
│ ├── img/ # Image resources
│ ├── scripts/ # JavaScript files
│ └── css/ # Global styles
├── components/ # Additional components
├── requirements/ # Requirements documentation
├── node_modules/ # Node.js dependencies
├── index.html # Main page
├── about.html # About page
├── contact.html # Contact page
├── main.js # Main JavaScript file
├── package.json # Project configuration
├── package-lock.json # Dependencies versions
├── LICENSE # License file
└── README.md # Project documentation
The project uses three main CSS files:
reset.css
: Normalizes browser stylesglobal.css
: Global styles and variableshome.css
: Specific styles for the home page
This project is specifically optimized and tested for Google Chrome. While it may work in other browsers, optimal experience is not guaranteed outside of Chrome.
The project uses a local development server to facilitate the development process. Make sure to keep the server running (npm run dev
) while working on the code.
Web Components are developed following modern web standards, using native browser APIs such as Shadow DOM and Custom Elements.