Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdForeign committed Aug 2, 2024
1 parent 80eb698 commit 93cc9f6
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 117 deletions.
4 changes: 0 additions & 4 deletions src/Cropper.Blazor/Client/Pages/Crop/CropPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
"polygon image"
})" />





<DocsPage>
<DocsPageHeader Title="Crop image" SubTitle="Here are examples of basic usage of the getting canvas drawn the cropped image." />
<DocsPageContent>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<div class="mud-codeblock">
<div class="html">
<pre>
<div class="html">
<pre>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">script</span><span class="htmlTagDelimiter">&gt;</span>
window.getPolygonImage = (sourceCanvas, path) => {
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
const width = sourceCanvas.width,
height = sourceCanvas.height;
window.getPolygonImage = (sourceCanvas, path) => {
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
const width = sourceCanvas.width,
height = sourceCanvas.height;

canvas.width = width;
canvas.height = height;
context.imageSmoothingEnabled = true;
canvas.width = width;
canvas.height = height;
context.imageSmoothingEnabled = true;

context.beginPath();
context.moveTo(path[0] * width / 100, path[1] * height / 100);
context.fillStyle = "rgba(255, 255, 255, 0)";
context.beginPath();
context.moveTo(path[0] * width / 100, path[1] * height / 100);
context.fillStyle = "rgba(255, 255, 255, 0)";

for (let i = 2; i < path.length; i += 2) {
context.lineTo(path[i] * width / 100, path[i + 1] * height / 100);
}
for (let i = 2; i < path.length; i += 2) {
context.lineTo(path[i] * width / 100, path[i + 1] * height / 100);
}

context.closePath();
context.clip();
context.fill();
context.globalCompositeOperation = 'lighter';
context.drawImage(sourceCanvas, 0, 0, width, height);
context.closePath();
context.clip();
context.fill();
context.globalCompositeOperation = 'lighter';
context.drawImage(sourceCanvas, 0, 0, width, height);

return canvas.toDataURL("image/png", 1);
}
return canvas.toDataURL("image/png", 1);
}
<span class="htmlTagDelimiter">&lt;&#47;</span><span class="htmlElementName">script</span> <span class="htmlTagDelimiter">&gt;</span>
</pre>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<div class="mud-codeblock">
<div class="html">
<pre>
<div class="html">
<pre>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">script</span><span class="htmlTagDelimiter">&gt;</span>
window.getEllipseImage = (sourceCanvas) => {
const createdCanvas = document.createElement('canvas');
const contextCanvas = createdCanvas.getContext('2d');
const widthCanvas = sourceCanvas.width,
heightCanvas = sourceCanvas.height;
window.getEllipseImage = (sourceCanvas) => {
const createdCanvas = document.createElement('canvas');
const contextCanvas = createdCanvas.getContext('2d');
const widthCanvas = sourceCanvas.width,
heightCanvas = sourceCanvas.height;

createdCanvas.width = widthCanvas;
createdCanvas.height = heightCanvas;
contextCanvas.imageSmoothingEnabled = true;
createdCanvas.width = widthCanvas;
createdCanvas.height = heightCanvas;
contextCanvas.imageSmoothingEnabled = true;

contextCanvas.drawImage(sourceCanvas, 0, 0, widthCanvas, heightCanvas);
contextCanvas.globalCompositeOperation = 'destination-in';
contextCanvas.beginPath();
contextCanvas.ellipse(widthCanvas / 2, heightCanvas / 2, widthCanvas / 2, heightCanvas / 2, 0 * Math.PI, 0, 180 * Math.PI, true);
contextCanvas.fill();
contextCanvas.drawImage(sourceCanvas, 0, 0, widthCanvas, heightCanvas);
contextCanvas.globalCompositeOperation = 'destination-in';
contextCanvas.beginPath();
contextCanvas.ellipse(widthCanvas / 2, heightCanvas / 2, widthCanvas / 2, heightCanvas / 2, 0 * Math.PI, 0, 180 * Math.PI, true);
contextCanvas.fill();

return createdCanvas.toDataURL("image/png", 1);
}
return createdCanvas.toDataURL("image/png", 1);
}
<span class="htmlTagDelimiter">&lt;&#47;</span><span class="htmlElementName">script</span> <span class="htmlTagDelimiter">&gt;</span>
</pre>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="mud-codeblock">
<div class="html">
<div class="html">
<pre>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">script</span> <span class="htmlAttributeName">src</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">_content/Cropper.Blazor/cropper.min.js</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span><span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">/script</span><span class="htmlTagDelimiter">&gt;</span>
</pre>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div class="mud-codeblock">
<div class="csharp">
<pre>
<div class="csharp">
<pre>
<span class="keyword">using</span> Cropper.Blazor.Extensions;

<span class="localVar">builder</span>.Services.<span class="function">AddCropper</span>();

</pre>
</div>
</div>
</div>
132 changes: 66 additions & 66 deletions src/Cropper.Blazor/Client/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,76 +2,76 @@
<html lang="en-us">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes" />
<meta name="robots" content="index, follow" />
<meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
<meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
<meta name="docsearch:language" content="en" />
<meta name="docsearch:version" content="master" />
<meta name="google-site-verification" content="x2SFbVPxbn1Gk2wv-POqGp4oAlzFZV7FLIXDzrOCvlY" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<base href="/" />
<link href="manifest.json" rel="manifest" />
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png" />
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#ff5c9b" />
<meta name="msapplication-TileColor" content="#110e2d" />
<meta name="theme-color" content="#ffffff" />
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
<link href="_content/Cropper.Blazor/cropper.min.css" rel="stylesheet" />
<link href="Cropper.Blazor.Client.styles.css" rel="stylesheet" />
<link href="Cropper.Blazor.Client.min.css" rel="stylesheet" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes" />
<meta name="robots" content="index, follow" />
<meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
<meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
<meta name="docsearch:language" content="en" />
<meta name="docsearch:version" content="master" />
<meta name="google-site-verification" content="x2SFbVPxbn1Gk2wv-POqGp4oAlzFZV7FLIXDzrOCvlY" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<base href="/" />
<link href="manifest.json" rel="manifest" />
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png" />
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#ff5c9b" />
<meta name="msapplication-TileColor" content="#110e2d" />
<meta name="theme-color" content="#ffffff" />
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
<link href="_content/Cropper.Blazor/cropper.min.css" rel="stylesheet" />
<link href="Cropper.Blazor.Client.styles.css" rel="stylesheet" />
<link href="Cropper.Blazor.Client.min.css" rel="stylesheet" />
</head>

<body>
<div id="app">
<div class="master-loader">
<div class="logo-loader-wrapper">
<div class="loader-box">
<img src="logo.svg" class="loader-image" />
<img src="logo.svg" class="loader-image" />
<div class="loader-text text-gradient"></div>
</div>
</div>
</div>
</div>
<div id="app">
<div class="master-loader">
<div class="logo-loader-wrapper">
<div class="loader-box">
<img src="logo.svg" class="loader-image" />
<img src="logo.svg" class="loader-image" />
<div class="loader-text text-gradient"></div>
</div>
</div>
</div>
</div>

<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="decode.min.js"></script>
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
<script>
Blazor.start({
loadBootResource: function (type, name, defaultUri, integrity) {
// For framework resources, use the precompressed .br files for faster downloads
// This is needed only because GitHub pages doesn't natively support Brotli (or even gzip for .dll files)
if (type !== 'dotnetjs' && location.hostname !== 'localhost') {
return (async function () {
const response = await fetch(defaultUri + '.br', { cache: 'no-cache' });
if (!response.ok) {
throw new Error(response.statusText);
}
const originalResponseBuffer = await response.arrayBuffer();
const originalResponseArray = new Int8Array(originalResponseBuffer);
const decompressedResponseArray = BrotliDecode(originalResponseArray);
const contentType = type === 'dotnetwasm' ? 'application/wasm' : 'application/octet-stream';
return new Response(decompressedResponseArray, { headers: { 'content-type': contentType } });
})();
}
}
});
</script>
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
<script src="_content/Cropper.Blazor/cropper.min.js"></script>
<script src="overrideCropperJsInteropModule.min.js"></script>
<script src="jsObjectModule.min.js"></script>
<script src="helper.min.js"></script>
<script src="sw-registrator.min.js"></script>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="decode.min.js"></script>
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
<script>
Blazor.start({
loadBootResource: function (type, name, defaultUri, integrity) {
// For framework resources, use the precompressed .br files for faster downloads
// This is needed only because GitHub pages doesn't natively support Brotli (or even gzip for .dll files)
if (type !== 'dotnetjs' && location.hostname !== 'localhost') {
return (async function () {
const response = await fetch(defaultUri + '.br', { cache: 'no-cache' });
if (!response.ok) {
throw new Error(response.statusText);
}
const originalResponseBuffer = await response.arrayBuffer();
const originalResponseArray = new Int8Array(originalResponseBuffer);
const decompressedResponseArray = BrotliDecode(originalResponseArray);
const contentType = type === 'dotnetwasm' ? 'application/wasm' : 'application/octet-stream';
return new Response(decompressedResponseArray, { headers: { 'content-type': contentType } });
})();
}
}
});
</script>
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
<script src="_content/Cropper.Blazor/cropper.min.js"></script>
<script src="overrideCropperJsInteropModule.min.js"></script>
<script src="jsObjectModule.min.js"></script>
<script src="helper.min.js"></script>
<script src="sw-registrator.min.js"></script>
</body>

</html>

0 comments on commit 93cc9f6

Please sign in to comment.