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