From 41fdadb229cb165ec16b647a010b0d794a3a1e12 Mon Sep 17 00:00:00 2001 From: Aditya Thakral Date: Sun, 22 Aug 2021 22:40:54 -0400 Subject: [PATCH] Add decoration to the bubble component (#152) Closes #87 Co-authored-by: l42luo Co-authored-by: Linna Luo Reviewed-on: https://git.csclub.uwaterloo.ca/www/www-new/pulls/152 Reviewed-by: l42luo Co-authored-by: Aditya Thakral Co-committed-by: Aditya Thakral --- components/Bubble.module.css | 68 ++++++++++++++++++++++++++++- components/Bubble.tsx | 15 ++++++- pages/about/index.module.css | 2 +- public/images/bubble-decoration.svg | 5 +++ 4 files changed, 85 insertions(+), 5 deletions(-) create mode 100644 public/images/bubble-decoration.svg diff --git a/components/Bubble.module.css b/components/Bubble.module.css index a7f3b645..638c93b7 100644 --- a/components/Bubble.module.css +++ b/components/Bubble.module.css @@ -1,7 +1,71 @@ -.bubble { +.container { + position: relative; padding: calc(36rem / 16) 0; + overflow-x: clip; } -.bubble:nth-child(odd) { +.bubble { + --border-radius: calc(5000rem / 16); + + display: flex; + flex-direction: row; + position: absolute; + top: 0; + height: 100%; + width: 100%; + justify-content: center; + align-items: flex-start; +} + +.bar { + height: 100%; + width: 100%; +} + +.decoration { + display: none; + width: calc(128rem / 16); +} + +.margin { + display: none; +} + +.content { + position: relative; + z-index: 1; +} + +.container:nth-child(odd) .bar { background-color: var(--primary-accent-light); } + +@media only screen and (min-width: calc(1350rem / 16)) { + .container:nth-child(odd) .decoration { + display: block; + position: absolute; + } + + .container:nth-child(4n + 1) .bar { + border-top-right-radius: var(--border-radius); + border-bottom-right-radius: var(--border-radius); + transform: translateX(-12.5vw); + } + + .container:nth-child(4n + 1) .decoration { + top: calc(-50rem / 16); + right: 8vw; + } + + .container:nth-child(4n + 3) .bar { + border-top-left-radius: var(--border-radius); + border-bottom-left-radius: var(--border-radius); + transform: translateX(12.5vw); + } + + .container:nth-child(4n + 3) .decoration { + top: calc(-50rem / 16); + left: 8vw; + transform: rotateY(180deg); + } +} diff --git a/components/Bubble.tsx b/components/Bubble.tsx index 746ee896..da86dc3d 100644 --- a/components/Bubble.tsx +++ b/components/Bubble.tsx @@ -1,13 +1,24 @@ import React from "react"; +import { Image } from "@/components/Image"; + import { DefaultLayout } from "./DefaultLayout"; import styles from "./Bubble.module.css"; export default function Bubble(props: { children: React.ReactNode }) { return ( -
- {props.children} +
+
+
+ +
+
+ {props.children} +
); } diff --git a/pages/about/index.module.css b/pages/about/index.module.css index c3fc0309..2bcd8b39 100644 --- a/pages/about/index.module.css +++ b/pages/about/index.module.css @@ -1,5 +1,5 @@ .page { - margin-bottom: calc(20rem / 16); + margin-bottom: calc(60rem / 16); } .title { diff --git a/public/images/bubble-decoration.svg b/public/images/bubble-decoration.svg new file mode 100644 index 00000000..4c3efe69 --- /dev/null +++ b/public/images/bubble-decoration.svg @@ -0,0 +1,5 @@ + + + + +