Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 167 additions & 1 deletion news_layout/css/main.css
Original file line number Diff line number Diff line change
@@ -1 +1,167 @@
/* Write your CSS here */
html {
background: darkgray;
font-size: 14px;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
min-width: 300px;
overflow-x: hidden;
overflow-y: scroll;
text-rendering: optimizeLegibility;
}

body {
color: #666;
font-family: "Source Sans Pro", "Helvetica", "Arial", sans-serif;
font-size: 1rem;
font-weight: 400;
line-height: 1.4;
}

a {
text-decoration: none;
transition: all 0.3s cubic-bezier(.25, .8, .25, 1);
}

div, h2, p, figure {
margin: 0;
padding: 0;
}

.header {
color: white;
padding: 40px 0 20px;
text-align: center;
}

.header h1 {
font-size: 40px;
font-weight: bold;
}

.header h2 a {
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
color: white;
font-size: 20px;
opacity: 0.5;
}

.header h2 a:hover {
border-bottom-color: white;
opacity: 1;
}

.main {
margin: 0 auto;
max-width: 1040px;
padding: 10px;
}

.column {
flex: 1;
flex-direction: column;
justify-content: center;
flex-basis: auto;

}

.article {
background: white;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
color: #666;
display: flex;
flex: 1;
flex-direction: column;
flex-basis: auto;
margin: 10px;
}

.article:hover,
.article:focus {
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
color: #444;
}

.article-image {
background: #eee;
display: block;
padding-top: 75%;
position: relative;
width: 100%;
}

.article-image img {
display: block;
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
}

.article-image.is-3by2 {
padding-top: 66.6666%;
}

.article-image.is-16by9 {
padding-top: 56.25%;
}

.article-body {
display: flex;
flex: 1;
flex-direction: column;
padding: 20px;
}

.article-title {
color: #333;
flex-shrink: 0;
font-size: 1.4em;
font-weight: 700;
line-height: 1.2;
}

.article-content {
flex: 1;
margin-top: 5px;
}

.article-info {
display: flex;
font-size: 0.85em;
justify-content: space-between;
margin-top: 10px;
}

@media screen and (min-width: 800px) {
.columns,
.column {
display: flex;
}
}

@media screen and (min-width: 1000px) {
.first-article {
flex-direction: row;
}

.first-article .article-body {
flex: 1;
}

.first-article .article-image {
height: 300px;
order: 2;
padding-top: 0;
width: 400px;
}

.main-column {
flex: 2;
}

.nested-column {
flex: 2;
}
}

90 changes: 88 additions & 2 deletions news_layout/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,96 @@
<html>
<head>
<meta charset="utf-8">
<title>Flexbox Layout</title>
<title>True Facts</title>
<link rel="stylesheet" href="css/main.css">
</head>

<body>
<!-- Starter File -->
<header class="header">
<h1>True Facts: Mother Nature's Finest</h1>
<h2><a href="https://www.thoughtco.com/">Resource</a></h2>
</header>

<main class="main columns">
<section class="column main-column">
<a class="article first-article" href="https://www.youtube.com/watch?v=0aSCPmabRpM">
<figure class="article-image is-4by3">
<img src="http://funnyfilez.funnypart.com/pictures/FunnyPart-com-praying_mantis.jpg" alt="praying_mantis">
</figure>
<div class="article-body">
<h2 class="article-title">
WAZZUP?!
</h2>
<p class="article-content">
Mantids are the only insect capable of turning their heads 180 degrees.
</p>
<footer class="article-info">
<span>Deepest apologies for this one.</span>
<span>~Gaia</span>
</footer>
</div>
</a>

<div class="columns">
<div class="column nested-column">
<a class="article" href="https://www.youtube.com/watch?v=XeFxdkaFzRA">
<figure class="article-image is-16by9">
<img src="http://i.imgur.com/btWw5zw.jpg?1" alt="baby_owl">
</figure>
<div class="article-body">
<h2 class="article-title">
G'day, sir!
</h2>
<p class="article-content">
Owl's eyes are fixed in the sockets as they require large forward-facing peepers to capture as much light as possible during their hunts in the darkness that is night.
</p>
<footer class="article-info">
<span>Regards.</span>
<span>~Tellus</span>

</footer>
</div>
</a>
</div>

<div class="column">
<a class="article" href="http://www.defenders.org/polar-bear/basic-facts">
<figure class="article-image is-16by9">
<img src="https://i.pinimg.com/564x/a5/09/0b/a5090bf247426fb2b735bf31a6e67b18.jpg" alt="polar_bear">
</figure>
<div class="article-body">
<h2 class="article-title">
...Hey...?
</h2>
<p class="article-content">
Polar bears are the only cannibalistic kind of bear.
</p>
<footer class="article-info">
<span>An alternative fact for you.</span>
<span>~Terra Mato</span>

</footer>
</div>
</a>
<section class="column">
<a class="article" href="https://www.youtube.com/watch?v=Ch5MEJk5ZCQ">
<figure class="article-image is-3by2">
<img src="http://starsunfolded.1ygkv60km.netdna-cdn.com/wp-content/uploads/2016/06/Morgan-Freeman.jpg" alt="majestic_morgan_freeman">
</figure>
<div class="article-body">
<h2 class="article-title">
Hello, World
</h2>
<p class="article-content">
Morgan Freeman narrated your birth.
</p>
<footer class="article-info">
<span>Not even kidding.</span>
<span>~Mother Nature</span>
</footer>
</div>
</a>
</section>
</main>
</body>
</html>