fancies
This commit is contained in:
57
index.html
57
index.html
@@ -7,8 +7,8 @@
|
|||||||
<title>Jhewit | Home</title>
|
<title>Jhewit | Home</title>
|
||||||
<link rel="stylesheet" href="main.css" />
|
<link rel="stylesheet" href="main.css" />
|
||||||
</head>
|
</head>
|
||||||
<body><!--
|
<body>
|
||||||
<div id="sider">
|
<!--<div id="sider">
|
||||||
<h2>Sidebar</h2>
|
<h2>Sidebar</h2>
|
||||||
<div id="sider-cats">
|
<div id="sider-cats">
|
||||||
<input type="checkbox" id="i_1" class="hidden" />
|
<input type="checkbox" id="i_1" class="hidden" />
|
||||||
@@ -27,12 +27,12 @@
|
|||||||
</div>-->
|
</div>-->
|
||||||
<div id="outer">
|
<div id="outer">
|
||||||
<div id="header">
|
<div id="header">
|
||||||
<div id="head-marker" class="scrolly"></div>
|
<div id="head-marker" class=""></div>
|
||||||
<div id="headin">
|
<div id="headin">
|
||||||
<h1>Jhewit</h1>
|
<h1>Jhewit</h1><!--
|
||||||
<div id="links">
|
<div id="links">
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
Dropdown 1
|
INFORMATION
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="dropdown-inner">
|
<div class="dropdown-inner">
|
||||||
@@ -47,37 +47,22 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown">
|
</div>-->
|
||||||
Dropdown 2
|
<div id="carousel-outer">
|
||||||
</div>
|
<div id="carousel-inner">
|
||||||
<div>
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #1</div>
|
||||||
<div class="dropdown-inner">
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #2</div>
|
||||||
<a href="#">
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #3</div>
|
||||||
LINK
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #4</div>
|
||||||
</a>
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #5</div>
|
||||||
<a href="#">
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #6</div>
|
||||||
LINK
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #7</div>
|
||||||
</a>
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #8</div>
|
||||||
<a href="#">
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #9</div>
|
||||||
LINK
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #10</div>
|
||||||
</a>
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #11</div>
|
||||||
</div>
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #12</div>
|
||||||
</div>
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #13</div>
|
||||||
<div class="dropdown">
|
|
||||||
Dropdown 3
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div class="dropdown-inner">
|
|
||||||
<a href="#">
|
|
||||||
LINK
|
|
||||||
</a>
|
|
||||||
<a href="#">
|
|
||||||
LINK
|
|
||||||
</a>
|
|
||||||
<a href="#">
|
|
||||||
LINK
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
65
main.css
65
main.css
@@ -40,6 +40,7 @@ h1 {
|
|||||||
background-image: url(https://www.state.gov/wp-content/uploads/2022/02/Kuwait-2323x1406.png);
|
background-image: url(https://www.state.gov/wp-content/uploads/2022/02/Kuwait-2323x1406.png);
|
||||||
background-attachment: fixed;
|
background-attachment: fixed;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
position: relative;
|
||||||
/*clip-path: polygon(0% 0%, 100% 0%, 100% 90%, 30% 100%, 0% 90%);*/
|
/*clip-path: polygon(0% 0%, 100% 0%, 100% 90%, 30% 100%, 0% 90%);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,6 +60,12 @@ h1 {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
/*display: grid;
|
||||||
|
grid-template-columns: var(--sidebar-size) auto;
|
||||||
|
grid-template-columns: var(--sidebar-size) auto;*/
|
||||||
|
}
|
||||||
|
|
||||||
.dropdown {
|
.dropdown {
|
||||||
background-color: aliceblue;
|
background-color: aliceblue;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
@@ -91,6 +98,7 @@ h1 {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
@@ -106,13 +114,14 @@ h1 {
|
|||||||
transition: background-color 0.3s, color 0.3s;
|
transition: background-color 0.3s, color 0.3s;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
color: lightgreen;
|
color: red;
|
||||||
/*margin-left: var(--sidebar-size);*/
|
/*margin-left: var(--sidebar-size);
|
||||||
width: calc(100vw); /*- var(--sidebar-size)*/
|
width: calc(100vw - var(--sidebar-size));*/
|
||||||
|
width: 100vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
#head-marker.scrolly-out + #headin > #links > * > *, #head-marker.scrolly-out + #headin > #links > * {
|
#head-marker.scrolly-out + #headin > #links > * > *, #head-marker.scrolly-out + #headin > #links > * {
|
||||||
background-color: black;
|
/*background-color: black;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#outer {
|
#outer {
|
||||||
@@ -178,3 +187,51 @@ a:hover {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#carousel-inner > div {
|
||||||
|
width: max(15vw, 15vh);
|
||||||
|
height: max(15vw, 15vh);
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
padding: max(2vw, 2vh);
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 30px;
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 2%;
|
||||||
|
margin-right: 2%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#carousel-outer {
|
||||||
|
--do-scroll: yes;
|
||||||
|
padding: 20px;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: rgba(255, 125, 125, 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
#carousel-outer:hover {
|
||||||
|
--do-scroll: no;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide scrollbar for Chrome, Safari and Opera */
|
||||||
|
#carousel-inner::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide scrollbar for IE, Edge and Firefox */
|
||||||
|
#carousel-inner {
|
||||||
|
-ms-overflow-style: none;
|
||||||
|
/* IE and Edge */
|
||||||
|
scrollbar-width: none;
|
||||||
|
/* Firefox */
|
||||||
|
}
|
||||||
|
|
||||||
|
#carousel-inner {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow-x: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
43
main.js
43
main.js
@@ -39,8 +39,9 @@ const scrollchecks = () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
var perc = clamp(0, document.getElementById("outer").scrollTop / (window.innerHeight / 2), 1);
|
var perc = clamp(0, document.getElementById("outer").scrollTop / (window.innerHeight / 2), 1);
|
||||||
document.querySelector("#headin > h1").style.fontSize = 2 + 4 * (1 - perc) + "em";
|
document.querySelector("#headin > h1").style.fontSize = 0 + 6 * (1 - perc) + "em";
|
||||||
document.querySelector("#links").style.opacity = perc;
|
//document.querySelector("#links").style.opacity = perc;
|
||||||
|
//document.querySelector("#carousel").style.opacity = perc;
|
||||||
};
|
};
|
||||||
window.addEventListener("scroll", scrollchecks);
|
window.addEventListener("scroll", scrollchecks);
|
||||||
window.addEventListener("scrollend", scrollchecks);
|
window.addEventListener("scrollend", scrollchecks);
|
||||||
@@ -49,3 +50,41 @@ window.addEventListener("resize", scrollchecks);
|
|||||||
window.addEventListener("load", scrollchecks);
|
window.addEventListener("load", scrollchecks);
|
||||||
window.addEventListener("touchmove", scrollchecks);
|
window.addEventListener("touchmove", scrollchecks);
|
||||||
setInterval(scrollchecks, 250); // Computers are fast and scrolling in JavaScript is dumb. Shoot me.
|
setInterval(scrollchecks, 250); // Computers are fast and scrolling in JavaScript is dumb. Shoot me.
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
requestAnimationFrame(main);
|
||||||
|
var el = document.getElementById("carousel-inner");
|
||||||
|
if (getComputedStyle(el).getPropertyValue("--do-scroll") == "yes") {
|
||||||
|
el.scrollBy({
|
||||||
|
left: 10,
|
||||||
|
top: 0,
|
||||||
|
behavior: "smooth"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (el.scrollLeft > el.scrollWidth - window.innerWidth - (el.children[0].getBoundingClientRect().width * 3)) {
|
||||||
|
var hammer = el.children[0];
|
||||||
|
el.removeChild(hammer);
|
||||||
|
let smol = el.scrollWidth;
|
||||||
|
el.appendChild(hammer);
|
||||||
|
hammer = el.lastChild;
|
||||||
|
el.scrollBy({
|
||||||
|
left: smol - el.scrollWidth,
|
||||||
|
top: 0,
|
||||||
|
behavior: "auto"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (el.scrollLeft < el.children[0].getBoundingClientRect().width * 3) {
|
||||||
|
var hammer = el.lastChild;
|
||||||
|
el.removeChild(hammer);
|
||||||
|
let smol = el.scrollWidth;
|
||||||
|
el.insertBefore(hammer, el.firstChild);
|
||||||
|
hammer = el.firstChild;
|
||||||
|
el.scrollBy({
|
||||||
|
left: el.scrollWidth - smol,
|
||||||
|
top: 0,
|
||||||
|
behavior: "auto"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
||||||
@@ -7,8 +7,8 @@
|
|||||||
<title>Jhewit | Home</title>
|
<title>Jhewit | Home</title>
|
||||||
<link rel="stylesheet" href="main.css" />
|
<link rel="stylesheet" href="main.css" />
|
||||||
</head>
|
</head>
|
||||||
<body><!--
|
<body>
|
||||||
<div id="sider">
|
<!--<div id="sider">
|
||||||
<h2>Sidebar</h2>
|
<h2>Sidebar</h2>
|
||||||
<div id="sider-cats">
|
<div id="sider-cats">
|
||||||
<input type="checkbox" id="i_1" class="hidden" />
|
<input type="checkbox" id="i_1" class="hidden" />
|
||||||
@@ -27,12 +27,12 @@
|
|||||||
</div>-->
|
</div>-->
|
||||||
<div id="outer">
|
<div id="outer">
|
||||||
<div id="header">
|
<div id="header">
|
||||||
<div id="head-marker" class="scrolly"></div>
|
<div id="head-marker" class=""></div>
|
||||||
<div id="headin">
|
<div id="headin">
|
||||||
<h1>Jhewit</h1>
|
<h1>Jhewit</h1><!--
|
||||||
<div id="links">
|
<div id="links">
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
Dropdown 1
|
INFORMATION
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="dropdown-inner">
|
<div class="dropdown-inner">
|
||||||
@@ -47,37 +47,22 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown">
|
</div>-->
|
||||||
Dropdown 2
|
<div id="carousel-outer">
|
||||||
</div>
|
<div id="carousel-inner">
|
||||||
<div>
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #1</div>
|
||||||
<div class="dropdown-inner">
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #2</div>
|
||||||
<a href="#">
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #3</div>
|
||||||
LINK
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #4</div>
|
||||||
</a>
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #5</div>
|
||||||
<a href="#">
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #6</div>
|
||||||
LINK
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #7</div>
|
||||||
</a>
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #8</div>
|
||||||
<a href="#">
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #9</div>
|
||||||
LINK
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #10</div>
|
||||||
</a>
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #11</div>
|
||||||
</div>
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #12</div>
|
||||||
</div>
|
<div style="background-image: url(https://www.rebeccas.com/mm5/graphics/00000001/nv1364.jpg);">Category #13</div>
|
||||||
<div class="dropdown">
|
|
||||||
Dropdown 3
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div class="dropdown-inner">
|
|
||||||
<a href="#">
|
|
||||||
LINK
|
|
||||||
</a>
|
|
||||||
<a href="#">
|
|
||||||
LINK
|
|
||||||
</a>
|
|
||||||
<a href="#">
|
|
||||||
LINK
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user