Skip to content

Commit

Permalink
📱 Make it responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
petterhh committed Dec 12, 2024
1 parent b7cd5d4 commit ace6522
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/components/sections/openness/Openness.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export interface OpennessProps {
export default function Openness({ section }: OpennessProps) {
return (
<div className={styles.wrapper}>
<div className={styles.title}>
<Text type={"h2"}>{section.basicTitle}</Text>
</div>
<Text type={"h2"} className={styles.title}>
{section.basicTitle}
</Text>
<div className={styles.content}>
<div className={styles.image}>
<SanityImage image={section.image} />
Expand Down
40 changes: 32 additions & 8 deletions src/components/sections/openness/openness.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
color: var(--text-primary);
}

.image {
height: 30rem;

& img {
border-radius: 0.375rem 6rem 0.375rem 0.375rem;
}
}

.title {
width: 40rem;
color: var(--text-primary);

@media (max-width: 834px) {
width: 25.875rem;
}

@media (max-width: 425px) {
width: 19.4375rem;
}
}

.content {
Expand All @@ -29,4 +29,28 @@
align-items: flex-start;
padding: 0.25rem;
gap: 1rem;

@media (max-width: 768px) {
display: flex;
flex-direction: column;
padding: 1.5rem;
}
}

.image {
height: 30rem;

& img {
border-radius: 0.375rem 6rem 0.375rem 0.375rem;
}

@media (max-width: 834px) {
height: 26.25rem;
align-self: stretch;
}

@media (max-width: 425px) {
align-self: stretch;
height: 22.375;
}
}
8 changes: 4 additions & 4 deletions src/components/smileyBox/SmileyBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ type SmileyBoxProps = {

export default function SmileyBox({ description }: SmileyBoxProps) {
return (
description && (
<div className={styles.wrapper}>
<div className={styles.smiley} />
<div className={styles.wrapper}>
<div className={styles.smiley} />
<div className={styles.description}>
<Text type={"h3"}>{description}</Text>
</div>
)
</div>
);
}
25 changes: 24 additions & 1 deletion src/components/smileyBox/smileyBox.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@
justify-content: space-between;
align-items: flex-start;
height: 30rem;
min-width: var(19.75rem);
min-width: 19.75rem;
padding: 2.25rem;
border-radius: 6rem 6rem 0.375rem 0.375rem;
background-color: #dafbdc;

@media (max-width: 834px) {
align-self: stretch;
height: 26.25rem;
}

@media (max-width: 425px) {
align-self: stretch;
height: 26.25rem;
min-width: 19.4375rem;
}
}

.smiley {
Expand All @@ -23,3 +34,15 @@
background-color: var(--text-primary);
}
}

.description {
align-self: stretch;

@media (max-width: 834px) {
max-width: 27.1875rem;
}

@media (max-width: 425px) {
max-width: 19.4375rem;
}
}

0 comments on commit ace6522

Please sign in to comment.