Add parallax effect to background
This commit is contained in:
parent
21d70b4a8a
commit
b2f80c3a92
@ -6,4 +6,4 @@ date: 2023-06-27
|
|||||||
|
|
||||||
# Hi, I'm Tyler
|
# Hi, I'm Tyler
|
||||||
|
|
||||||
I'm a software engineer that does a little bit of everything
|
Software engineer, aspiring postmath
|
||||||
|
59
content/posts/test-1.md
Normal file
59
content/posts/test-1.md
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
---
|
||||||
|
title: "My first post"
|
||||||
|
date: 2023-07-15
|
||||||
|
banner: "https://s3.clortox.com/static-assets/boat.jpg"
|
||||||
|
---
|
||||||
|
|
||||||
|
This is my first test post This is my other test post.
|
||||||
|
|
||||||
|
{{< figure src="https://s3.clortox.com/static-assets/boat.jpg" alt="Boat"
|
||||||
|
caption="My caption" class="figure-left">}}
|
||||||
|
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
54
content/posts/test-2.md
Normal file
54
content/posts/test-2.md
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
title: 'My other post'
|
||||||
|
date: 2023-07-15
|
||||||
|
---
|
||||||
|
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
||||||
|
This is my other test post
|
@ -15,10 +15,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Utilities",
|
"name": "Utilities",
|
||||||
"url": "/utilities/"
|
"url": "/utilities/"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "About",
|
|
||||||
"url": "/about/"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"RightHandSide": [
|
"RightHandSide": [
|
||||||
|
@ -1,16 +1,13 @@
|
|||||||
@keyframes animatedBackground {
|
.background {
|
||||||
from { background-position: 0 0; }
|
|
||||||
to { background-position: 0 100%; }
|
|
||||||
}
|
|
||||||
@keyframes rotateBackground {
|
|
||||||
from { transform: rotate(0deg); }
|
|
||||||
to { transform: rotate(360deg); }
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background-image: url("/img/webb-dark.png");
|
background-image: url("/img/webb-dark.png");
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: -1;
|
||||||
|
|
||||||
background-position: center;
|
background-position: center;
|
||||||
background-repeat: cover;
|
background-repeat: repeat;
|
||||||
background-attachment: fixed;
|
background-attachment: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,10 +6,7 @@ footer {
|
|||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding-top: 3vh;
|
padding-top: 3vh;
|
||||||
}
|
z-index: 100;
|
||||||
|
|
||||||
.footer-fade {
|
|
||||||
background: linear-gradient(rgba(11,11,12,0.2) 0%, rgba(11,11,12,1) 35%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-sections {
|
.footer-sections {
|
||||||
@ -46,6 +43,7 @@ footer {
|
|||||||
|
|
||||||
.footer-header {
|
.footer-header {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
|
max-width: 100%;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,3 +51,9 @@ small {
|
|||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
color: rgba(255,255,255,0.5);
|
color: rgba(255,255,255,0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 768px) {
|
||||||
|
.footer-sections {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -14,6 +14,7 @@ body {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-bottom: 0px;
|
padding-bottom: 0px;
|
||||||
|
background-color: rgba(11,11,12,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2, h3, h4 {
|
h1, h2, h3, h4 {
|
||||||
@ -48,11 +49,6 @@ html {
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|
||||||
display: grid;
|
|
||||||
align-content: center;
|
|
||||||
justify-content: center;
|
|
||||||
justify-items: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-fade {
|
.top-fade {
|
||||||
@ -69,8 +65,12 @@ html {
|
|||||||
|
|
||||||
.intro-content {
|
.intro-content {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.page-header {
|
.page-header {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -119,8 +119,13 @@ article a {
|
|||||||
padding: 50px;
|
padding: 50px;
|
||||||
height: 30vh;
|
height: 30vh;
|
||||||
padding-bottom: 25px;
|
padding-bottom: 25px;
|
||||||
background: linear-gradient(rgba(11,11,12,1) 0%, rgba(11,11,12,0.9) 50%, rgba(0,0,0,0) 100%);
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
background: linear-gradient(rgba(11,11,12,1) 0%, rgba(11,11,12,0.9) 50%, rgba(0,0,0,0) 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
article a:hover {
|
||||||
|
background: linear-gradient(rgba(11,11,12,1) 0%, rgba(11,11,12,0.9) 50%, rgba(32,42,68,0.5) 100%);
|
||||||
|
transition: 300ms linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post {
|
.post {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
{{- partial "head.html" . -}}
|
{{- partial "head.html" . -}}
|
||||||
<body>
|
<body>
|
||||||
|
<div class="parallax background"></div>
|
||||||
{{- partial "header.html" . -}}
|
{{- partial "header.html" . -}}
|
||||||
<div id="content">
|
<div id="content">
|
||||||
{{- block "main" . }}{{- end }}
|
{{- block "main" . }}{{- end }}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ range.Pages }}
|
{{ range.Pages }}
|
||||||
<article class="light-dashed-bottom">
|
<article class="light-dashed-bottom">
|
||||||
<a href="{{ .Permalink }}" onmouseover="scrambleLetters(document.querySelector('#{{ .Title | anchorize }}'))">
|
<a href="{{ .Permalink }}">
|
||||||
{{ if .Params.banner }}
|
{{ if .Params.banner }}
|
||||||
<div class="post-list-body-container">
|
<div class="post-list-body-container">
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<footer class="footer-fade">
|
<footer>
|
||||||
<div class="footer-sections">
|
<div class="footer-sections">
|
||||||
<div class="footer-list" style="width: 85%">
|
<div class="footer-list" style="width: 85%">
|
||||||
<h4 id="contact" class="footer-header" style="margin-bottom: 5px">Contact</h4>
|
<h4 id="contact" class="footer-header" style="margin-bottom: 5px">Contact</h4>
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
<link rel="stylesheet" href="{{ "css/footer.css" | relURL }}">
|
<link rel="stylesheet" href="{{ "css/footer.css" | relURL }}">
|
||||||
|
|
||||||
<link rel="stylesheet" href="{{ "css/background.css" | relURL }}">
|
<link rel="stylesheet" href="{{ "css/background.css" | relURL }}">
|
||||||
<script src="{{ "js/scramble.js" | relURL }}"></script>
|
<script src="{{ "js/script.js" | relURL }}"></script>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
</head>
|
</head>
|
||||||
|
@ -4,6 +4,13 @@ window.onload = function() {
|
|||||||
document.querySelectorAll(".scramble").forEach(item => {
|
document.querySelectorAll(".scramble").forEach(item => {
|
||||||
item.addEventListener("mouseover", scramble);
|
item.addEventListener("mouseover", scramble);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.addEventListener('scroll', function() {
|
||||||
|
const parallax = document.querySelector('.parallax')
|
||||||
|
let scrollPosition = window.pageYOffset;
|
||||||
|
|
||||||
|
parallax.style.transform = 'translateY(' + scrollPosition * .5 + 'px)';
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function scramble(event){
|
function scramble(event){
|
Loading…
Reference in New Issue
Block a user