Skip to content

Commit

Permalink
Merge pull request #73 from StudyLions/staging
Browse files Browse the repository at this point in the history
Release V1.5.0
  • Loading branch information
stefanstax authored Jun 17, 2022
2 parents 6c2b4ed + ae73ca4 commit 8ca9b8c
Show file tree
Hide file tree
Showing 115 changed files with 908 additions and 13 deletions.
2 changes: 1 addition & 1 deletion components/PurchaseCompleteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function PurchaseCompleteModal(props: IProps) {
The Gems will be added to your account in the next 24 hours. Make sure to open your DM on Discord
</p>
<div className="flex justify-between gap-[20px] mt-[20px] px-[37px] ex_sm:flex-col md:pb-[20px]">
<Link href={"/coming-soon"}>
<Link href={"/skins"}>
<a className="alignCenter w-full bg-blue0 h-[36px] rounded-2xl uppercase font-bold hover:bg-blue1">
Browse skins
</a>
Expand Down
6 changes: 3 additions & 3 deletions components/liongems/LionGemsBuySection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function LionGemsBuySection() {
/>
)}

<div className={`${styles.buySection}`}>
<div id="getLionsGems" className={`${styles.buySection}`}>
<h1
className={`uppercase text-center pt-[50px] pb-[40px] font-bold text-[55px] sm:text-[45px]`}
id={"liongems"}
Expand Down Expand Up @@ -95,7 +95,7 @@ export default function LionGemsBuySection() {
+{numberWithCommas(donationItem.tokens_bonus)} bonus
</p>
<a
className={`rounded-full block text-2xl mx-5 mb-5 text-center py-1 font-bold bg-red20 hover:bg-red04`}
className={`rounded-3xl block text-2xl mx-5 mb-5 text-center py-1 font-bold bg-red20 hover:bg-red04`}
>
{donationItem.amount}
</a>
Expand All @@ -112,7 +112,7 @@ export default function LionGemsBuySection() {
✨To gift LionGems, use the <span className={"text-[#ffd469]"}>!gift</span> command✨
</p>
<div className={"mt-[30px]"}>
<Button image={magnifying_glass} label={"BROWSE SKINS"} href={"/coming-soon"} />
<Button image={magnifying_glass} label={"BROWSE SKINS"} href={"/skins"} />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/liongems/LionGemsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let buttonsList: Array<IButton> = [
src: magnifying_glass,
},
label: "Browse skins",
href: "/coming-soon",
href: "/skins",
},
];

Expand Down
2 changes: 1 addition & 1 deletion components/liongems/LionGemsPremiumPlan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const PremiumCard = (card) => {

const LionGemsPremiumPlan = () => {
return (
<div className={"flex flex-col pt-[100px] mx-auto"}>
<div id="premiumPlans" className={"flex flex-col pt-[100px] mx-auto"}>
<h1
className={"font-bold text-[55px] sm:text-[45px] landing-[66px] uppercase text-center pt-[67px]"}
id={"premium-plans"}
Expand Down
246 changes: 246 additions & 0 deletions components/lionskins/SkinModal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
import React, { useRef, useState, useEffect } from "react";
import Image from "next/image";
import useOnClickOutside from "@/hooks/useOnClickOutside";
import useWindowSize from "@/hooks/useWindowSize";
import { NavigationPaths } from "@/constants/types";

const SkinModal = (props) => {
const { width } = useWindowSize();
const ref = useRef();
useOnClickOutside(ref, () => props.closeModal());

// create an event listener

// Define various classes later to be used
let fluidHeight;
let fluidWidth;
let fluidWidthClass;
let fluidImageContainer;
let fluidInfoContainer;
let modalWidth;
let fluidJustify;

const handleRefresh = () => {
// Grab window width
if (width >= 1920) {
modalWidth = `w-[1000px]`;
fluidWidth = 90;
fluidHeight = 90;
fluidWidthClass = "w-11/12";
fluidJustify = `justify-between`;
fluidImageContainer = "w-6/12";
fluidInfoContainer = "w-6/12";
} else if (width > 1280 && width < 1919) {
modalWidth = `w-8/12`;
fluidWidth = 100;
fluidHeight = 100;
fluidWidthClass = "w-11/12";
fluidJustify = `justify-between`;
fluidImageContainer = "w-5/12";
fluidInfoContainer = "w-7/12";
} else if (width > 967) {
modalWidth = `w-11/12`;
fluidWidth = 100;
fluidHeight = 100;
fluidWidthClass = "w-11/12";
fluidJustify = `justify-between`;
fluidImageContainer = "w-5/12";
fluidInfoContainer = "w-7/12";
} else if (width > 767) {
modalWidth = `w-11/12`;
fluidWidth = 140;
fluidHeight = 140;
fluidWidthClass = "w-full";
fluidJustify = `justify-center`;
fluidImageContainer = "w-11/12";
fluidInfoContainer = "w-11/12";
} else if (width > 650) {
modalWidth = `w-11/12`;
fluidWidth = 100;
fluidHeight = 100;
fluidWidthClass = `w-full`;
fluidJustify = `justify-center`;
fluidImageContainer = "w-11/12";
fluidInfoContainer = "w-11/12";
} else {
modalWidth = `w-full`;
fluidWidth = 70;
fluidHeight = 70;
fluidWidthClass = `w-full`;
fluidJustify = "justify-center";
fluidImageContainer = "w-5/12";
fluidInfoContainer = "w-7/12";
}
};

handleRefresh();
// Calculate various classes depending on the window width

let thumbnailImageWidth = fluidWidth;
let thumbnailImageHeight = fluidHeight;
let mainImageWidth = 400;
let mainImageHeight = 400;
const [mainImage, setMainImage] = useState(props.imageOne);

// #bc4a49
return (
<div className="fixed inset-0 overflow-auto flex justify-center items-center bg-transparentBlack20 z-50">
<div
ref={ref}
className={`flex flex-wrap ${fluidJustify} items-stretch relative ${modalWidth} h-fit m-auto bg-slate-900 rounded-3xl`}
>
<div
className={` flex justify-center items-center ${fluidImageContainer} md:w-11/12 mx-0 my-0 sm:mx-auto sm:my-4 p-8 bg-slate-800 rounded-3xl`}
>
<Image
src={mainImage}
width={mainImageWidth}
objectFit="contain"
height={mainImageHeight}
alt={props.label}
/>
</div>
<div
className={`${fluidInfoContainer} md:w-11/12 mx-0 my-0 sm:mx-auto sm:my-4 p-4 flex flex-wrap justify-center items-center`}
>
<div className={`flex flex-wrap ${fluidWidthClass} justify-between items-center my-3`}>
<h1 className="text-center text-[#fff] text-3xl font-extrabold uppercase">{props.label}</h1>
<div className="flex w-fitContent justify-between items-center">
<Image
src={require("@/public/icons/diamond-white.svg")}
alt="Star icon"
layout="fixed"
height={30}
width={30}
objectFit="contain"
/>
<p className="text-center ml-2 font-black text-[#fff] text-2xl">
{props.price.toLocaleString(undefined, { maximumFractionDigits: 2 })}
</p>
</div>
<div className="w-full mt-2 border-solid border-b rounded-xl border-[#fff]"></div>
</div>
{/* Thumbnails */}
<div className={`${fluidWidthClass} flex flex-wrap justify-center items-center gap-[10px]`}>
<img
onClick={() => setMainImage(props.imageOne)}
className="cursor-zoom-in"
src={props.imageOneThumbnail}
width={thumbnailImageWidth}
height={thumbnailImageHeight}
alt=""
/>
<img
onClick={() => setMainImage(props.imageTwo)}
className="cursor-zoom-in"
src={props.imageTwoThumbnail}
width={thumbnailImageWidth}
height={thumbnailImageHeight}
alt=""
/>
<img
onClick={() => setMainImage(props.imageThree)}
className="cursor-zoom-in"
src={props.imageThreeThumbnail}
width={thumbnailImageWidth}
height={thumbnailImageHeight}
alt=""
/>
<img
onClick={() => setMainImage(props.imageFour)}
className="cursor-zoom-in"
src={props.imageFourThumbnail}
width={thumbnailImageWidth}
height={thumbnailImageHeight}
alt=""
/>
<img
onClick={() => setMainImage(props.imageFive)}
className="cursor-zoom-in"
src={props.imageFiveThumbnail}
width={thumbnailImageWidth}
height={thumbnailImageHeight}
alt=""
/>
<img
onClick={() => setMainImage(props.imageSix)}
className="cursor-zoom-in"
src={props.imageSixThumbnail}
width={thumbnailImageWidth}
height={thumbnailImageHeight}
alt=""
/>
<img
onClick={() => setMainImage(props.imageSeven)}
className="cursor-zoom-in"
src={props.imageSevenThumbnail}
width={thumbnailImageWidth}
height={thumbnailImageHeight}
alt=""
/>
<img
onClick={() => setMainImage(props.imageEight)}
className="cursor-zoom-in"
src={props.imageEightThumbnail}
width={thumbnailImageWidth}
height={thumbnailImageHeight}
alt=""
/>
</div>
{/* Buttons / Guidance */}
<div className={`${fluidWidthClass} flex flex-wrap justify-between items-stretch flex-col my-3`}>
<p className="text-center p-2 mb-4 border-solid border-b border-l border-r border-t rounded-lg border-[#fff]">
To purchase, use the command <span className="font-black">!skin</span>
</p>
<div className="flex flex-wrap justify-evenly items-center ex_sm:flex-col">
<a
href={NavigationPaths.donate + "#premiumPlans"}
className="flex flex-wrap justify-evenly items-center w-6/12 p-2 border-solid border-b border-l border-r border-t rounded-3xl border-[#fff] text-[#fff] font-medium text-sm uppercase"
>
<Image
src={require("@/public/icons/diamond-white.svg")}
alt="Star icon"
layout="fixed"
height={20}
width={18}
objectFit="contain"
/>{" "}
Get Liongems
</a>
<a
href={NavigationPaths.donate + "#getLionsGems"}
className="flex flex-wrap justify-evenly items-center w-5/12 p-2 border-solid border-b border-l border-r border-t rounded-3xl border-[#fff] text-[#fff] font-semibold text-sm uppercase"
>
<Image
src={require("@/public/icons/star-white.svg")}
alt="Star icon"
layout="fixed"
height={20}
width={18}
objectFit="contain"
/>{" "}
Go Premium
</a>
</div>
</div>
</div>
<div
className="absolute mdlg:fixed mdlg:bg-indigo-400 mdlg:p-2 mdlg:rounded-md right-5 top-3 cursor-pointer"
onClick={() => props.closeModal()}
>
<Image
src={require("@/public/icons/close-white.svg")}
alt="Close icon"
height={16}
width={16}
objectFit="contain"
/>
</div>
</div>
{/* </div> */}
</div>
);
};

export default SkinModal;

12 changes: 12 additions & 0 deletions components/lionskins/Skins.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.gradientBackground {
&:hover {
background-image: linear-gradient(
to bottom,
#e5c05f 10%,
#b28b4b 40%,
rgba(255, 233, 212, 0.1019607843) 85%,
transparent 89%
);
}
}

75 changes: 75 additions & 0 deletions components/lionskins/SkinsBrowser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import React, { useState } from "react";
import Image from "next/image";
import SkinModal from "./SkinModal";
import { SkinsList } from "@/constants/SkinsList";
import styles from "./Skins.module.scss";

const SkinsBrowser = () => {
const [isModalOpen, setIsOpenModal] = useState(false);
const [data, setData] = useState(null);
return (
<div className={"flex flex-wrap justify-center items-center gap-[20px] py-20"}>
{SkinsList.map((skin) => (
<div
className={`flex flex-wrap w-3/12 lg:w-5/12 md:w-6/12 sm:w-11/12 justify-center items-center rounded-3xl p-2 ${styles.gradientBackground}`}
>
<div
className="cursor-zoom-in flex flex-wrap justify-center items-center bg-gradient-to-b from-indigo-900 to-gray-900 p-4 rounded-3xl"
key={skin.id}
onClick={() => {
setIsOpenModal(true);
setData(skin);
}}
>
<h2 className="text-3xl mb-3 text-gray-300">{skin.label}</h2>
<Image
src={skin.image.imageOne}
alt={skin.label}
objectFit="contain"
className="my-3"
width={600}
height={600}
/>
<div className="w-6/12 sm:w-8/12 flex flex-wrap justify-center items-center bg-red-500 my-2 p-2 rounded-3xl pulse">
<Image
src={require("@/public/icons/diamond-white.svg")}
alt="Star icon"
layout="fixed"
height={20}
width={20}
objectFit="contain"
/>
<p className="ml-4">{skin.price.toLocaleString(undefined, { maximumFractionDigits: 2 })}</p>
</div>
</div>
</div>
))}
{isModalOpen ? (
<SkinModal
label={data.label}
imageOne={data.image.imageOne.default.src}
imageTwo={data.image.imageTwo.default.src}
imageThree={data.image.imageThree.default.src}
imageFour={data.image.imageFour.default.src}
imageFive={data.image.imageFive.default.src}
imageSix={data.image.imageSix.default.src}
imageSeven={data.image.imageSeven.default.src}
imageEight={data.image.imageEight.default.src}
imageOneThumbnail={data.image.imageOneThumbnail.default.src}
imageTwoThumbnail={data.image.imageTwoThumbnail.default.src}
imageThreeThumbnail={data.image.imageThreeThumbnail.default.src}
imageFourThumbnail={data.image.imageFourThumbnail.default.src}
imageFiveThumbnail={data.image.imageFiveThumbnail.default.src}
imageSixThumbnail={data.image.imageSixThumbnail.default.src}
imageSevenThumbnail={data.image.imageSevenThumbnail.default.src}
imageEightThumbnail={data.image.imageEightThumbnail.default.src}
price={data.price}
closeModal={() => setIsOpenModal(false)}
/>
) : null}
</div>
);
};

export default SkinsBrowser;

Loading

0 comments on commit 8ca9b8c

Please sign in to comment.