Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: format code with Prettier and StandardJS #541

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/stateless/ContentPlaceholder/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'

Check failure on line 1 in src/components/stateless/ContentPlaceholder/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

ESLint

ESLint: Install the 'eslint' package
import { motion } from 'motion/react'
import { mix } from 'popmotion'
import styles from './index.module.less'
Expand All @@ -22,11 +22,11 @@
)

const ContentPlaceholder = () => (
<motion.div

Check notice on line 25 in src/components/stateless/ContentPlaceholder/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
variants={{ collapsed: { scale: 0.8 }, open: { scale: 1 } }}
initial="collapsed"
animate="open"
whileInView={true}
whileInView
transition={{ duration: 0.8 }}
className={styles.contentPlaceholder}
>
Expand Down
37 changes: 17 additions & 20 deletions src/pages/motion/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useRef, useEffect } from 'react'

Check failure on line 1 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

ESLint

ESLint: Install the 'eslint' package
import {
motion,
useAnimationControls,
Expand Down Expand Up @@ -71,7 +71,7 @@
]

const randomSort = (arr) => {
let newArr = []
const newArr = []
const len = arr.length
for (let i = 0; i < len; i++) {
const random = Math.floor(Math.random() * arr.length)
Expand Down Expand Up @@ -101,14 +101,14 @@

const [listLabel, setListLabel] = useState(['JavaScript', 'html', 'css', 'webAssembly'])
const [isBig, setBigState] = useState(false)
const [leftState, setLeftState] = useState(false)

Check warning on line 104 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused local symbol

Unused constant leftState

Check warning on line 104 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused local symbol

Unused constant setLeftState

const scrollRef = useRef(null)

const { scrollYProgress, scrollY } = useScroll({
container: scrollRef,
})
const { scrollYProgress: scrYPro, scrollY: scrY } = useScroll({

Check warning on line 111 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused local symbol

Unused constant scrY
target: constraintsRef,
container: scrollRef,
offset: ['start end', 'end start'],
Expand All @@ -123,7 +123,7 @@
const scrYProCardX = useTransform(scrYProCard, [0, 1], ['1%', '-50%'])

const scaleSec = useTransform(scrYPro, (value) => value * 3)
useMotionValueEvent(scrYPro, 'change', (current) => {})

Check warning on line 126 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused local symbol

Unused parameter current

const x = useTransform(scrollY, (value) => {
return (value * 1) / 5
Expand Down Expand Up @@ -155,8 +155,8 @@
return (
<FixTabPanel ref={scrollRef}>
<h2>Hi, Motion</h2>
<motion.h2>{rounded}</motion.h2>

Check notice on line 158 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.h2
<motion.div

Check notice on line 159 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
position: 'fixed',
top: 0,
Expand All @@ -166,10 +166,10 @@
backgroundColor: '#aaa',
borderRadius: '3px',
// scaleX: scrollYProgress,
scaleX: scaleX,
scaleX,
}}
></motion.div>
/>
<motion.div

Check notice on line 172 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 100,
height: 100,
Expand All @@ -192,8 +192,8 @@
rotate: 45, // 旋转45度
opacity: 0.5, // 不透明度设置为0.5
}}
></motion.div>
/>
<motion.div

Check notice on line 196 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
transformTemplate={template}
animate={{ rotate: 360 }}
style={{
Expand All @@ -204,9 +204,9 @@
rotate: 0,
x: '200px',
}}
></motion.div>
/>

<motion.div

Check notice on line 209 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 100,
height: 100,
Expand All @@ -217,10 +217,10 @@
duration: 2,
}}
variants={animations}
initial={'hidden'}
animate={'show'}
></motion.div>
initial="hidden"
animate="show"
/>
<motion.ul

Check notice on line 223 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.ul
initial="hidden"
animate="visible"
variants={list}
Expand All @@ -231,12 +231,12 @@
}}
style={{ fontSize: 20 }}
>
<motion.li variants={item}>item1</motion.li>

Check notice on line 234 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.li
<motion.li variants={item}>item2</motion.li>

Check notice on line 235 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.li
<motion.li variants={item}>item3</motion.li>

Check notice on line 236 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.li
</motion.ul>
{['vue', 'react', 'angular'].map((item, i) => (
<motion.p style={{ fontSize: 20 }} key={i} custom={i + 0.3} animate="visible" variants={variantsText}>

Check notice on line 239 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.p
{item}
</motion.p>
))}
Expand All @@ -248,7 +248,7 @@
gap: 30,
}}
>
<motion.div

Check notice on line 251 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 100,
height: 100,
Expand All @@ -270,7 +270,7 @@
onClick={() => {
setRotate(!isRotated)
}}
></motion.div>
/>
</div>

{/* <div
Expand Down Expand Up @@ -300,7 +300,7 @@
margin: '200px 0 0 150px',
}}
>
<motion.div

Check notice on line 303 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 100,
height: 100,
Expand All @@ -326,14 +326,14 @@
setIsAnimation(false)
console.log('Completed animating', definition)
}}
></motion.div>
/>
<div
style={{
display: 'flex',
gap: 20,
}}
>
<motion.div

Check notice on line 336 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
...btnStyle,
pointerEvents: isAnimation ? 'none' : 'auto',
Expand All @@ -349,7 +349,7 @@
</motion.div>
</div>
</div>
<motion.div

Check notice on line 352 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
display: 'flex',
flexDirection: 'column',
Expand All @@ -363,7 +363,7 @@
}}
ref={constraintsRef}
>
<motion.section

Check notice on line 366 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.section
style={{
width: 100,
height: 50,
Expand All @@ -381,7 +381,7 @@
>
拖动元素
</motion.section>
<motion.div

Check notice on line 384 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 100,
height: 100,
Expand All @@ -398,20 +398,17 @@
onDragStart={(event, info) => console.log(info.point.x, info.point.y)}
onDragEnd={(event, info) => console.log(info.point.x, info.point.y)}
onDirectionLock={(axis) => console.log('axis', axis)}
dragSnapToOrigin={true}
dragSnapToOrigin
// dragConstraints={{ left: 0, right: 300 }}
dragConstraints={constraintsRef}
// dragElastic={false}
// dragElastic={0.8}
// dragPropagation={false}
></motion.div>
/>
<div
style={{
display: 'flex',
gap: 20,
}}
>
<motion.div

Check notice on line 411 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={btnStyle}
onTap={() => {
controller.start({ scale: 1.2 })
Expand All @@ -419,7 +416,7 @@
>
</motion.div>
<motion.div

Check notice on line 419 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={btnStyle}
onTap={() => {
controller.start({ rotate: 45 })
Expand All @@ -427,7 +424,7 @@
>
旋转
</motion.div>
<motion.div

Check notice on line 427 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={btnStyle}
onClick={() => {
controller.start({ opacity: 0.2 })
Expand All @@ -435,7 +432,7 @@
>
透明度
</motion.div>
<motion.div

Check notice on line 435 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={btnStyle}
onTap={() => {
controller.start({ opacity: 1, rotate: 0, scale: 1.0 })
Expand All @@ -448,7 +445,7 @@

<section ref={targetRef} className="relative h-[300vh] pt-4 bg-neutral-300">
<div className="sticky top-0 flex items-center overflow-hidden">
<motion.div style={{ x: scrYProCardX }} className="flex gap-4">

Check notice on line 448 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
<HorizontalScrollParallax />
</motion.div>
</div>
Expand Down Expand Up @@ -488,7 +485,7 @@
}}
key={i}
>
<motion.div

Check notice on line 488 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 100,
height: 100,
Expand Down Expand Up @@ -537,7 +534,7 @@
</div>
</div>

<motion.div

Check notice on line 537 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 180,
backgroundColor: '#333',
Expand All @@ -551,7 +548,7 @@
setButtonState(!buttonRight)
}}
>
<motion.div

Check notice on line 551 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
layout // 设置在白色圆球元素上,即子元素上 <-
style={{
width: 60,
Expand All @@ -559,11 +556,11 @@
backgroundColor: 'white',
borderRadius: 60,
}}
></motion.div>
/>
</motion.div>

<section style={{ fontSize: 30 }}>scrollDirection: {scrollDirection}</section>
<motion.div

Check notice on line 563 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 200,
height: 100,
Expand All @@ -573,8 +570,8 @@
x,
rotate,
}}
></motion.div>
/>
<motion.div

Check notice on line 574 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 200,
height: 100,
Expand All @@ -582,7 +579,7 @@
borderRadius: '20px',
scaleX,
}}
></motion.div>
/>

<div
style={{
Expand All @@ -596,7 +593,7 @@
marginBottom: 20,
}}
>
<motion.div

Check notice on line 596 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
display: 'flex',
flexDirection: 'column',
Expand All @@ -606,7 +603,7 @@
>
{listLabel.map((item) => {
return (
<motion.div

Check notice on line 606 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
layout
style={{
width: 200,
Expand All @@ -623,7 +620,7 @@
</motion.div>
)
})}
<motion.div

Check notice on line 623 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 160,
height: 30,
Expand Down Expand Up @@ -654,7 +651,7 @@
alignItems: 'center',
}}
>
<motion.div

Check notice on line 654 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
backgroundColor: '#333',
borderRadius: '10px',
Expand All @@ -667,7 +664,7 @@
layout
>
<LayoutGroup>
<motion.div

Check notice on line 667 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
layout
style={{
width: isBig ? 200 : 60,
Expand All @@ -685,9 +682,9 @@
setBigState(!isBig)
}}
>
<motion.span layout>click</motion.span>

Check notice on line 685 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.span
</motion.div>
<motion.div

Check notice on line 687 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
layout
style={{
width: 60,
Expand All @@ -695,8 +692,8 @@
backgroundColor: '#fff',
borderRadius: 10,
}}
></motion.div>
/>
<motion.div

Check notice on line 696 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
layout
style={{
width: 60,
Expand All @@ -704,7 +701,7 @@
backgroundColor: '#fff',
borderRadius: 10,
}}
></motion.div>
/>
</LayoutGroup>
</motion.div>
</div>
Expand Down
Loading