Skip to content

Commit

Permalink
++
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Rey committed Oct 23, 2024
1 parent f780c40 commit 6c20f1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 6 additions & 1 deletion petitbonhomme/_includes/outfit_display_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ outfitStacks.forEach((stack) => {

function setupWheel(outfitStack) {
const wheelItems = outfitStack.querySelectorAll('.outfit-wheel-item-image-wrap');
const radius = {{ wheel_radius }};
const pageWidth = window.innerWidth;
const radius = Math.min(pageWidth / 2, {{ wheel_radius }});

const wheel = outfitStack.querySelectorAll('.wheel')[0];
wheel.style.width = `${2 * radius + 200}px`;
wheel.style.height = `${2 * radius + 200}px`;

// Position the items in a circle around the center of the wheel
const angleStep = (2 * Math.PI) / wheelItems.length; // Divide the circle by the number of items
Expand Down
6 changes: 2 additions & 4 deletions petitbonhomme/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ Index Page
#latest-items {
display: flex;
flex-direction: row;
justify-content: center;
justify-content: space-evenly;
gap: 20px;
flex-wrap: wrap;
margin: 20px auto;
width: 100%;
}

#latest-items div {
Expand Down Expand Up @@ -543,8 +543,6 @@ Calendar Page
position: absolute;
top: 50%;
left: 50%;
width: 600px; /* Size of the wheel */
height: 600px;
transform: translate(-50%, -50%);
background-color: rgba(255, 255, 255, 1); /* White background with some transparency */
border-radius: 50%; /* Makes it a circle */
Expand Down

0 comments on commit 6c20f1a

Please sign in to comment.