diff options
Diffstat (limited to 'src/frontend/styles')
| -rw-r--r-- | src/frontend/styles/Cart.styled.ts | 89 | ||||
| -rw-r--r-- | src/frontend/styles/Checkout.styled.ts | 79 | ||||
| -rw-r--r-- | src/frontend/styles/Home.styled.ts | 51 | ||||
| -rw-r--r-- | src/frontend/styles/ProductDetail.styled.ts | 87 | ||||
| -rw-r--r-- | src/frontend/styles/Theme.ts | 41 | ||||
| -rwxr-xr-x | src/frontend/styles/globals.css | 30 | ||||
| -rw-r--r-- | src/frontend/styles/style.d.ts | 41 |
7 files changed, 418 insertions, 0 deletions
diff --git a/src/frontend/styles/Cart.styled.ts b/src/frontend/styles/Cart.styled.ts new file mode 100644 index 0000000..e8348cf --- /dev/null +++ b/src/frontend/styles/Cart.styled.ts @@ -0,0 +1,89 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +import styled from 'styled-components'; +import Button from '../components/Button'; + +export const Cart = styled.div` + margin: 24px; + + ${({ theme }) => theme.breakpoints.desktop} { + margin: 100px; + } +`; + +export const Container = styled.div` + display: flex; + flex-direction: column; + gap: 24px; +`; + +export const CarTitle = styled.h1` + margin: 0; +`; + +export const Header = styled.div` + margin-bottom: 50px; + display: flex; + flex-direction: column; + gap: 5px; + align-items: start; + + ${({ theme }) => theme.breakpoints.desktop} { + flex-direction: row; + justify-content: space-between; + align-items: center; + } +`; + +export const Title = styled.h1` + text-align: center; + margin: 0; + font-size: ${({ theme }) => theme.sizes.mLarge}; + + ${({ theme }) => theme.breakpoints.desktop} { + font-size: ${({ theme }) => theme.sizes.dLarge}; + } +`; + +export const Subtitle = styled.h3` + text-align: center; + margin: 0; + font-size: ${({ theme }) => theme.sizes.mMedium}; + color: ${({ theme }) => theme.colors.textLightGray}; + + ${({ theme }) => theme.breakpoints.desktop} { + font-size: ${({ theme }) => theme.sizes.dMedium}; + } +`; + +export const ButtonContainer = styled.div` + display: flex; + justify-content: center; + align-items: center; +`; + +export const EmptyCartContainer = styled.div` + display: flex; + flex-direction: column; + gap: 28px; + align-items: center; + justify-content: center; + margin-bottom: 120px; + margin-top: 24px; + + ${({ theme }) => theme.breakpoints.desktop} { + display: grid; + grid-template-columns: auto; + } +`; + +export const EmptyCartButton = styled(Button)` + font-weight: ${({ theme }) => theme.fonts.regular}; + color: ${({ theme }) => theme.colors.otelRed}; + padding: 0; + + ${({ theme }) => theme.breakpoints.desktop} { + width: inherit; + } +`; diff --git a/src/frontend/styles/Checkout.styled.ts b/src/frontend/styles/Checkout.styled.ts new file mode 100644 index 0000000..69e340f --- /dev/null +++ b/src/frontend/styles/Checkout.styled.ts @@ -0,0 +1,79 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +import styled from 'styled-components'; + +export const Checkout = styled.div` + margin: 20px; + + ${({ theme }) => theme.breakpoints.desktop} { + margin: 100px; + } +`; + +export const Container = styled.div` + display: flex; + flex-direction: column; + gap: 28px; + align-items: center; + justify-content: center; + margin-bottom: 120px; + + ${({ theme }) => theme.breakpoints.desktop} { + display: grid; + grid-template-columns: auto; + } +`; + +export const DataRow = styled.div` + display: grid; + width: 100%; + justify-content: space-between; + grid-template-columns: 1fr 1fr; + padding: 24px 0; + border-top: solid 1px rgba(154, 160, 166, 0.5); + + span:last-of-type { + text-align: right; + } +`; + +export const ItemList = styled.div` + width: 100%; + display: flex; + flex-direction: column; + gap: 24px; + + ${({ theme }) => theme.breakpoints.desktop} { + margin: 72px 0; + } +`; + +export const Title = styled.h1` + text-align: center; + margin: 0; + + font-size: ${({ theme }) => theme.sizes.mLarge}; + + ${({ theme }) => theme.breakpoints.desktop} { + font-size: ${({ theme }) => theme.sizes.dLarge}; + } +`; + +export const Subtitle = styled.h3` + text-align: center; + margin: 0; + + font-size: ${({ theme }) => theme.sizes.mMedium}; + color: ${({ theme }) => theme.colors.textLightGray}; + + ${({ theme }) => theme.breakpoints.desktop} { + font-size: ${({ theme }) => theme.sizes.dMedium}; + } +`; + +export const ButtonContainer = styled.div` + display: flex; + justify-content: center; + align-items: center; +`; diff --git a/src/frontend/styles/Home.styled.ts b/src/frontend/styles/Home.styled.ts new file mode 100644 index 0000000..d1a0d14 --- /dev/null +++ b/src/frontend/styles/Home.styled.ts @@ -0,0 +1,51 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +import styled from 'styled-components'; + +export const Container = styled.div` + width: 100%; + padding: 0 20px; + + ${({ theme }) => theme.breakpoints.desktop} { + padding: 0 100px; + } +`; + +export const Row = styled.div` + display: flex; + flex-wrap: wrap; + width: 100%; +`; + +export const Content = styled.div` + width: 100%; + ${({ theme }) => theme.breakpoints.desktop} { + margin-top: 100px; + } +`; + +export const HotProducts = styled.div` + margin-bottom: 20px; + + ${({ theme }) => theme.breakpoints.desktop} { + margin-bottom: 100px; + } +`; + +export const HotProductsTitle = styled.h1` + font-size: ${({ theme }) => theme.sizes.mLarge}; + font-weight: ${({ theme }) => theme.fonts.bold}; + + ${({ theme }) => theme.breakpoints.desktop} { + font-size: ${({ theme }) => theme.sizes.dxLarge}; + } +`; + +export const Home = styled.div` + @media (max-width: 992px) { + ${Content} { + width: 100%; + } + } +`; diff --git a/src/frontend/styles/ProductDetail.styled.ts b/src/frontend/styles/ProductDetail.styled.ts new file mode 100644 index 0000000..a2dda38 --- /dev/null +++ b/src/frontend/styles/ProductDetail.styled.ts @@ -0,0 +1,87 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +import styled from 'styled-components'; +import Button from '../components/Button'; + +export const ProductDetail = styled.div` + ${({ theme }) => theme.breakpoints.desktop} { + padding: 100px; + } +`; + +export const Container = styled.div` + display: grid; + grid-template-columns: 1fr; + gap: 28px; + + ${({ theme }) => theme.breakpoints.desktop} { + grid-template-columns: 40% 60%; + } +`; + +export const Image = styled.div<{ $src: string }>` + width: 100%; + height: 150px; + + background: url(${({ $src }) => $src}) no-repeat center; + background-size: 100% auto; + + ${({ theme }) => theme.breakpoints.desktop} { + height: 500px; + background-position: top; + } +`; + +export const Details = styled.div` + display: flex; + flex-direction: column; + gap: 16px; + padding: 0 20px; +`; + +export const AddToCart = styled(Button)` + display: flex; + align-items: center; + gap: 10px; + justify-content: center; + width: 100%; + font-size: ${({ theme }) => theme.sizes.dSmall}; + font-weight: ${({ theme }) => theme.fonts.regular}; + + ${({ theme }) => theme.breakpoints.desktop} { + font-size: ${({ theme }) => theme.sizes.dMedium}; + width: 220px; + } +`; + +export const Name = styled.h5` + font-size: ${({ theme }) => theme.sizes.dMedium}; + margin: 0; + + ${({ theme }) => theme.breakpoints.desktop} { + font-size: ${({ theme }) => theme.sizes.dLarge}; + } +`; + +export const Text = styled.p` + margin: 0; +`; + +export const Description = styled(Text)` + margin: 0; + color: ${({ theme }) => theme.colors.textLightGray}; + font-weight: ${({ theme }) => theme.fonts.regular}; + + ${({ theme }) => theme.breakpoints.desktop} { + font-size: ${({ theme }) => theme.sizes.dMedium}; + } +`; + +export const ProductPrice = styled(Text)` + font-weight: ${({ theme }) => theme.fonts.bold}; + + ${({ theme }) => theme.breakpoints.desktop} { + font-size: ${({ theme }) => theme.sizes.dLarge}; + } +`; diff --git a/src/frontend/styles/Theme.ts b/src/frontend/styles/Theme.ts new file mode 100644 index 0000000..f2478cc --- /dev/null +++ b/src/frontend/styles/Theme.ts @@ -0,0 +1,41 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +import { DefaultTheme } from 'styled-components'; + +const Theme: DefaultTheme = { + colors: { + otelBlue: '#5262A8', + otelYellow: '#EAAA3B', + otelGray: '#403F4B', + otelRed: '#FB7181', + backgroundGray: 'rgba(64, 63, 75, 0.1)', + lightBorderGray: 'rgba(82, 98, 168, 0.3)', + borderGray: '#2E2437', + textGray: '#29293E', + textLightGray: '#78788C', + white: '#FFFFFF', + }, + breakpoints: { + desktop: '@media (min-width: 768px)', + }, + sizes: { + mxLarge: '22px', + mLarge: '20px', + mMedium: '14px', + mSmall: '12px', + dxLarge: '58px', + dLarge: '40px', + dMedium: '18px', + dSmall: '16px', + nano: '8px', + }, + fonts: { + bold: '800', + regular: '500', + semiBold: '700', + light: '400', + }, +}; + +export default Theme; diff --git a/src/frontend/styles/globals.css b/src/frontend/styles/globals.css new file mode 100755 index 0000000..b9557bc --- /dev/null +++ b/src/frontend/styles/globals.css @@ -0,0 +1,30 @@ +/* Copyright The OpenTelemetry Authors */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ +/* See the License for the specific language governing permissions and */ +/* limitations under the License. */ + +body { + background: white; + margin: 0px; + font-family: 'Open Sans', sans-serif; +} + +body * { + box-sizing: border-box; + color: #29293E; + font-weight: 600; +} + +select { + -webkit-appearance: none; + -webkit-border-radius: 0px; +} diff --git a/src/frontend/styles/style.d.ts b/src/frontend/styles/style.d.ts new file mode 100644 index 0000000..0ec905d --- /dev/null +++ b/src/frontend/styles/style.d.ts @@ -0,0 +1,41 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +import 'styled-components'; + +declare module 'styled-components' { + export interface DefaultTheme { + colors: { + otelBlue: string; + otelYellow: string; + otelGray: string; + otelRed: string; + backgroundGray: string; + lightBorderGray: string; + borderGray: string; + textGray: string; + textLightGray: string; + white: string; + }; + sizes: { + mLarge: string; + mxLarge: string; + mMedium: string; + mSmall: string; + dLarge: string; + dxLarge: string; + dMedium: string; + dSmall: string; + nano: string; + }; + breakpoints: { + desktop: string; + }; + fonts: { + bold: string; + regular: string; + semiBold: string; + light: string; + }; + } +} |
