Activity 31: Angular Ecommerce Product List

Create a List of Object Data Structures

product.service.ts

product.model.ts

product.component.ts

product.component.html

import { Injectable } from '@angular/core';
import { Product } from '../model/product.model';

@Injectable({
  providedIn: 'root',
})
export class ProductService {
  private productList: Product[] = [
    {
      price: 590,
      image:
        'https://www.uniqlo.com/jp/ja/contents/feature/masterpiece/common/img/product/item_05_03_03.jpg?240829',
      name: 'Uniqlo Cotton Crew Neck T-Shirt',
      rate: 'Description: High-quality cotton, minimalist style, and available in multiple colors.',
}

,
{
  price: 2000,
    image:
        'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxAPDw8QDw0PDw0NDw0PDhANDw8PDxAQFREWFhUSFRUYHSggGBomGxUTITEhJiotMi4uGCA3OzUsQygtLisBCgoKDg0OFQ8OGisaFR0tKzcrKy0uLTctLSsrLSstKystKystLSsrKy0vLSstKy0tNy0rNystKzctLS0uLjctLf/AABEIARMAtwMBIgACEQEDEQH/xAAcAAEAAgMBAQEAAAAAAAAAAAAAAQgCBgcEBQP/xABHEAACAgEBBAYECgYHCQAAAAAAAQIDBBEFEiExBgcTQVFhcYGS0RQWIjJCUlWRscEIJGJyocIVIzNDU4KiNERjc5OjsvDx/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/xAAVEQEBAAAAAAAAAAAAAAAAAAAAEf/aAAwDAQACEQMRAD8A7MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPm7X2/h4f8AtWZRQ3yjbZFTfojzfqRrFHW3secmnkXQWuinPGu3Jea0TaXpSA3kGuUdPdkT5bUxV/zLFU/unoybOneyY89q4b/cujP/AMdQNiBpWd1qbIqTccqd0u6NFFzb8tZJRXrZ5Nidbuzcmbhb22Hq9ITyVHs5LznBtQ9fDzA6ADDHvhZCM65xsrmtYzrkpwkvFNcGZgAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/9k=',
      name: 'Penshoppe Graphic Tee',
      rate: 'Description: Trendy graphic designs, perfect for casual wear.',
    },
    {
      price: 5500,
      image:
        'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQVzvtdMAjiaHyPZ3AiQ-NXwKBUnXQA7Rb-uw&s',
      name: 'Giordano Round Neck Basic Tee  ',
      rate: 'Description: Premium fabric and a classic fit, known for durability and comfort.',
    },
    {
      price:9000,
      image:
        'https://down-ph.img.susercontent.com/file/099f92cbbd3f253a76d4c348b21ae53a',
      name: 'Hanford V-Neck Shirt (3-Pack)',
      rate: 'Description: Value pack of soft, breathable V-neck shirts, great for everyday use.',
    },
    {
      price: 2000,
      image:
        'https://shop.bench.com.ph/media/catalog/product/cache/009763e0cc55019733fb9a5ba619b171/b/o/bow0470gr4_fl_f_za.jpg',
      name: 'Bench Plain T-Shirt',
      rate: 'Description: Affordable plain shirts in a variety of colors and sizes.',
    },


  ];

  getProductList() {
    return this.productList;
  }
}
main {
  background-color: #31152b; /* Black background */
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(233, 217, 237, 0.1); /* White shadow for contrast */
  height: 100%;
  overflow-y: auto;
  display: grid;
  gap: 3rem;
  color: #e9cfcf; /* Red text color */
  transition: background-color 0.5s ease; /* Smooth background transition */
}

main:hover {
  background-color: #111; /* Slightly darker black on hover */
}

.product-card {
  border-radius: 1rem;
  padding: 1rem;
  height: auto;
  box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1); /* White shadow for contrast */
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease; /* Smooth scaling on hover */
}

.product-card:hover {
  transform: scale(1.05); /* Slightly enlarge on hover */
}

.product-card__image__container {
  height: 15rem;
  border-radius: 1rem;
  overflow: hidden; /* Hide image overflow */
}

.product-card__image {
  height: 100%;
  width: 100%;
  object-fit: cover; /* Cover the entire container */
  transition: transform 0.3s ease; /* Smooth scaling on hover */
}

.product-card__image:hover {
  transform: scale(1.1); /* Slightly enlarge on hover */
}

.product-card__details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

h1 {
  font-size: 2.5rem; /* Larger font size */
  font-weight: bold; /* Bold text */
  text-align: center;
  color: #ff0000; /* Red text color */
  padding-bottom: 2rem;
}

.product-card__details__name {
  font-size: 1.5rem;
  padding: 0.5rem 0;
  color: #ff0000; /* Red text color */
  font-weight: bold; /* Bold text */
}

.product-card__details__description {
  line-height: 1.5rem;
  flex-grow: 1;
  color: #ff0000; /* Red text color */
}

.product-card__details__price {
  font-size: 1.5rem;
  padding: 1rem 0;
  color: #ff0000; /* Red text color */
  font-weight: bold; /* Bold text */
}

.button-container {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.button-cart,
.button-buy {
  background-color: #22191f; /* Red for buttons */
  color: white;
  font-size: 1.25rem;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease; /* Add transform transition */
  border: none; /* Remove default button border */
}

.button-cart:hover {
  background-color: #800000; /* Darker red on hover */
  transform: scale(1.05); /* Slightly enlarge on hover */
}

.button-buy:hover {
  background-color: #800000; /* Darker red on hover */
  transform: scale(1.05); /* Slightly enlarge on hover */
}


@media (max-width: 767px) {
  main {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  main {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  main {
    grid-template-columns: repeat(5, 1fr);
  }
}

https://act31-maryjoy.web.app/