Last active
April 16, 2024 21:22
-
-
Save aPinix/708391fe11f50574494e041e8608e22c to your computer and use it in GitHub Desktop.
Revisions
-
aPinix revised this gist
Aug 25, 2022 . No changes.There are no files selected for viewing
-
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ createSvgRectWithBorderRadius('.wrapper', '#09f', 0, 0, 400, 300, 40, 70, 20, 110); /** * Create a rounded rectangle (different radius for each corner) * @author aPinix <https://twitter.com/aPinix> * @version 1.0 * @see {@link https://codepen.io/aPinix/pen/dyRvjQq} -
aPinix revised this gist
Aug 25, 2022 . No changes.There are no files selected for viewing
-
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +0,0 @@ -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,3 @@ # This is a title  -
aPinix revised this gist
Aug 25, 2022 . No changes.There are no files selected for viewing
-
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,3 @@ # This is a title  -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ -
aPinix renamed this gist
Aug 25, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
aPinix renamed this gist
Aug 25, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,7 @@ createSvgRectWithBorderRadius('.wrapper', '#09f', 0, 0, 400, 300, 40, 70, 20, 11 * @see {@link https://codepen.io/aPinix/pen/dyRvjQq} * @link https://codepen.io/aPinix/pen/dyRvjQq * @param {string} elemSelector The selector for the element to append the svg * @param {string} color The color of the rectangle * @param {number} positionX Position of the rectangle on the x axis * @param {number} positionY Position of the rectangle on the y axis * @param {number} width Width of the rectangle -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ createSvgRectWithBorderRadius('.wrapper', '#09f', 0, 0, 400, 300, 40, 70, 20, 110); /** * Create a rounded rectangle (allows for different radius on each corner) @@ -16,7 +16,7 @@ createRoundRect('.wrapper', 0, 0, 400, 300, 40, 70, 20, 110); * @param {number} bottomRightRadius Radius of the bottom right corner * @param {number} bottomLeftRadius Radius of the bottom left corner */ function createSvgRectWithBorderRadius(elemSelector, color, positionX, positionY, width, height, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius) { const svgRectWithBorderRadius = (positionX, positionY, width, height, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius) => { return `M${positionX + topLeftRadius},${positionY}\ h${width - (topLeftRadius + topRightRadius)}\ @@ -37,5 +37,6 @@ createRoundRect('.wrapper', 0, 0, 400, 300, 40, 70, 20, 110); const path = document.createElementNS('http://www.w3.org/2000/svg', 'path'); path.setAttribute('d', svgRectWithBorderRadius(positionX, positionY, width, height, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius)); path.setAttribute('fill', color); svg.append(path); } -
aPinix revised this gist
Aug 25, 2022 . No changes.There are no files selected for viewing
-
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 0 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +0,0 @@ -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +0,0 @@ -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ createRoundRect('.wrapper', 0, 0, 400, 300, 40, 70, 20, 110); * @version 1.0 * @see {@link https://codepen.io/aPinix/pen/dyRvjQq} * @link https://codepen.io/aPinix/pen/dyRvjQq * @param {string} elemSelector The selector for the element to append the svg * @param {number} positionX Position of the rectangle on the x axis * @param {number} positionY Position of the rectangle on the y axis * @param {number} width Width of the rectangle -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ createRoundRect('.wrapper', 0, 0, 400, 300, 40, 70, 20, 110); * @version 1.0 * @see {@link https://codepen.io/aPinix/pen/dyRvjQq} * @link https://codepen.io/aPinix/pen/dyRvjQq * @param {string} elemSelector The selector for the element to append to * @param {number} positionX Position of the rectangle on the x axis * @param {number} positionY Position of the rectangle on the y axis * @param {number} width Width of the rectangle @@ -16,7 +16,7 @@ createRoundRect('.wrapper', 0, 0, 400, 300, 40, 70, 20, 110); * @param {number} bottomRightRadius Radius of the bottom right corner * @param {number} bottomLeftRadius Radius of the bottom left corner */ function createSvgRectWithBorderRadius(elemSelector, positionX, positionY, width, height, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius) { const svgRectWithBorderRadius = (positionX, positionY, width, height, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius) => { return `M${positionX + topLeftRadius},${positionY}\ h${width - (topLeftRadius + topRightRadius)}\ @@ -33,7 +33,7 @@ createRoundRect('.wrapper', 0, 0, 400, 300, 40, 70, 20, 110); const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); svg.setAttribute('width', width); svg.setAttribute('height', height); document.querySelector(elemSelector).append(svg); const path = document.createElementNS('http://www.w3.org/2000/svg', 'path'); path.setAttribute('d', svgRectWithBorderRadius(positionX, positionY, width, height, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius)); -
aPinix revised this gist
Aug 25, 2022 . No changes.There are no files selected for viewing
-
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1 @@ <div class="wrapper"></div> -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 17 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,17 @@ .wrapper { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; > * + * { margin-left: 40px; } } svg { path { fill: tomato; } } -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,15 +6,15 @@ createRoundRect('.wrapper', 0, 0, 400, 300, 40, 70, 20, 110); * @version 1.0 * @see {@link https://codepen.io/aPinix/pen/dyRvjQq} * @link https://codepen.io/aPinix/pen/dyRvjQq * @param {string} selector The selector for the element to append to * @param {number} positionX Position of the rectangle on the x axis * @param {number} positionY Position of the rectangle on the y axis * @param {number} width Width of the rectangle * @param {number} height Height of the rectangle * @param {number} topLeftRadius Radius of the top left corner * @param {number} topRightRadius Radius of the top right corner * @param {number} bottomRightRadius Radius of the bottom right corner * @param {number} bottomLeftRadius Radius of the bottom left corner */ function createSvgRectWithBorderRadius(selector, positionX, positionY, width, height, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius) { const svgRectWithBorderRadius = (positionX, positionY, width, height, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius) => { -
aPinix revised this gist
Aug 25, 2022 . No changes.There are no files selected for viewing
-
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 12 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,18 +2,19 @@ createRoundRect('.wrapper', 0, 0, 400, 300, 40, 70, 20, 110); /** * Create a rounded rectangle (allows for different radius on each corner) * @author aPinix <https://twitter.com/aPinix> * @version 1.0 * @see {@link https://codepen.io/aPinix/pen/dyRvjQq} * @link https://codepen.io/aPinix/pen/dyRvjQq * @param {String} selector The selector for the element to append to * @param {Number} positionX Position of the rectangle on the x axis * @param {Number} positionY Position of the rectangle on the y axis * @param {Number} width Width of the rectangle * @param {Number} height Height of the rectangle * @param {Number} topLeftRadius Radius of the top left corner * @param {Number} topRightRadius Radius of the top right corner * @param {Number} bottomRightRadius Radius of the bottom right corner * @param {Number} bottomLeftRadius Radius of the bottom left corner */ function createSvgRectWithBorderRadius(selector, positionX, positionY, width, height, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius) { const svgRectWithBorderRadius = (positionX, positionY, width, height, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius) => { -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,8 @@ createRoundRect('.wrapper', 0, 0, 400, 300, 40, 70, 20, 110); /** * Create a rounded rectangle (allows for different radius on each corner) * @author aPinix <a.pinix@gmail.com> * @version 1.0 * @see {@link https://codepen.io/aPinix/pen/dyRvjQq} * @param {String} selector The selector for the element to append to * @param {Number} positionX Position of the rectangle on the x axis * @param {Number} positionY Position of the rectangle on the y axis -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,7 @@ createRoundRect('.wrapper', 0, 0, 400, 300, 40, 70, 20, 110); /** * Create a rounded rectangle (allows for different radius on each corner) * @author aPinix <a.pinix@gmail.com> * https://codepen.io/aPinix/pen/dyRvjQq * @param {String} selector The selector for the element to append to * @param {Number} positionX Position of the rectangle on the x axis -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,7 @@ createRoundRect('.wrapper', 0, 0, 400, 300, 40, 70, 20, 110); /** * Create a rounded rectangle (allows for different radius on each corner) * https://codepen.io/aPinix/pen/dyRvjQq * @param {String} selector The selector for the element to append to * @param {Number} positionX Position of the rectangle on the x axis * @param {Number} positionY Position of the rectangle on the y axis -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ createRoundRect('.wrapper', 0, 0, 400, 300, 40, 70, 20, 110); /** * Create a rounded rectangle (allows for different radius on each corner) * @param {String} selector The selector for the element to append to * @param {Number} positionX Position of the rectangle on the x axis * @param {Number} positionY Position of the rectangle on the y axis -
aPinix revised this gist
Aug 25, 2022 . 1 changed file with 10 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,16 @@ createRoundRect('.wrapper', 0, 0, 400, 300, 40, 70, 20, 110); /** * Create a rounded rectangle (Allows for different radius on each corner) * @param {String} selector The selector for the element to append to * @param {Number} positionX Position of the rectangle on the x axis * @param {Number} positionY Position of the rectangle on the y axis * @param {Number} width Width of the rectangle * @param {Number} height Height of the rectangle * @param {Number} topLeftRadius Radius of the top left corner * @param {Number} topRightRadius Radius of the top right corner * @param {Number} bottomRightRadius Radius of the bottom right corner * @param {Number} bottomLeftRadius Radius of the bottom left corner */ function createSvgRectWithBorderRadius(selector, positionX, positionY, width, height, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius) { const svgRectWithBorderRadius = (positionX, positionY, width, height, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius) => {
NewerOlder