@@ -58,7 +58,7 @@ async function cropImage () {
5858 // Paper stack settings
5959 const paperPadding = 60 // Extra space for rotated papers
6060 const rotationAngle = 5 * Math . PI / 180 // 5 degrees in radians
61-
61+
6262 // Create canvas with extra space for rotated papers
6363 const canvasWidth = newWidth + paperPadding * 2
6464 const canvasHeight = newHeight + paperPadding * 2
@@ -72,51 +72,51 @@ async function cropImage () {
7272 // Helper function to draw a paper with shadow
7373 function drawPaper ( x , y , width , height , rotation , shadowIntensity ) {
7474 ctx . save ( )
75-
75+
7676 // Move to center of where paper should be
7777 ctx . translate ( x + width / 2 , y + height / 2 )
7878 ctx . rotate ( rotation )
79-
79+
8080 // Draw shadow
8181 ctx . shadowColor = `rgba(0, 0, 0, ${ shadowIntensity } )`
8282 ctx . shadowBlur = 8
8383 ctx . shadowOffsetX = 4
8484 ctx . shadowOffsetY = 4
85-
85+
8686 // Draw paper
8787 ctx . fillStyle = '#ffffff'
8888 ctx . fillRect ( - width / 2 , - height / 2 , width , height )
89-
89+
9090 // Add subtle border
9191 ctx . shadowColor = 'transparent'
9292 ctx . strokeStyle = 'rgba(0, 0, 0, 0.1)'
9393 ctx . lineWidth = 1
9494 ctx . strokeRect ( - width / 2 , - height / 2 , width , height )
95-
95+
9696 ctx . restore ( )
9797 }
9898
9999 // Draw background papers (rotated)
100100 const centerX = canvasWidth / 2 - newWidth / 2
101101 const centerY = canvasHeight / 2 - newHeight / 2
102-
102+
103103 // Bottom paper (rotated left)
104104 drawPaper ( centerX - 3 , centerY + 6 , newWidth , newHeight , - rotationAngle , 0.15 )
105-
105+
106106 // Middle paper (rotated right)
107107 drawPaper ( centerX + 3 , centerY + 3 , newWidth , newHeight , rotationAngle , 0.2 )
108-
108+
109109 // Top paper (no rotation) - we'll draw the actual image on this one
110110 ctx . save ( )
111111 ctx . shadowColor = 'rgba(0, 0, 0, 0.25)'
112112 ctx . shadowBlur = 10
113113 ctx . shadowOffsetX = 2
114114 ctx . shadowOffsetY = 2
115-
115+
116116 // Draw white background for top paper
117117 ctx . fillStyle = '#ffffff'
118118 ctx . fillRect ( centerX , centerY , newWidth , newHeight )
119-
119+
120120 // Reset shadow for the actual image
121121 ctx . shadowColor = 'transparent'
122122 ctx . shadowBlur = 0
@@ -131,12 +131,12 @@ async function cropImage () {
131131 centerX , centerY , // Destination x, y (centered on top paper)
132132 newWidth , newHeight // Destination width, height
133133 )
134-
134+
135135 // Add subtle border to top paper
136136 ctx . strokeStyle = 'rgba(0, 0, 0, 0.1)'
137137 ctx . lineWidth = 1
138138 ctx . strokeRect ( centerX , centerY , newWidth , newHeight )
139-
139+
140140 ctx . restore ( )
141141
142142 // Save the cropped image
0 commit comments