-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
565 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/_projects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Frontend Mentor - News homepage solution | ||
|
||
This is a solution to the [News homepage challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/news-homepage-H6SWTa1MFl). Frontend Mentor challenges help you improve your coding skills by building realistic projects. | ||
|
||
## Table of contents | ||
|
||
- [Overview](#overview) | ||
- [The challenge](#the-challenge) | ||
- [Screenshot](#screenshot) | ||
- [Links](#links) | ||
- [My process](#my-process) | ||
- [What I learned](#what-i-learned) | ||
|
||
|
||
## Overview | ||
|
||
### The challenge | ||
|
||
Users should be able to: | ||
|
||
- View the optimal layout for the interface depending on their device's screen size | ||
- See hover and focus states for all interactive elements on the page | ||
|
||
### Screenshot | ||
|
||
![](./src/images/screenshot.png) | ||
![](./src/images/screenshot-mobile.png) | ||
![](./src/images/screenshot-mobile-menu.png) | ||
|
||
### Links | ||
|
||
- Live Site URL: [Github Pages](https://alpe12.github.io/frontendMentor/news-homepage/) | ||
|
||
## My process | ||
|
||
### What I learned | ||
|
||
I wanted the padding to scale between two values, depending on the page width (also two values). After much research I was able to do it with this: | ||
|
||
```css | ||
--min-width: 681; | ||
--max-width: 1440; | ||
--min-padding-vertical: 22.5; | ||
--max-padding-vertical: 90; | ||
--min-padding-horizontal: 40; | ||
--max-padding-horizontal: 165; | ||
padding: | ||
clamp( | ||
var(--min-padding-vertical)*1px, | ||
calc(var(--min-padding-vertical)*1px + (var(--max-padding-vertical) - var(--min-padding-vertical)) * ((100vw - var(--min-width)*1px) / (var(--max-width) - var(--min-width)))), | ||
var(--max-padding-vertical)*1px | ||
) | ||
clamp( | ||
var(--min-padding-horizontal)*1px, | ||
calc(var(--min-padding-horizontal)*1px + (var(--max-padding-horizontal) - var(--min-padding-horizontal)) * ((100vw - var(--min-width)*1px) / (var(--max-width) - var(--min-width)))), | ||
var(--max-padding-horizontal)*1px | ||
); | ||
``` | ||
|
||
Also learned more about how to use grid. Still a lot to learn though. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Frontend Mentor | News homepage</title> | ||
<link rel="shortcut icon" href="./src/images/favicon-32x32.png" type="image/x-icon"> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700;800&display=swap" rel="stylesheet"> | ||
<link rel="stylesheet" href="./src/css/style.css"> | ||
<script src="./src/js/script.js" defer></script> | ||
</head> | ||
<body> | ||
<header> | ||
<img src="./src/images/logo.svg" alt=""> | ||
<input class="hamburger" id="menu-toggle" type="checkbox"> | ||
<label class="hamburger" for="menu-toggle"> | ||
<img src="./src/images/icon-menu.svg" alt="" class="open"> | ||
<img src="./src/images/icon-menu-close.svg" alt="" class="close"> | ||
</label> | ||
<nav> | ||
<ul> | ||
<li><a href="">Home</a></li> | ||
<li><a href="">New</a></li> | ||
<li><a href="">Popular</a></li> | ||
<li><a href="">Trending</a></li> | ||
<li><a href="">Categories</a></li> | ||
</ul> | ||
</nav> | ||
</header> | ||
<main> | ||
<div class="web3"> | ||
<picture> | ||
<source media="(min-width: 820px)" srcset="./src/images/image-web-3-desktop.jpg"> | ||
<img src="./src/images/image-web-3-mobile.jpg" alt=""> | ||
</picture> | ||
<h1>The Bright Future of Web 3.0?</h1> | ||
<div class="content"> | ||
<p>We dive into the next evolution of the web that claims to put the power of the platforms back into the hands of the people. | ||
But is it really fulfilling its promise?</p> | ||
<a href="">Read more</a> | ||
</div> | ||
</div> | ||
<div class="new"> | ||
<h2>New</h2> | ||
<div class="articles"> | ||
<article> | ||
<h3><a href="">Hydrogen VS Electric Cars</a></h3> | ||
<p>Will hydrogen-fueled cars ever catch up to EVs?</p> | ||
</article> | ||
<article> | ||
<h3><a href="">The Downsides of AI Artistry</a></h3> | ||
<p>What are the possible adverse effects of on-demand AI image generation?</p> | ||
</article> | ||
<article> | ||
<h3><a href="">Is VC Funding Drying Up?</a></h3> | ||
<p>Private funding by VC firms is down 50% YOY. We take a look at what that means.</p> | ||
</article> | ||
</div> | ||
</div> | ||
<div class="cards"> | ||
<article> | ||
<img src="./src/images/image-retro-pcs.jpg" alt=""> | ||
<div class="content"> | ||
<span class="count">01</span> | ||
<h4><a href="">Reviving Retro PCs</a></h4> | ||
<p>What happens when old PCs are given modern upgrades?</p> | ||
</div> | ||
</article> | ||
<article> | ||
<img src="./src/images/image-top-laptops.jpg" alt=""> | ||
<div class="content"> | ||
<span class="count">02</span> | ||
<h4><a href="">Top 10 Laptops of 2022</a></h4> | ||
<p>Our best picks for various needs and budgets.</p> | ||
</div> | ||
</article> | ||
<article> | ||
<img src="./src/images/image-gaming-growth.jpg" alt=""> | ||
<div class="content"> | ||
<span class="count">03</span> | ||
<h4><a href="">The Growth of Gaming</a></h4> | ||
<p>How the pandemic has sparked fresh opportunities.</p> | ||
</div> | ||
</article> | ||
</div> | ||
</main> | ||
<div class="attribution"> | ||
<p>Challenge by <a href="https://www.frontendmentor.io/challenges/news-homepage-H6SWTa1MFl" target="_blank">Frontend Mentor</a>.</p> | ||
<p>Coded by <a href="https://github.com/alpe12">Douglas Pessoa</a>.</p> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.