almost done with basic layout

This commit is contained in:
yequari 2023-09-24 11:37:22 -07:00
parent 296ed0de4e
commit dda401d147
8 changed files with 254 additions and 0 deletions

6
css/counter.css Normal file
View File

@ -0,0 +1,6 @@
.wrapper {
width: 100%;
height: 400px;
display: block;
background-color: aqua;
}

59
css/shelf.css Normal file
View File

@ -0,0 +1,59 @@
.wrapper {
width: 300px;
height: 100px;
display: block;
}
.shelf {
width: 100%;
height: 100%;
display: block;
perspective: 400px; /* determines size of the overall element in the final transform */
backface-visibility: visible;
transform-style: preserve-3d;
perspective-origin: 50% 40%;
}
.face {
width: 300px;
height: 100px;
display: block;
position: absolute;
}
.small-face {
width: 100px;
height: 100px;
display: block;
position: absolute;
}
.top-shelf {
background-color: #DAA06D;
transform: rotateX(90deg) translateZ(50px);
}
.bottom-shelf {
background-color: #DAA06D;
transform: rotateX(-90deg) translateZ(50px);
}
.right-shelf {
background-color: #6F4E37;
transform: rotateY(90deg) translateZ(50px);
right: 0;
}
.left-shelf {
background-color: #6F4E37;
transform: rotateY(-90deg) translateZ(50px);
}
.front-shelf {
background: rgba(255,255,255,0.1);
transform: translateZ(50px);
}
.back-shelf {
background: #6E260E;
transform: rotateY(180deg) translateZ(50px);
}

52
css/style.css Normal file
View File

@ -0,0 +1,52 @@
/* toy-shelf {
width: 400px;
height: 150px;
display: inline-block;
background-color: chartreuse;
} */
body {
background: url(../images/d7YslGq.gif);
line-height: 1.6;
font-size: 16px;
}
header {
}
h1,h2,h3 {
line-height: 1.2;
}
.container {
background-color: white;
width: 85%;
padding: 20px 50px;
margin: 0 auto;
}
.content {
display: flex;
flex-flow: row wrap-reverse;
}
.sidebar {
flex: 3 1 20%;
border: 1px solid black;
padding: 20px 40px;
}
.storefront {
flex: 1 3 fit-content;
margin: 0 auto;
}
.shelf-group {
display: inline-block;
padding: 0 20px;
}
shop-counter {
position: relative;
z-index: 2;
}

BIN
images/MulONxK.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/NRJjSF0.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/d7YslGq.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 891 B

80
index.html Normal file
View File

@ -0,0 +1,80 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="js/elements.js"></script>
<link rel="stylesheet" href="css/style.css" />
<title>yeet</title>
</head>
<body>
<div class="container">
<header>
<h1>yequari's emporium of excellent toys</h1>
<h3><em>Odd that we only have Transformers though</em></h3>
</header>
<div class="content">
<div class="storefront">
<div class="shelf-group">
<h2>Featured</h2>
<toy-shelf>
<ul>
<li>Armada Megatron</li>
<li>Leo Prime</li>
<li>Coronation Starscream</li>
</ul>
</toy-shelf>
<toy-shelf>
<ul>
<li>Armada Starscream</li>
<li>Leo Nemesis Prime</li>
<li>Optimus Prime</li>
</ul>
</toy-shelf>
<toy-shelf></toy-shelf>
</div>
<div class="shelf-group">
<h2>New Arrivals</h2>
<toy-shelf>
<ul>
<li>Armada Megatron</li>
<li>Leo Prime</li>
<li>Coronation Starscream</li>
</ul>
</toy-shelf>
<toy-shelf>
<ul>
<li>Armada Starscream</li>
<li>Leo Nemesis Prime</li>
<li>Optimus Prime</li>
</ul>
</toy-shelf>
<toy-shelf></toy-shelf>
</div>
<shop-counter></shop-counter>
</div>
<div class="sidebar" id="text">
<p>
<em>This site is a work in progress.
I thought it would be cool to work publicly and show off my experimentation and progress.
Check back on Oct 7th to see the completed version!</em>
</p>
<p>
Welcome to yequari's emporium of excellent toys,
the premier stop for all your toys and collectibles in Marigold Town!
Although we currently collect and showcase primarily Transformers,
we deal with toys and collectibles of all makers, brands, and eras.
MISB, used, vintage, modern, we got it all.
</p>
<p>
We accept trade-ins! Want to add to our collection? Go to the <a href="#">trade-in counter</a>.
</p>
<p>
Don't see what you're looking for at the front desk? We might have it in the <a href="#">back</a>.
</p>
</div>
</div>
</div>
</body>
</html>

57
js/elements.js Normal file
View File

@ -0,0 +1,57 @@
class ToyShelf extends HTMLElement {
constructor() {
super();
const shadow = this.attachShadow({mode: "open", slotAssignment: "named"});
const wrapper = document.createElement("span");
wrapper.setAttribute("class", "wrapper");
const shelf = document.createElement("span")
shelf.setAttribute("class", "shelf")
const topshelf = shelf.appendChild(document.createElement("div"));
topshelf.setAttribute("class", "top-shelf face");
const leftshelf = shelf.appendChild(document.createElement("div"));
leftshelf.setAttribute("class", "left-shelf small-face");
const rightshelf = shelf.appendChild(document.createElement("div"));
rightshelf.setAttribute("class", "right-shelf small-face");
const back = shelf.appendChild(document.createElement("div"));
back.setAttribute("class", "back-shelf face");
const bottomshelf = shelf.appendChild(document.createElement("div"));
bottomshelf.setAttribute("class", "bottom-shelf face");
const front = shelf.appendChild(document.createElement("div"));
front.setAttribute("class", "front-shelf face");
let style = document.createElement("link");
style.setAttribute("rel", "stylesheet");
style.setAttribute("href", "css/shelf.css")
wrapper.appendChild(shelf);
shadow.appendChild(wrapper);
shadow.appendChild(style);
}
}
class ShopCounter extends HTMLElement {
constructor() {
super();
const shadow = this.attachShadow({mode: "open", slotAssignment: "named"});
let style = document.createElement("link");
style.setAttribute("rel", "stylesheet");
style.setAttribute("href", "css/counter.css")
const wrapper = document.createElement("span");
wrapper.setAttribute("class", "wrapper");
const shelf = document.createElement("span")
shelf.setAttribute("class", "counter")
shadow.appendChild(wrapper);
shadow.appendChild(style);
}
}
customElements.define("toy-shelf", ToyShelf);
customElements.define("shop-counter", ShopCounter);