From 5dbd5fbcdf4f77b742f92cd81964f94dff3cd760 Mon Sep 17 00:00:00 2001 From: brulijam Date: Thu, 29 Aug 2024 19:12:40 +0200 Subject: [PATCH] changed and implemented a lot --- src/css/main.css | 262 +++++++++++++++++++++++++----------------- src/index.html | 13 ++- src/js/distance.js | 70 +++++++++++ src/js/fuzzysearch.js | 126 ++++++++++++++++++++ src/js/links.js | 1 + src/js/main.js | 28 +---- src/js/redirect.js | 60 ++++++++++ src/js/timer.js | 2 +- src/redirect.html | 13 +++ 9 files changed, 440 insertions(+), 135 deletions(-) create mode 100644 src/js/distance.js create mode 100644 src/js/fuzzysearch.js create mode 100644 src/js/redirect.js create mode 100644 src/redirect.html diff --git a/src/css/main.css b/src/css/main.css index 1006997..6eff091 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -1,50 +1,41 @@ +/* Root Variables */ :root { --bg-color: rgb(15, 15, 15); --primary: rgb(240, 240, 240); - - --secondary-color: hsl(210, 80%, 60%); - --secondary-color2: hsl(210, 20%, 20%); - - --font-weight: 300; + --secondary-color: hsl(210, 80%, 80%); + --secondary-color2: hsl(210, 60%, 40%); + --secondary-color-bg: hsl(210, 40%, 5%); + --font-weight: 350; --font-family: "Lucida Console"; - - --link-font-weight: 700; + --bigger-font-weight: 700; --link-border-radius: 1000px; - - --page-max-width: 600px; + --page-max-width: 700px; } -/* General */ +/* General Styles */ body { - background-color: var(--bg-color); + background-color: var(--secondary-color-bg); color: var(--primary); + /*color: var(--primary);*/ font-family: var(--font-family), monospace; font-weight: var(--font-weight); overflow-x: hidden; - - - /* if slim */ - @media only screen and (max-width: 480px) { - margin: 5px; + margin: 0; + position: relative; + height: 100%; } - /* if wide */ - @media only screen and (min-width: 480px) { - margin: 20px; - } - - & h1, p { - margin: 0; - } +h1, p { + margin: 0; } main { + position: relative; + z-index: 1; max-width: var(--page-max-width); margin: 0 auto; - /*border: 1px solid var(--secondary-color);*/ - /*border-radius: 5px;*/ padding: 20px; - filter: drop-shadow(0px 0px 1px var(--secondary-color)) brightness(1); + filter: drop-shadow(0 0 2px var(--secondary-color)) brightness(1); } ::selection { @@ -52,148 +43,209 @@ main { background: var(--secondary-color); } -/* Header*/ +/* Header Styles */ header { text-align: center; width: max-content; margin: 0 auto; - - & .names { - /*margin: 0 auto;*/ - width: min-content; - white-space: nowrap; - - & h1, p { - - text-align: left; - color: var(--secondary-color); - } - } - - & img { - border-radius: 50%; - max-width: 300px; - padding: 0; - } } -/* Links */ +header .names { + width: min-content; + white-space: nowrap; +} + +header h1, header p { + text-align: left; + color: var(--secondary-color); +} + +header img { + border-radius: 50%; + max-width: 300px; + padding: 0; +} + +/* Links Styles */ h2 { width: 100%; margin: 0; - /* if slim */ @media only screen and (max-width: 480px) { - text-align: center; + text-align: center; /* slim */ margin: 10px auto; } + + @media only screen and (min-width: 480px) { + text-align: left; /* wide */ + margin: 0; + } } .text-link { color: var(--secondary-color); text-decoration: underline solid var(--secondary-color2) 1px; - top: 0; position: relative; padding: 0 2px; } .text-link:hover { text-decoration: underline solid var(--secondary-color) 1px; - filter: drop-shadow(0px 0px 5px var(--secondary-color2)) brightness(1.02); + filter: drop-shadow(0 0 5px var(--secondary-color2)) brightness(1.02); top: -2px; } +/* Links Container */ .links { padding: 10px; - border: 1px solid var(--secondary-color); - border-radius: 5px; } +/* Link Group */ .linkGroup { margin: auto; - /* if wide */ @media only screen and (min-width: 480px) { display: flex; - flex-wrap: wrap; - } - - & .link { - height: fit-content; - position: relative; - top: 0; - transition: top ease 100ms; - - /* if slim */ - @media only screen and (max-width: 480px) { - margin-bottom: 10px; - margin-left: 5%; - margin-right: 5%; - } - - /* if wide */ - @media only screen and (min-width: 480px) { - padding: 5px; - } + flex-wrap: wrap; /* wide */ } } +/* Link Styles */ +.link { + height: fit-content; + position: relative; + transition: top 100ms ease, filter 100ms ease; /* Added filter transition */ + + @media only screen and (max-width: 480px) { + margin: 10px 5%; /* slim */ + } + + @media only screen and (min-width: 480px) { + padding: 5px; /* wide */ + } +} + +/* Button Styles */ .linkButton { - font-weight: var(--link-font-weight); + font-weight: var(--bigger-font-weight); font-size: 25px; line-height: 25px; text-align: center; text-decoration: none; text-transform: lowercase; - color: var(--bg-color); background-color: var(--secondary-color); - display: block; box-sizing: border-box; padding: 10px 20px; border-radius: var(--link-border-radius); + width: 100%; /* slim */ - /* if slim */ - @media only screen and (max-width: 480px) { - width: 100%; - } - - & .icon { - width: 25px; - height: 25px; - padding-right: 10px; - padding-bottom: 2px; - vertical-align: middle; - } -} - -.link:hover { - filter: drop-shadow(0px 0px 5px var(--secondary-color)) brightness(1.05); - top: -2px; -} - -.links:hover .link:not(:hover) a { - /* if wide */ @media only screen and (min-width: 480px) { - filter: brightness(0.8); + width: auto; /* wide */ } +} +.linkButton .icon { + width: 25px; + height: 25px; + padding-right: 10px; + padding-bottom: 2px; + vertical-align: middle; +} + +/* Default Hover Effect */ +.hoverHighlight:hover { + @media only screen and (min-width: 480px) { + filter: drop-shadow(0 0 8px var(--secondary-color)) brightness(1.1); + top: -2px; + } +} +.links:hover .hoverHighlight:not(:hover) { + @media only screen and (min-width: 480px) { + filter: brightness(0.5); + } +} + +/* Search Highlighting */ +.highlightSearch { + filter: drop-shadow(0 0 8px var(--secondary-color)) brightness(1.1); + z-index: 1; + @media only screen and (min-width: 480px) { + top: -2px; + } +} + +.notHighlightSearch { + filter: brightness(0.5); + @media only screen and (max-width: 480px) { + display: none; + } } .linkButton:active { transform: scale(0.95); - top: +2px; + top: 2px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); } +/* Search Input Field Styles */ +.fuzzysearch { + margin: 0 auto; + text-align: center; + max-width: var(--page-max-width); +} +#link-search { + background-color: var(--secondary-color2); + color: var(--secondary-color); + border: 2px solid var(--secondary-color2); + border-radius: 50px; + padding: 10px 15px; + font-size: 16px; + text-align: center; + font-weight: var(--bigger-font-weight); + width: 100%; + max-width: 400px; /* Adjust width as needed */ + /*box-shadow: 0 0 5px var(--secondary-color2);*/ + transition: background-color 100ms ease, border-color 100ms ease, box-shadow 100ms ease; +} -/* Timers */ +#link-search::placeholder { + color: var(--secondary-color); + opacity: 0.9; /* Placeholder text opacity */ +} + +#link-search:focus::placeholder { + color: var(--secondary-color); + opacity: 0.9; /* Placeholder text opacity */ +} + +#link-search:focus { + outline: none; + background-color: var(--secondary-color-bg); + box-shadow: 0 0 10px var(--secondary-color); + border-color: var(--secondary-color2); + color: var(--secondary-color); +} + +@media only screen and (max-width: 480px) { + #link-search { + padding: 8px 12px; + max-width: 90%; /* Responsive width for small screens */ + } +} + +@media only screen and (min-width: 480px) { + #link-search { + padding: 10px 15px; + } +} + +/* Timers Styles */ .timer p { - /* if slim */ @media only screen and (max-width: 480px) { - margin-bottom: 20px; + margin-bottom: 20px; /* slim */ } } @@ -202,7 +254,7 @@ h2 { text-decoration: none; } -/* Footer */ +/* Footer Styles */ footer { text-align: center; -} \ No newline at end of file +} diff --git a/src/index.html b/src/index.html index 6e96b8f..6d36b59 100644 --- a/src/index.html +++ b/src/index.html @@ -3,10 +3,12 @@ - julian brammer + Julian Brammer + + @@ -14,12 +16,13 @@
-

julian brammer

+

Julian Brammer

@brulijam


+

css is pain and I used way too much math to implement that fuzzy search.

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea @@ -30,8 +33,10 @@ takimata sanctus est Lorem ipsum dolor sit amet.

-
- +

+
+ +