diff --git a/src/pages/home/index.jsx b/src/pages/home/index.jsx index 0d009667b..e1c0301bb 100644 --- a/src/pages/home/index.jsx +++ b/src/pages/home/index.jsx @@ -80,7 +80,7 @@ import { prettyObject, // randomNum, getDirection, - oneApiImage, + oneApiImage } from '@utils/aidFn' import { fireConfetti } from '@utils/confetti' import Zoom from 'react-medium-image-zoom' @@ -96,7 +96,7 @@ const code = { main : "This component needs more than the default code block to be displayed" detailed : "For now, if you want the exact same behaviour, please check the github" }`, - lang: 'typescript', + lang: 'typescript' } const preCode = ` @@ -121,26 +121,26 @@ const slugs = [ 'vercel', 'docker', 'git', - 'sonarqube', + 'sonarqube' ] const dataSteps = [ { title: 'Step 1', - code: 'npx create-react-app my-app', + code: 'npx create-react-app my-app' }, { title: 'Step 2', - code: 'cd my-app', + code: 'cd my-app' }, { title: 'Step 3', - code: 'npm start', + code: 'npm start' }, { title: 'Step 4', - code: 'npm run build', - }, + code: 'npm run build' + } ] const Home = () => { @@ -231,8 +231,8 @@ const Home = () => { [ { content: text, - role: 'user', - }, + role: 'user' + } ], key, signal @@ -316,8 +316,8 @@ const Home = () => { [ { content: text, - role: 'user', - }, + role: 'user' + } ], key, signal @@ -348,7 +348,7 @@ const Home = () => { setAiImageList( res.data.map((item) => ({ imageUrl: item.url, - imagePrompt: item.revised_prompt, + imagePrompt: item.revised_prompt })) ) }) @@ -364,7 +364,7 @@ const Home = () => { const scrollRef = useRef(null) const [customElement, setCustomElement] = useState() const { scrollDir, scrollPosition } = useDetectScroll({ - target: customElement, + target: customElement }) useEffect(() => { @@ -407,12 +407,12 @@ const Home = () => {
- - + + { -
-
+
{isStream &&
正在输入...
}
{dateTime}
-
+
{aiImageList.length > 0 && ( <> {aiImageList.map((item, index) => (
{item.imagePrompt}
- {item.url} + {item.url}
))} @@ -468,31 +468,31 @@ const Home = () => {
- +
- +
This is something
- +
- +
- +
{/*
@@ -504,7 +504,7 @@ const Home = () => { 'Loading awesome content', 'Almost there', 'Just a moment', - 'Getting things ready', + 'Getting things ready' ]} />
@@ -533,7 +533,7 @@ const Home = () => { style={{ marginBottom: 15, position: 'relative', - overflow: 'hidden', + overflow: 'hidden' }} > @@ -542,7 +542,7 @@ const Home = () => { style={{ marginBottom: 15, position: 'relative', - overflow: 'hidden', + overflow: 'hidden' }} > @@ -555,12 +555,12 @@ const Home = () => { width: 360, background: '#111827', position: 'relative', - overflow: 'hidden', + overflow: 'hidden' }} > - - - + + +
{ fontSize: 20, height: 200, width: 360, - background: '#111827', + background: '#111827' }} >
{ height: 200, width: 360, overflow: 'hidden', - position: 'relative', + position: 'relative' }} - className="bg-slate-900" + className='bg-slate-900' >
@@ -600,9 +600,9 @@ const Home = () => { height: 200, width: 360, overflow: 'hidden', - position: 'relative', + position: 'relative' }} - className="bg-slate-900" + className='bg-slate-900' >
@@ -617,7 +617,7 @@ const Home = () => { display: 'flex', alignItems: 'center', justifyContent: 'center', - color: '#fff', + color: '#fff' }} > Direction: {enterDirection} @@ -626,10 +626,10 @@ const Home = () => {
{ margin: '20px 0', width: 360, height: 200, - background: '#000', + background: '#000' }} >
{/*
{
*/}
- +
- +
@@ -707,14 +707,14 @@ const Home = () => {

React Animate On Scroll.

- +

- +

{/* */} - +
{/*
@@ -752,7 +752,7 @@ const Home = () => { marginBottom: 40, width: 360, height: 200, - overflow: 'hidden', + overflow: 'hidden' }} > @@ -764,15 +764,15 @@ const Home = () => { marginBottom: 40, width: 360, height: 200, - overflow: 'hidden', + overflow: 'hidden' }} > @@ -782,12 +782,12 @@ const Home = () => { marginBottom: 40, width: 360, height: 200, - overflow: 'hidden', + overflow: 'hidden' }} > <> - +
Mix Blend Mode
@@ -797,21 +797,21 @@ const Home = () => { marginBottom: 40, width: 360, height: 200, - overflow: 'hidden', + overflow: 'hidden' }} > - +
- +
@@ -821,7 +821,7 @@ const Home = () => {
- +
@@ -835,7 +835,7 @@ const Home = () => { height: 200, position: 'relative', backgroundColor: 'rgba(0, 0,0, 0.8)', - borderRadius: 8, + borderRadius: 8 }} >
@@ -854,23 +854,23 @@ const Home = () => { marginBottom: 40, height: 200, width: 360, - overflow: 'hidden', + overflow: 'hidden' }} >
-

+

@@ -900,20 +900,20 @@ const Home = () => {
Hi, React!
-
+
Button Button @@ -937,8 +937,8 @@ const Home = () => {
I build - - websites and apps. + + websites and apps. {/* */}
{/*
@@ -963,13 +963,13 @@ const Home = () => {
- +
{ height: 200, width: '100%', border: '1px solid #ccc', - background: '#aaa', + background: '#aaa' }} />
{ height: 150, width: '100%', border: '1px solid #ccc', - background: '#aaa', + background: '#aaa' }} />
{ height: 150, width: '100%', border: '1px solid #ccc', - background: '#aaa', + background: '#aaa' }} />
{ height: 200, width: '100%', border: '1px solid #ccc', - background: '#aaa', + background: '#aaa' }} />
{ height: 100, width: '100%', border: '1px solid #ccc', - background: '#aaa', + background: '#aaa' }} />
{ height: 200, width: '100%', border: '1px solid #ccc', - background: '#aaa', + background: '#aaa' }} />
{ height: 150, width: '100%', border: '1px solid #ccc', - background: '#aaa', + background: '#aaa' }} />
{ height: 100, width: '100%', border: '1px solid #ccc', - background: '#aaa', + background: '#aaa' }} />
{ height: 150, width: '100%', border: '1px solid #ccc', - background: '#aaa', + background: '#aaa' }} />
{ height: 100, width: '100%', border: '1px solid #ccc', - background: '#aaa', + background: '#aaa' }} />
{ height: 200, width: '100%', border: '1px solid #ccc', - background: '#aaa', + background: '#aaa' }} />
{ height: 150, width: '100%', border: '1px solid #ccc', - background: '#aaa', + background: '#aaa' }} />
{ height: 150, width: '100%', border: '1px solid #ccc', - background: '#aaa', + background: '#aaa' }} /> @@ -1086,7 +1086,7 @@ const Home = () => {
- +
{ textAlign: 'center', background: '#aaa', margin: '0 10px', - borderRadius: 8, + borderRadius: 8 // transform: 'rotateX(60deg) rotateY(0deg) rotateZ(45deg)' }} > @@ -1104,7 +1104,7 @@ const Home = () => {
- +
{ textAlign: 'center', background: '#aaa', margin: '0 10px', - borderRadius: 8, + borderRadius: 8 }} > Vue diff --git a/src/utils/aidFn.js b/src/utils/aidFn.js index cf9c63687..2503fb5b2 100644 --- a/src/utils/aidFn.js +++ b/src/utils/aidFn.js @@ -63,7 +63,7 @@ export const getImgsUrl = (html) => { export const customizeTimer = { intervalTimer: null, timeoutTimer: null, - setTimeout(cb, interval) { + setTimeout (cb, interval) { const { now } = Date const stime = now() let etime = stime @@ -78,10 +78,10 @@ export const customizeTimer = { this.timeoutTimer = requestAnimationFrame(loop) return this.timeoutTimer }, - clearTimeout() { + clearTimeout () { cancelAnimationFrame(this.timeoutTimer) }, - setInterval(cb, interval) { + setInterval (cb, interval) { const { now } = Date let stime = now() let etime = stime @@ -97,9 +97,9 @@ export const customizeTimer = { this.intervalTimer = requestAnimationFrame(loop) return this.intervalTimer }, - clearInterval() { + clearInterval () { cancelAnimationFrame(this.intervalTimer) - }, + } } export const isDecimal = (value) => { @@ -188,7 +188,7 @@ export const formatRomanNumeral = (num) => { { value: 9, numeral: 'IX' }, { value: 5, numeral: 'V' }, { value: 4, numeral: 'IV' }, - { value: 1, numeral: 'I' }, + { value: 1, numeral: 'I' } ] let result = '' for (const { value, numeral } of romanMap) { @@ -336,13 +336,13 @@ export const oneApiChat = (chatList, token, signal) => signal, headers: { Authorization: token, - 'Content-Type': 'application/json', + 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'gpt-4.1', messages: chatList, - stream: true, - }), + stream: true + }) }) export const oneApiImage = (chatList, token, signal) => @@ -351,15 +351,15 @@ export const oneApiImage = (chatList, token, signal) => signal, headers: { Authorization: token, - 'Content-Type': 'application/json', + 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'dall-e-3', prompt: chatList[0].content, n: 1, size: '1792x1024', - response_format: 'url', - }), + response_format: 'url' + }) }) export const getCurrentDate = () => { const date = new Date() @@ -386,7 +386,7 @@ export const saveHtmlToPng = async (eleHtml, successFun, errorFun) => { try { const ele = eleHtml ?? document.getElementById('image-wrapper') const canvas = await html2canvas(ele, { - useCORS: true, + useCORS: true }) const imgUrl = canvas.toDataURL('image/png') const tempLink = document.createElement('a')