Update layout and add responsive web design

This commit is contained in:
M.R. Firmansyah 2024-08-26 16:26:38 +07:00
parent 6680cbb23a
commit f970867d66
3 changed files with 67 additions and 28 deletions

View file

@ -3,18 +3,17 @@
font-feature-settings: 'liga' 1, 'calt' 1; font-feature-settings: 'liga' 1, 'calt' 1;
} }
body { body {
padding: 2rem;
font-size: 1.05rem; font-size: 1.05rem;
line-height: 1.5; line-height: 1.5;
text-align: center
} }
h1 { h1 {
font-size: 4rem; margin: 0;
font-size: 2.75rem;
line-height: 1; line-height: 1;
letter-spacing: -0.03em; letter-spacing: -0.03em;
} }
h2 { h2 {
font-size: 2.75rem; font-size: 1.35rem;
line-height: 1; line-height: 1;
letter-spacing: -0.03em; letter-spacing: -0.03em;
} }
@ -22,36 +21,73 @@ a {
color: black; color: black;
text-decoration: none; text-decoration: none;
} }
.motto { .home{
margin: auto; position: absolute;
padding: 1em; left: 2em;
width: 18em; top: 2em;
border: 1px solid black; right: 2em;
border-radius: .33em; bottom: 2em;
text-align: center;
font-size: 1.55rem;
line-height: 1.3;
} }
.contact-container { .contact-container {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: left;
} }
.contact-container > div { .contact-container > div {
margin: .33em; margin-top: .33em;
margin-right: .33em;
padding: .33em; padding: .33em;
padding-top: 0;
padding-bottom: 0;
background-color: #f0f0f0; background-color: #f0f0f0;
border-radius: .33em; border-radius: .33em;
} }
.motto {
margin-top: 1em;
margin-bottom: 1em;
font-size: 1.35rem;
line-height: 1.3;
font-weight: 500;
}
.button { .button {
margin: auto; margin-top: 0;
margin-bottom: 1em;
padding: 1em; padding: 1em;
width: 16em; padding-left: 2em;
color: white; color: white;
background-color: black; background-color: black;
border-radius: .33em; border-radius: .33em;
text-align: center;
cursor: pointer; cursor: pointer;
display: block; display: block;
font-size: 1.35rem;
font-weight: bold; font-weight: bold;
} }
.button:hover {
background-color: #636363;
}
@media only screen and (min-width: 768px) {
h1 {
font-size: 4rem;
}
h2 {
font-size: 2.75rem;
}
.home{
margin-left: 2em;
display: grid;
grid-auto-flow: column;
align-items: center;
grid-template-columns: repeat(2, 1fr);
}
.motto {
margin: 2em;
}
.button {
margin-left: 2em;
margin-top: 0;
margin-right: 2em;
margin-bottom: 1em;
padding: 1em;
padding-left: 2em;
}
}

View file

@ -2,6 +2,7 @@
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="preconnect" href="https://rsms.me/"> <link rel="preconnect" href="https://rsms.me/">
<link rel="stylesheet" href="https://rsms.me/inter/inter.css"> <link rel="stylesheet" href="https://rsms.me/inter/inter.css">
{{ $style := resources.Get "style.css" | minify }} {{ $style := resources.Get "style.css" | minify }}
@ -9,16 +10,18 @@
<title>{{ .Site.Title }}</title> <title>{{ .Site.Title }}</title>
</head> </head>
<body> <body>
<main aria-role="main"> <div class="home">
<header class="home-page-header"> <header>
<h1>{{ .Site.Author.name }}</h1> <h1>{{ .Site.Author.name }}</h1>
<h2>{{ .Site.Author.about }}</h2> <h2>{{ .Site.Author.about }}</h2>
{{ partial "contact.html" . }}
</header> </header>
{{ partial "contact.html" . }}<br> <div>
<div class="motto"> <div class="motto">
“{{ .Site.Author.motto | safeHTML }}” “{{ .Site.Author.motto | safeHTML }}”
</div><br> </div>
{{ partial "links.html" . }} {{ partial "links.html" . }}
</main> </div>
</div>
</body> </body>
</html> </html>

View file

@ -1,3 +1,3 @@
<a class="button" href="{{ .Site.Author.url.blog }}">Blog</a><br> <a class="button" href="{{ .Site.Author.url.blog }}">Blog</a>
<a class="button" href="{{ .Site.Author.url.social }}">Media Sosial</a><br> <a class="button" href="{{ .Site.Author.url.social }}">Media Sosial</a>
<a class="button" href="{{ .Site.Author.url.git }}" >Repositori Git</a> <a class="button" href="{{ .Site.Author.url.git }}" >Repositori Git</a>