Skip to content

Instantly share code, notes, and snippets.

@achingachris
Created September 22, 2022 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achingachris/fffc4c92672843c1d5688f5c2004f9a1 to your computer and use it in GitHub Desktop.
Save achingachris/fffc4c92672843c1d5688f5c2004f9a1 to your computer and use it in GitHub Desktop.
@import url('https://fonts.googleapis.com/css2?family=Rajdhani&display=swap');
:root {
--bg_main: #42464e;
--text_light: #fff;
--text_med: #4a586e;
--text_dark: #1e2432;
--red: #ac0d27;
--darkred: #c3112d;
--orange: #ad6812;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-weight: normal;
font-family: 'Rajdhani', sans-serif;
}
a {
color: inherit;
text-decoration: none;
}
button {
cursor: pointer;
}
input {
-webkit-appearance: none;
}
button,
input {
border: none;
background: none;
outline: none;
color: inherit;
}
img {
display: block;
max-width: 100%;
height: auto;
}
ul {
list-style: none;
}
body {
font: 1rem/1.3 'Roboto', sans-serif;
background: var(--bg_main);
color: var(--text_dark);
padding: 70px;
}
.container {
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding: 0 15px;
}
/* SECTION #1
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.section-head {
color: var(--text_light);
}
.heading {
font-weight: bold;
font-size: 4rem;
letter-spacing: 0.02em;
padding: 0 0 30px 0;
}
.section-head form {
position: relative;
display: flex;
align-items: center;
}
.section-head form input {
font-size: 2rem;
height: 40px;
padding: 5px 5px 10px;
border-bottom: 1px solid;
}
.section-head form input::placeholder {
color: currentColor;
}
.section-head form button {
font-size: 1rem;
font-weight: bold;
letter-spacing: 0.1em;
padding: 15px 20px;
margin-left: 15px;
border-radius: 5px;
background: var(--red);
transition: background 0.3s ease-in-out;
}
.section-head form button:hover {
background: var(--darkred);
}
.section-head form .msg {
position: absolute;
bottom: -40px;
left: 0;
max-width: 450px;
min-height: 40px;
}
/* SECTION #2
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.city-array {
margin: 70px 0 20px;
}
.city-array .cities {
display: grid;
grid-gap: 32px 20px;
grid-template-columns: repeat(4, 1fr);
}
.city-array .city {
position: relative;
padding: 40px 10%;
border-radius: 20px;
background: var(--text_light);
color: var(--text_med);
}
.city-array .city::after {
content: '';
width: 90%;
height: 50px;
position: absolute;
bottom: -12px;
left: 5%;
z-index: -1;
opacity: 0.3;
border-radius: 20px;
background: var(--text_light);
}
.city-array figcaption {
margin-top: 10px;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.city-array .city-temp {
font-size: 5rem;
font-weight: bold;
margin-top: 10px;
color: var(--text_dark);
}
.city-array .city sup {
font-size: 0.5em;
}
.city-array .city-name sup {
padding: 0.2em 0.6em;
border-radius: 30px;
color: var(--text_light);
background: var(--orange);
}
.city-array .city-icon {
margin-top: 10px;
width: 100px;
height: 100px;
}
/* FOOTER
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.page-footer {
text-align: right;
font-size: 1rem;
color: var(--text_light);
margin-top: 40px;
}
.page-footer span {
color: var(--red);
}
/* MQ
–––––––––––––––––––––––––––––––––––––––––––––––––– */
@media screen and (max-width: 1000px) {
body {
padding: 30px;
}
.city-array .cities {
grid-template-columns: repeat(3, 1fr);
}
}
@media screen and (max-width: 700px) {
.heading,
.city-array .city-temp {
font-size: 3rem;
}
.city-array {
margin-top: 20px;
}
.section-head form {
flex-direction: column;
align-items: flex-start;
}
.section-head form input,
.section-head form button {
width: 100%;
}
.section-head form button {
margin: 20px 0 0 0;
}
.section-head form .msg {
position: static;
max-width: none;
min-height: 0;
margin-top: 10px;
}
.city-array .cities {
grid-template-columns: repeat(2, 1fr);
}
}
@media screen and (max-width: 500px) {
body {
padding: 15px;
}
.city-array .cities {
grid-template-columns: repeat(1, 1fr);
}
}
/* API Key banner
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.api {
background: #fffbbc;
position: fixed;
top: 0;
left: 0;
width: 100%;
padding: 10px;
}
.api a {
text-decoration: underline;
}
.api a:hover {
text-decoration: none;
}
section.section-head {
/* center section */
margin: auto;
width: 50%;
padding: 10px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment