This commit is contained in:
everythingonblack
2025-04-09 19:18:55 +07:00
parent 055decb2ce
commit 0acbc2ec28
8 changed files with 58 additions and 11 deletions

View File

@@ -2,7 +2,7 @@
"name": "groovebrew-mockup", "name": "groovebrew-mockup",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"homepage": "https://kedaimaster.com", "homepage": "https://dev.kedaimaster.com",
"dependencies": { "dependencies": {
"@emotion/react": "^11.13.3", "@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0", "@emotion/styled": "^11.13.0",

View File

@@ -25,6 +25,7 @@ import GuidePage from "../pages/GuidePage";
import Join from "../pages/Join"; import Join from "../pages/Join";
import Loading from "../pages/Loading"; import Loading from "../pages/Loading";
import Message from "../pages/Message"; import Message from "../pages/Message";
import PlayerPrompt from "../pages/PlayerPrompt";
import Login from "../pages/Login"; import Login from "../pages/Login";
import ResetPassword from "../pages/ResetPassword"; import ResetPassword from "../pages/ResetPassword";
import { getImageUrl } from "../helpers/itemHelper.js"; import { getImageUrl } from "../helpers/itemHelper.js";
@@ -133,6 +134,7 @@ const Modal = ({ user, shop, isOpen, onClose, modalContent, deviceType, setModal
{modalContent === "claim-coupon" && <Join setModal={setModal} />} {modalContent === "claim-coupon" && <Join setModal={setModal} />}
{modalContent === "loading" && <Loading setModal={setModal} />} {modalContent === "loading" && <Loading setModal={setModal} />}
{modalContent === "message" && <Message handleYes={handleYes}/>} {modalContent === "message" && <Message handleYes={handleYes}/>}
{modalContent === "player-prompt" && <PlayerPrompt/>}
</div> </div>
</div> </div>
); );

View File

@@ -3,7 +3,7 @@ import "./MusicPlayer.css";
import MusicComponent from "./MusicComponent"; import MusicComponent from "./MusicComponent";
import Switch from "react-switch"; import Switch from "react-switch";
export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLogin, queue }) { export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLogin, queue, setModal }) {
const [currentTime, setCurrentTime] = useState(0); const [currentTime, setCurrentTime] = useState(0);
const [trackLength, setTrackLength] = useState(0); const [trackLength, setTrackLength] = useState(0);
const [viewing, setViewing] = useState(false); // State for expansion const [viewing, setViewing] = useState(false); // State for expansion
@@ -83,6 +83,10 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
// }); // });
// }; // };
const modifyUrl = (url) => {
return url.replace(/w\d+-h\d+/, "w255-h255");
};
const fetchColor = async () => { const fetchColor = async () => {
if ( if (
currentSong && currentSong &&
@@ -104,7 +108,9 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
// setSubtitleColor("white"); // setSubtitleColor("white");
// setSubtitleBG("black"); // setSubtitleBG("black");
// } // }
setBackgroundImage(imageUrl); const proxiedUrl = `https://dev.api.kedaimaster.com/image?url=${encodeURIComponent(modifyUrl(imageUrl))}`; // Use your proxy to fetch the image
setBackgroundImage(proxiedUrl);
} catch (error) { } catch (error) {
console.error("Error fetching or processing image:", error); console.error("Error fetching or processing image:", error);
} }
@@ -279,6 +285,7 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
if (socket != null && token) { if (socket != null && token) {
socket.emit("songRequest", { token, shopId, track }); socket.emit("songRequest", { token, shopId, track });
setSongName(""); setSongName("");
console.log(track)
} }
}; };
@@ -401,17 +408,12 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
}, 1000); // 1 second timeout (same as the CSS transition duration) }, 1000); // 1 second timeout (same as the CSS transition duration)
}; };
function modifyUrl(url) {
// Use a regular expression to find the part of the URL that starts with '='
return url.replace(/=(w\d+)-(h\d+)-/, '=w255-h255-');
}
return ( return (
<div className={`music-player`} style={{ marginBottom: `${viewing ? '-10px' : ''}` }}> <div className={`music-player`} style={{ marginBottom: `${viewing ? '-10px' : ''}` }}>
<div <div
onClick={toggleView} onClick={toggleView}
className="current-bgr" className="current-bgr"
style={{ backgroundImage: `url(${modifyUrl(backgroundImage)})` }} style={{ backgroundImage: `url(${backgroundImage})` }}
// style={{ backgroundImage: `url(${videoSrc != "" ? '' : backgroundImage})` }} // style={{ backgroundImage: `url(${videoSrc != "" ? '' : backgroundImage})` }}
> >
{/* <video {/* <video
@@ -485,6 +487,11 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
</div> </div>
</div> </div>
<div className="auth-box" style={{marginTop: '-11px'}} onClick={()=>setModal('player-prompt')}>
<div>
Filter jenis musik dengan AI
</div>
</div>
</> </>
)} )}
<div className="search-box"> <div className="search-box">

View File

@@ -1,5 +1,5 @@
// src/config.js // src/config.js
const API_BASE_URL = 'https://api.kedaimaster.com'; const API_BASE_URL = 'https://dev.api.kedaimaster.com';
export default API_BASE_URL; export default API_BASE_URL;

View File

@@ -242,6 +242,7 @@ function CafePage({
shopOwnerId={shopOwnerId} shopOwnerId={shopOwnerId}
isSpotifyNeedLogin={isSpotifyNeedLogin} isSpotifyNeedLogin={isSpotifyNeedLogin}
queue={queue} queue={queue}
setModal={setModal}
/> />
<ItemTypeLister <ItemTypeLister
user={user} user={user}

View File

@@ -46,7 +46,7 @@ const CreateCouponPage = () => {
let encodedCouponCode = encodeURIComponent(encryptedCouponCode); let encodedCouponCode = encodeURIComponent(encryptedCouponCode);
// Construct the URL with the encoded coupon code as a query parameter // Construct the URL with the encoded coupon code as a query parameter
const urlWithCoupon = `https://coupon.kedaimaster.com/coupon?c=${encodedCouponCode}`; const urlWithCoupon = `https://dev.coupon.kedaimaster.com/coupon?c=${encodedCouponCode}`;
// Optionally, set the URL to use with the coupon // Optionally, set the URL to use with the coupon
setCouponUrl(urlWithCoupon); setCouponUrl(urlWithCoupon);

View File

@@ -15,6 +15,12 @@
padding: 40px 3px 15px 3px; padding: 40px 3px 15px 3px;
} }
.input {
width: calc(100% - 10px);
border-radius: 6px;
font-size: 19px;
margin-bottom: 10px;
}
/* Main Heading */ /* Main Heading */
.mainHeading { .mainHeading {
width: 222px; width: 222px;

31
src/pages/PlayerPrompt.js Normal file
View File

@@ -0,0 +1,31 @@
// LinktreePage.js
import React, { useState, useEffect } from 'react';
import styles from './Join.module.css'; // Import the module.css file
const LinktreePage = ({ handleYes }) => {
const [captMessage, setCaptMessage] = useState('');
const [descMessage, setDescMessage] = useState('');
useEffect(() => {
const newQueryParams = new URLSearchParams(window.location.search);
const r = newQueryParams.get('captMessage');
const s = newQueryParams.get('descMessage');
if (r) {
setCaptMessage(r)
setDescMessage(s)
}
}, []);
return (
<div className={styles.linktreePage}>
<div className={styles.dashboardContainer}>
<div className={styles.mainHeading}>Filter jenis musik</div>
<div className={styles.descHeading}>Masukkan prompt untuk Gemini AI</div>
<input className={styles.input} placeholder="hanya musik santai"type="text"/>
<div onClick={handleYes} className={styles.button}>Simpan</div>
</div>
</div>
);
};
export default LinktreePage;