made design better for tiling window manager
This commit is contained in:
parent
f23e48700b
commit
75c00e447a
@ -6,24 +6,22 @@ body {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|
||||||
padding-left: auto;
|
|
||||||
padding-right: auto;
|
|
||||||
background-color: pink;
|
background-color: pink;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
background: url("bg.svg") center center/auto repeat, linear-gradient(
|
background:
|
||||||
to bottom, transparent, pink
|
url("bg.svg") center center/auto repeat,
|
||||||
);
|
linear-gradient(to bottom, transparent, pink);
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-grid {
|
.search-grid {
|
||||||
margin-top: -10em;
|
width: 100%;
|
||||||
|
|
||||||
width: 40em;
|
margin-left: 10em;
|
||||||
height: 30em;
|
margin-right: 10em;
|
||||||
|
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 5em;
|
gap: 5em;
|
||||||
@ -32,6 +30,8 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.search {
|
.search {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
grid-row: 2;
|
grid-row: 2;
|
||||||
grid-column: 1 / span 2;
|
grid-column: 1 / span 2;
|
||||||
}
|
}
|
||||||
@ -39,16 +39,17 @@ body {
|
|||||||
.search-logo {
|
.search-logo {
|
||||||
grid-row: 1;
|
grid-row: 1;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-height: 700px){
|
@media (min-height: 700px) {
|
||||||
.search-grid {
|
.search-grid {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
@ -62,7 +63,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
background-color: rgba(255, 255, 255, .5);
|
background-color: rgba(255, 255, 255, 0.5);
|
||||||
width: 10em;
|
width: 10em;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -85,5 +86,5 @@ body {
|
|||||||
background-color: lightblue;
|
background-color: lightblue;
|
||||||
|
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
border-radius: .5em;
|
border-radius: 0.5em;
|
||||||
}
|
}
|
||||||
|
@ -1,68 +1,65 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>{{ .PageTitle }}</title>
|
<title>{{ .PageTitle }}</title>
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="assets/style.css">
|
<link rel="stylesheet" type="text/css" href="assets/style.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form class="search-grid" action="{{ .SearchFormAction }}">
|
<form class="search-grid" action="{{ .SearchFormAction }}">
|
||||||
<div class="search-logo">
|
<div class="search-logo">
|
||||||
<img als="girl_juice" src="assets/girl_juice.png" />
|
<img als="girl_juice" src="assets/girl_juice.png" />
|
||||||
<h2 class="phrases"></h2>
|
<h2 class="phrases"></h2>
|
||||||
<img als="girl_juice" src="assets/girl_juice.png" />
|
<img als="girl_juice" src="assets/girl_juice.png" />
|
||||||
</div>
|
</div>
|
||||||
<input name="{{ .SearchInputName }}" type="text" class="grid-item" class="search" placeholder="{{ .SearchPlaceholder }}" />
|
<input
|
||||||
|
name="{{ .SearchInputName }}"
|
||||||
|
type="text"
|
||||||
|
class="grid-item"
|
||||||
|
class="search"
|
||||||
|
placeholder="{{ .SearchPlaceholder }}"
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
|
|
||||||
<div class="store-cards">
|
<script>
|
||||||
{{range $Store := .Stores }}
|
const phrases = [
|
||||||
<a target="_blank" href="{{ $Store.Url }}" class="card">
|
{{range $Phrase := .HeaderPhrases }}
|
||||||
<h3>{{ $Store.Name }}</h3>
|
"{{ $Phrase }}",
|
||||||
<p>{{ $Store.Description }}</p>
|
{{- end }}
|
||||||
</a>
|
]
|
||||||
{{- end }}
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<script>
|
Array.from(document.querySelectorAll(".phrases")).forEach(element => {
|
||||||
const phrases = [
|
element.textContent = phrases[Math.floor(Math.random()*phrases.length)];
|
||||||
{{range $Phrase := .HeaderPhrases }}
|
})
|
||||||
"{{ $Phrase }}",
|
|
||||||
{{- end }}
|
|
||||||
]
|
|
||||||
|
|
||||||
Array.from(document.querySelectorAll(".phrases")).forEach(element => {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
element.textContent = phrases[Math.floor(Math.random()*phrases.length)];
|
const marqueeElement = document.body;
|
||||||
})
|
let xPosition = 0;
|
||||||
|
let yPosition = 0;
|
||||||
|
const xSpeed = {{ .BackgroundScrollX }}; // Adjust speed here (lower is slower)
|
||||||
|
const ySpeed = {{ .BackgroundScrollY }};
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
function animateMarquee() {
|
||||||
const marqueeElement = document.body;
|
xPosition -= xSpeed;
|
||||||
let xPosition = 0;
|
yPosition -= ySpeed;
|
||||||
let yPosition = 0;
|
|
||||||
const xSpeed = {{ .BackgroundScrollX }}; // Adjust speed here (lower is slower)
|
|
||||||
const ySpeed = {{ .BackgroundScrollY }};
|
|
||||||
|
|
||||||
function animateMarquee() {
|
// Reset position when the image has scrolled completely
|
||||||
xPosition -= xSpeed;
|
if (Math.abs(xPosition) >= marqueeElement.offsetWidth) {
|
||||||
yPosition -= ySpeed;
|
xPosition = 0;
|
||||||
|
}
|
||||||
|
if (Math.abs(yPosition) >= marqueeElement.offsetHeight) {
|
||||||
|
yPosition = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Reset position when the image has scrolled completely
|
marqueeElement.style.backgroundPosition = `${xPosition}px ${yPosition}px`;
|
||||||
if (Math.abs(xPosition) >= marqueeElement.offsetWidth) {
|
requestAnimationFrame(animateMarquee);
|
||||||
xPosition = 0;
|
|
||||||
}
|
|
||||||
if (Math.abs(yPosition) >= marqueeElement.offsetHeight) {
|
|
||||||
yPosition = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
marqueeElement.style.backgroundPosition = `${xPosition}px ${yPosition}px`;
|
// Start the animation
|
||||||
requestAnimationFrame(animateMarquee);
|
animateMarquee();
|
||||||
}
|
});
|
||||||
|
</script>
|
||||||
// Start the animation
|
</body>
|
||||||
animateMarquee();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
Loading…
x
Reference in New Issue
Block a user