From 5c1058d6cc84818271e7de5d36f63f02a74d561d Mon Sep 17 00:00:00 2001 From: petracoding Date: Sat, 10 Feb 2024 16:46:05 +0100 Subject: [PATCH 01/26] Update Neocities Widgets --- neocities/lastfm.html | 59 +++++++++++++++++++++++++++++++++++++++++++ neocities/stats.html | 5 ++++ neocities/status.html | 5 ++++ 3 files changed, 69 insertions(+) create mode 100644 neocities/lastfm.html diff --git a/neocities/lastfm.html b/neocities/lastfm.html new file mode 100644 index 0000000..7fb6f18 --- /dev/null +++ b/neocities/lastfm.html @@ -0,0 +1,59 @@ + + + + petrapixel stats + + + + + + +
+
+ +
+
+ + + diff --git a/neocities/stats.html b/neocities/stats.html index 5e08871..92fdd41 100644 --- a/neocities/stats.html +++ b/neocities/stats.html @@ -17,6 +17,11 @@ display: flex; justify-content: center; text-align: center; + color: #612e43; + } + + main { + max-width: 170px; } diff --git a/neocities/status.html b/neocities/status.html index 18a7cea..a88a734 100644 --- a/neocities/status.html +++ b/neocities/status.html @@ -17,6 +17,11 @@ display: flex; justify-content: center; text-align: center; + color: #612e43; + } + + main { + max-width: 170px; } From f78349e350a3e9c1040f05cc732968622865a7c4 Mon Sep 17 00:00:00 2001 From: petracoding Date: Sat, 10 Feb 2024 16:52:26 +0100 Subject: [PATCH 02/26] Improve Neocities Widgets --- neocities/lastfm.html | 7 ++++++- neocities/stats.html | 5 +++++ neocities/status.html | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/neocities/lastfm.html b/neocities/lastfm.html index 7fb6f18..7cb8396 100644 --- a/neocities/lastfm.html +++ b/neocities/lastfm.html @@ -5,6 +5,10 @@ + + + + + + + + + + + diff --git a/pinterest/index.html b/pinterest/index.html new file mode 100644 index 0000000..b823b29 --- /dev/null +++ b/pinterest/index.html @@ -0,0 +1,42 @@ + + + + Pinterest Board iFrame + + + + + + + + + + + + +
+

Pinterest Board iFrame

+

Easily generate a Pinterest board widget!

+ +
+ + Paste the link to your pinterest board: + + + +
+

Result

+ HTML (iFrame): + + or... + Notion Embed Link: + + (Paste this code in Notion and select "Create embed") + +
+

Preview

+ (If you can't see anything here the link to your pinterest board is incorrect!) + +
+ + From 90c8d95e815a851350281149dff8c94c9ed32d77 Mon Sep 17 00:00:00 2001 From: petracoding Date: Sun, 25 Feb 2024 12:22:18 +0100 Subject: [PATCH 06/26] Improvements --- css/folder/main.scss | 47 ++++++++++++++++++++++++++++++-- css/subpages/notion-widgets.scss | 8 ------ index.html | 12 +++++--- main.js | 2 +- notion/index.html | 3 +- pinterest/index.html | 3 +- tumblr-tag-list-tool.html | 1 + 7 files changed, 59 insertions(+), 17 deletions(-) diff --git a/css/folder/main.scss b/css/folder/main.scss index 398e935..2012c82 100644 --- a/css/folder/main.scss +++ b/css/folder/main.scss @@ -28,7 +28,10 @@ a { &:hover, &:focus, &:visited { - color: #1d5999; + &, + & small { + color: #1d5999; + } } } @@ -78,6 +81,32 @@ h2 { } } +.back-link { + position: fixed; + top: 0; + left: 0; + z-index: 1; + padding: 0.5em; + line-height: 1; + + a { + display: block; + text-decoration: none; + color: #251d35; + padding: 0.5em; + + &:hover, + &:focus { + text-decoration: underline; + color: #251d35; + } + } + + @media (max-width: 900px) { + display: none; + } +} + @media (prefers-color-scheme: dark) { body { background: rgb(12, 11, 14); @@ -92,7 +121,21 @@ h2 { &:hover, &:focus, &:visited { - color: #6c89b7; + &, + & small { + color: #6c89b7; + } + } + } + + .back-link { + a { + color: rgb(190, 188, 195); + + &:hover, + &:focus { + color: rgb(190, 188, 195); + } } } } diff --git a/css/subpages/notion-widgets.scss b/css/subpages/notion-widgets.scss index 12ff9d8..c95dc49 100644 --- a/css/subpages/notion-widgets.scss +++ b/css/subpages/notion-widgets.scss @@ -140,14 +140,6 @@ background-color: rgb(25, 25, 25) !important; } - .back-link { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - } - > * { width: 100%; diff --git a/index.html b/index.html index 234f9d5..9537114 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,8 @@ + +
@@ -48,19 +50,21 @@

My Userscripts:

-->

Elsewhere:

+ diff --git a/main.js b/main.js index 4c4050f..4b1d4eb 100644 --- a/main.js +++ b/main.js @@ -149,7 +149,7 @@ eval("document.addEventListener(\"DOMContentLoaded\", function (event) {\r\n if /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("// Imports\nvar ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.i, \"@font-face {\\n font-family: \\\"basiic\\\";\\n src: url(https://cinni.net/fonts/basiic.ttf); }\\n\\n* {\\n box-sizing: border-box;\\n color: #251d35; }\\n\\nbody {\\n font-family: \\\"basiic\\\", \\\"Mukta\\\", sans-serif;\\n letter-spacing: -0.03em;\\n font-size: 17px;\\n line-height: 1.8;\\n display: flex;\\n justify-content: center;\\n background: #f4ecec; }\\n @media (min-width: 1000px) {\\n body {\\n font-size: 22px;\\n line-height: 2; } }\\n\\na, a:hover, a:focus, a:visited {\\n color: #1d5999; }\\n\\nmain {\\n width: 95%;\\n max-width: 850px; }\\n @media (min-width: 1000px) {\\n main {\\n width: 90%;\\n padding-top: 10vh;\\n padding-bottom: 10vh; } }\\n\\np {\\n margin: 0.5em 0;\\n text-align: justify; }\\n\\nul {\\n margin: 0.5em 0;\\n padding-left: 1.5em; }\\n\\nh1,\\nh2 {\\n margin-bottom: 0;\\n line-height: 1.5; }\\n\\nh2 {\\n margin-top: 1.5em;\\n font-size: 20px; }\\n @media (min-width: 1000px) {\\n h2 {\\n font-size: 28px; } }\\n\\n.cursor {\\n animation: blink 1s step-start 0s infinite; }\\n\\n@keyframes blink {\\n 50% {\\n opacity: 0; } }\\n\\n@media (prefers-color-scheme: dark) {\\n body {\\n background: #0c0b0e; }\\n * {\\n color: #bebcc3; }\\n a, a:hover, a:focus, a:visited {\\n color: #6c89b7; } }\\n\\n.tumblr-tag-list-tool button,\\n.tumblr-tag-list-tool input[type=\\\"text\\\"],\\n.tumblr-tag-list-tool textarea {\\n font-family: \\\"Mukta\\\", sans-serif;\\n font-size: 16px;\\n line-height: 1.75;\\n background: #eee4e4;\\n border: 1px solid #898989;\\n padding: 5px 15px; }\\n @media (min-width: 1000px) {\\n .tumblr-tag-list-tool button,\\n .tumblr-tag-list-tool input[type=\\\"text\\\"],\\n .tumblr-tag-list-tool textarea {\\n font-size: 22px; } }\\n .tumblr-tag-list-tool button:focus,\\n .tumblr-tag-list-tool input[type=\\\"text\\\"]:focus,\\n .tumblr-tag-list-tool textarea:focus {\\n outline: none;\\n border: 1px solid black; }\\n\\n.tumblr-tag-list-tool input[type=\\\"text\\\"] {\\n margin-top: 10px;\\n width: 100%; }\\n\\n.tumblr-tag-list-tool textarea {\\n width: 100%;\\n margin: 10px 0;\\n min-height: 250px; }\\n\\n.tumblr-tag-list-tool button {\\n margin: 20px 0;\\n cursor: pointer; }\\n .tumblr-tag-list-tool button:hover, .tumblr-tag-list-tool button:focus {\\n filter: brightness(0.95); }\\n\\n.tumblr-tag-list-tool span {\\n display: block;\\n margin-top: 30px; }\\n\\n.tumblr-tag-list-tool label {\\n width: 100%;\\n display: block;\\n margin-top: 10px; }\\n\\n.tumblr-tag-list-tool input[type=\\\"checkbox\\\"] {\\n filter: saturate(0) brightness(0.9); }\\n\\n.tumblr-tag-list-tool #output {\\n padding: 10px;\\n border: 2px solid lightgray;\\n max-height: 85vh;\\n overflow-y: auto; }\\n .tumblr-tag-list-tool #output:empty {\\n display: none; }\\n\\n.tumblr-tag-list-tool .wrap {\\n margin-left: 30px;\\n margin-bottom: 20px; }\\n\\n@media (prefers-color-scheme: dark) {\\n .tumblr-tag-list-tool input[type=\\\"text\\\"],\\n .tumblr-tag-list-tool textarea,\\n .tumblr-tag-list-tool button {\\n color: #bebcc3;\\n background: #2a2a2c;\\n border-color: #2a2a2c; }\\n .tumblr-tag-list-tool input[type=\\\"text\\\"]:focus,\\n .tumblr-tag-list-tool textarea:focus,\\n .tumblr-tag-list-tool button:focus {\\n border-color: #f4ecec; }\\n .tumblr-tag-list-tool input[type=\\\"checkbox\\\"] {\\n filter: invert(1) saturate(0); }\\n .tumblr-tag-list-tool button:hover, .tumblr-tag-list-tool button:focus {\\n filter: brightness(0.8); } }\\n\\n.notion-widgets button,\\n.notion-widgets input[type=\\\"text\\\"],\\n.notion-widgets input[type=\\\"number\\\"],\\n.notion-widgets input[type=\\\"color\\\"],\\n.notion-widgets textarea,\\n.notion-widgets select {\\n font-family: \\\"Mukta\\\", sans-serif;\\n font-size: 16px;\\n line-height: 1.75;\\n background: #eee4e4;\\n border: 1px solid #898989;\\n padding: 5px 15px;\\n margin-bottom: 0.5em; }\\n @media (min-width: 1000px) {\\n .notion-widgets button,\\n .notion-widgets input[type=\\\"text\\\"],\\n .notion-widgets input[type=\\\"number\\\"],\\n .notion-widgets input[type=\\\"color\\\"],\\n .notion-widgets textarea,\\n .notion-widgets select {\\n font-size: 22px; } }\\n .notion-widgets button:focus,\\n .notion-widgets input[type=\\\"text\\\"]:focus,\\n .notion-widgets input[type=\\\"number\\\"]:focus,\\n .notion-widgets input[type=\\\"color\\\"]:focus,\\n .notion-widgets textarea:focus,\\n .notion-widgets select:focus {\\n outline: none;\\n border: 1px solid black; }\\n\\n.notion-widgets input[type=\\\"text\\\"] {\\n margin-top: 10px;\\n width: 100%; }\\n\\n.notion-widgets textarea {\\n width: 100%;\\n min-height: 150px; }\\n\\n.notion-widgets h1:not(:first-child) {\\n margin-top: 10vh; }\\n\\n.notion-widgets h2 {\\n margin-top: 0;\\n margin-bottom: 0.5em; }\\n\\n.notion-widgets span {\\n display: block; }\\n\\n.notion-widgets label {\\n width: 100%;\\n display: block; }\\n\\n.notion-widgets input[type=\\\"radio\\\"],\\n.notion-widgets input[type=\\\"checkbox\\\"] {\\n filter: saturate(0) brightness(0.9); }\\n\\n.notion-widgets #output {\\n padding: 10px;\\n border: 2px solid lightgray;\\n max-height: 85vh;\\n overflow-y: auto; }\\n .notion-widgets #output:empty {\\n display: none; }\\n\\n.notion-widgets .wrap {\\n margin-left: 30px;\\n margin-bottom: 20px; }\\n\\n.notion-widgets iframe {\\n width: 100%;\\n border: 1px solid #898989;\\n margin-bottom: 1em; }\\n\\n.notion-widgets section {\\n display: flex;\\n gap: 30px; }\\n .notion-widgets section > * {\\n flex: 0 0 50%; }\\n\\n.notion-widgets .output {\\n font-size: 0.85em; }\\n\\n@media (prefers-color-scheme: dark) {\\n .notion-widgets input[type=\\\"text\\\"],\\n .notion-widgets input[type=\\\"number\\\"],\\n .notion-widgets input[type=\\\"color\\\"],\\n .notion-widgets textarea,\\n .notion-widgets button,\\n .notion-widgets select {\\n color: #bebcc3;\\n background: #2a2a2c;\\n border-color: #2a2a2c; }\\n .notion-widgets input[type=\\\"text\\\"]:focus,\\n .notion-widgets input[type=\\\"number\\\"]:focus,\\n .notion-widgets input[type=\\\"color\\\"]:focus,\\n .notion-widgets textarea:focus,\\n .notion-widgets button:focus,\\n .notion-widgets select:focus {\\n border-color: #f4ecec; }\\n .notion-widgets input[type=\\\"checkbox\\\"] {\\n filter: invert(1) saturate(0); }\\n .notion-widgets button:hover, .notion-widgets button:focus {\\n filter: brightness(0.8); }\\n .notion-widgets iframe {\\n border: 2px solid white; } }\\n\\n.notion-widget {\\n position: relative;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n height: 100%;\\n overflow: hidden;\\n background-color: white !important; }\\n .notion-widget.dark-mode {\\n background-color: #191919 !important; }\\n .notion-widget .back-link {\\n position: absolute;\\n top: 0;\\n left: 0;\\n right: 0;\\n bottom: 0; }\\n .notion-widget > * {\\n width: 100%; }\\n .notion-widget > *.centered {\\n display: flex;\\n justify-content: center; }\\n .notion-widget > *.centered #text {\\n text-align: center; }\\n .notion-widget #text {\\n display: inline-block;\\n letter-spacing: 0; }\\n\\n@media (prefers-color-scheme: dark) {\\n .notion-widget {\\n background-color: white !important; }\\n .notion-widget.dark-mode {\\n background-color: #191919 !important; } }\\n\\n.pinterest-board button,\\n.pinterest-board input[type=\\\"text\\\"],\\n.pinterest-board input[type=\\\"number\\\"],\\n.pinterest-board input[type=\\\"color\\\"],\\n.pinterest-board textarea,\\n.pinterest-board select {\\n font-family: \\\"Mukta\\\", sans-serif;\\n font-size: 16px;\\n line-height: 1.75;\\n background: #eee4e4;\\n border: 1px solid #898989;\\n padding: 5px 15px;\\n margin-bottom: 0.5em; }\\n @media (min-width: 1000px) {\\n .pinterest-board button,\\n .pinterest-board input[type=\\\"text\\\"],\\n .pinterest-board input[type=\\\"number\\\"],\\n .pinterest-board input[type=\\\"color\\\"],\\n .pinterest-board textarea,\\n .pinterest-board select {\\n font-size: 22px; } }\\n .pinterest-board button:focus,\\n .pinterest-board input[type=\\\"text\\\"]:focus,\\n .pinterest-board input[type=\\\"number\\\"]:focus,\\n .pinterest-board input[type=\\\"color\\\"]:focus,\\n .pinterest-board textarea:focus,\\n .pinterest-board select:focus {\\n outline: none;\\n border: 1px solid black; }\\n\\n.pinterest-board input[type=\\\"text\\\"] {\\n margin-top: 10px;\\n width: 100%; }\\n\\n.pinterest-board textarea {\\n width: 100%;\\n min-height: 150px; }\\n\\n.pinterest-board h1:not(:first-child) {\\n margin-top: 10vh; }\\n\\n.pinterest-board h2 {\\n font-size: 2em;\\n margin-top: 0;\\n margin-bottom: 0; }\\n\\n.pinterest-board span {\\n display: block; }\\n\\n.pinterest-board label {\\n width: 100%;\\n display: block; }\\n\\n.pinterest-board input[type=\\\"radio\\\"],\\n.pinterest-board input[type=\\\"checkbox\\\"] {\\n filter: saturate(0) brightness(0.9); }\\n\\n.pinterest-board #output {\\n padding: 10px;\\n border: 2px solid lightgray;\\n max-height: 85vh;\\n overflow-y: auto; }\\n .pinterest-board #output:empty {\\n display: none; }\\n\\n.pinterest-board .wrap {\\n margin-left: 30px;\\n margin-bottom: 20px; }\\n\\n.pinterest-board iframe {\\n width: 100%;\\n border: 1px solid #898989;\\n margin-bottom: 1em;\\n height: 500px; }\\n\\n.pinterest-board .output,\\n.pinterest-board .outputNotion {\\n font-size: 0.85em;\\n min-height: 2em; }\\n @media (max-width: 900px) {\\n .pinterest-board .output,\\n .pinterest-board .outputNotion {\\n min-height: 6em; } }\\n\\n@media (prefers-color-scheme: dark) {\\n .pinterest-board input[type=\\\"text\\\"],\\n .pinterest-board input[type=\\\"number\\\"],\\n .pinterest-board input[type=\\\"color\\\"],\\n .pinterest-board textarea,\\n .pinterest-board button,\\n .pinterest-board select {\\n color: #bebcc3;\\n background: #2a2a2c;\\n border-color: #2a2a2c; }\\n .pinterest-board input[type=\\\"text\\\"]:focus,\\n .pinterest-board input[type=\\\"number\\\"]:focus,\\n .pinterest-board input[type=\\\"color\\\"]:focus,\\n .pinterest-board textarea:focus,\\n .pinterest-board button:focus,\\n .pinterest-board select:focus {\\n border-color: #f4ecec; }\\n .pinterest-board input[type=\\\"checkbox\\\"] {\\n filter: invert(1) saturate(0); }\\n .pinterest-board button:hover, .pinterest-board button:focus {\\n filter: brightness(0.8); }\\n .pinterest-board iframe {\\n border: 2px solid white; } }\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n\n\n//# sourceURL=webpack:///./css/main.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js"); +eval("// Imports\nvar ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.i, \"@font-face {\\n font-family: \\\"basiic\\\";\\n src: url(https://cinni.net/fonts/basiic.ttf); }\\n\\n* {\\n box-sizing: border-box;\\n color: #251d35; }\\n\\nbody {\\n font-family: \\\"basiic\\\", \\\"Mukta\\\", sans-serif;\\n letter-spacing: -0.03em;\\n font-size: 17px;\\n line-height: 1.8;\\n display: flex;\\n justify-content: center;\\n background: #f4ecec; }\\n @media (min-width: 1000px) {\\n body {\\n font-size: 22px;\\n line-height: 2; } }\\n\\na,\\na small, a:hover,\\na:hover small, a:focus,\\na:focus small, a:visited,\\na:visited small {\\n color: #1d5999; }\\n\\nmain {\\n width: 95%;\\n max-width: 850px; }\\n @media (min-width: 1000px) {\\n main {\\n width: 90%;\\n padding-top: 10vh;\\n padding-bottom: 10vh; } }\\n\\np {\\n margin: 0.5em 0;\\n text-align: justify; }\\n\\nul {\\n margin: 0.5em 0;\\n padding-left: 1.5em; }\\n\\nh1,\\nh2 {\\n margin-bottom: 0;\\n line-height: 1.5; }\\n\\nh2 {\\n margin-top: 1.5em;\\n font-size: 20px; }\\n @media (min-width: 1000px) {\\n h2 {\\n font-size: 28px; } }\\n\\n.cursor {\\n animation: blink 1s step-start 0s infinite; }\\n\\n@keyframes blink {\\n 50% {\\n opacity: 0; } }\\n\\n.back-link {\\n position: fixed;\\n top: 0;\\n left: 0;\\n z-index: 1;\\n padding: 0.5em;\\n line-height: 1; }\\n .back-link a {\\n display: block;\\n text-decoration: none;\\n color: #251d35;\\n padding: 0.5em; }\\n .back-link a:hover, .back-link a:focus {\\n text-decoration: underline;\\n color: #251d35; }\\n @media (max-width: 900px) {\\n .back-link {\\n display: none; } }\\n\\n@media (prefers-color-scheme: dark) {\\n body {\\n background: #0c0b0e; }\\n * {\\n color: #bebcc3; }\\n a,\\n a small, a:hover,\\n a:hover small, a:focus,\\n a:focus small, a:visited,\\n a:visited small {\\n color: #6c89b7; }\\n .back-link a {\\n color: #bebcc3; }\\n .back-link a:hover, .back-link a:focus {\\n color: #bebcc3; } }\\n\\n.tumblr-tag-list-tool button,\\n.tumblr-tag-list-tool input[type=\\\"text\\\"],\\n.tumblr-tag-list-tool textarea {\\n font-family: \\\"Mukta\\\", sans-serif;\\n font-size: 16px;\\n line-height: 1.75;\\n background: #eee4e4;\\n border: 1px solid #898989;\\n padding: 5px 15px; }\\n @media (min-width: 1000px) {\\n .tumblr-tag-list-tool button,\\n .tumblr-tag-list-tool input[type=\\\"text\\\"],\\n .tumblr-tag-list-tool textarea {\\n font-size: 22px; } }\\n .tumblr-tag-list-tool button:focus,\\n .tumblr-tag-list-tool input[type=\\\"text\\\"]:focus,\\n .tumblr-tag-list-tool textarea:focus {\\n outline: none;\\n border: 1px solid black; }\\n\\n.tumblr-tag-list-tool input[type=\\\"text\\\"] {\\n margin-top: 10px;\\n width: 100%; }\\n\\n.tumblr-tag-list-tool textarea {\\n width: 100%;\\n margin: 10px 0;\\n min-height: 250px; }\\n\\n.tumblr-tag-list-tool button {\\n margin: 20px 0;\\n cursor: pointer; }\\n .tumblr-tag-list-tool button:hover, .tumblr-tag-list-tool button:focus {\\n filter: brightness(0.95); }\\n\\n.tumblr-tag-list-tool span {\\n display: block;\\n margin-top: 30px; }\\n\\n.tumblr-tag-list-tool label {\\n width: 100%;\\n display: block;\\n margin-top: 10px; }\\n\\n.tumblr-tag-list-tool input[type=\\\"checkbox\\\"] {\\n filter: saturate(0) brightness(0.9); }\\n\\n.tumblr-tag-list-tool #output {\\n padding: 10px;\\n border: 2px solid lightgray;\\n max-height: 85vh;\\n overflow-y: auto; }\\n .tumblr-tag-list-tool #output:empty {\\n display: none; }\\n\\n.tumblr-tag-list-tool .wrap {\\n margin-left: 30px;\\n margin-bottom: 20px; }\\n\\n@media (prefers-color-scheme: dark) {\\n .tumblr-tag-list-tool input[type=\\\"text\\\"],\\n .tumblr-tag-list-tool textarea,\\n .tumblr-tag-list-tool button {\\n color: #bebcc3;\\n background: #2a2a2c;\\n border-color: #2a2a2c; }\\n .tumblr-tag-list-tool input[type=\\\"text\\\"]:focus,\\n .tumblr-tag-list-tool textarea:focus,\\n .tumblr-tag-list-tool button:focus {\\n border-color: #f4ecec; }\\n .tumblr-tag-list-tool input[type=\\\"checkbox\\\"] {\\n filter: invert(1) saturate(0); }\\n .tumblr-tag-list-tool button:hover, .tumblr-tag-list-tool button:focus {\\n filter: brightness(0.8); } }\\n\\n.notion-widgets button,\\n.notion-widgets input[type=\\\"text\\\"],\\n.notion-widgets input[type=\\\"number\\\"],\\n.notion-widgets input[type=\\\"color\\\"],\\n.notion-widgets textarea,\\n.notion-widgets select {\\n font-family: \\\"Mukta\\\", sans-serif;\\n font-size: 16px;\\n line-height: 1.75;\\n background: #eee4e4;\\n border: 1px solid #898989;\\n padding: 5px 15px;\\n margin-bottom: 0.5em; }\\n @media (min-width: 1000px) {\\n .notion-widgets button,\\n .notion-widgets input[type=\\\"text\\\"],\\n .notion-widgets input[type=\\\"number\\\"],\\n .notion-widgets input[type=\\\"color\\\"],\\n .notion-widgets textarea,\\n .notion-widgets select {\\n font-size: 22px; } }\\n .notion-widgets button:focus,\\n .notion-widgets input[type=\\\"text\\\"]:focus,\\n .notion-widgets input[type=\\\"number\\\"]:focus,\\n .notion-widgets input[type=\\\"color\\\"]:focus,\\n .notion-widgets textarea:focus,\\n .notion-widgets select:focus {\\n outline: none;\\n border: 1px solid black; }\\n\\n.notion-widgets input[type=\\\"text\\\"] {\\n margin-top: 10px;\\n width: 100%; }\\n\\n.notion-widgets textarea {\\n width: 100%;\\n min-height: 150px; }\\n\\n.notion-widgets h1:not(:first-child) {\\n margin-top: 10vh; }\\n\\n.notion-widgets h2 {\\n margin-top: 0;\\n margin-bottom: 0.5em; }\\n\\n.notion-widgets span {\\n display: block; }\\n\\n.notion-widgets label {\\n width: 100%;\\n display: block; }\\n\\n.notion-widgets input[type=\\\"radio\\\"],\\n.notion-widgets input[type=\\\"checkbox\\\"] {\\n filter: saturate(0) brightness(0.9); }\\n\\n.notion-widgets #output {\\n padding: 10px;\\n border: 2px solid lightgray;\\n max-height: 85vh;\\n overflow-y: auto; }\\n .notion-widgets #output:empty {\\n display: none; }\\n\\n.notion-widgets .wrap {\\n margin-left: 30px;\\n margin-bottom: 20px; }\\n\\n.notion-widgets iframe {\\n width: 100%;\\n border: 1px solid #898989;\\n margin-bottom: 1em; }\\n\\n.notion-widgets section {\\n display: flex;\\n gap: 30px; }\\n .notion-widgets section > * {\\n flex: 0 0 50%; }\\n\\n.notion-widgets .output {\\n font-size: 0.85em; }\\n\\n@media (prefers-color-scheme: dark) {\\n .notion-widgets input[type=\\\"text\\\"],\\n .notion-widgets input[type=\\\"number\\\"],\\n .notion-widgets input[type=\\\"color\\\"],\\n .notion-widgets textarea,\\n .notion-widgets button,\\n .notion-widgets select {\\n color: #bebcc3;\\n background: #2a2a2c;\\n border-color: #2a2a2c; }\\n .notion-widgets input[type=\\\"text\\\"]:focus,\\n .notion-widgets input[type=\\\"number\\\"]:focus,\\n .notion-widgets input[type=\\\"color\\\"]:focus,\\n .notion-widgets textarea:focus,\\n .notion-widgets button:focus,\\n .notion-widgets select:focus {\\n border-color: #f4ecec; }\\n .notion-widgets input[type=\\\"checkbox\\\"] {\\n filter: invert(1) saturate(0); }\\n .notion-widgets button:hover, .notion-widgets button:focus {\\n filter: brightness(0.8); }\\n .notion-widgets iframe {\\n border: 2px solid white; } }\\n\\n.notion-widget {\\n position: relative;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n height: 100%;\\n overflow: hidden;\\n background-color: white !important; }\\n .notion-widget.dark-mode {\\n background-color: #191919 !important; }\\n .notion-widget > * {\\n width: 100%; }\\n .notion-widget > *.centered {\\n display: flex;\\n justify-content: center; }\\n .notion-widget > *.centered #text {\\n text-align: center; }\\n .notion-widget #text {\\n display: inline-block;\\n letter-spacing: 0; }\\n\\n@media (prefers-color-scheme: dark) {\\n .notion-widget {\\n background-color: white !important; }\\n .notion-widget.dark-mode {\\n background-color: #191919 !important; } }\\n\\n.pinterest-board button,\\n.pinterest-board input[type=\\\"text\\\"],\\n.pinterest-board input[type=\\\"number\\\"],\\n.pinterest-board input[type=\\\"color\\\"],\\n.pinterest-board textarea,\\n.pinterest-board select {\\n font-family: \\\"Mukta\\\", sans-serif;\\n font-size: 16px;\\n line-height: 1.75;\\n background: #eee4e4;\\n border: 1px solid #898989;\\n padding: 5px 15px;\\n margin-bottom: 0.5em; }\\n @media (min-width: 1000px) {\\n .pinterest-board button,\\n .pinterest-board input[type=\\\"text\\\"],\\n .pinterest-board input[type=\\\"number\\\"],\\n .pinterest-board input[type=\\\"color\\\"],\\n .pinterest-board textarea,\\n .pinterest-board select {\\n font-size: 22px; } }\\n .pinterest-board button:focus,\\n .pinterest-board input[type=\\\"text\\\"]:focus,\\n .pinterest-board input[type=\\\"number\\\"]:focus,\\n .pinterest-board input[type=\\\"color\\\"]:focus,\\n .pinterest-board textarea:focus,\\n .pinterest-board select:focus {\\n outline: none;\\n border: 1px solid black; }\\n\\n.pinterest-board input[type=\\\"text\\\"] {\\n margin-top: 10px;\\n width: 100%; }\\n\\n.pinterest-board textarea {\\n width: 100%;\\n min-height: 150px; }\\n\\n.pinterest-board h1:not(:first-child) {\\n margin-top: 10vh; }\\n\\n.pinterest-board h2 {\\n font-size: 2em;\\n margin-top: 0;\\n margin-bottom: 0; }\\n\\n.pinterest-board span {\\n display: block; }\\n\\n.pinterest-board label {\\n width: 100%;\\n display: block; }\\n\\n.pinterest-board input[type=\\\"radio\\\"],\\n.pinterest-board input[type=\\\"checkbox\\\"] {\\n filter: saturate(0) brightness(0.9); }\\n\\n.pinterest-board #output {\\n padding: 10px;\\n border: 2px solid lightgray;\\n max-height: 85vh;\\n overflow-y: auto; }\\n .pinterest-board #output:empty {\\n display: none; }\\n\\n.pinterest-board .wrap {\\n margin-left: 30px;\\n margin-bottom: 20px; }\\n\\n.pinterest-board iframe {\\n width: 100%;\\n border: 1px solid #898989;\\n margin-bottom: 1em;\\n height: 500px; }\\n\\n.pinterest-board .output,\\n.pinterest-board .outputNotion {\\n font-size: 0.85em;\\n min-height: 2em; }\\n @media (max-width: 900px) {\\n .pinterest-board .output,\\n .pinterest-board .outputNotion {\\n min-height: 6em; } }\\n\\n@media (prefers-color-scheme: dark) {\\n .pinterest-board input[type=\\\"text\\\"],\\n .pinterest-board input[type=\\\"number\\\"],\\n .pinterest-board input[type=\\\"color\\\"],\\n .pinterest-board textarea,\\n .pinterest-board button,\\n .pinterest-board select {\\n color: #bebcc3;\\n background: #2a2a2c;\\n border-color: #2a2a2c; }\\n .pinterest-board input[type=\\\"text\\\"]:focus,\\n .pinterest-board input[type=\\\"number\\\"]:focus,\\n .pinterest-board input[type=\\\"color\\\"]:focus,\\n .pinterest-board textarea:focus,\\n .pinterest-board button:focus,\\n .pinterest-board select:focus {\\n border-color: #f4ecec; }\\n .pinterest-board input[type=\\\"checkbox\\\"] {\\n filter: invert(1) saturate(0); }\\n .pinterest-board button:hover, .pinterest-board button:focus {\\n filter: brightness(0.8); }\\n .pinterest-board iframe {\\n border: 2px solid white; } }\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n\n\n//# sourceURL=webpack:///./css/main.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js"); /***/ }), diff --git a/notion/index.html b/notion/index.html index 9e0b2d2..b170620 100644 --- a/notion/index.html +++ b/notion/index.html @@ -16,7 +16,7 @@

Notion Widgets

-

Free Notion Widgets created by Petra.

+

Free Notion Widgets created by Petra.

Text Widget

@@ -72,5 +72,6 @@

Code

More coming soon!

+ diff --git a/pinterest/index.html b/pinterest/index.html index b823b29..ca61ca8 100644 --- a/pinterest/index.html +++ b/pinterest/index.html @@ -16,7 +16,7 @@

Pinterest Board iFrame

-

Easily generate a Pinterest board widget!

+

Easily generate a Pinterest board widget! Created by Petra.


@@ -38,5 +38,6 @@

Preview

(If you can't see anything here the link to your pinterest board is incorrect!)
+ diff --git a/tumblr-tag-list-tool.html b/tumblr-tag-list-tool.html index 319453d..cf7c721 100644 --- a/tumblr-tag-list-tool.html +++ b/tumblr-tag-list-tool.html @@ -44,5 +44,6 @@

Generate a tag list:

+ From b190cbd4a0b01f6e4271a31e93c2e9f298de4d97 Mon Sep 17 00:00:00 2001 From: petracoding Date: Sun, 25 Feb 2024 12:46:02 +0100 Subject: [PATCH 07/26] Small improvements --- index.html | 2 +- js/subpages/notion-widgets.js | 2 ++ main.js | 2 +- notion/index.html | 7 ++++++- pinterest/index.html | 6 +++--- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 9537114..27c7b14 100644 --- a/index.html +++ b/index.html @@ -49,7 +49,7 @@

My Userscripts:

-->

Elsewhere:

-
    +
    • GitHub
    • GreasyFork (userscripts) diff --git a/js/subpages/notion-widgets.js b/js/subpages/notion-widgets.js index 49b8295..85839e6 100644 --- a/js/subpages/notion-widgets.js +++ b/js/subpages/notion-widgets.js @@ -29,12 +29,14 @@ document.addEventListener("DOMContentLoaded", function () { url += "&color=" + color; if (container.querySelector("#text-bg").checked) { container.querySelector(".only-show-if-bg-color").style.visibility = "visible"; + container.querySelector(".only-show-if-bg-color").style.height = "auto"; const background = container.querySelector("#text-background").value.replace("#", ""); url += "&background=" + background; const corners = container.querySelector("#text-corners").value; url += "&corners=" + corners; } else { container.querySelector(".only-show-if-bg-color").style.visibility = "hidden"; + container.querySelector(".only-show-if-bg-color").style.height = "1px"; } const font = container.querySelector("#text-font").value; url += "&font=" + font; diff --git a/main.js b/main.js index 4b1d4eb..31751b0 100644 --- a/main.js +++ b/main.js @@ -116,7 +116,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _css /*! no static exports found */ /***/ (function(module, exports) { -eval("const isLocal = window.location.hostname == \"localhost\";\r\nconst urlBase = isLocal ? \"http://localhost:52330/notion/\" : \"https://petracoding.github.io/notion/\";\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function () {\r\n if (document.querySelector(\".notion-widgets\")) {\r\n doText();\r\n const textOptionElements = document.querySelector(\"#text\").querySelectorAll(\"input, select\");\r\n [...textOptionElements].forEach((e) => e.addEventListener(\"input\", doText));\r\n }\r\n\r\n function doText() {\r\n const container = document.querySelector(\"#text\");\r\n let url = urlBase + \"text.html\";\r\n const mode = container.querySelector('[name=\"text-mode\"]:checked').value;\r\n url += \"?mode=\" + mode;\r\n const centered = container.querySelector(\"#text-centered\").checked;\r\n url += \"¢ered=\" + (centered ? \"1\" : \"0\");\r\n const size = container.querySelector(\"#text-size\").value;\r\n url += \"&size=\" + size;\r\n const fullWidth = container.querySelector(\"#text-fullWidth\").checked;\r\n url += \"&fullWidth=\" + (fullWidth ? \"1\" : \"0\");\r\n const bold = container.querySelector(\"#text-bold\").checked;\r\n url += \"&bold=\" + (bold ? \"1\" : \"0\");\r\n const italic = container.querySelector(\"#text-italic\").checked;\r\n url += \"&italic=\" + (italic ? \"1\" : \"0\");\r\n const underline = container.querySelector(\"#text-underline\").checked;\r\n url += \"&underline=\" + (underline ? \"1\" : \"0\");\r\n const color = container.querySelector(\"#text-color\").value.replace(\"#\", \"\");\r\n url += \"&color=\" + color;\r\n if (container.querySelector(\"#text-bg\").checked) {\r\n container.querySelector(\".only-show-if-bg-color\").style.visibility = \"visible\";\r\n const background = container.querySelector(\"#text-background\").value.replace(\"#\", \"\");\r\n url += \"&background=\" + background;\r\n const corners = container.querySelector(\"#text-corners\").value;\r\n url += \"&corners=\" + corners;\r\n } else {\r\n container.querySelector(\".only-show-if-bg-color\").style.visibility = \"hidden\";\r\n }\r\n const font = container.querySelector(\"#text-font\").value;\r\n url += \"&font=\" + font;\r\n const text = container.querySelector(\"#text-text\").value;\r\n url += \"&text=\" + encodeURIComponent(text).replaceAll(\"%20\", \"§\");\r\n container.querySelector(\".output\").value = url;\r\n container.querySelector(\"iframe\").setAttribute(\"src\", url);\r\n }\r\n\r\n // WIDGETS THEMSELVES:\r\n\r\n // TEXT\r\n if (document.querySelector(\"#notion-widget-text\")) {\r\n const background = findGetParameter(\"background\");\r\n const centered = findGetParameter(\"centered\");\r\n const color = findGetParameter(\"color\");\r\n const corners = findGetParameter(\"corners\");\r\n const font = findGetParameter(\"font\");\r\n const fullWidth = findGetParameter(\"fullWidth\");\r\n const mode = findGetParameter(\"mode\");\r\n const size = findGetParameter(\"size\");\r\n const text = findGetParameter(\"text\");\r\n const bold = findGetParameter(\"bold\");\r\n const italic = findGetParameter(\"italic\");\r\n const underline = findGetParameter(\"underline\");\r\n\r\n if (mode == \"dark\") document.body.classList.add(\"dark-mode\");\r\n\r\n const textEl = this.querySelector(\"#text\");\r\n\r\n if (centered == \"1\") {\r\n textEl.closest(\"div:not(#text)\").classList.add(\"centered\");\r\n }\r\n if (size) textEl.style.fontSize = size + \"px\";\r\n if (font) textEl.style.fontFamily = font;\r\n if (color) textEl.style.color = \"#\" + color;\r\n if (corners) textEl.style.borderRadius = corners + \"px\";\r\n if (fullWidth == \"1\") textEl.style.width = \"100%\";\r\n if (bold == \"1\") textEl.style.fontWeight = \"bold\";\r\n if (italic == \"1\") textEl.style.fontStyle = \"italic\";\r\n if (underline == \"1\") textEl.style.textDecoration = \"underline\";\r\n if (background) {\r\n textEl.style.backgroundColor = \"#\" + background;\r\n textEl.style.padding = \"0 0.5em\";\r\n }\r\n\r\n textEl.innerHTML = decodeURIComponent(text.replaceAll(\"§\", \"%20\"));\r\n }\r\n});\r\n\r\nfunction findGetParameter(parameterName) {\r\n var result = null,\r\n tmp = [];\r\n location.search\r\n .substr(1)\r\n .split(\"&\")\r\n .forEach(function (item) {\r\n tmp = item.split(\"=\");\r\n if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);\r\n });\r\n return result;\r\n}\r\n\n\n//# sourceURL=webpack:///./js/subpages/notion-widgets.js?"); +eval("const isLocal = window.location.hostname == \"localhost\";\r\nconst urlBase = isLocal ? \"http://localhost:52330/notion/\" : \"https://petracoding.github.io/notion/\";\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function () {\r\n if (document.querySelector(\".notion-widgets\")) {\r\n doText();\r\n const textOptionElements = document.querySelector(\"#text\").querySelectorAll(\"input, select\");\r\n [...textOptionElements].forEach((e) => e.addEventListener(\"input\", doText));\r\n }\r\n\r\n function doText() {\r\n const container = document.querySelector(\"#text\");\r\n let url = urlBase + \"text.html\";\r\n const mode = container.querySelector('[name=\"text-mode\"]:checked').value;\r\n url += \"?mode=\" + mode;\r\n const centered = container.querySelector(\"#text-centered\").checked;\r\n url += \"¢ered=\" + (centered ? \"1\" : \"0\");\r\n const size = container.querySelector(\"#text-size\").value;\r\n url += \"&size=\" + size;\r\n const fullWidth = container.querySelector(\"#text-fullWidth\").checked;\r\n url += \"&fullWidth=\" + (fullWidth ? \"1\" : \"0\");\r\n const bold = container.querySelector(\"#text-bold\").checked;\r\n url += \"&bold=\" + (bold ? \"1\" : \"0\");\r\n const italic = container.querySelector(\"#text-italic\").checked;\r\n url += \"&italic=\" + (italic ? \"1\" : \"0\");\r\n const underline = container.querySelector(\"#text-underline\").checked;\r\n url += \"&underline=\" + (underline ? \"1\" : \"0\");\r\n const color = container.querySelector(\"#text-color\").value.replace(\"#\", \"\");\r\n url += \"&color=\" + color;\r\n if (container.querySelector(\"#text-bg\").checked) {\r\n container.querySelector(\".only-show-if-bg-color\").style.visibility = \"visible\";\r\n container.querySelector(\".only-show-if-bg-color\").style.height = \"auto\";\r\n const background = container.querySelector(\"#text-background\").value.replace(\"#\", \"\");\r\n url += \"&background=\" + background;\r\n const corners = container.querySelector(\"#text-corners\").value;\r\n url += \"&corners=\" + corners;\r\n } else {\r\n container.querySelector(\".only-show-if-bg-color\").style.visibility = \"hidden\";\r\n container.querySelector(\".only-show-if-bg-color\").style.height = \"1px\";\r\n }\r\n const font = container.querySelector(\"#text-font\").value;\r\n url += \"&font=\" + font;\r\n const text = container.querySelector(\"#text-text\").value;\r\n url += \"&text=\" + encodeURIComponent(text).replaceAll(\"%20\", \"§\");\r\n container.querySelector(\".output\").value = url;\r\n container.querySelector(\"iframe\").setAttribute(\"src\", url);\r\n }\r\n\r\n // WIDGETS THEMSELVES:\r\n\r\n // TEXT\r\n if (document.querySelector(\"#notion-widget-text\")) {\r\n const background = findGetParameter(\"background\");\r\n const centered = findGetParameter(\"centered\");\r\n const color = findGetParameter(\"color\");\r\n const corners = findGetParameter(\"corners\");\r\n const font = findGetParameter(\"font\");\r\n const fullWidth = findGetParameter(\"fullWidth\");\r\n const mode = findGetParameter(\"mode\");\r\n const size = findGetParameter(\"size\");\r\n const text = findGetParameter(\"text\");\r\n const bold = findGetParameter(\"bold\");\r\n const italic = findGetParameter(\"italic\");\r\n const underline = findGetParameter(\"underline\");\r\n\r\n if (mode == \"dark\") document.body.classList.add(\"dark-mode\");\r\n\r\n const textEl = this.querySelector(\"#text\");\r\n\r\n if (centered == \"1\") {\r\n textEl.closest(\"div:not(#text)\").classList.add(\"centered\");\r\n }\r\n if (size) textEl.style.fontSize = size + \"px\";\r\n if (font) textEl.style.fontFamily = font;\r\n if (color) textEl.style.color = \"#\" + color;\r\n if (corners) textEl.style.borderRadius = corners + \"px\";\r\n if (fullWidth == \"1\") textEl.style.width = \"100%\";\r\n if (bold == \"1\") textEl.style.fontWeight = \"bold\";\r\n if (italic == \"1\") textEl.style.fontStyle = \"italic\";\r\n if (underline == \"1\") textEl.style.textDecoration = \"underline\";\r\n if (background) {\r\n textEl.style.backgroundColor = \"#\" + background;\r\n textEl.style.padding = \"0 0.5em\";\r\n }\r\n\r\n textEl.innerHTML = decodeURIComponent(text.replaceAll(\"§\", \"%20\"));\r\n }\r\n});\r\n\r\nfunction findGetParameter(parameterName) {\r\n var result = null,\r\n tmp = [];\r\n location.search\r\n .substr(1)\r\n .split(\"&\")\r\n .forEach(function (item) {\r\n tmp = item.split(\"=\");\r\n if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);\r\n });\r\n return result;\r\n}\r\n\n\n//# sourceURL=webpack:///./js/subpages/notion-widgets.js?"); /***/ }), diff --git a/notion/index.html b/notion/index.html index b170620..d021bb0 100644 --- a/notion/index.html +++ b/notion/index.html @@ -70,7 +70,12 @@

      Code

      -

      More coming soon!

      +

      Pinterest Widget

      +
      +
      Generate a Pinterest board widget here.
      +
      + + diff --git a/pinterest/index.html b/pinterest/index.html index ca61ca8..e6ecde9 100644 --- a/pinterest/index.html +++ b/pinterest/index.html @@ -21,7 +21,7 @@

      Pinterest Board iFrame


      Paste the link to your pinterest board: - +
      @@ -31,11 +31,11 @@

      Result

      or... Notion Embed Link: - (Paste this code in Notion and select "Create embed") + (Paste this link in Notion and select "Create embed")

      Preview

      - (If you can't see anything here the link to your pinterest board is incorrect!) + (If you can't see anything here then the link to your pinterest board is incorrect!) From 526c2ceef868d95cb7de3e0d6a6e28d10a12e620 Mon Sep 17 00:00:00 2001 From: petracoding Date: Sun, 25 Feb 2024 14:44:36 +0100 Subject: [PATCH 08/26] Pinterest Bugfix --- js/subpages/pinterest-board.js | 11 ++++++++++- main.js | 2 +- pinterest/index.html | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/js/subpages/pinterest-board.js b/js/subpages/pinterest-board.js index f543bb7..514aa7b 100644 --- a/js/subpages/pinterest-board.js +++ b/js/subpages/pinterest-board.js @@ -17,7 +17,7 @@ function buildURL() { document.querySelector(".outputNotion").value = ""; document.querySelector("iframe").setAttribute("src", ""); } else { - url += "?link=" + link.replace("https://www.pinterest.at/", ""); + url += "?link=" + cleanPinterestUrl(link); const hideHeader = document.querySelector("#hide-header").checked; url += "&hideHeader=" + (hideHeader ? "1" : "0"); document.querySelector("iframe").setAttribute("src", url); @@ -27,3 +27,12 @@ function buildURL() { document.querySelector(".outputNotion").value = url; } } + +function cleanPinterestUrl(link) { + const i = getPosition(link, "/", 3); + return link.substr(i).substr(1); +} + +function getPosition(string, subString, index) { + return string.split(subString, index).join(subString).length; +} diff --git a/main.js b/main.js index 31751b0..311d731 100644 --- a/main.js +++ b/main.js @@ -127,7 +127,7 @@ eval("const isLocal = window.location.hostname == \"localhost\";\r\nconst urlBas /*! no static exports found */ /***/ (function(module, exports) { -eval("const isLocal = window.location.hostname == \"localhost\";\r\nconst urlBase = isLocal ? \"http://localhost:52330/pinterest/board.html\" : \"https://petracoding.github.io/pinterest/board.html\";\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function () {\r\n if (document.querySelector(\".pinterest-board\")) {\r\n buildURL();\r\n document.querySelector(\"#your-link\").addEventListener(\"input\", buildURL);\r\n document.querySelector(\"#hide-header\").addEventListener(\"input\", buildURL);\r\n }\r\n});\r\n\r\nfunction buildURL() {\r\n let url = urlBase;\r\n const link = document.querySelector(\"#your-link\").value;\r\n if (!link) {\r\n document.querySelector(\".output\").value = \"\";\r\n document.querySelector(\".outputNotion\").value = \"\";\r\n document.querySelector(\"iframe\").setAttribute(\"src\", \"\");\r\n } else {\r\n url += \"?link=\" + link.replace(\"https://www.pinterest.at/\", \"\");\r\n const hideHeader = document.querySelector(\"#hide-header\").checked;\r\n url += \"&hideHeader=\" + (hideHeader ? \"1\" : \"0\");\r\n document.querySelector(\"iframe\").setAttribute(\"src\", url);\r\n\r\n const output = ``;\r\n document.querySelector(\".output\").value = output;\r\n document.querySelector(\".outputNotion\").value = url;\r\n }\r\n}\r\n\n\n//# sourceURL=webpack:///./js/subpages/pinterest-board.js?"); +eval("const isLocal = window.location.hostname == \"localhost\";\r\nconst urlBase = isLocal ? \"http://localhost:52330/pinterest/board.html\" : \"https://petracoding.github.io/pinterest/board.html\";\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function () {\r\n if (document.querySelector(\".pinterest-board\")) {\r\n buildURL();\r\n document.querySelector(\"#your-link\").addEventListener(\"input\", buildURL);\r\n document.querySelector(\"#hide-header\").addEventListener(\"input\", buildURL);\r\n }\r\n});\r\n\r\nfunction buildURL() {\r\n let url = urlBase;\r\n const link = document.querySelector(\"#your-link\").value;\r\n if (!link) {\r\n document.querySelector(\".output\").value = \"\";\r\n document.querySelector(\".outputNotion\").value = \"\";\r\n document.querySelector(\"iframe\").setAttribute(\"src\", \"\");\r\n } else {\r\n url += \"?link=\" + cleanPinterestUrl(link);\r\n const hideHeader = document.querySelector(\"#hide-header\").checked;\r\n url += \"&hideHeader=\" + (hideHeader ? \"1\" : \"0\");\r\n document.querySelector(\"iframe\").setAttribute(\"src\", url);\r\n\r\n const output = ``;\r\n document.querySelector(\".output\").value = output;\r\n document.querySelector(\".outputNotion\").value = url;\r\n }\r\n}\r\n\r\nfunction cleanPinterestUrl(link) {\r\n const i = getPosition(link, \"/\", 3);\r\n return link.substr(i).substr(1);\r\n}\r\n\r\nfunction getPosition(string, subString, index) {\r\n return string.split(subString, index).join(subString).length;\r\n}\r\n\n\n//# sourceURL=webpack:///./js/subpages/pinterest-board.js?"); /***/ }), diff --git a/pinterest/index.html b/pinterest/index.html index e6ecde9..2a1aa99 100644 --- a/pinterest/index.html +++ b/pinterest/index.html @@ -2,7 +2,7 @@ Pinterest Board iFrame - + From 1a2e6b35184d13351046bd507908d464151fa16d Mon Sep 17 00:00:00 2001 From: petracoding Date: Thu, 29 Feb 2024 10:39:49 +0100 Subject: [PATCH 09/26] Improvements to Pinterest Board Widget --- css/subpages/pinterest-board.scss | 1 + js/subpages/pinterest-board.js | 3 +++ main.js | 4 ++-- manual-list-sorter.html | 34 +++++++++++++++++++++++++++++++ pinterest/board.html | 16 ++++++++++----- pinterest/index.html | 14 ++++++++++--- 6 files changed, 62 insertions(+), 10 deletions(-) create mode 100644 manual-list-sorter.html diff --git a/css/subpages/pinterest-board.scss b/css/subpages/pinterest-board.scss index 12114ae..e67ab42 100644 --- a/css/subpages/pinterest-board.scss +++ b/css/subpages/pinterest-board.scss @@ -31,6 +31,7 @@ textarea { width: 100%; min-height: 150px; + margin-bottom: 0; } h1:not(:first-child) { diff --git a/js/subpages/pinterest-board.js b/js/subpages/pinterest-board.js index 514aa7b..1461e7c 100644 --- a/js/subpages/pinterest-board.js +++ b/js/subpages/pinterest-board.js @@ -6,6 +6,7 @@ document.addEventListener("DOMContentLoaded", function () { buildURL(); document.querySelector("#your-link").addEventListener("input", buildURL); document.querySelector("#hide-header").addEventListener("input", buildURL); + document.querySelector("#transparent-bg").addEventListener("input", buildURL); } }); @@ -20,6 +21,8 @@ function buildURL() { url += "?link=" + cleanPinterestUrl(link); const hideHeader = document.querySelector("#hide-header").checked; url += "&hideHeader=" + (hideHeader ? "1" : "0"); + const transparent = document.querySelector("#transparent-bg").checked; + url += "&transparent=" + (transparent ? "1" : "0"); document.querySelector("iframe").setAttribute("src", url); const output = ``; diff --git a/main.js b/main.js index 311d731..10c7036 100644 --- a/main.js +++ b/main.js @@ -127,7 +127,7 @@ eval("const isLocal = window.location.hostname == \"localhost\";\r\nconst urlBas /*! no static exports found */ /***/ (function(module, exports) { -eval("const isLocal = window.location.hostname == \"localhost\";\r\nconst urlBase = isLocal ? \"http://localhost:52330/pinterest/board.html\" : \"https://petracoding.github.io/pinterest/board.html\";\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function () {\r\n if (document.querySelector(\".pinterest-board\")) {\r\n buildURL();\r\n document.querySelector(\"#your-link\").addEventListener(\"input\", buildURL);\r\n document.querySelector(\"#hide-header\").addEventListener(\"input\", buildURL);\r\n }\r\n});\r\n\r\nfunction buildURL() {\r\n let url = urlBase;\r\n const link = document.querySelector(\"#your-link\").value;\r\n if (!link) {\r\n document.querySelector(\".output\").value = \"\";\r\n document.querySelector(\".outputNotion\").value = \"\";\r\n document.querySelector(\"iframe\").setAttribute(\"src\", \"\");\r\n } else {\r\n url += \"?link=\" + cleanPinterestUrl(link);\r\n const hideHeader = document.querySelector(\"#hide-header\").checked;\r\n url += \"&hideHeader=\" + (hideHeader ? \"1\" : \"0\");\r\n document.querySelector(\"iframe\").setAttribute(\"src\", url);\r\n\r\n const output = ``;\r\n document.querySelector(\".output\").value = output;\r\n document.querySelector(\".outputNotion\").value = url;\r\n }\r\n}\r\n\r\nfunction cleanPinterestUrl(link) {\r\n const i = getPosition(link, \"/\", 3);\r\n return link.substr(i).substr(1);\r\n}\r\n\r\nfunction getPosition(string, subString, index) {\r\n return string.split(subString, index).join(subString).length;\r\n}\r\n\n\n//# sourceURL=webpack:///./js/subpages/pinterest-board.js?"); +eval("const isLocal = window.location.hostname == \"localhost\";\r\nconst urlBase = isLocal ? \"http://localhost:52330/pinterest/board.html\" : \"https://petracoding.github.io/pinterest/board.html\";\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function () {\r\n if (document.querySelector(\".pinterest-board\")) {\r\n buildURL();\r\n document.querySelector(\"#your-link\").addEventListener(\"input\", buildURL);\r\n document.querySelector(\"#hide-header\").addEventListener(\"input\", buildURL);\r\n document.querySelector(\"#transparent-bg\").addEventListener(\"input\", buildURL);\r\n }\r\n});\r\n\r\nfunction buildURL() {\r\n let url = urlBase;\r\n const link = document.querySelector(\"#your-link\").value;\r\n if (!link) {\r\n document.querySelector(\".output\").value = \"\";\r\n document.querySelector(\".outputNotion\").value = \"\";\r\n document.querySelector(\"iframe\").setAttribute(\"src\", \"\");\r\n } else {\r\n url += \"?link=\" + cleanPinterestUrl(link);\r\n const hideHeader = document.querySelector(\"#hide-header\").checked;\r\n url += \"&hideHeader=\" + (hideHeader ? \"1\" : \"0\");\r\n const transparent = document.querySelector(\"#transparent-bg\").checked;\r\n url += \"&transparent=\" + (transparent ? \"1\" : \"0\");\r\n document.querySelector(\"iframe\").setAttribute(\"src\", url);\r\n\r\n const output = ``;\r\n document.querySelector(\".output\").value = output;\r\n document.querySelector(\".outputNotion\").value = url;\r\n }\r\n}\r\n\r\nfunction cleanPinterestUrl(link) {\r\n const i = getPosition(link, \"/\", 3);\r\n return link.substr(i).substr(1);\r\n}\r\n\r\nfunction getPosition(string, subString, index) {\r\n return string.split(subString, index).join(subString).length;\r\n}\r\n\n\n//# sourceURL=webpack:///./js/subpages/pinterest-board.js?"); /***/ }), @@ -149,7 +149,7 @@ eval("document.addEventListener(\"DOMContentLoaded\", function (event) {\r\n if /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("// Imports\nvar ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.i, \"@font-face {\\n font-family: \\\"basiic\\\";\\n src: url(https://cinni.net/fonts/basiic.ttf); }\\n\\n* {\\n box-sizing: border-box;\\n color: #251d35; }\\n\\nbody {\\n font-family: \\\"basiic\\\", \\\"Mukta\\\", sans-serif;\\n letter-spacing: -0.03em;\\n font-size: 17px;\\n line-height: 1.8;\\n display: flex;\\n justify-content: center;\\n background: #f4ecec; }\\n @media (min-width: 1000px) {\\n body {\\n font-size: 22px;\\n line-height: 2; } }\\n\\na,\\na small, a:hover,\\na:hover small, a:focus,\\na:focus small, a:visited,\\na:visited small {\\n color: #1d5999; }\\n\\nmain {\\n width: 95%;\\n max-width: 850px; }\\n @media (min-width: 1000px) {\\n main {\\n width: 90%;\\n padding-top: 10vh;\\n padding-bottom: 10vh; } }\\n\\np {\\n margin: 0.5em 0;\\n text-align: justify; }\\n\\nul {\\n margin: 0.5em 0;\\n padding-left: 1.5em; }\\n\\nh1,\\nh2 {\\n margin-bottom: 0;\\n line-height: 1.5; }\\n\\nh2 {\\n margin-top: 1.5em;\\n font-size: 20px; }\\n @media (min-width: 1000px) {\\n h2 {\\n font-size: 28px; } }\\n\\n.cursor {\\n animation: blink 1s step-start 0s infinite; }\\n\\n@keyframes blink {\\n 50% {\\n opacity: 0; } }\\n\\n.back-link {\\n position: fixed;\\n top: 0;\\n left: 0;\\n z-index: 1;\\n padding: 0.5em;\\n line-height: 1; }\\n .back-link a {\\n display: block;\\n text-decoration: none;\\n color: #251d35;\\n padding: 0.5em; }\\n .back-link a:hover, .back-link a:focus {\\n text-decoration: underline;\\n color: #251d35; }\\n @media (max-width: 900px) {\\n .back-link {\\n display: none; } }\\n\\n@media (prefers-color-scheme: dark) {\\n body {\\n background: #0c0b0e; }\\n * {\\n color: #bebcc3; }\\n a,\\n a small, a:hover,\\n a:hover small, a:focus,\\n a:focus small, a:visited,\\n a:visited small {\\n color: #6c89b7; }\\n .back-link a {\\n color: #bebcc3; }\\n .back-link a:hover, .back-link a:focus {\\n color: #bebcc3; } }\\n\\n.tumblr-tag-list-tool button,\\n.tumblr-tag-list-tool input[type=\\\"text\\\"],\\n.tumblr-tag-list-tool textarea {\\n font-family: \\\"Mukta\\\", sans-serif;\\n font-size: 16px;\\n line-height: 1.75;\\n background: #eee4e4;\\n border: 1px solid #898989;\\n padding: 5px 15px; }\\n @media (min-width: 1000px) {\\n .tumblr-tag-list-tool button,\\n .tumblr-tag-list-tool input[type=\\\"text\\\"],\\n .tumblr-tag-list-tool textarea {\\n font-size: 22px; } }\\n .tumblr-tag-list-tool button:focus,\\n .tumblr-tag-list-tool input[type=\\\"text\\\"]:focus,\\n .tumblr-tag-list-tool textarea:focus {\\n outline: none;\\n border: 1px solid black; }\\n\\n.tumblr-tag-list-tool input[type=\\\"text\\\"] {\\n margin-top: 10px;\\n width: 100%; }\\n\\n.tumblr-tag-list-tool textarea {\\n width: 100%;\\n margin: 10px 0;\\n min-height: 250px; }\\n\\n.tumblr-tag-list-tool button {\\n margin: 20px 0;\\n cursor: pointer; }\\n .tumblr-tag-list-tool button:hover, .tumblr-tag-list-tool button:focus {\\n filter: brightness(0.95); }\\n\\n.tumblr-tag-list-tool span {\\n display: block;\\n margin-top: 30px; }\\n\\n.tumblr-tag-list-tool label {\\n width: 100%;\\n display: block;\\n margin-top: 10px; }\\n\\n.tumblr-tag-list-tool input[type=\\\"checkbox\\\"] {\\n filter: saturate(0) brightness(0.9); }\\n\\n.tumblr-tag-list-tool #output {\\n padding: 10px;\\n border: 2px solid lightgray;\\n max-height: 85vh;\\n overflow-y: auto; }\\n .tumblr-tag-list-tool #output:empty {\\n display: none; }\\n\\n.tumblr-tag-list-tool .wrap {\\n margin-left: 30px;\\n margin-bottom: 20px; }\\n\\n@media (prefers-color-scheme: dark) {\\n .tumblr-tag-list-tool input[type=\\\"text\\\"],\\n .tumblr-tag-list-tool textarea,\\n .tumblr-tag-list-tool button {\\n color: #bebcc3;\\n background: #2a2a2c;\\n border-color: #2a2a2c; }\\n .tumblr-tag-list-tool input[type=\\\"text\\\"]:focus,\\n .tumblr-tag-list-tool textarea:focus,\\n .tumblr-tag-list-tool button:focus {\\n border-color: #f4ecec; }\\n .tumblr-tag-list-tool input[type=\\\"checkbox\\\"] {\\n filter: invert(1) saturate(0); }\\n .tumblr-tag-list-tool button:hover, .tumblr-tag-list-tool button:focus {\\n filter: brightness(0.8); } }\\n\\n.notion-widgets button,\\n.notion-widgets input[type=\\\"text\\\"],\\n.notion-widgets input[type=\\\"number\\\"],\\n.notion-widgets input[type=\\\"color\\\"],\\n.notion-widgets textarea,\\n.notion-widgets select {\\n font-family: \\\"Mukta\\\", sans-serif;\\n font-size: 16px;\\n line-height: 1.75;\\n background: #eee4e4;\\n border: 1px solid #898989;\\n padding: 5px 15px;\\n margin-bottom: 0.5em; }\\n @media (min-width: 1000px) {\\n .notion-widgets button,\\n .notion-widgets input[type=\\\"text\\\"],\\n .notion-widgets input[type=\\\"number\\\"],\\n .notion-widgets input[type=\\\"color\\\"],\\n .notion-widgets textarea,\\n .notion-widgets select {\\n font-size: 22px; } }\\n .notion-widgets button:focus,\\n .notion-widgets input[type=\\\"text\\\"]:focus,\\n .notion-widgets input[type=\\\"number\\\"]:focus,\\n .notion-widgets input[type=\\\"color\\\"]:focus,\\n .notion-widgets textarea:focus,\\n .notion-widgets select:focus {\\n outline: none;\\n border: 1px solid black; }\\n\\n.notion-widgets input[type=\\\"text\\\"] {\\n margin-top: 10px;\\n width: 100%; }\\n\\n.notion-widgets textarea {\\n width: 100%;\\n min-height: 150px; }\\n\\n.notion-widgets h1:not(:first-child) {\\n margin-top: 10vh; }\\n\\n.notion-widgets h2 {\\n margin-top: 0;\\n margin-bottom: 0.5em; }\\n\\n.notion-widgets span {\\n display: block; }\\n\\n.notion-widgets label {\\n width: 100%;\\n display: block; }\\n\\n.notion-widgets input[type=\\\"radio\\\"],\\n.notion-widgets input[type=\\\"checkbox\\\"] {\\n filter: saturate(0) brightness(0.9); }\\n\\n.notion-widgets #output {\\n padding: 10px;\\n border: 2px solid lightgray;\\n max-height: 85vh;\\n overflow-y: auto; }\\n .notion-widgets #output:empty {\\n display: none; }\\n\\n.notion-widgets .wrap {\\n margin-left: 30px;\\n margin-bottom: 20px; }\\n\\n.notion-widgets iframe {\\n width: 100%;\\n border: 1px solid #898989;\\n margin-bottom: 1em; }\\n\\n.notion-widgets section {\\n display: flex;\\n gap: 30px; }\\n .notion-widgets section > * {\\n flex: 0 0 50%; }\\n\\n.notion-widgets .output {\\n font-size: 0.85em; }\\n\\n@media (prefers-color-scheme: dark) {\\n .notion-widgets input[type=\\\"text\\\"],\\n .notion-widgets input[type=\\\"number\\\"],\\n .notion-widgets input[type=\\\"color\\\"],\\n .notion-widgets textarea,\\n .notion-widgets button,\\n .notion-widgets select {\\n color: #bebcc3;\\n background: #2a2a2c;\\n border-color: #2a2a2c; }\\n .notion-widgets input[type=\\\"text\\\"]:focus,\\n .notion-widgets input[type=\\\"number\\\"]:focus,\\n .notion-widgets input[type=\\\"color\\\"]:focus,\\n .notion-widgets textarea:focus,\\n .notion-widgets button:focus,\\n .notion-widgets select:focus {\\n border-color: #f4ecec; }\\n .notion-widgets input[type=\\\"checkbox\\\"] {\\n filter: invert(1) saturate(0); }\\n .notion-widgets button:hover, .notion-widgets button:focus {\\n filter: brightness(0.8); }\\n .notion-widgets iframe {\\n border: 2px solid white; } }\\n\\n.notion-widget {\\n position: relative;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n height: 100%;\\n overflow: hidden;\\n background-color: white !important; }\\n .notion-widget.dark-mode {\\n background-color: #191919 !important; }\\n .notion-widget > * {\\n width: 100%; }\\n .notion-widget > *.centered {\\n display: flex;\\n justify-content: center; }\\n .notion-widget > *.centered #text {\\n text-align: center; }\\n .notion-widget #text {\\n display: inline-block;\\n letter-spacing: 0; }\\n\\n@media (prefers-color-scheme: dark) {\\n .notion-widget {\\n background-color: white !important; }\\n .notion-widget.dark-mode {\\n background-color: #191919 !important; } }\\n\\n.pinterest-board button,\\n.pinterest-board input[type=\\\"text\\\"],\\n.pinterest-board input[type=\\\"number\\\"],\\n.pinterest-board input[type=\\\"color\\\"],\\n.pinterest-board textarea,\\n.pinterest-board select {\\n font-family: \\\"Mukta\\\", sans-serif;\\n font-size: 16px;\\n line-height: 1.75;\\n background: #eee4e4;\\n border: 1px solid #898989;\\n padding: 5px 15px;\\n margin-bottom: 0.5em; }\\n @media (min-width: 1000px) {\\n .pinterest-board button,\\n .pinterest-board input[type=\\\"text\\\"],\\n .pinterest-board input[type=\\\"number\\\"],\\n .pinterest-board input[type=\\\"color\\\"],\\n .pinterest-board textarea,\\n .pinterest-board select {\\n font-size: 22px; } }\\n .pinterest-board button:focus,\\n .pinterest-board input[type=\\\"text\\\"]:focus,\\n .pinterest-board input[type=\\\"number\\\"]:focus,\\n .pinterest-board input[type=\\\"color\\\"]:focus,\\n .pinterest-board textarea:focus,\\n .pinterest-board select:focus {\\n outline: none;\\n border: 1px solid black; }\\n\\n.pinterest-board input[type=\\\"text\\\"] {\\n margin-top: 10px;\\n width: 100%; }\\n\\n.pinterest-board textarea {\\n width: 100%;\\n min-height: 150px; }\\n\\n.pinterest-board h1:not(:first-child) {\\n margin-top: 10vh; }\\n\\n.pinterest-board h2 {\\n font-size: 2em;\\n margin-top: 0;\\n margin-bottom: 0; }\\n\\n.pinterest-board span {\\n display: block; }\\n\\n.pinterest-board label {\\n width: 100%;\\n display: block; }\\n\\n.pinterest-board input[type=\\\"radio\\\"],\\n.pinterest-board input[type=\\\"checkbox\\\"] {\\n filter: saturate(0) brightness(0.9); }\\n\\n.pinterest-board #output {\\n padding: 10px;\\n border: 2px solid lightgray;\\n max-height: 85vh;\\n overflow-y: auto; }\\n .pinterest-board #output:empty {\\n display: none; }\\n\\n.pinterest-board .wrap {\\n margin-left: 30px;\\n margin-bottom: 20px; }\\n\\n.pinterest-board iframe {\\n width: 100%;\\n border: 1px solid #898989;\\n margin-bottom: 1em;\\n height: 500px; }\\n\\n.pinterest-board .output,\\n.pinterest-board .outputNotion {\\n font-size: 0.85em;\\n min-height: 2em; }\\n @media (max-width: 900px) {\\n .pinterest-board .output,\\n .pinterest-board .outputNotion {\\n min-height: 6em; } }\\n\\n@media (prefers-color-scheme: dark) {\\n .pinterest-board input[type=\\\"text\\\"],\\n .pinterest-board input[type=\\\"number\\\"],\\n .pinterest-board input[type=\\\"color\\\"],\\n .pinterest-board textarea,\\n .pinterest-board button,\\n .pinterest-board select {\\n color: #bebcc3;\\n background: #2a2a2c;\\n border-color: #2a2a2c; }\\n .pinterest-board input[type=\\\"text\\\"]:focus,\\n .pinterest-board input[type=\\\"number\\\"]:focus,\\n .pinterest-board input[type=\\\"color\\\"]:focus,\\n .pinterest-board textarea:focus,\\n .pinterest-board button:focus,\\n .pinterest-board select:focus {\\n border-color: #f4ecec; }\\n .pinterest-board input[type=\\\"checkbox\\\"] {\\n filter: invert(1) saturate(0); }\\n .pinterest-board button:hover, .pinterest-board button:focus {\\n filter: brightness(0.8); }\\n .pinterest-board iframe {\\n border: 2px solid white; } }\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n\n\n//# sourceURL=webpack:///./css/main.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js"); +eval("// Imports\nvar ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.i, \"@font-face {\\n font-family: \\\"basiic\\\";\\n src: url(https://cinni.net/fonts/basiic.ttf); }\\n\\n* {\\n box-sizing: border-box;\\n color: #251d35; }\\n\\nbody {\\n font-family: \\\"basiic\\\", \\\"Mukta\\\", sans-serif;\\n letter-spacing: -0.03em;\\n font-size: 17px;\\n line-height: 1.8;\\n display: flex;\\n justify-content: center;\\n background: #f4ecec; }\\n @media (min-width: 1000px) {\\n body {\\n font-size: 22px;\\n line-height: 2; } }\\n\\na,\\na small, a:hover,\\na:hover small, a:focus,\\na:focus small, a:visited,\\na:visited small {\\n color: #1d5999; }\\n\\nmain {\\n width: 95%;\\n max-width: 850px; }\\n @media (min-width: 1000px) {\\n main {\\n width: 90%;\\n padding-top: 10vh;\\n padding-bottom: 10vh; } }\\n\\np {\\n margin: 0.5em 0;\\n text-align: justify; }\\n\\nul {\\n margin: 0.5em 0;\\n padding-left: 1.5em; }\\n\\nh1,\\nh2 {\\n margin-bottom: 0;\\n line-height: 1.5; }\\n\\nh2 {\\n margin-top: 1.5em;\\n font-size: 20px; }\\n @media (min-width: 1000px) {\\n h2 {\\n font-size: 28px; } }\\n\\n.cursor {\\n animation: blink 1s step-start 0s infinite; }\\n\\n@keyframes blink {\\n 50% {\\n opacity: 0; } }\\n\\n.back-link {\\n position: fixed;\\n top: 0;\\n left: 0;\\n z-index: 1;\\n padding: 0.5em;\\n line-height: 1; }\\n .back-link a {\\n display: block;\\n text-decoration: none;\\n color: #251d35;\\n padding: 0.5em; }\\n .back-link a:hover, .back-link a:focus {\\n text-decoration: underline;\\n color: #251d35; }\\n @media (max-width: 900px) {\\n .back-link {\\n display: none; } }\\n\\n@media (prefers-color-scheme: dark) {\\n body {\\n background: #0c0b0e; }\\n * {\\n color: #bebcc3; }\\n a,\\n a small, a:hover,\\n a:hover small, a:focus,\\n a:focus small, a:visited,\\n a:visited small {\\n color: #6c89b7; }\\n .back-link a {\\n color: #bebcc3; }\\n .back-link a:hover, .back-link a:focus {\\n color: #bebcc3; } }\\n\\n.tumblr-tag-list-tool button,\\n.tumblr-tag-list-tool input[type=\\\"text\\\"],\\n.tumblr-tag-list-tool textarea {\\n font-family: \\\"Mukta\\\", sans-serif;\\n font-size: 16px;\\n line-height: 1.75;\\n background: #eee4e4;\\n border: 1px solid #898989;\\n padding: 5px 15px; }\\n @media (min-width: 1000px) {\\n .tumblr-tag-list-tool button,\\n .tumblr-tag-list-tool input[type=\\\"text\\\"],\\n .tumblr-tag-list-tool textarea {\\n font-size: 22px; } }\\n .tumblr-tag-list-tool button:focus,\\n .tumblr-tag-list-tool input[type=\\\"text\\\"]:focus,\\n .tumblr-tag-list-tool textarea:focus {\\n outline: none;\\n border: 1px solid black; }\\n\\n.tumblr-tag-list-tool input[type=\\\"text\\\"] {\\n margin-top: 10px;\\n width: 100%; }\\n\\n.tumblr-tag-list-tool textarea {\\n width: 100%;\\n margin: 10px 0;\\n min-height: 250px; }\\n\\n.tumblr-tag-list-tool button {\\n margin: 20px 0;\\n cursor: pointer; }\\n .tumblr-tag-list-tool button:hover, .tumblr-tag-list-tool button:focus {\\n filter: brightness(0.95); }\\n\\n.tumblr-tag-list-tool span {\\n display: block;\\n margin-top: 30px; }\\n\\n.tumblr-tag-list-tool label {\\n width: 100%;\\n display: block;\\n margin-top: 10px; }\\n\\n.tumblr-tag-list-tool input[type=\\\"checkbox\\\"] {\\n filter: saturate(0) brightness(0.9); }\\n\\n.tumblr-tag-list-tool #output {\\n padding: 10px;\\n border: 2px solid lightgray;\\n max-height: 85vh;\\n overflow-y: auto; }\\n .tumblr-tag-list-tool #output:empty {\\n display: none; }\\n\\n.tumblr-tag-list-tool .wrap {\\n margin-left: 30px;\\n margin-bottom: 20px; }\\n\\n@media (prefers-color-scheme: dark) {\\n .tumblr-tag-list-tool input[type=\\\"text\\\"],\\n .tumblr-tag-list-tool textarea,\\n .tumblr-tag-list-tool button {\\n color: #bebcc3;\\n background: #2a2a2c;\\n border-color: #2a2a2c; }\\n .tumblr-tag-list-tool input[type=\\\"text\\\"]:focus,\\n .tumblr-tag-list-tool textarea:focus,\\n .tumblr-tag-list-tool button:focus {\\n border-color: #f4ecec; }\\n .tumblr-tag-list-tool input[type=\\\"checkbox\\\"] {\\n filter: invert(1) saturate(0); }\\n .tumblr-tag-list-tool button:hover, .tumblr-tag-list-tool button:focus {\\n filter: brightness(0.8); } }\\n\\n.notion-widgets button,\\n.notion-widgets input[type=\\\"text\\\"],\\n.notion-widgets input[type=\\\"number\\\"],\\n.notion-widgets input[type=\\\"color\\\"],\\n.notion-widgets textarea,\\n.notion-widgets select {\\n font-family: \\\"Mukta\\\", sans-serif;\\n font-size: 16px;\\n line-height: 1.75;\\n background: #eee4e4;\\n border: 1px solid #898989;\\n padding: 5px 15px;\\n margin-bottom: 0.5em; }\\n @media (min-width: 1000px) {\\n .notion-widgets button,\\n .notion-widgets input[type=\\\"text\\\"],\\n .notion-widgets input[type=\\\"number\\\"],\\n .notion-widgets input[type=\\\"color\\\"],\\n .notion-widgets textarea,\\n .notion-widgets select {\\n font-size: 22px; } }\\n .notion-widgets button:focus,\\n .notion-widgets input[type=\\\"text\\\"]:focus,\\n .notion-widgets input[type=\\\"number\\\"]:focus,\\n .notion-widgets input[type=\\\"color\\\"]:focus,\\n .notion-widgets textarea:focus,\\n .notion-widgets select:focus {\\n outline: none;\\n border: 1px solid black; }\\n\\n.notion-widgets input[type=\\\"text\\\"] {\\n margin-top: 10px;\\n width: 100%; }\\n\\n.notion-widgets textarea {\\n width: 100%;\\n min-height: 150px; }\\n\\n.notion-widgets h1:not(:first-child) {\\n margin-top: 10vh; }\\n\\n.notion-widgets h2 {\\n margin-top: 0;\\n margin-bottom: 0.5em; }\\n\\n.notion-widgets span {\\n display: block; }\\n\\n.notion-widgets label {\\n width: 100%;\\n display: block; }\\n\\n.notion-widgets input[type=\\\"radio\\\"],\\n.notion-widgets input[type=\\\"checkbox\\\"] {\\n filter: saturate(0) brightness(0.9); }\\n\\n.notion-widgets #output {\\n padding: 10px;\\n border: 2px solid lightgray;\\n max-height: 85vh;\\n overflow-y: auto; }\\n .notion-widgets #output:empty {\\n display: none; }\\n\\n.notion-widgets .wrap {\\n margin-left: 30px;\\n margin-bottom: 20px; }\\n\\n.notion-widgets iframe {\\n width: 100%;\\n border: 1px solid #898989;\\n margin-bottom: 1em; }\\n\\n.notion-widgets section {\\n display: flex;\\n gap: 30px; }\\n .notion-widgets section > * {\\n flex: 0 0 50%; }\\n\\n.notion-widgets .output {\\n font-size: 0.85em; }\\n\\n@media (prefers-color-scheme: dark) {\\n .notion-widgets input[type=\\\"text\\\"],\\n .notion-widgets input[type=\\\"number\\\"],\\n .notion-widgets input[type=\\\"color\\\"],\\n .notion-widgets textarea,\\n .notion-widgets button,\\n .notion-widgets select {\\n color: #bebcc3;\\n background: #2a2a2c;\\n border-color: #2a2a2c; }\\n .notion-widgets input[type=\\\"text\\\"]:focus,\\n .notion-widgets input[type=\\\"number\\\"]:focus,\\n .notion-widgets input[type=\\\"color\\\"]:focus,\\n .notion-widgets textarea:focus,\\n .notion-widgets button:focus,\\n .notion-widgets select:focus {\\n border-color: #f4ecec; }\\n .notion-widgets input[type=\\\"checkbox\\\"] {\\n filter: invert(1) saturate(0); }\\n .notion-widgets button:hover, .notion-widgets button:focus {\\n filter: brightness(0.8); }\\n .notion-widgets iframe {\\n border: 2px solid white; } }\\n\\n.notion-widget {\\n position: relative;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n height: 100%;\\n overflow: hidden;\\n background-color: white !important; }\\n .notion-widget.dark-mode {\\n background-color: #191919 !important; }\\n .notion-widget > * {\\n width: 100%; }\\n .notion-widget > *.centered {\\n display: flex;\\n justify-content: center; }\\n .notion-widget > *.centered #text {\\n text-align: center; }\\n .notion-widget #text {\\n display: inline-block;\\n letter-spacing: 0; }\\n\\n@media (prefers-color-scheme: dark) {\\n .notion-widget {\\n background-color: white !important; }\\n .notion-widget.dark-mode {\\n background-color: #191919 !important; } }\\n\\n.pinterest-board button,\\n.pinterest-board input[type=\\\"text\\\"],\\n.pinterest-board input[type=\\\"number\\\"],\\n.pinterest-board input[type=\\\"color\\\"],\\n.pinterest-board textarea,\\n.pinterest-board select {\\n font-family: \\\"Mukta\\\", sans-serif;\\n font-size: 16px;\\n line-height: 1.75;\\n background: #eee4e4;\\n border: 1px solid #898989;\\n padding: 5px 15px;\\n margin-bottom: 0.5em; }\\n @media (min-width: 1000px) {\\n .pinterest-board button,\\n .pinterest-board input[type=\\\"text\\\"],\\n .pinterest-board input[type=\\\"number\\\"],\\n .pinterest-board input[type=\\\"color\\\"],\\n .pinterest-board textarea,\\n .pinterest-board select {\\n font-size: 22px; } }\\n .pinterest-board button:focus,\\n .pinterest-board input[type=\\\"text\\\"]:focus,\\n .pinterest-board input[type=\\\"number\\\"]:focus,\\n .pinterest-board input[type=\\\"color\\\"]:focus,\\n .pinterest-board textarea:focus,\\n .pinterest-board select:focus {\\n outline: none;\\n border: 1px solid black; }\\n\\n.pinterest-board input[type=\\\"text\\\"] {\\n margin-top: 10px;\\n width: 100%; }\\n\\n.pinterest-board textarea {\\n width: 100%;\\n min-height: 150px;\\n margin-bottom: 0; }\\n\\n.pinterest-board h1:not(:first-child) {\\n margin-top: 10vh; }\\n\\n.pinterest-board h2 {\\n font-size: 2em;\\n margin-top: 0;\\n margin-bottom: 0; }\\n\\n.pinterest-board span {\\n display: block; }\\n\\n.pinterest-board label {\\n width: 100%;\\n display: block; }\\n\\n.pinterest-board input[type=\\\"radio\\\"],\\n.pinterest-board input[type=\\\"checkbox\\\"] {\\n filter: saturate(0) brightness(0.9); }\\n\\n.pinterest-board #output {\\n padding: 10px;\\n border: 2px solid lightgray;\\n max-height: 85vh;\\n overflow-y: auto; }\\n .pinterest-board #output:empty {\\n display: none; }\\n\\n.pinterest-board .wrap {\\n margin-left: 30px;\\n margin-bottom: 20px; }\\n\\n.pinterest-board iframe {\\n width: 100%;\\n border: 1px solid #898989;\\n margin-bottom: 1em;\\n height: 500px; }\\n\\n.pinterest-board .output,\\n.pinterest-board .outputNotion {\\n font-size: 0.85em;\\n min-height: 2em; }\\n @media (max-width: 900px) {\\n .pinterest-board .output,\\n .pinterest-board .outputNotion {\\n min-height: 6em; } }\\n\\n@media (prefers-color-scheme: dark) {\\n .pinterest-board input[type=\\\"text\\\"],\\n .pinterest-board input[type=\\\"number\\\"],\\n .pinterest-board input[type=\\\"color\\\"],\\n .pinterest-board textarea,\\n .pinterest-board button,\\n .pinterest-board select {\\n color: #bebcc3;\\n background: #2a2a2c;\\n border-color: #2a2a2c; }\\n .pinterest-board input[type=\\\"text\\\"]:focus,\\n .pinterest-board input[type=\\\"number\\\"]:focus,\\n .pinterest-board input[type=\\\"color\\\"]:focus,\\n .pinterest-board textarea:focus,\\n .pinterest-board button:focus,\\n .pinterest-board select:focus {\\n border-color: #f4ecec; }\\n .pinterest-board input[type=\\\"checkbox\\\"] {\\n filter: invert(1) saturate(0); }\\n .pinterest-board button:hover, .pinterest-board button:focus {\\n filter: brightness(0.8); }\\n .pinterest-board iframe {\\n border: 2px solid white; } }\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n\n\n//# sourceURL=webpack:///./css/main.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js"); /***/ }), diff --git a/manual-list-sorter.html b/manual-list-sorter.html new file mode 100644 index 0000000..c910a79 --- /dev/null +++ b/manual-list-sorter.html @@ -0,0 +1,34 @@ + + + + Manual List Sorter Tool + + + + + + + + + + + + +
      +

      Manual List Sorter Tool

      +

      This is a little tool to easily create tag lists you can share anywhere. Created by Petra.

      + + Enter your list(s) (separated by new line or comma): + + + + + After clicking "Generate" just copy everything below and paste it into a pinned post or anywhere else. + + + +
      +
      + + + diff --git a/pinterest/board.html b/pinterest/board.html index 54a8fab..c6b5e9b 100644 --- a/pinterest/board.html +++ b/pinterest/board.html @@ -9,10 +9,6 @@
      @@ -61,13 +66,13 @@

      Elsewhere:

      GreasyFork (userscripts)
    • - Neocities (petrapixel.neocities.org) + Mail (petracoding@outlook.com)
    • Tumblr Themes (on hiatus)
    • - Mail (petracoding@outlook.com) + Neocities (petrapixel.neocities.org)
    diff --git a/js/pages/tumblr-tag-list-tool.js b/js/pages/tumblr-tag-list-tool.js index 6637041..28152ab 100644 --- a/js/pages/tumblr-tag-list-tool.js +++ b/js/pages/tumblr-tag-list-tool.js @@ -22,57 +22,73 @@ document.addEventListener("DOMContentLoaded", function (event) { } } - document.querySelector("#go").addEventListener("click", () => { - const outputEl = document.querySelector("#output"); - const input = document.querySelector("textarea").value; - const addHashtags = document.querySelector("#addHashtags").checked; - const useSearch = document.querySelector("#useSearch").checked; - const eachTagInNewLine = eachTagInNewLineCheckbox.checked; - const groupTags = groupTagsCheckbox.checked; - const useHeadings = groupTags && document.querySelector("#headings").checked; - const url = document.querySelector("#url").value; - const separator = document.querySelector("#separator").value || ""; - let o = ""; - let isHeading = false; - let isFirstGroup = true; + generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox); - const groups = groupTags ? input.split(/\n\n/) : [input]; - - groups.forEach((group) => { - const tags = group.split(/[\n,#]+/); - isHeading = useHeadings; - if (groupTags && !isFirstGroup) { - o += "
    "; - } - let i = 0; - tags.forEach((tag) => { - i++; - let isLastTag = i == tags.length; - tag = tag.trim(); - if (tag !== "," && tag !== "") { - if (isHeading) { - o += tag + "
    "; - isHeading = false; - } else { - const tagSafeForString = tag; - o += - "" + - (addHashtags ? "#" : "") + - tag + - "" + - (eachTagInNewLine ? "
    " : isLastTag ? "" : separator); - } - } - }); - isFirstGroup = false; + const allInputs = document.querySelectorAll("main input, main textarea"); + [...allInputs].forEach((inputEl) => { + inputEl.addEventListener("change", () => { + generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox); + }); + inputEl.addEventListener("input", () => { + generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox); }); - - outputEl.innerHTML = o; }); + + // document.querySelector("#go").addEventListener("click", () => { + // generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox); + // }); } }); + +function generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox) { + const outputEl = document.querySelector("#output"); + const input = document.querySelector("textarea").value; + const addHashtags = document.querySelector("#addHashtags").checked; + const useSearch = document.querySelector("#useSearch").checked; + const eachTagInNewLine = eachTagInNewLineCheckbox.checked; + const groupTags = groupTagsCheckbox.checked; + const useHeadings = groupTags && document.querySelector("#headings").checked; + const url = document.querySelector("#url").value; + const separator = document.querySelector("#separator").value || ""; + let o = ""; + let isHeading = false; + let isFirstGroup = true; + + const groups = groupTags ? input.split(/\n\n/) : [input]; + + groups.forEach((group) => { + const tags = group.split(/[\n,#]+/); + isHeading = useHeadings; + if (groupTags && !isFirstGroup) { + o += "
    "; + } + let i = 0; + tags.forEach((tag) => { + i++; + let isLastTag = i == tags.length; + tag = tag.trim(); + if (tag !== "," && tag !== "") { + if (isHeading) { + o += tag + "
    "; + isHeading = false; + } else { + const tagSafeForString = tag; + o += + "" + + (addHashtags ? "#" : "") + + tag + + "" + + (eachTagInNewLine ? "
    " : isLastTag ? "" : separator); + } + } + }); + isFirstGroup = false; + }); + + outputEl.innerHTML = o; +} diff --git a/main.js b/main.js index 38f099b..cd953c9 100644 --- a/main.js +++ b/main.js @@ -56,7 +56,7 @@ eval("const isLocal = window.location.hostname == \"localhost\";\r\nconst urlBas \******************************************/ /***/ (() => { -eval("document.addEventListener(\"DOMContentLoaded\", function (event) {\r\n if (document.querySelector(\".tumblr-tag-list-tool\")) {\r\n const eachTagInNewLineCheckbox = document.querySelector(\"#eachTagInNewLine\");\r\n const separatorWrapEl = document.querySelector(\".separator-wrap\");\r\n const groupTagsCheckbox = document.querySelector(\"#groupTags\");\r\n const groupTagsWrapEl = document.querySelector(\".group-tags-wrap\");\r\n\r\n prepare();\r\n eachTagInNewLineCheckbox.addEventListener(\"change\", prepare);\r\n groupTagsCheckbox.addEventListener(\"change\", prepare);\r\n\r\n function prepare() {\r\n if (eachTagInNewLineCheckbox.checked) {\r\n separatorWrapEl.style.display = \"none\";\r\n } else {\r\n separatorWrapEl.style.display = \"block\";\r\n }\r\n if (groupTagsCheckbox.checked) {\r\n groupTagsWrapEl.style.display = \"block\";\r\n } else {\r\n groupTagsWrapEl.style.display = \"none\";\r\n }\r\n }\r\n\r\n document.querySelector(\"#go\").addEventListener(\"click\", () => {\r\n const outputEl = document.querySelector(\"#output\");\r\n const input = document.querySelector(\"textarea\").value;\r\n const addHashtags = document.querySelector(\"#addHashtags\").checked;\r\n const useSearch = document.querySelector(\"#useSearch\").checked;\r\n const eachTagInNewLine = eachTagInNewLineCheckbox.checked;\r\n const groupTags = groupTagsCheckbox.checked;\r\n const useHeadings = groupTags && document.querySelector(\"#headings\").checked;\r\n const url = document.querySelector(\"#url\").value;\r\n const separator = document.querySelector(\"#separator\").value || \"\";\r\n let o = \"\";\r\n let isHeading = false;\r\n let isFirstGroup = true;\r\n\r\n const groups = groupTags ? input.split(/\\n\\n/) : [input];\r\n\r\n groups.forEach((group) => {\r\n const tags = group.split(/[\\n,#]+/);\r\n isHeading = useHeadings;\r\n if (groupTags && !isFirstGroup) {\r\n o += \"
    \";\r\n }\r\n let i = 0;\r\n tags.forEach((tag) => {\r\n i++;\r\n let isLastTag = i == tags.length;\r\n tag = tag.trim();\r\n if (tag !== \",\" && tag !== \"\") {\r\n if (isHeading) {\r\n o += tag + \"
    \";\r\n isHeading = false;\r\n } else {\r\n const tagSafeForString = tag;\r\n o +=\r\n \"\" +\r\n (addHashtags ? \"#\" : \"\") +\r\n tag +\r\n \"\" +\r\n (eachTagInNewLine ? \"
    \" : isLastTag ? \"\" : separator);\r\n }\r\n }\r\n });\r\n isFirstGroup = false;\r\n });\r\n\r\n outputEl.innerHTML = o;\r\n });\r\n }\r\n});\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/tumblr-tag-list-tool.js?"); +eval("document.addEventListener(\"DOMContentLoaded\", function (event) {\r\n if (document.querySelector(\".tumblr-tag-list-tool\")) {\r\n const eachTagInNewLineCheckbox = document.querySelector(\"#eachTagInNewLine\");\r\n const separatorWrapEl = document.querySelector(\".separator-wrap\");\r\n const groupTagsCheckbox = document.querySelector(\"#groupTags\");\r\n const groupTagsWrapEl = document.querySelector(\".group-tags-wrap\");\r\n\r\n prepare();\r\n eachTagInNewLineCheckbox.addEventListener(\"change\", prepare);\r\n groupTagsCheckbox.addEventListener(\"change\", prepare);\r\n\r\n function prepare() {\r\n if (eachTagInNewLineCheckbox.checked) {\r\n separatorWrapEl.style.display = \"none\";\r\n } else {\r\n separatorWrapEl.style.display = \"block\";\r\n }\r\n if (groupTagsCheckbox.checked) {\r\n groupTagsWrapEl.style.display = \"block\";\r\n } else {\r\n groupTagsWrapEl.style.display = \"none\";\r\n }\r\n }\r\n\r\n generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox);\r\n\r\n const allInputs = document.querySelectorAll(\"main input, main textarea\");\r\n [...allInputs].forEach((inputEl) => {\r\n inputEl.addEventListener(\"change\", () => {\r\n generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox);\r\n });\r\n inputEl.addEventListener(\"input\", () => {\r\n generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox);\r\n });\r\n });\r\n\r\n // document.querySelector(\"#go\").addEventListener(\"click\", () => {\r\n // generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox);\r\n // });\r\n }\r\n});\r\n\r\nfunction generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox) {\r\n const outputEl = document.querySelector(\"#output\");\r\n const input = document.querySelector(\"textarea\").value;\r\n const addHashtags = document.querySelector(\"#addHashtags\").checked;\r\n const useSearch = document.querySelector(\"#useSearch\").checked;\r\n const eachTagInNewLine = eachTagInNewLineCheckbox.checked;\r\n const groupTags = groupTagsCheckbox.checked;\r\n const useHeadings = groupTags && document.querySelector(\"#headings\").checked;\r\n const url = document.querySelector(\"#url\").value;\r\n const separator = document.querySelector(\"#separator\").value || \"\";\r\n let o = \"\";\r\n let isHeading = false;\r\n let isFirstGroup = true;\r\n\r\n const groups = groupTags ? input.split(/\\n\\n/) : [input];\r\n\r\n groups.forEach((group) => {\r\n const tags = group.split(/[\\n,#]+/);\r\n isHeading = useHeadings;\r\n if (groupTags && !isFirstGroup) {\r\n o += \"
    \";\r\n }\r\n let i = 0;\r\n tags.forEach((tag) => {\r\n i++;\r\n let isLastTag = i == tags.length;\r\n tag = tag.trim();\r\n if (tag !== \",\" && tag !== \"\") {\r\n if (isHeading) {\r\n o += tag + \"
    \";\r\n isHeading = false;\r\n } else {\r\n const tagSafeForString = tag;\r\n o +=\r\n \"\" +\r\n (addHashtags ? \"#\" : \"\") +\r\n tag +\r\n \"\" +\r\n (eachTagInNewLine ? \"
    \" : isLastTag ? \"\" : separator);\r\n }\r\n }\r\n });\r\n isFirstGroup = false;\r\n });\r\n\r\n outputEl.innerHTML = o;\r\n}\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/tumblr-tag-list-tool.js?"); /***/ }), @@ -77,7 +77,7 @@ eval("document.addEventListener(\"DOMContentLoaded\", function () {\r\n if (!do /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.tumblr-tag-list-tool span {\n display: block;\n margin-top: 30px;\n}\n.tumblr-tag-list-tool label {\n width: 100%;\n display: block;\n margin-top: 10px;\n}\n.tumblr-tag-list-tool #output {\n padding: 10px;\n border: 2px solid lightgray;\n max-height: 85vh;\n overflow-y: auto;\n}\n.tumblr-tag-list-tool #output:empty {\n display: none;\n}\n.tumblr-tag-list-tool .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n\n.notion-widgets button,\n.notion-widgets input[type=text],\n.notion-widgets input[type=number],\n.notion-widgets input[type=color],\n.notion-widgets textarea,\n.notion-widgets select {\n font-family: \"Mukta\", sans-serif;\n font-size: 16px;\n line-height: 1.75;\n background: #eee4e4;\n border: 1px solid rgb(137, 137, 137);\n padding: 5px 15px;\n margin-bottom: 0.5em;\n}\n@media (min-width: 1000px) {\n .notion-widgets button,\n .notion-widgets input[type=text],\n .notion-widgets input[type=number],\n .notion-widgets input[type=color],\n .notion-widgets textarea,\n .notion-widgets select {\n font-size: 22px;\n }\n}\n.notion-widgets button:focus,\n.notion-widgets input[type=text]:focus,\n.notion-widgets input[type=number]:focus,\n.notion-widgets input[type=color]:focus,\n.notion-widgets textarea:focus,\n.notion-widgets select:focus {\n outline: none;\n border: 1px solid black;\n}\n.notion-widgets input[type=text] {\n margin-top: 10px;\n width: 100%;\n}\n.notion-widgets textarea {\n width: 100%;\n min-height: 150px;\n}\n.notion-widgets h1:not(:first-child) {\n margin-top: 10vh;\n}\n.notion-widgets h2 {\n margin-top: 0;\n margin-bottom: 0.5em;\n}\n.notion-widgets span {\n display: block;\n}\n.notion-widgets label {\n width: 100%;\n display: block;\n}\n.notion-widgets input[type=radio],\n.notion-widgets input[type=checkbox] {\n filter: saturate(0) brightness(0.9);\n}\n.notion-widgets #output {\n padding: 10px;\n border: 2px solid lightgray;\n max-height: 85vh;\n overflow-y: auto;\n}\n.notion-widgets #output:empty {\n display: none;\n}\n.notion-widgets .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n.notion-widgets iframe {\n width: 100%;\n border: 1px solid rgb(137, 137, 137);\n margin-bottom: 1em;\n}\n.notion-widgets section {\n display: flex;\n gap: 30px;\n}\n.notion-widgets section > * {\n flex: 0 0 50%;\n}\n.notion-widgets .output {\n font-size: 0.85em;\n}\n\n@media (prefers-color-scheme: dark) {\n .notion-widgets input[type=text],\n .notion-widgets input[type=number],\n .notion-widgets input[type=color],\n .notion-widgets textarea,\n .notion-widgets button,\n .notion-widgets select {\n color: rgb(190, 188, 195);\n background: rgb(42, 42, 44);\n border-color: rgb(42, 42, 44);\n }\n .notion-widgets input[type=text]:focus,\n .notion-widgets input[type=number]:focus,\n .notion-widgets input[type=color]:focus,\n .notion-widgets textarea:focus,\n .notion-widgets button:focus,\n .notion-widgets select:focus {\n border-color: #f4ecec;\n }\n .notion-widgets input[type=checkbox] {\n filter: invert(1) saturate(0);\n }\n .notion-widgets button:hover, .notion-widgets button:focus {\n filter: brightness(0.8);\n }\n .notion-widgets iframe {\n border: 2px solid white;\n }\n}\n.notion-widget {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n overflow: hidden;\n background-color: white !important;\n}\n.notion-widget.dark-mode {\n background-color: rgb(25, 25, 25) !important;\n}\n.notion-widget > * {\n width: 100%;\n}\n.notion-widget > *.centered {\n display: flex;\n justify-content: center;\n}\n.notion-widget > *.centered #text {\n text-align: center;\n}\n.notion-widget #text {\n display: inline-block;\n letter-spacing: 0;\n}\n\n@media (prefers-color-scheme: dark) {\n .notion-widget {\n background-color: white !important;\n }\n .notion-widget.dark-mode {\n background-color: rgb(25, 25, 25) !important;\n }\n}\n.pinterest-board h1:not(:first-child) {\n margin-top: 10vh;\n}\n.pinterest-board h2 {\n font-size: 2em;\n margin-top: 0;\n margin-bottom: 0;\n}\n.pinterest-board span {\n display: block;\n}\n.pinterest-board label {\n width: 100%;\n display: block;\n}\n.pinterest-board #output {\n padding: 10px;\n border: 2px solid lightgray;\n max-height: 85vh;\n overflow-y: auto;\n}\n.pinterest-board #output:empty {\n display: none;\n}\n.pinterest-board .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n.pinterest-board iframe {\n width: 100%;\n border: 1px solid rgb(137, 137, 137);\n border-radius: 8px;\n margin-bottom: 1em;\n height: 500px;\n}\n.pinterest-board .output,\n.pinterest-board .outputNotion {\n font-size: 0.85em;\n min-height: 2em;\n}\n@media (max-width: 900px) {\n .pinterest-board .output,\n .pinterest-board .outputNotion {\n min-height: 6em;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n .pinterest-board iframe {\n border: 2px solid white;\n }\n}\n@media (min-width: 500px) {\n .two-lists {\n display: flex;\n }\n .two-lists textarea:first-child {\n margin-right: 0.5em;\n }\n .two-lists textarea:last-child {\n margin-left: 0.5em;\n }\n}\n* {\n font-family: \"Noto Sans Mono\", \"Consolas\", \"SF Mono\", monospace;\n box-sizing: border-box;\n color: #2f283c;\n user-select: none;\n}\n\nbody {\n font-size: 16px;\n line-height: 1.5;\n display: flex;\n justify-content: center;\n background: #f8f2f2;\n}\n@media (min-width: 1000px) {\n body {\n font-size: 19px;\n line-height: 1.7;\n }\n}\n\na, a small, a:visited, a:visited small {\n color: #084a90;\n text-decoration: none;\n display: inline-block;\n transition: transform 0.3s ease;\n}\na:hover, a:hover small, a:focus, a:focus small {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.03) rotate(-1deg);\n}\n\n@keyframes rainbow_animation {\n 0%, 100% {\n background-position: 0 0;\n }\n 50% {\n background-position: 100% 0;\n }\n}\n::selection {\n background: #1d5999;\n}\n\nmain {\n width: 95%;\n max-width: 880px;\n}\n@media (min-width: 1000px) {\n main {\n width: 90%;\n padding-top: 10vh;\n padding-bottom: 10vh;\n }\n}\n@media (max-height: 800px) {\n main {\n padding-top: 5vh;\n padding-bottom: 5vh;\n }\n}\n\np {\n margin: 0.5em 0;\n text-align: justify;\n}\n\nul {\n margin: 0.5em 0;\n padding-left: 1.1em;\n}\n\nli {\n margin: 0.3em 0;\n}\nli .md {\n vertical-align: middle;\n}\n\nh1 {\n letter-spacing: 4px;\n}\n\nh1,\nh2 {\n margin-bottom: 0;\n line-height: 1.5;\n}\n\nh2 {\n margin-top: 1.5em;\n font-size: 20px;\n}\n@media (min-width: 1000px) {\n h2 {\n font-size: 28px;\n }\n}\n\nsmall {\n font-size: 0.75em;\n}\n\nhr {\n border: 0;\n height: 1px;\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0), currentColor, rgba(0, 0, 0, 0));\n margin: 1em 0;\n}\n\n.cursor {\n animation: blink 1s step-start 0s infinite;\n}\n\n.md.hydrated {\n font-size: 1.1em;\n}\n\n@keyframes blink {\n 50% {\n opacity: 0;\n }\n}\n.back-link {\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n line-height: 1;\n}\n.back-link a {\n display: block;\n text-decoration: none;\n color: #251d35;\n padding: 15px;\n font-size: 32px;\n text-decoration: none;\n transition: 0.3s ease;\n}\n.back-link a:hover, .back-link a:focus {\n text-decoration: none;\n color: #251d35;\n transform: scale(1.5) rotate(20deg);\n}\n@media (max-width: 900px) {\n .back-link {\n display: none;\n }\n}\n\n/*\n\tFORM\n*/\nbutton,\ninput[type=text],\ninput[type=number],\ninput[type=color],\ntextarea,\nselect {\n font-size: 1em;\n line-height: 1.75;\n background: #eee4e4;\n border: 1px solid rgb(137, 137, 137);\n padding: 5px 15px;\n border-radius: 8px;\n transition: 0.4s ease;\n}\nbutton:focus,\ninput[type=text]:focus,\ninput[type=number]:focus,\ninput[type=color]:focus,\ntextarea:focus,\nselect:focus {\n outline: none;\n border: 1px solid black;\n}\n\nlabel {\n cursor: pointer;\n}\n\ninput[type=text] {\n margin-top: 10px;\n width: 100%;\n}\n\ninput[type=radio],\ninput[type=checkbox] {\n filter: saturate(0) brightness(0.9);\n}\n\ntextarea {\n width: 100%;\n margin: 10px 0;\n min-height: 250px;\n}\n\nbutton {\n margin: 20px 0;\n cursor: pointer;\n transition: 0.4s ease;\n font-size: 1.1em;\n}\nbutton span {\n margin: 0 !important;\n transition: transform 0.4s ease;\n}\nbutton:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\nbutton:not([disabled]):hover, button:not([disabled]):focus {\n filter: brightness(0.95);\n outline: none;\n border: 1px solid black;\n}\nbutton:not([disabled]):hover span, button:not([disabled]):focus span {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.03) rotate(-1deg);\n}\nbutton:not([disabled]):hover span {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.03) rotate(-1deg);\n}\nbutton:not([disabled]):active {\n transform: scale(0.9);\n}\n\n/*\n\tDARK SCHEME\n*/\nbody {\n background: rgb(12, 11, 14);\n}\n\n* {\n color: rgb(168, 166, 172);\n}\n\na, a small, a:visited, a:visited small {\n color: #578adb;\n}\na:hover, a:hover small, a:focus, a:focus small {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n}\n\n::selection {\n background: #3b609c;\n}\n\n.back-link a {\n color: rgb(190, 188, 195);\n}\n.back-link a:hover, .back-link a:focus {\n color: rgb(190, 188, 195);\n}\n\nbutton,\ninput[type=text],\ninput[type=number],\ninput[type=color],\ntextarea,\nselect {\n color: rgb(190, 188, 195);\n background: rgb(42, 42, 44);\n border-color: rgb(42, 42, 44);\n}\nbutton:focus,\ninput[type=text]:focus,\ninput[type=number]:focus,\ninput[type=color]:focus,\ntextarea:focus,\nselect:focus {\n border-color: #f4ecec;\n}\n\ninput[type=radio],\ninput[type=checkbox] {\n filter: invert(1) saturate(0);\n}\n\nbutton:not([disabled]):hover, button:not([disabled]):focus {\n filter: brightness(0.8);\n border-color: #f4ecec;\n}`, \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://petracoding-github-io/./css/main.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.tumblr-tag-list-tool span {\n display: block;\n margin-top: 30px;\n}\n.tumblr-tag-list-tool label {\n width: 100%;\n display: block;\n margin-top: 10px;\n}\n.tumblr-tag-list-tool #output {\n padding: 20px;\n border: 2px solid lightgray;\n border-radius: 8px;\n max-height: 85vh;\n overflow-y: auto;\n margin-top: 1em;\n}\n.tumblr-tag-list-tool #output,\n.tumblr-tag-list-tool #output * {\n user-select: auto;\n}\n.tumblr-tag-list-tool #output:empty {\n display: none;\n}\n.tumblr-tag-list-tool #output a {\n color: currentColor !important;\n background: none !important;\n animation: none !important;\n transition: none !important;\n transform: none !important;\n text-decoration: underline;\n}\n.tumblr-tag-list-tool #output a:hover, .tumblr-tag-list-tool #output a:focus {\n text-decoration: none;\n}\n.tumblr-tag-list-tool .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n\n.notion-widgets button,\n.notion-widgets input[type=text],\n.notion-widgets input[type=number],\n.notion-widgets input[type=color],\n.notion-widgets textarea,\n.notion-widgets select {\n font-family: \"Mukta\", sans-serif;\n font-size: 16px;\n line-height: 1.75;\n background: #eee4e4;\n border: 1px solid rgb(137, 137, 137);\n padding: 5px 15px;\n margin-bottom: 0.5em;\n}\n@media (min-width: 1000px) {\n .notion-widgets button,\n .notion-widgets input[type=text],\n .notion-widgets input[type=number],\n .notion-widgets input[type=color],\n .notion-widgets textarea,\n .notion-widgets select {\n font-size: 22px;\n }\n}\n.notion-widgets button:focus,\n.notion-widgets input[type=text]:focus,\n.notion-widgets input[type=number]:focus,\n.notion-widgets input[type=color]:focus,\n.notion-widgets textarea:focus,\n.notion-widgets select:focus {\n outline: none;\n border: 1px solid black;\n}\n.notion-widgets input[type=text] {\n margin-top: 10px;\n width: 100%;\n}\n.notion-widgets textarea {\n width: 100%;\n min-height: 150px;\n}\n.notion-widgets h1:not(:first-child) {\n margin-top: 10vh;\n}\n.notion-widgets h2 {\n margin-top: 0;\n margin-bottom: 0.5em;\n}\n.notion-widgets span {\n display: block;\n}\n.notion-widgets label {\n width: 100%;\n display: block;\n}\n.notion-widgets input[type=radio],\n.notion-widgets input[type=checkbox] {\n filter: saturate(0) brightness(0.9);\n}\n.notion-widgets #output {\n padding: 10px;\n border: 2px solid lightgray;\n max-height: 85vh;\n overflow-y: auto;\n}\n.notion-widgets #output:empty {\n display: none;\n}\n.notion-widgets .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n.notion-widgets iframe {\n width: 100%;\n border: 1px solid rgb(137, 137, 137);\n margin-bottom: 1em;\n}\n.notion-widgets section {\n display: flex;\n gap: 30px;\n}\n.notion-widgets section > * {\n flex: 0 0 50%;\n}\n.notion-widgets .output {\n font-size: 0.85em;\n}\n\n@media (prefers-color-scheme: dark) {\n .notion-widgets input[type=text],\n .notion-widgets input[type=number],\n .notion-widgets input[type=color],\n .notion-widgets textarea,\n .notion-widgets button,\n .notion-widgets select {\n color: rgb(190, 188, 195);\n background: rgb(42, 42, 44);\n border-color: rgb(42, 42, 44);\n }\n .notion-widgets input[type=text]:focus,\n .notion-widgets input[type=number]:focus,\n .notion-widgets input[type=color]:focus,\n .notion-widgets textarea:focus,\n .notion-widgets button:focus,\n .notion-widgets select:focus {\n border-color: #f4ecec;\n }\n .notion-widgets input[type=checkbox] {\n filter: invert(1) saturate(0);\n }\n .notion-widgets button:hover, .notion-widgets button:focus {\n filter: brightness(0.8);\n }\n .notion-widgets iframe {\n border: 2px solid white;\n }\n}\n.notion-widget {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n overflow: hidden;\n background-color: white !important;\n}\n.notion-widget.dark-mode {\n background-color: rgb(25, 25, 25) !important;\n}\n.notion-widget > * {\n width: 100%;\n}\n.notion-widget > *.centered {\n display: flex;\n justify-content: center;\n}\n.notion-widget > *.centered #text {\n text-align: center;\n}\n.notion-widget #text {\n display: inline-block;\n letter-spacing: 0;\n}\n\n@media (prefers-color-scheme: dark) {\n .notion-widget {\n background-color: white !important;\n }\n .notion-widget.dark-mode {\n background-color: rgb(25, 25, 25) !important;\n }\n}\n.pinterest-board h1:not(:first-child) {\n margin-top: 10vh;\n}\n.pinterest-board h2 {\n font-size: 2em;\n margin-top: 0;\n margin-bottom: 0;\n}\n.pinterest-board span {\n display: block;\n}\n.pinterest-board label {\n width: 100%;\n display: block;\n}\n.pinterest-board #output {\n padding: 10px;\n border: 2px solid lightgray;\n max-height: 85vh;\n overflow-y: auto;\n}\n.pinterest-board #output:empty {\n display: none;\n}\n.pinterest-board .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n.pinterest-board iframe {\n width: 100%;\n border: 1px solid rgb(137, 137, 137);\n border-radius: 8px;\n margin-bottom: 1em;\n height: 500px;\n}\n.pinterest-board .output,\n.pinterest-board .outputNotion {\n font-size: 0.85em;\n min-height: 2em;\n}\n@media (max-width: 900px) {\n .pinterest-board .output,\n .pinterest-board .outputNotion {\n min-height: 6em;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n .pinterest-board iframe {\n border: 2px solid white;\n }\n}\n.manual-list-sorter #word {\n font-size: 1.5em;\n}\n@media (min-width: 500px) {\n .manual-list-sorter .two-lists {\n display: flex;\n }\n .manual-list-sorter .two-lists textarea:first-child {\n margin-right: 0.5em;\n }\n .manual-list-sorter .two-lists textarea:last-child {\n margin-left: 0.5em;\n }\n .manual-list-sorter #word {\n font-size: 3em;\n }\n}\n@media (max-width: 900px) {\n .manual-list-sorter #word ~ button:last-child {\n margin-top: 0;\n }\n}\n\n* {\n font-family: \"Noto Sans Mono\", \"Consolas\", \"SF Mono\", monospace;\n box-sizing: border-box;\n color: #2f283c;\n}\n\nh1,\nh2 {\n user-select: none;\n}\n\nbody {\n padding: 10px;\n font-size: 16px;\n line-height: 1.5;\n display: flex;\n justify-content: center;\n background: #f8f2f2;\n}\n@media (min-width: 1000px) {\n body {\n font-size: 19px;\n line-height: 1.7;\n }\n}\n\na, a small, a:visited, a:visited small {\n color: #084a90;\n text-decoration: none;\n display: inline-block;\n transition: transform 0.3s ease;\n}\n@media (max-width: 900px) {\n a, a small, a:visited, a:visited small {\n display: inline;\n }\n}\na:hover, a:hover small, a:focus, a:focus small {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.03) rotate(-1deg);\n}\n\n@keyframes rainbow_animation {\n 0%, 100% {\n background-position: 0 0;\n }\n 50% {\n background-position: 100% 0;\n }\n}\n::selection {\n background: #1d5999;\n}\n\nmain {\n width: 95%;\n max-width: 880px;\n}\n@media (min-width: 1000px) {\n main {\n width: 90%;\n padding-top: 10vh;\n padding-bottom: 10vh;\n }\n}\n@media (min-width: 1000px) and (max-height: 800px) {\n main {\n padding-top: 5vh;\n padding-bottom: 5vh;\n }\n}\n\np {\n margin: 0.5em 0;\n text-align: justify;\n}\n\nul {\n margin: 0.5em 0;\n padding-left: 1.1em;\n}\n\nli {\n margin: 0.3em 0;\n}\nli .md {\n vertical-align: middle;\n}\n\nh1 {\n letter-spacing: 4px;\n}\n\nh1,\nh2 {\n margin-bottom: 0;\n line-height: 1.5;\n}\n\nh2 {\n margin-top: 1.5em;\n font-size: 20px;\n}\n@media (min-width: 1000px) {\n h2 {\n font-size: 28px;\n }\n}\n\nsmall {\n font-size: 0.75em;\n}\n\nhr {\n border: 0;\n height: 1px;\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0), currentColor, rgba(0, 0, 0, 0));\n margin: 1em 0;\n}\n\n.cursor {\n animation: blink 1s step-start 0s infinite;\n}\n\n.md.hydrated {\n font-size: 1.1em;\n transform: translateX(-5px);\n}\n\n@keyframes blink {\n 50% {\n opacity: 0;\n }\n}\n.back-link {\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n line-height: 1;\n}\n.back-link a {\n display: block;\n text-decoration: none;\n color: #251d35;\n padding: 15px;\n font-size: 32px;\n text-decoration: none;\n transition: 0.3s ease;\n}\n@media (max-width: 900px) {\n .back-link a {\n padding: 10px;\n font-size: 24px;\n }\n}\n.back-link a:hover, .back-link a:focus {\n text-decoration: none;\n color: #251d35;\n transform: scale(1.5) rotate(20deg);\n}\n\n/*\n\tFORM\n*/\nbutton,\ninput[type=text],\ninput[type=number],\ninput[type=color],\ntextarea,\nselect {\n font-size: 1em;\n line-height: 1.75;\n background: #eee4e4;\n border: 1px solid rgb(137, 137, 137);\n padding: 5px 15px;\n border-radius: 8px;\n transition: 0.4s ease;\n}\nbutton:focus,\ninput[type=text]:focus,\ninput[type=number]:focus,\ninput[type=color]:focus,\ntextarea:focus,\nselect:focus {\n outline: none;\n border: 1px solid black;\n}\n\nlabel {\n cursor: pointer;\n}\n\ninput[type=text] {\n margin-top: 10px;\n width: 100%;\n}\n\ninput[type=radio],\ninput[type=checkbox] {\n filter: saturate(0) brightness(0.9);\n}\n\ntextarea {\n width: 100%;\n margin: 10px 0;\n min-height: 250px;\n}\n\nbutton {\n margin: 20px 0;\n cursor: pointer;\n transition: 0.4s ease;\n font-size: 1.1em;\n}\nbutton span {\n display: inline-block;\n margin: 0 !important;\n transition: transform 0.4s ease;\n}\nbutton:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\nbutton:not([disabled]):hover, button:not([disabled]):focus {\n filter: brightness(0.95);\n outline: none;\n border: 1px solid black;\n}\nbutton:not([disabled]):hover span, button:not([disabled]):focus span {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.04) rotate(-2deg);\n}\nbutton:not([disabled]):hover span {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.03) rotate(-1deg);\n}\nbutton:not([disabled]):active {\n transform: scale(0.9);\n}\n\n/*\n\tDARK SCHEME\n*/\nbody {\n background: rgb(12, 11, 14);\n}\n\n* {\n color: rgb(168, 166, 172);\n}\n\na, a small, a:visited, a:visited small {\n color: #578adb;\n}\na:hover, a:hover small, a:focus, a:focus small {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n}\n\n::selection {\n background: #3b609c;\n}\n\n.back-link a {\n color: rgb(190, 188, 195);\n}\n.back-link a:hover, .back-link a:focus {\n color: rgb(190, 188, 195);\n}\n\nbutton,\ninput[type=text],\ninput[type=number],\ninput[type=color],\ntextarea,\nselect {\n color: rgb(190, 188, 195);\n background: rgb(42, 42, 44);\n border-color: rgb(42, 42, 44);\n}\nbutton:focus,\ninput[type=text]:focus,\ninput[type=number]:focus,\ninput[type=color]:focus,\ntextarea:focus,\nselect:focus {\n border-color: #f4ecec;\n}\n\ninput[type=radio],\ninput[type=checkbox] {\n filter: invert(1) saturate(0);\n}\n\nbutton:not([disabled]):hover, button:not([disabled]):focus {\n filter: brightness(0.8);\n border-color: #f4ecec;\n}`, \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://petracoding-github-io/./css/main.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js"); /***/ }), diff --git a/manual-list-sorter.html b/manual-list-sorter.html index 9f3ec6c..2c43f4c 100644 --- a/manual-list-sorter.html +++ b/manual-list-sorter.html @@ -23,15 +23,15 @@

    Manual List Sorter Tool

    - +
    - click start to start + click start to start
    - - + +

    diff --git a/neocities/lastfm.html b/neocities/lastfm.html index 5798ccd..e01bec2 100644 --- a/neocities/lastfm.html +++ b/neocities/lastfm.html @@ -2,7 +2,7 @@ petrapixel stats - + diff --git a/neocities/stats.html b/neocities/stats.html index 7285148..f2eb3e4 100644 --- a/neocities/stats.html +++ b/neocities/stats.html @@ -2,7 +2,7 @@ petrapixel stats - + diff --git a/neocities/status.html b/neocities/status.html index 6481b0c..b28f0d5 100644 --- a/neocities/status.html +++ b/neocities/status.html @@ -2,7 +2,7 @@ petrapixel stats - + diff --git a/notion/index.html b/notion/index.html index 17dfae2..93fb71e 100644 --- a/notion/index.html +++ b/notion/index.html @@ -2,7 +2,7 @@ Notion Widgets - + diff --git a/notion/text.html b/notion/text.html index 7fa44e0..a6e5a81 100644 --- a/notion/text.html +++ b/notion/text.html @@ -2,7 +2,7 @@ Text Widget - + diff --git a/pinterest/board.html b/pinterest/board.html index a09ff77..5aa114f 100644 --- a/pinterest/board.html +++ b/pinterest/board.html @@ -2,7 +2,7 @@ pinterest board - + diff --git a/pinterest/index.html b/pinterest/index.html index f666130..220d319 100644 --- a/pinterest/index.html +++ b/pinterest/index.html @@ -2,7 +2,7 @@ Pinterest Board iFrame - + diff --git a/tumblr-tag-list-tool.html b/tumblr-tag-list-tool.html index cd118fe..0827ebc 100644 --- a/tumblr-tag-list-tool.html +++ b/tumblr-tag-list-tool.html @@ -2,7 +2,7 @@ Tumblr Tag List Tool - + @@ -38,9 +38,9 @@

    Generate a tag list:

    - After clicking "Generate" just copy everything below and paste it into a pinned post or anywhere else. + Just copy everything below and paste it into a pinned post or anywhere else. - +
    diff --git a/vocabulary-manager.html b/vocabulary-manager.html index 21b5fb2..1750489 100644 --- a/vocabulary-manager.html +++ b/vocabulary-manager.html @@ -2,7 +2,7 @@ Vocabulary Manager - + @@ -58,8 +58,8 @@

    Input:

    Output:

    - - + +

    Number of items: ?. Number of removed items: ?. Number of lists: ?.


    From aa775f0d7c439b2a23c77086759dd6ff76ad54cc Mon Sep 17 00:00:00 2001 From: petracoding Date: Sun, 13 Oct 2024 13:15:34 +0200 Subject: [PATCH 17/26] notion to quizlet --- js/main.js | 1 + js/pages/notion-to-quizlet.js | 65 +++++++++++++++++++++++++++++++++++ main.js | 12 ++++++- notion-to-quizlet.html | 36 +++++++++++++++++++ 4 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 js/pages/notion-to-quizlet.js create mode 100644 notion-to-quizlet.html diff --git a/js/main.js b/js/main.js index 8594a6e..4711b65 100644 --- a/js/main.js +++ b/js/main.js @@ -4,6 +4,7 @@ import "./pages/notion-widgets"; import "./pages/pinterest-board"; import "./pages/vocabulary-manager"; import "./pages/manual-list-sorter"; +import "./pages/notion-to-quizlet"; document.addEventListener("DOMContentLoaded", function () { console.log("hewwo :3"); diff --git a/js/pages/notion-to-quizlet.js b/js/pages/notion-to-quizlet.js new file mode 100644 index 0000000..49f4f5b --- /dev/null +++ b/js/pages/notion-to-quizlet.js @@ -0,0 +1,65 @@ +document.addEventListener("DOMContentLoaded", function () { + if (!document.querySelector(".notion-to-quizlet")) return; + + const inputEl = document.querySelector("#input"); + const output1 = document.querySelector("#output1"); + const output2 = document.querySelector("#output2"); + + generateOutput1(inputEl.value); + // generateOutput2(inputEl.value); + + inputEl.addEventListener("change", () => { + generateOutput1(inputEl.value); + // generateOutput2(inputEl.value); + }); + inputEl.addEventListener("input", () => { + generateOutput1(inputEl.value); + // generateOutput2(inputEl.value); + }); + + function generateOutput1(input) { + const output = input + .replaceAll(/\*\*(.+)\*\*/g, "$1") // remove bold + .replaceAll(/\*(.+)\*/g, "$1") // remove italic + .replaceAll(/\s+!\[.*\]\(.*\)\s+/g, "\n") // remove images + .replaceAll(" -", " ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍‍ ‍ ‍✧") // level 5 + .replaceAll(" -", " ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍‍ ‍ ‍⬥") // level 4 + .replaceAll(" -", " ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍■") // level 3 + .replaceAll(" -", " ‍ ‍‍ ‍ ‍‍ ‍ ‍ ✦") // level 2 + .replaceAll("- ", "● "); // level 1 + output1.value = output; + copyToClipboard(output1.value); + } + + // function generateOutput2(input) { + // const output = input + // .replaceAll(/\*\*(.+)\*\*/g, "$1") + // .replaceAll(" -", "      -") + // .replaceAll(" -", "    -") + // .replaceAll(" -", "  -") + // .replaceAll("\n", "
    ") + // .replaceAll("- ", "● "); + // output2.innerHTML = output; + // } +}); + +function copyToClipboard(text) { + if (window.clipboardData && window.clipboardData.setData) { + // Internet Explorer-specific code path to prevent textarea being shown while dialog is visible. + return window.clipboardData.setData("Text", text); + } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { + var textarea = document.createElement("textarea"); + textarea.textContent = text; + textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in Microsoft Edge. + document.body.appendChild(textarea); + textarea.select(); + try { + return document.execCommand("copy"); // Security exception may be thrown by some browsers. + } catch (ex) { + console.warn("Copy to clipboard failed.", ex); + return prompt("Copy to clipboard: Ctrl+C, Enter", text); + } finally { + document.body.removeChild(textarea); + } + } +} diff --git a/main.js b/main.js index cd953c9..8fccedb 100644 --- a/main.js +++ b/main.js @@ -16,7 +16,7 @@ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _css_main_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../css/main.scss */ \"./css/main.scss\");\n/* harmony import */ var _pages_tumblr_tag_list_tool__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pages/tumblr-tag-list-tool */ \"./js/pages/tumblr-tag-list-tool.js\");\n/* harmony import */ var _pages_tumblr_tag_list_tool__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_pages_tumblr_tag_list_tool__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _pages_notion_widgets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pages/notion-widgets */ \"./js/pages/notion-widgets.js\");\n/* harmony import */ var _pages_notion_widgets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_pages_notion_widgets__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _pages_pinterest_board__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pages/pinterest-board */ \"./js/pages/pinterest-board.js\");\n/* harmony import */ var _pages_pinterest_board__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_pages_pinterest_board__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _pages_vocabulary_manager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./pages/vocabulary-manager */ \"./js/pages/vocabulary-manager.js\");\n/* harmony import */ var _pages_vocabulary_manager__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_pages_vocabulary_manager__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _pages_manual_list_sorter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./pages/manual-list-sorter */ \"./js/pages/manual-list-sorter.js\");\n/* harmony import */ var _pages_manual_list_sorter__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_pages_manual_list_sorter__WEBPACK_IMPORTED_MODULE_5__);\n\r\n\r\n\r\n\r\n\r\n\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function () {\r\n console.log(\"hewwo :3\");\r\n});\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/main.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _css_main_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../css/main.scss */ \"./css/main.scss\");\n/* harmony import */ var _pages_tumblr_tag_list_tool__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pages/tumblr-tag-list-tool */ \"./js/pages/tumblr-tag-list-tool.js\");\n/* harmony import */ var _pages_tumblr_tag_list_tool__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_pages_tumblr_tag_list_tool__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _pages_notion_widgets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pages/notion-widgets */ \"./js/pages/notion-widgets.js\");\n/* harmony import */ var _pages_notion_widgets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_pages_notion_widgets__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _pages_pinterest_board__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pages/pinterest-board */ \"./js/pages/pinterest-board.js\");\n/* harmony import */ var _pages_pinterest_board__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_pages_pinterest_board__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _pages_vocabulary_manager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./pages/vocabulary-manager */ \"./js/pages/vocabulary-manager.js\");\n/* harmony import */ var _pages_vocabulary_manager__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_pages_vocabulary_manager__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _pages_manual_list_sorter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./pages/manual-list-sorter */ \"./js/pages/manual-list-sorter.js\");\n/* harmony import */ var _pages_manual_list_sorter__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_pages_manual_list_sorter__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _pages_notion_to_quizlet__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./pages/notion-to-quizlet */ \"./js/pages/notion-to-quizlet.js\");\n/* harmony import */ var _pages_notion_to_quizlet__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_pages_notion_to_quizlet__WEBPACK_IMPORTED_MODULE_6__);\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function () {\r\n console.log(\"hewwo :3\");\r\n});\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/main.js?"); /***/ }), @@ -30,6 +30,16 @@ eval("document.addEventListener(\"DOMContentLoaded\", function () {\r\n if (!do /***/ }), +/***/ "./js/pages/notion-to-quizlet.js": +/*!***************************************!*\ + !*** ./js/pages/notion-to-quizlet.js ***! + \***************************************/ +/***/ (() => { + +eval("document.addEventListener(\"DOMContentLoaded\", function () {\r\n if (!document.querySelector(\".notion-to-quizlet\")) return;\r\n\r\n const inputEl = document.querySelector(\"#input\");\r\n const output1 = document.querySelector(\"#output1\");\r\n const output2 = document.querySelector(\"#output2\");\r\n\r\n generateOutput1(inputEl.value);\r\n // generateOutput2(inputEl.value);\r\n\r\n inputEl.addEventListener(\"change\", () => {\r\n generateOutput1(inputEl.value);\r\n // generateOutput2(inputEl.value);\r\n });\r\n inputEl.addEventListener(\"input\", () => {\r\n generateOutput1(inputEl.value);\r\n // generateOutput2(inputEl.value);\r\n });\r\n\r\n function generateOutput1(input) {\r\n const output = input\r\n .replaceAll(/\\*\\*(.+)\\*\\*/g, \"$1\") // remove bold\r\n .replaceAll(/\\*(.+)\\*/g, \"$1\") // remove italic\r\n .replaceAll(/\\s+!\\[.*\\]\\(.*\\)\\s+/g, \"\\n\") // remove images\r\n .replaceAll(\" -\", \" ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍‍ ‍ ‍✧\") // level 5\r\n .replaceAll(\" -\", \" ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍‍ ‍ ‍⬥\") // level 4\r\n .replaceAll(\" -\", \" ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍■\") // level 3\r\n .replaceAll(\" -\", \" ‍ ‍‍ ‍ ‍‍ ‍ ‍ ✦\") // level 2\r\n .replaceAll(\"- \", \"● \"); // level 1\r\n output1.value = output;\r\n copyToClipboard(output1.value);\r\n }\r\n\r\n // function generateOutput2(input) {\r\n // const output = input\r\n // .replaceAll(/\\*\\*(.+)\\*\\*/g, \"$1\")\r\n // .replaceAll(\" -\", \"      -\")\r\n // .replaceAll(\" -\", \"    -\")\r\n // .replaceAll(\" -\", \"  -\")\r\n // .replaceAll(\"\\n\", \"
    \")\r\n // .replaceAll(\"- \", \"● \");\r\n // output2.innerHTML = output;\r\n // }\r\n});\r\n\r\nfunction copyToClipboard(text) {\r\n if (window.clipboardData && window.clipboardData.setData) {\r\n // Internet Explorer-specific code path to prevent textarea being shown while dialog is visible.\r\n return window.clipboardData.setData(\"Text\", text);\r\n } else if (document.queryCommandSupported && document.queryCommandSupported(\"copy\")) {\r\n var textarea = document.createElement(\"textarea\");\r\n textarea.textContent = text;\r\n textarea.style.position = \"fixed\"; // Prevent scrolling to bottom of page in Microsoft Edge.\r\n document.body.appendChild(textarea);\r\n textarea.select();\r\n try {\r\n return document.execCommand(\"copy\"); // Security exception may be thrown by some browsers.\r\n } catch (ex) {\r\n console.warn(\"Copy to clipboard failed.\", ex);\r\n return prompt(\"Copy to clipboard: Ctrl+C, Enter\", text);\r\n } finally {\r\n document.body.removeChild(textarea);\r\n }\r\n }\r\n}\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/notion-to-quizlet.js?"); + +/***/ }), + /***/ "./js/pages/notion-widgets.js": /*!************************************!*\ !*** ./js/pages/notion-widgets.js ***! diff --git a/notion-to-quizlet.html b/notion-to-quizlet.html new file mode 100644 index 0000000..e6e1203 --- /dev/null +++ b/notion-to-quizlet.html @@ -0,0 +1,36 @@ + + + + Notion to Quizlet + + + + + + + + + + + + +
    +

    Notion to Quizlet

    +
    + + + +
    + + + +

    (Copied automatically)

    + +
    + + + From 224d485950e8cf69109fe15c55d07590cac360e9 Mon Sep 17 00:00:00 2001 From: petracoding Date: Tue, 5 Nov 2024 14:09:51 +0100 Subject: [PATCH 18/26] tag list tool warning message --- css/pages/tumblr-tag-list-tool.scss | 6 ++++++ js/pages/tumblr-tag-list-tool.js | 8 ++++++++ main.js | 4 ++-- tumblr-tag-list-tool.html | 4 +++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/css/pages/tumblr-tag-list-tool.scss b/css/pages/tumblr-tag-list-tool.scss index d5f8f36..3f6e584 100644 --- a/css/pages/tumblr-tag-list-tool.scss +++ b/css/pages/tumblr-tag-list-tool.scss @@ -10,6 +10,12 @@ margin-top: 10px; } + #warning { + color: red; + line-height: 1; + font-size: 0.85em; + } + #output { padding: 20px; border: 2px solid lightgray; diff --git a/js/pages/tumblr-tag-list-tool.js b/js/pages/tumblr-tag-list-tool.js index 28152ab..258b100 100644 --- a/js/pages/tumblr-tag-list-tool.js +++ b/js/pages/tumblr-tag-list-tool.js @@ -53,6 +53,7 @@ function generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox) { let o = ""; let isHeading = false; let isFirstGroup = true; + let totalTagCount = 0; const groups = groupTags ? input.split(/\n\n/) : [input]; @@ -72,6 +73,7 @@ function generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox) { o += tag + "
    "; isHeading = false; } else { + totalTagCount++; const tagSafeForString = tag; o += " { -eval("document.addEventListener(\"DOMContentLoaded\", function (event) {\r\n if (document.querySelector(\".tumblr-tag-list-tool\")) {\r\n const eachTagInNewLineCheckbox = document.querySelector(\"#eachTagInNewLine\");\r\n const separatorWrapEl = document.querySelector(\".separator-wrap\");\r\n const groupTagsCheckbox = document.querySelector(\"#groupTags\");\r\n const groupTagsWrapEl = document.querySelector(\".group-tags-wrap\");\r\n\r\n prepare();\r\n eachTagInNewLineCheckbox.addEventListener(\"change\", prepare);\r\n groupTagsCheckbox.addEventListener(\"change\", prepare);\r\n\r\n function prepare() {\r\n if (eachTagInNewLineCheckbox.checked) {\r\n separatorWrapEl.style.display = \"none\";\r\n } else {\r\n separatorWrapEl.style.display = \"block\";\r\n }\r\n if (groupTagsCheckbox.checked) {\r\n groupTagsWrapEl.style.display = \"block\";\r\n } else {\r\n groupTagsWrapEl.style.display = \"none\";\r\n }\r\n }\r\n\r\n generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox);\r\n\r\n const allInputs = document.querySelectorAll(\"main input, main textarea\");\r\n [...allInputs].forEach((inputEl) => {\r\n inputEl.addEventListener(\"change\", () => {\r\n generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox);\r\n });\r\n inputEl.addEventListener(\"input\", () => {\r\n generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox);\r\n });\r\n });\r\n\r\n // document.querySelector(\"#go\").addEventListener(\"click\", () => {\r\n // generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox);\r\n // });\r\n }\r\n});\r\n\r\nfunction generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox) {\r\n const outputEl = document.querySelector(\"#output\");\r\n const input = document.querySelector(\"textarea\").value;\r\n const addHashtags = document.querySelector(\"#addHashtags\").checked;\r\n const useSearch = document.querySelector(\"#useSearch\").checked;\r\n const eachTagInNewLine = eachTagInNewLineCheckbox.checked;\r\n const groupTags = groupTagsCheckbox.checked;\r\n const useHeadings = groupTags && document.querySelector(\"#headings\").checked;\r\n const url = document.querySelector(\"#url\").value;\r\n const separator = document.querySelector(\"#separator\").value || \"\";\r\n let o = \"\";\r\n let isHeading = false;\r\n let isFirstGroup = true;\r\n\r\n const groups = groupTags ? input.split(/\\n\\n/) : [input];\r\n\r\n groups.forEach((group) => {\r\n const tags = group.split(/[\\n,#]+/);\r\n isHeading = useHeadings;\r\n if (groupTags && !isFirstGroup) {\r\n o += \"
    \";\r\n }\r\n let i = 0;\r\n tags.forEach((tag) => {\r\n i++;\r\n let isLastTag = i == tags.length;\r\n tag = tag.trim();\r\n if (tag !== \",\" && tag !== \"\") {\r\n if (isHeading) {\r\n o += tag + \"
    \";\r\n isHeading = false;\r\n } else {\r\n const tagSafeForString = tag;\r\n o +=\r\n \"
    \" +\r\n (addHashtags ? \"#\" : \"\") +\r\n tag +\r\n \"\" +\r\n (eachTagInNewLine ? \"
    \" : isLastTag ? \"\" : separator);\r\n }\r\n }\r\n });\r\n isFirstGroup = false;\r\n });\r\n\r\n outputEl.innerHTML = o;\r\n}\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/tumblr-tag-list-tool.js?"); +eval("document.addEventListener(\"DOMContentLoaded\", function (event) {\r\n if (document.querySelector(\".tumblr-tag-list-tool\")) {\r\n const eachTagInNewLineCheckbox = document.querySelector(\"#eachTagInNewLine\");\r\n const separatorWrapEl = document.querySelector(\".separator-wrap\");\r\n const groupTagsCheckbox = document.querySelector(\"#groupTags\");\r\n const groupTagsWrapEl = document.querySelector(\".group-tags-wrap\");\r\n\r\n prepare();\r\n eachTagInNewLineCheckbox.addEventListener(\"change\", prepare);\r\n groupTagsCheckbox.addEventListener(\"change\", prepare);\r\n\r\n function prepare() {\r\n if (eachTagInNewLineCheckbox.checked) {\r\n separatorWrapEl.style.display = \"none\";\r\n } else {\r\n separatorWrapEl.style.display = \"block\";\r\n }\r\n if (groupTagsCheckbox.checked) {\r\n groupTagsWrapEl.style.display = \"block\";\r\n } else {\r\n groupTagsWrapEl.style.display = \"none\";\r\n }\r\n }\r\n\r\n generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox);\r\n\r\n const allInputs = document.querySelectorAll(\"main input, main textarea\");\r\n [...allInputs].forEach((inputEl) => {\r\n inputEl.addEventListener(\"change\", () => {\r\n generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox);\r\n });\r\n inputEl.addEventListener(\"input\", () => {\r\n generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox);\r\n });\r\n });\r\n\r\n // document.querySelector(\"#go\").addEventListener(\"click\", () => {\r\n // generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox);\r\n // });\r\n }\r\n});\r\n\r\nfunction generateOutput(eachTagInNewLineCheckbox, groupTagsCheckbox) {\r\n const outputEl = document.querySelector(\"#output\");\r\n const input = document.querySelector(\"textarea\").value;\r\n const addHashtags = document.querySelector(\"#addHashtags\").checked;\r\n const useSearch = document.querySelector(\"#useSearch\").checked;\r\n const eachTagInNewLine = eachTagInNewLineCheckbox.checked;\r\n const groupTags = groupTagsCheckbox.checked;\r\n const useHeadings = groupTags && document.querySelector(\"#headings\").checked;\r\n const url = document.querySelector(\"#url\").value;\r\n const separator = document.querySelector(\"#separator\").value || \"\";\r\n let o = \"\";\r\n let isHeading = false;\r\n let isFirstGroup = true;\r\n let totalTagCount = 0;\r\n\r\n const groups = groupTags ? input.split(/\\n\\n/) : [input];\r\n\r\n groups.forEach((group) => {\r\n const tags = group.split(/[\\n,#]+/);\r\n isHeading = useHeadings;\r\n if (groupTags && !isFirstGroup) {\r\n o += \"
    \";\r\n }\r\n let i = 0;\r\n tags.forEach((tag) => {\r\n i++;\r\n let isLastTag = i == tags.length;\r\n tag = tag.trim();\r\n if (tag !== \",\" && tag !== \"\") {\r\n if (isHeading) {\r\n o += tag + \"
    \";\r\n isHeading = false;\r\n } else {\r\n totalTagCount++;\r\n const tagSafeForString = tag;\r\n o +=\r\n \"\" +\r\n (addHashtags ? \"#\" : \"\") +\r\n tag +\r\n \"\" +\r\n (eachTagInNewLine ? \"
    \" : isLastTag ? \"\" : separator);\r\n }\r\n }\r\n });\r\n isFirstGroup = false;\r\n });\r\n\r\n outputEl.innerHTML = o;\r\n\r\n if (totalTagCount > 100) {\r\n document.querySelector(\"#warning\").innerHTML = \"Warning: You have \" + totalTagCount + \" tags. It's not possible to have more than 100 tags in a single tumblr post!\";\r\n } else {\r\n document.querySelector(\"#warning\").innerHTML = \"\";\r\n }\r\n}\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/tumblr-tag-list-tool.js?"); /***/ }), @@ -87,7 +87,7 @@ eval("document.addEventListener(\"DOMContentLoaded\", function () {\r\n if (!do /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.tumblr-tag-list-tool span {\n display: block;\n margin-top: 30px;\n}\n.tumblr-tag-list-tool label {\n width: 100%;\n display: block;\n margin-top: 10px;\n}\n.tumblr-tag-list-tool #output {\n padding: 20px;\n border: 2px solid lightgray;\n border-radius: 8px;\n max-height: 85vh;\n overflow-y: auto;\n margin-top: 1em;\n}\n.tumblr-tag-list-tool #output,\n.tumblr-tag-list-tool #output * {\n user-select: auto;\n}\n.tumblr-tag-list-tool #output:empty {\n display: none;\n}\n.tumblr-tag-list-tool #output a {\n color: currentColor !important;\n background: none !important;\n animation: none !important;\n transition: none !important;\n transform: none !important;\n text-decoration: underline;\n}\n.tumblr-tag-list-tool #output a:hover, .tumblr-tag-list-tool #output a:focus {\n text-decoration: none;\n}\n.tumblr-tag-list-tool .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n\n.notion-widgets button,\n.notion-widgets input[type=text],\n.notion-widgets input[type=number],\n.notion-widgets input[type=color],\n.notion-widgets textarea,\n.notion-widgets select {\n font-family: \"Mukta\", sans-serif;\n font-size: 16px;\n line-height: 1.75;\n background: #eee4e4;\n border: 1px solid rgb(137, 137, 137);\n padding: 5px 15px;\n margin-bottom: 0.5em;\n}\n@media (min-width: 1000px) {\n .notion-widgets button,\n .notion-widgets input[type=text],\n .notion-widgets input[type=number],\n .notion-widgets input[type=color],\n .notion-widgets textarea,\n .notion-widgets select {\n font-size: 22px;\n }\n}\n.notion-widgets button:focus,\n.notion-widgets input[type=text]:focus,\n.notion-widgets input[type=number]:focus,\n.notion-widgets input[type=color]:focus,\n.notion-widgets textarea:focus,\n.notion-widgets select:focus {\n outline: none;\n border: 1px solid black;\n}\n.notion-widgets input[type=text] {\n margin-top: 10px;\n width: 100%;\n}\n.notion-widgets textarea {\n width: 100%;\n min-height: 150px;\n}\n.notion-widgets h1:not(:first-child) {\n margin-top: 10vh;\n}\n.notion-widgets h2 {\n margin-top: 0;\n margin-bottom: 0.5em;\n}\n.notion-widgets span {\n display: block;\n}\n.notion-widgets label {\n width: 100%;\n display: block;\n}\n.notion-widgets input[type=radio],\n.notion-widgets input[type=checkbox] {\n filter: saturate(0) brightness(0.9);\n}\n.notion-widgets #output {\n padding: 10px;\n border: 2px solid lightgray;\n max-height: 85vh;\n overflow-y: auto;\n}\n.notion-widgets #output:empty {\n display: none;\n}\n.notion-widgets .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n.notion-widgets iframe {\n width: 100%;\n border: 1px solid rgb(137, 137, 137);\n margin-bottom: 1em;\n}\n.notion-widgets section {\n display: flex;\n gap: 30px;\n}\n.notion-widgets section > * {\n flex: 0 0 50%;\n}\n.notion-widgets .output {\n font-size: 0.85em;\n}\n\n@media (prefers-color-scheme: dark) {\n .notion-widgets input[type=text],\n .notion-widgets input[type=number],\n .notion-widgets input[type=color],\n .notion-widgets textarea,\n .notion-widgets button,\n .notion-widgets select {\n color: rgb(190, 188, 195);\n background: rgb(42, 42, 44);\n border-color: rgb(42, 42, 44);\n }\n .notion-widgets input[type=text]:focus,\n .notion-widgets input[type=number]:focus,\n .notion-widgets input[type=color]:focus,\n .notion-widgets textarea:focus,\n .notion-widgets button:focus,\n .notion-widgets select:focus {\n border-color: #f4ecec;\n }\n .notion-widgets input[type=checkbox] {\n filter: invert(1) saturate(0);\n }\n .notion-widgets button:hover, .notion-widgets button:focus {\n filter: brightness(0.8);\n }\n .notion-widgets iframe {\n border: 2px solid white;\n }\n}\n.notion-widget {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n overflow: hidden;\n background-color: white !important;\n}\n.notion-widget.dark-mode {\n background-color: rgb(25, 25, 25) !important;\n}\n.notion-widget > * {\n width: 100%;\n}\n.notion-widget > *.centered {\n display: flex;\n justify-content: center;\n}\n.notion-widget > *.centered #text {\n text-align: center;\n}\n.notion-widget #text {\n display: inline-block;\n letter-spacing: 0;\n}\n\n@media (prefers-color-scheme: dark) {\n .notion-widget {\n background-color: white !important;\n }\n .notion-widget.dark-mode {\n background-color: rgb(25, 25, 25) !important;\n }\n}\n.pinterest-board h1:not(:first-child) {\n margin-top: 10vh;\n}\n.pinterest-board h2 {\n font-size: 2em;\n margin-top: 0;\n margin-bottom: 0;\n}\n.pinterest-board span {\n display: block;\n}\n.pinterest-board label {\n width: 100%;\n display: block;\n}\n.pinterest-board #output {\n padding: 10px;\n border: 2px solid lightgray;\n max-height: 85vh;\n overflow-y: auto;\n}\n.pinterest-board #output:empty {\n display: none;\n}\n.pinterest-board .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n.pinterest-board iframe {\n width: 100%;\n border: 1px solid rgb(137, 137, 137);\n border-radius: 8px;\n margin-bottom: 1em;\n height: 500px;\n}\n.pinterest-board .output,\n.pinterest-board .outputNotion {\n font-size: 0.85em;\n min-height: 2em;\n}\n@media (max-width: 900px) {\n .pinterest-board .output,\n .pinterest-board .outputNotion {\n min-height: 6em;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n .pinterest-board iframe {\n border: 2px solid white;\n }\n}\n.manual-list-sorter #word {\n font-size: 1.5em;\n}\n@media (min-width: 500px) {\n .manual-list-sorter .two-lists {\n display: flex;\n }\n .manual-list-sorter .two-lists textarea:first-child {\n margin-right: 0.5em;\n }\n .manual-list-sorter .two-lists textarea:last-child {\n margin-left: 0.5em;\n }\n .manual-list-sorter #word {\n font-size: 3em;\n }\n}\n@media (max-width: 900px) {\n .manual-list-sorter #word ~ button:last-child {\n margin-top: 0;\n }\n}\n\n* {\n font-family: \"Noto Sans Mono\", \"Consolas\", \"SF Mono\", monospace;\n box-sizing: border-box;\n color: #2f283c;\n}\n\nh1,\nh2 {\n user-select: none;\n}\n\nbody {\n padding: 10px;\n font-size: 16px;\n line-height: 1.5;\n display: flex;\n justify-content: center;\n background: #f8f2f2;\n}\n@media (min-width: 1000px) {\n body {\n font-size: 19px;\n line-height: 1.7;\n }\n}\n\na, a small, a:visited, a:visited small {\n color: #084a90;\n text-decoration: none;\n display: inline-block;\n transition: transform 0.3s ease;\n}\n@media (max-width: 900px) {\n a, a small, a:visited, a:visited small {\n display: inline;\n }\n}\na:hover, a:hover small, a:focus, a:focus small {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.03) rotate(-1deg);\n}\n\n@keyframes rainbow_animation {\n 0%, 100% {\n background-position: 0 0;\n }\n 50% {\n background-position: 100% 0;\n }\n}\n::selection {\n background: #1d5999;\n}\n\nmain {\n width: 95%;\n max-width: 880px;\n}\n@media (min-width: 1000px) {\n main {\n width: 90%;\n padding-top: 10vh;\n padding-bottom: 10vh;\n }\n}\n@media (min-width: 1000px) and (max-height: 800px) {\n main {\n padding-top: 5vh;\n padding-bottom: 5vh;\n }\n}\n\np {\n margin: 0.5em 0;\n text-align: justify;\n}\n\nul {\n margin: 0.5em 0;\n padding-left: 1.1em;\n}\n\nli {\n margin: 0.3em 0;\n}\nli .md {\n vertical-align: middle;\n}\n\nh1 {\n letter-spacing: 4px;\n}\n\nh1,\nh2 {\n margin-bottom: 0;\n line-height: 1.5;\n}\n\nh2 {\n margin-top: 1.5em;\n font-size: 20px;\n}\n@media (min-width: 1000px) {\n h2 {\n font-size: 28px;\n }\n}\n\nsmall {\n font-size: 0.75em;\n}\n\nhr {\n border: 0;\n height: 1px;\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0), currentColor, rgba(0, 0, 0, 0));\n margin: 1em 0;\n}\n\n.cursor {\n animation: blink 1s step-start 0s infinite;\n}\n\n.md.hydrated {\n font-size: 1.1em;\n transform: translateX(-5px);\n}\n\n@keyframes blink {\n 50% {\n opacity: 0;\n }\n}\n.back-link {\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n line-height: 1;\n}\n.back-link a {\n display: block;\n text-decoration: none;\n color: #251d35;\n padding: 15px;\n font-size: 32px;\n text-decoration: none;\n transition: 0.3s ease;\n}\n@media (max-width: 900px) {\n .back-link a {\n padding: 10px;\n font-size: 24px;\n }\n}\n.back-link a:hover, .back-link a:focus {\n text-decoration: none;\n color: #251d35;\n transform: scale(1.5) rotate(20deg);\n}\n\n/*\n\tFORM\n*/\nbutton,\ninput[type=text],\ninput[type=number],\ninput[type=color],\ntextarea,\nselect {\n font-size: 1em;\n line-height: 1.75;\n background: #eee4e4;\n border: 1px solid rgb(137, 137, 137);\n padding: 5px 15px;\n border-radius: 8px;\n transition: 0.4s ease;\n}\nbutton:focus,\ninput[type=text]:focus,\ninput[type=number]:focus,\ninput[type=color]:focus,\ntextarea:focus,\nselect:focus {\n outline: none;\n border: 1px solid black;\n}\n\nlabel {\n cursor: pointer;\n}\n\ninput[type=text] {\n margin-top: 10px;\n width: 100%;\n}\n\ninput[type=radio],\ninput[type=checkbox] {\n filter: saturate(0) brightness(0.9);\n}\n\ntextarea {\n width: 100%;\n margin: 10px 0;\n min-height: 250px;\n}\n\nbutton {\n margin: 20px 0;\n cursor: pointer;\n transition: 0.4s ease;\n font-size: 1.1em;\n}\nbutton span {\n display: inline-block;\n margin: 0 !important;\n transition: transform 0.4s ease;\n}\nbutton:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\nbutton:not([disabled]):hover, button:not([disabled]):focus {\n filter: brightness(0.95);\n outline: none;\n border: 1px solid black;\n}\nbutton:not([disabled]):hover span, button:not([disabled]):focus span {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.04) rotate(-2deg);\n}\nbutton:not([disabled]):hover span {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.03) rotate(-1deg);\n}\nbutton:not([disabled]):active {\n transform: scale(0.9);\n}\n\n/*\n\tDARK SCHEME\n*/\nbody {\n background: rgb(12, 11, 14);\n}\n\n* {\n color: rgb(168, 166, 172);\n}\n\na, a small, a:visited, a:visited small {\n color: #578adb;\n}\na:hover, a:hover small, a:focus, a:focus small {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n}\n\n::selection {\n background: #3b609c;\n}\n\n.back-link a {\n color: rgb(190, 188, 195);\n}\n.back-link a:hover, .back-link a:focus {\n color: rgb(190, 188, 195);\n}\n\nbutton,\ninput[type=text],\ninput[type=number],\ninput[type=color],\ntextarea,\nselect {\n color: rgb(190, 188, 195);\n background: rgb(42, 42, 44);\n border-color: rgb(42, 42, 44);\n}\nbutton:focus,\ninput[type=text]:focus,\ninput[type=number]:focus,\ninput[type=color]:focus,\ntextarea:focus,\nselect:focus {\n border-color: #f4ecec;\n}\n\ninput[type=radio],\ninput[type=checkbox] {\n filter: invert(1) saturate(0);\n}\n\nbutton:not([disabled]):hover, button:not([disabled]):focus {\n filter: brightness(0.8);\n border-color: #f4ecec;\n}`, \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://petracoding-github-io/./css/main.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.tumblr-tag-list-tool span {\n display: block;\n margin-top: 30px;\n}\n.tumblr-tag-list-tool label {\n width: 100%;\n display: block;\n margin-top: 10px;\n}\n.tumblr-tag-list-tool #warning {\n color: red;\n line-height: 1;\n font-size: 0.85em;\n}\n.tumblr-tag-list-tool #output {\n padding: 20px;\n border: 2px solid lightgray;\n border-radius: 8px;\n max-height: 85vh;\n overflow-y: auto;\n margin-top: 1em;\n}\n.tumblr-tag-list-tool #output,\n.tumblr-tag-list-tool #output * {\n user-select: auto;\n}\n.tumblr-tag-list-tool #output:empty {\n display: none;\n}\n.tumblr-tag-list-tool #output a {\n color: currentColor !important;\n background: none !important;\n animation: none !important;\n transition: none !important;\n transform: none !important;\n text-decoration: underline;\n}\n.tumblr-tag-list-tool #output a:hover, .tumblr-tag-list-tool #output a:focus {\n text-decoration: none;\n}\n.tumblr-tag-list-tool .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n\n.notion-widgets button,\n.notion-widgets input[type=text],\n.notion-widgets input[type=number],\n.notion-widgets input[type=color],\n.notion-widgets textarea,\n.notion-widgets select {\n font-family: \"Mukta\", sans-serif;\n font-size: 16px;\n line-height: 1.75;\n background: #eee4e4;\n border: 1px solid rgb(137, 137, 137);\n padding: 5px 15px;\n margin-bottom: 0.5em;\n}\n@media (min-width: 1000px) {\n .notion-widgets button,\n .notion-widgets input[type=text],\n .notion-widgets input[type=number],\n .notion-widgets input[type=color],\n .notion-widgets textarea,\n .notion-widgets select {\n font-size: 22px;\n }\n}\n.notion-widgets button:focus,\n.notion-widgets input[type=text]:focus,\n.notion-widgets input[type=number]:focus,\n.notion-widgets input[type=color]:focus,\n.notion-widgets textarea:focus,\n.notion-widgets select:focus {\n outline: none;\n border: 1px solid black;\n}\n.notion-widgets input[type=text] {\n margin-top: 10px;\n width: 100%;\n}\n.notion-widgets textarea {\n width: 100%;\n min-height: 150px;\n}\n.notion-widgets h1:not(:first-child) {\n margin-top: 10vh;\n}\n.notion-widgets h2 {\n margin-top: 0;\n margin-bottom: 0.5em;\n}\n.notion-widgets span {\n display: block;\n}\n.notion-widgets label {\n width: 100%;\n display: block;\n}\n.notion-widgets input[type=radio],\n.notion-widgets input[type=checkbox] {\n filter: saturate(0) brightness(0.9);\n}\n.notion-widgets #output {\n padding: 10px;\n border: 2px solid lightgray;\n max-height: 85vh;\n overflow-y: auto;\n}\n.notion-widgets #output:empty {\n display: none;\n}\n.notion-widgets .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n.notion-widgets iframe {\n width: 100%;\n border: 1px solid rgb(137, 137, 137);\n margin-bottom: 1em;\n}\n.notion-widgets section {\n display: flex;\n gap: 30px;\n}\n.notion-widgets section > * {\n flex: 0 0 50%;\n}\n.notion-widgets .output {\n font-size: 0.85em;\n}\n\n@media (prefers-color-scheme: dark) {\n .notion-widgets input[type=text],\n .notion-widgets input[type=number],\n .notion-widgets input[type=color],\n .notion-widgets textarea,\n .notion-widgets button,\n .notion-widgets select {\n color: rgb(190, 188, 195);\n background: rgb(42, 42, 44);\n border-color: rgb(42, 42, 44);\n }\n .notion-widgets input[type=text]:focus,\n .notion-widgets input[type=number]:focus,\n .notion-widgets input[type=color]:focus,\n .notion-widgets textarea:focus,\n .notion-widgets button:focus,\n .notion-widgets select:focus {\n border-color: #f4ecec;\n }\n .notion-widgets input[type=checkbox] {\n filter: invert(1) saturate(0);\n }\n .notion-widgets button:hover, .notion-widgets button:focus {\n filter: brightness(0.8);\n }\n .notion-widgets iframe {\n border: 2px solid white;\n }\n}\n.notion-widget {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n overflow: hidden;\n background-color: white !important;\n}\n.notion-widget.dark-mode {\n background-color: rgb(25, 25, 25) !important;\n}\n.notion-widget > * {\n width: 100%;\n}\n.notion-widget > *.centered {\n display: flex;\n justify-content: center;\n}\n.notion-widget > *.centered #text {\n text-align: center;\n}\n.notion-widget #text {\n display: inline-block;\n letter-spacing: 0;\n}\n\n@media (prefers-color-scheme: dark) {\n .notion-widget {\n background-color: white !important;\n }\n .notion-widget.dark-mode {\n background-color: rgb(25, 25, 25) !important;\n }\n}\n.pinterest-board h1:not(:first-child) {\n margin-top: 10vh;\n}\n.pinterest-board h2 {\n font-size: 2em;\n margin-top: 0;\n margin-bottom: 0;\n}\n.pinterest-board span {\n display: block;\n}\n.pinterest-board label {\n width: 100%;\n display: block;\n}\n.pinterest-board #output {\n padding: 10px;\n border: 2px solid lightgray;\n max-height: 85vh;\n overflow-y: auto;\n}\n.pinterest-board #output:empty {\n display: none;\n}\n.pinterest-board .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n.pinterest-board iframe {\n width: 100%;\n border: 1px solid rgb(137, 137, 137);\n border-radius: 8px;\n margin-bottom: 1em;\n height: 500px;\n}\n.pinterest-board .output,\n.pinterest-board .outputNotion {\n font-size: 0.85em;\n min-height: 2em;\n}\n@media (max-width: 900px) {\n .pinterest-board .output,\n .pinterest-board .outputNotion {\n min-height: 6em;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n .pinterest-board iframe {\n border: 2px solid white;\n }\n}\n.manual-list-sorter #word {\n font-size: 1.5em;\n}\n@media (min-width: 500px) {\n .manual-list-sorter .two-lists {\n display: flex;\n }\n .manual-list-sorter .two-lists textarea:first-child {\n margin-right: 0.5em;\n }\n .manual-list-sorter .two-lists textarea:last-child {\n margin-left: 0.5em;\n }\n .manual-list-sorter #word {\n font-size: 3em;\n }\n}\n@media (max-width: 900px) {\n .manual-list-sorter #word ~ button:last-child {\n margin-top: 0;\n }\n}\n\n* {\n font-family: \"Noto Sans Mono\", \"Consolas\", \"SF Mono\", monospace;\n box-sizing: border-box;\n color: #2f283c;\n}\n\nh1,\nh2 {\n user-select: none;\n}\n\nbody {\n padding: 10px;\n font-size: 16px;\n line-height: 1.5;\n display: flex;\n justify-content: center;\n background: #f8f2f2;\n}\n@media (min-width: 1000px) {\n body {\n font-size: 19px;\n line-height: 1.7;\n }\n}\n\na, a small, a:visited, a:visited small {\n color: #084a90;\n text-decoration: none;\n display: inline-block;\n transition: transform 0.3s ease;\n}\n@media (max-width: 900px) {\n a, a small, a:visited, a:visited small {\n display: inline;\n }\n}\na:hover, a:hover small, a:focus, a:focus small {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.03) rotate(-1deg);\n}\n\n@keyframes rainbow_animation {\n 0%, 100% {\n background-position: 0 0;\n }\n 50% {\n background-position: 100% 0;\n }\n}\n::selection {\n background: #1d5999;\n}\n\nmain {\n width: 95%;\n max-width: 880px;\n}\n@media (min-width: 1000px) {\n main {\n width: 90%;\n padding-top: 10vh;\n padding-bottom: 10vh;\n }\n}\n@media (min-width: 1000px) and (max-height: 800px) {\n main {\n padding-top: 5vh;\n padding-bottom: 5vh;\n }\n}\n\np {\n margin: 0.5em 0;\n text-align: justify;\n}\n\nul {\n margin: 0.5em 0;\n padding-left: 1.1em;\n}\n\nli {\n margin: 0.3em 0;\n}\nli .md {\n vertical-align: middle;\n}\n\nh1 {\n letter-spacing: 4px;\n}\n\nh1,\nh2 {\n margin-bottom: 0;\n line-height: 1.5;\n}\n\nh2 {\n margin-top: 1.5em;\n font-size: 20px;\n}\n@media (min-width: 1000px) {\n h2 {\n font-size: 28px;\n }\n}\n\nsmall {\n font-size: 0.75em;\n}\n\nhr {\n border: 0;\n height: 1px;\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0), currentColor, rgba(0, 0, 0, 0));\n margin: 1em 0;\n}\n\n.cursor {\n animation: blink 1s step-start 0s infinite;\n}\n\n.md.hydrated {\n font-size: 1.1em;\n transform: translateX(-5px);\n}\n\n@keyframes blink {\n 50% {\n opacity: 0;\n }\n}\n.back-link {\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n line-height: 1;\n}\n.back-link a {\n display: block;\n text-decoration: none;\n color: #251d35;\n padding: 15px;\n font-size: 32px;\n text-decoration: none;\n transition: 0.3s ease;\n}\n@media (max-width: 900px) {\n .back-link a {\n padding: 10px;\n font-size: 24px;\n }\n}\n.back-link a:hover, .back-link a:focus {\n text-decoration: none;\n color: #251d35;\n transform: scale(1.5) rotate(20deg);\n}\n\n/*\n\tFORM\n*/\nbutton,\ninput[type=text],\ninput[type=number],\ninput[type=color],\ntextarea,\nselect {\n font-size: 1em;\n line-height: 1.75;\n background: #eee4e4;\n border: 1px solid rgb(137, 137, 137);\n padding: 5px 15px;\n border-radius: 8px;\n transition: 0.4s ease;\n}\nbutton:focus,\ninput[type=text]:focus,\ninput[type=number]:focus,\ninput[type=color]:focus,\ntextarea:focus,\nselect:focus {\n outline: none;\n border: 1px solid black;\n}\n\nlabel {\n cursor: pointer;\n}\n\ninput[type=text] {\n margin-top: 10px;\n width: 100%;\n}\n\ninput[type=radio],\ninput[type=checkbox] {\n filter: saturate(0) brightness(0.9);\n}\n\ntextarea {\n width: 100%;\n margin: 10px 0;\n min-height: 250px;\n}\n\nbutton {\n margin: 20px 0;\n cursor: pointer;\n transition: 0.4s ease;\n font-size: 1.1em;\n}\nbutton span {\n display: inline-block;\n margin: 0 !important;\n transition: transform 0.4s ease;\n}\nbutton:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\nbutton:not([disabled]):hover, button:not([disabled]):focus {\n filter: brightness(0.95);\n outline: none;\n border: 1px solid black;\n}\nbutton:not([disabled]):hover span, button:not([disabled]):focus span {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.04) rotate(-2deg);\n}\nbutton:not([disabled]):hover span {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.03) rotate(-1deg);\n}\nbutton:not([disabled]):active {\n transform: scale(0.9);\n}\n\n/*\n\tDARK SCHEME\n*/\nbody {\n background: rgb(12, 11, 14);\n}\n\n* {\n color: rgb(168, 166, 172);\n}\n\na, a small, a:visited, a:visited small {\n color: #578adb;\n}\na:hover, a:hover small, a:focus, a:focus small {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n}\n\n::selection {\n background: #3b609c;\n}\n\n.back-link a {\n color: rgb(190, 188, 195);\n}\n.back-link a:hover, .back-link a:focus {\n color: rgb(190, 188, 195);\n}\n\nbutton,\ninput[type=text],\ninput[type=number],\ninput[type=color],\ntextarea,\nselect {\n color: rgb(190, 188, 195);\n background: rgb(42, 42, 44);\n border-color: rgb(42, 42, 44);\n}\nbutton:focus,\ninput[type=text]:focus,\ninput[type=number]:focus,\ninput[type=color]:focus,\ntextarea:focus,\nselect:focus {\n border-color: #f4ecec;\n}\n\ninput[type=radio],\ninput[type=checkbox] {\n filter: invert(1) saturate(0);\n}\n\nbutton:not([disabled]):hover, button:not([disabled]):focus {\n filter: brightness(0.8);\n border-color: #f4ecec;\n}`, \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://petracoding-github-io/./css/main.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js"); /***/ }), diff --git a/tumblr-tag-list-tool.html b/tumblr-tag-list-tool.html index 0827ebc..1685a52 100644 --- a/tumblr-tag-list-tool.html +++ b/tumblr-tag-list-tool.html @@ -2,7 +2,7 @@ Tumblr Tag List Tool - + @@ -42,6 +42,8 @@

    Generate a tag list:

    +

    +
    From 99a015330a6b38c113a940ca085bcef97a88168e Mon Sep 17 00:00:00 2001 From: petracoding Date: Sun, 17 Nov 2024 19:39:55 +0100 Subject: [PATCH 19/26] selection mode for manual list sorter --- css/pages/manual-list-sorter.scss | 20 ++++++++++ js/pages/manual-list-sorter.js | 62 +++++++++++++++++++++++++++++++ main.js | 4 +- manual-list-sorter.html | 14 +++++-- 4 files changed, 94 insertions(+), 6 deletions(-) diff --git a/css/pages/manual-list-sorter.scss b/css/pages/manual-list-sorter.scss index 2cb9e53..bbd3a97 100644 --- a/css/pages/manual-list-sorter.scss +++ b/css/pages/manual-list-sorter.scss @@ -3,6 +3,26 @@ font-size: 1.5em; } + #selects { + display: flex; + flex-wrap: wrap; + user-select: none; + + div { + padding: 5px 10px; + cursor: pointer; + border-radius: 10px; + + &:hover { + background: rgba(255, 255, 255, 0.07); + } + + &.selected { + background: rgba(255, 255, 255, 0.2); + } + } + } + @media (min-width: 500px) { .two-lists { display: flex; diff --git a/js/pages/manual-list-sorter.js b/js/pages/manual-list-sorter.js index da07040..44ce5c5 100644 --- a/js/pages/manual-list-sorter.js +++ b/js/pages/manual-list-sorter.js @@ -2,6 +2,7 @@ document.addEventListener("DOMContentLoaded", function () { if (!document.querySelector(".manual-list-sorter")) return; const startBtn = document.querySelector("#start"); + const startBtn2 = document.querySelector("#select"); const btn1 = document.querySelector("#sortInto1"); const btn2 = document.querySelector("#sortInto2"); const inputListTextarea = document.querySelector("#input"); @@ -14,6 +15,9 @@ document.addEventListener("DOMContentLoaded", function () { list2 = [], currentIndex; + outputTextarea1.value = ""; + outputTextarea2.value = ""; + startBtn.removeAttribute("disabled"); inputListTextarea.removeAttribute("disabled"); btn1.setAttribute("disabled", "true"); @@ -29,9 +33,11 @@ document.addEventListener("DOMContentLoaded", function () { currentIndex = -1; inputListTextarea.setAttribute("disabled", "true"); startBtn.setAttribute("disabled", "true"); + startBtn2.setAttribute("disabled", "true"); btn1.removeAttribute("disabled"); btn2.removeAttribute("disabled"); wordSpan.innerHTML = inputList[currentIndex]; + document.querySelector("#manualsorting").style.display = "block"; nextItem(); window.onbeforeunload = function () { @@ -52,6 +58,62 @@ document.addEventListener("DOMContentLoaded", function () { nextItem(); }); + startBtn2.addEventListener("click", () => { + if (!inputListTextarea.value) { + alert("No items inserted!"); + } else { + outputTextarea1.value = ""; + outputTextarea2.value = ""; + inputList = inputListTextarea.value.replace(/,\s*$/, "").replaceAll(",,", ",").split(","); + currentIndex = -1; + inputListTextarea.setAttribute("disabled", "true"); + startBtn.setAttribute("disabled", "true"); + startBtn2.setAttribute("disabled", "true"); + btn1.removeAttribute("disabled"); + btn2.removeAttribute("disabled"); + wordSpan.innerHTML = inputList[currentIndex]; + document.querySelector("#selectdone").style.display = "block"; + prepareSelectionMode(); + + window.onbeforeunload = function () { + return "Are you sure you want to navigate away?"; + }; + } + }); + + function prepareSelectionMode() { + let content = ""; + inputList.forEach((listItem) => { + content += "
    " + listItem + "
    "; + }); + document.querySelector("#selects").innerHTML = content; + [...document.querySelectorAll("#selects div")].forEach((btn) => { + btn.addEventListener("click", () => { + if (btn.classList.contains("selected")) { + btn.classList.remove("selected"); + } else { + btn.classList.add("selected"); + } + }); + }); + } + + document.querySelector("#selectdone").addEventListener("click", () => { + list1 = []; + list2 = []; + + [...document.querySelectorAll("#selects div")].forEach((btn) => { + if (btn.classList.contains("selected")) { + list1.push(btn.innerHTML); + } else { + list2.push(btn.innerHTML); + } + }); + + outputTextarea1.value = list1.join(", "); + outputTextarea2.value = list2.join(", "); + }); + function nextItem() { if (currentIndex == inputList.length - 1) { wordSpan.innerHTML = "DONE!"; diff --git a/main.js b/main.js index 63199f6..6443ed0 100644 --- a/main.js +++ b/main.js @@ -26,7 +26,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _css \****************************************/ /***/ (() => { -eval("document.addEventListener(\"DOMContentLoaded\", function () {\r\n if (!document.querySelector(\".manual-list-sorter\")) return;\r\n\r\n const startBtn = document.querySelector(\"#start\");\r\n const btn1 = document.querySelector(\"#sortInto1\");\r\n const btn2 = document.querySelector(\"#sortInto2\");\r\n const inputListTextarea = document.querySelector(\"#input\");\r\n const outputTextarea1 = document.querySelector(\"#output1\");\r\n const outputTextarea2 = document.querySelector(\"#output2\");\r\n const wordSpan = document.querySelector(\"#word\");\r\n\r\n let inputList,\r\n list1 = [],\r\n list2 = [],\r\n currentIndex;\r\n\r\n startBtn.removeAttribute(\"disabled\");\r\n inputListTextarea.removeAttribute(\"disabled\");\r\n btn1.setAttribute(\"disabled\", \"true\");\r\n btn2.setAttribute(\"disabled\", \"true\");\r\n\r\n startBtn.addEventListener(\"click\", () => {\r\n if (!inputListTextarea.value) {\r\n alert(\"No items inserted!\");\r\n } else {\r\n outputTextarea1.value = \"\";\r\n outputTextarea2.value = \"\";\r\n inputList = inputListTextarea.value.replace(/,\\s*$/, \"\").replaceAll(\",,\", \",\").split(\",\");\r\n currentIndex = -1;\r\n inputListTextarea.setAttribute(\"disabled\", \"true\");\r\n startBtn.setAttribute(\"disabled\", \"true\");\r\n btn1.removeAttribute(\"disabled\");\r\n btn2.removeAttribute(\"disabled\");\r\n wordSpan.innerHTML = inputList[currentIndex];\r\n nextItem();\r\n\r\n window.onbeforeunload = function () {\r\n return \"Are you sure you want to navigate away?\";\r\n };\r\n }\r\n });\r\n\r\n btn1.addEventListener(\"click\", () => {\r\n list1.push(inputList[currentIndex]);\r\n outputTextarea1.value = list1.join(\", \");\r\n nextItem();\r\n });\r\n\r\n btn2.addEventListener(\"click\", () => {\r\n list2.push(inputList[currentIndex]);\r\n outputTextarea2.value = list2.join(\", \");\r\n nextItem();\r\n });\r\n\r\n function nextItem() {\r\n if (currentIndex == inputList.length - 1) {\r\n wordSpan.innerHTML = \"DONE!\";\r\n startBtn.removeAttribute(\"disabled\");\r\n inputListTextarea.removeAttribute(\"disabled\");\r\n btn1.setAttribute(\"disabled\", \"true\");\r\n btn2.setAttribute(\"disabled\", \"true\");\r\n } else {\r\n currentIndex++;\r\n wordSpan.innerHTML = inputList[currentIndex];\r\n }\r\n }\r\n});\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/manual-list-sorter.js?"); +eval("document.addEventListener(\"DOMContentLoaded\", function () {\r\n if (!document.querySelector(\".manual-list-sorter\")) return;\r\n\r\n const startBtn = document.querySelector(\"#start\");\r\n const startBtn2 = document.querySelector(\"#select\");\r\n const btn1 = document.querySelector(\"#sortInto1\");\r\n const btn2 = document.querySelector(\"#sortInto2\");\r\n const inputListTextarea = document.querySelector(\"#input\");\r\n const outputTextarea1 = document.querySelector(\"#output1\");\r\n const outputTextarea2 = document.querySelector(\"#output2\");\r\n const wordSpan = document.querySelector(\"#word\");\r\n\r\n let inputList,\r\n list1 = [],\r\n list2 = [],\r\n currentIndex;\r\n\r\n outputTextarea1.value = \"\";\r\n outputTextarea2.value = \"\";\r\n\r\n startBtn.removeAttribute(\"disabled\");\r\n inputListTextarea.removeAttribute(\"disabled\");\r\n btn1.setAttribute(\"disabled\", \"true\");\r\n btn2.setAttribute(\"disabled\", \"true\");\r\n\r\n startBtn.addEventListener(\"click\", () => {\r\n if (!inputListTextarea.value) {\r\n alert(\"No items inserted!\");\r\n } else {\r\n outputTextarea1.value = \"\";\r\n outputTextarea2.value = \"\";\r\n inputList = inputListTextarea.value.replace(/,\\s*$/, \"\").replaceAll(\",,\", \",\").split(\",\");\r\n currentIndex = -1;\r\n inputListTextarea.setAttribute(\"disabled\", \"true\");\r\n startBtn.setAttribute(\"disabled\", \"true\");\r\n startBtn2.setAttribute(\"disabled\", \"true\");\r\n btn1.removeAttribute(\"disabled\");\r\n btn2.removeAttribute(\"disabled\");\r\n wordSpan.innerHTML = inputList[currentIndex];\r\n document.querySelector(\"#manualsorting\").style.display = \"block\";\r\n nextItem();\r\n\r\n window.onbeforeunload = function () {\r\n return \"Are you sure you want to navigate away?\";\r\n };\r\n }\r\n });\r\n\r\n btn1.addEventListener(\"click\", () => {\r\n list1.push(inputList[currentIndex]);\r\n outputTextarea1.value = list1.join(\", \");\r\n nextItem();\r\n });\r\n\r\n btn2.addEventListener(\"click\", () => {\r\n list2.push(inputList[currentIndex]);\r\n outputTextarea2.value = list2.join(\", \");\r\n nextItem();\r\n });\r\n\r\n startBtn2.addEventListener(\"click\", () => {\r\n if (!inputListTextarea.value) {\r\n alert(\"No items inserted!\");\r\n } else {\r\n outputTextarea1.value = \"\";\r\n outputTextarea2.value = \"\";\r\n inputList = inputListTextarea.value.replace(/,\\s*$/, \"\").replaceAll(\",,\", \",\").split(\",\");\r\n currentIndex = -1;\r\n inputListTextarea.setAttribute(\"disabled\", \"true\");\r\n startBtn.setAttribute(\"disabled\", \"true\");\r\n startBtn2.setAttribute(\"disabled\", \"true\");\r\n btn1.removeAttribute(\"disabled\");\r\n btn2.removeAttribute(\"disabled\");\r\n wordSpan.innerHTML = inputList[currentIndex];\r\n document.querySelector(\"#selectdone\").style.display = \"block\";\r\n prepareSelectionMode();\r\n\r\n window.onbeforeunload = function () {\r\n return \"Are you sure you want to navigate away?\";\r\n };\r\n }\r\n });\r\n\r\n function prepareSelectionMode() {\r\n let content = \"\";\r\n inputList.forEach((listItem) => {\r\n content += \"
    \" + listItem + \"
    \";\r\n });\r\n document.querySelector(\"#selects\").innerHTML = content;\r\n [...document.querySelectorAll(\"#selects div\")].forEach((btn) => {\r\n btn.addEventListener(\"click\", () => {\r\n if (btn.classList.contains(\"selected\")) {\r\n btn.classList.remove(\"selected\");\r\n } else {\r\n btn.classList.add(\"selected\");\r\n }\r\n });\r\n });\r\n }\r\n\r\n document.querySelector(\"#selectdone\").addEventListener(\"click\", () => {\r\n list1 = [];\r\n list2 = [];\r\n\r\n [...document.querySelectorAll(\"#selects div\")].forEach((btn) => {\r\n if (btn.classList.contains(\"selected\")) {\r\n list1.push(btn.innerHTML);\r\n } else {\r\n list2.push(btn.innerHTML);\r\n }\r\n });\r\n\r\n outputTextarea1.value = list1.join(\", \");\r\n outputTextarea2.value = list2.join(\", \");\r\n });\r\n\r\n function nextItem() {\r\n if (currentIndex == inputList.length - 1) {\r\n wordSpan.innerHTML = \"DONE!\";\r\n startBtn.removeAttribute(\"disabled\");\r\n inputListTextarea.removeAttribute(\"disabled\");\r\n btn1.setAttribute(\"disabled\", \"true\");\r\n btn2.setAttribute(\"disabled\", \"true\");\r\n } else {\r\n currentIndex++;\r\n wordSpan.innerHTML = inputList[currentIndex];\r\n }\r\n }\r\n});\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/manual-list-sorter.js?"); /***/ }), @@ -87,7 +87,7 @@ eval("document.addEventListener(\"DOMContentLoaded\", function () {\r\n if (!do /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.tumblr-tag-list-tool span {\n display: block;\n margin-top: 30px;\n}\n.tumblr-tag-list-tool label {\n width: 100%;\n display: block;\n margin-top: 10px;\n}\n.tumblr-tag-list-tool #warning {\n color: red;\n line-height: 1;\n font-size: 0.85em;\n}\n.tumblr-tag-list-tool #output {\n padding: 20px;\n border: 2px solid lightgray;\n border-radius: 8px;\n max-height: 85vh;\n overflow-y: auto;\n margin-top: 1em;\n}\n.tumblr-tag-list-tool #output,\n.tumblr-tag-list-tool #output * {\n user-select: auto;\n}\n.tumblr-tag-list-tool #output:empty {\n display: none;\n}\n.tumblr-tag-list-tool #output a {\n color: currentColor !important;\n background: none !important;\n animation: none !important;\n transition: none !important;\n transform: none !important;\n text-decoration: underline;\n}\n.tumblr-tag-list-tool #output a:hover, .tumblr-tag-list-tool #output a:focus {\n text-decoration: none;\n}\n.tumblr-tag-list-tool .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n\n.notion-widgets button,\n.notion-widgets input[type=text],\n.notion-widgets input[type=number],\n.notion-widgets input[type=color],\n.notion-widgets textarea,\n.notion-widgets select {\n font-family: \"Mukta\", sans-serif;\n font-size: 16px;\n line-height: 1.75;\n background: #eee4e4;\n border: 1px solid rgb(137, 137, 137);\n padding: 5px 15px;\n margin-bottom: 0.5em;\n}\n@media (min-width: 1000px) {\n .notion-widgets button,\n .notion-widgets input[type=text],\n .notion-widgets input[type=number],\n .notion-widgets input[type=color],\n .notion-widgets textarea,\n .notion-widgets select {\n font-size: 22px;\n }\n}\n.notion-widgets button:focus,\n.notion-widgets input[type=text]:focus,\n.notion-widgets input[type=number]:focus,\n.notion-widgets input[type=color]:focus,\n.notion-widgets textarea:focus,\n.notion-widgets select:focus {\n outline: none;\n border: 1px solid black;\n}\n.notion-widgets input[type=text] {\n margin-top: 10px;\n width: 100%;\n}\n.notion-widgets textarea {\n width: 100%;\n min-height: 150px;\n}\n.notion-widgets h1:not(:first-child) {\n margin-top: 10vh;\n}\n.notion-widgets h2 {\n margin-top: 0;\n margin-bottom: 0.5em;\n}\n.notion-widgets span {\n display: block;\n}\n.notion-widgets label {\n width: 100%;\n display: block;\n}\n.notion-widgets input[type=radio],\n.notion-widgets input[type=checkbox] {\n filter: saturate(0) brightness(0.9);\n}\n.notion-widgets #output {\n padding: 10px;\n border: 2px solid lightgray;\n max-height: 85vh;\n overflow-y: auto;\n}\n.notion-widgets #output:empty {\n display: none;\n}\n.notion-widgets .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n.notion-widgets iframe {\n width: 100%;\n border: 1px solid rgb(137, 137, 137);\n margin-bottom: 1em;\n}\n.notion-widgets section {\n display: flex;\n gap: 30px;\n}\n.notion-widgets section > * {\n flex: 0 0 50%;\n}\n.notion-widgets .output {\n font-size: 0.85em;\n}\n\n@media (prefers-color-scheme: dark) {\n .notion-widgets input[type=text],\n .notion-widgets input[type=number],\n .notion-widgets input[type=color],\n .notion-widgets textarea,\n .notion-widgets button,\n .notion-widgets select {\n color: rgb(190, 188, 195);\n background: rgb(42, 42, 44);\n border-color: rgb(42, 42, 44);\n }\n .notion-widgets input[type=text]:focus,\n .notion-widgets input[type=number]:focus,\n .notion-widgets input[type=color]:focus,\n .notion-widgets textarea:focus,\n .notion-widgets button:focus,\n .notion-widgets select:focus {\n border-color: #f4ecec;\n }\n .notion-widgets input[type=checkbox] {\n filter: invert(1) saturate(0);\n }\n .notion-widgets button:hover, .notion-widgets button:focus {\n filter: brightness(0.8);\n }\n .notion-widgets iframe {\n border: 2px solid white;\n }\n}\n.notion-widget {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n overflow: hidden;\n background-color: white !important;\n}\n.notion-widget.dark-mode {\n background-color: rgb(25, 25, 25) !important;\n}\n.notion-widget > * {\n width: 100%;\n}\n.notion-widget > *.centered {\n display: flex;\n justify-content: center;\n}\n.notion-widget > *.centered #text {\n text-align: center;\n}\n.notion-widget #text {\n display: inline-block;\n letter-spacing: 0;\n}\n\n@media (prefers-color-scheme: dark) {\n .notion-widget {\n background-color: white !important;\n }\n .notion-widget.dark-mode {\n background-color: rgb(25, 25, 25) !important;\n }\n}\n.pinterest-board h1:not(:first-child) {\n margin-top: 10vh;\n}\n.pinterest-board h2 {\n font-size: 2em;\n margin-top: 0;\n margin-bottom: 0;\n}\n.pinterest-board span {\n display: block;\n}\n.pinterest-board label {\n width: 100%;\n display: block;\n}\n.pinterest-board #output {\n padding: 10px;\n border: 2px solid lightgray;\n max-height: 85vh;\n overflow-y: auto;\n}\n.pinterest-board #output:empty {\n display: none;\n}\n.pinterest-board .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n.pinterest-board iframe {\n width: 100%;\n border: 1px solid rgb(137, 137, 137);\n border-radius: 8px;\n margin-bottom: 1em;\n height: 500px;\n}\n.pinterest-board .output,\n.pinterest-board .outputNotion {\n font-size: 0.85em;\n min-height: 2em;\n}\n@media (max-width: 900px) {\n .pinterest-board .output,\n .pinterest-board .outputNotion {\n min-height: 6em;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n .pinterest-board iframe {\n border: 2px solid white;\n }\n}\n.manual-list-sorter #word {\n font-size: 1.5em;\n}\n@media (min-width: 500px) {\n .manual-list-sorter .two-lists {\n display: flex;\n }\n .manual-list-sorter .two-lists textarea:first-child {\n margin-right: 0.5em;\n }\n .manual-list-sorter .two-lists textarea:last-child {\n margin-left: 0.5em;\n }\n .manual-list-sorter #word {\n font-size: 3em;\n }\n}\n@media (max-width: 900px) {\n .manual-list-sorter #word ~ button:last-child {\n margin-top: 0;\n }\n}\n\n* {\n font-family: \"Noto Sans Mono\", \"Consolas\", \"SF Mono\", monospace;\n box-sizing: border-box;\n color: #2f283c;\n}\n\nh1,\nh2 {\n user-select: none;\n}\n\nbody {\n padding: 10px;\n font-size: 16px;\n line-height: 1.5;\n display: flex;\n justify-content: center;\n background: #f8f2f2;\n}\n@media (min-width: 1000px) {\n body {\n font-size: 19px;\n line-height: 1.7;\n }\n}\n\na, a small, a:visited, a:visited small {\n color: #084a90;\n text-decoration: none;\n display: inline-block;\n transition: transform 0.3s ease;\n}\n@media (max-width: 900px) {\n a, a small, a:visited, a:visited small {\n display: inline;\n }\n}\na:hover, a:hover small, a:focus, a:focus small {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.03) rotate(-1deg);\n}\n\n@keyframes rainbow_animation {\n 0%, 100% {\n background-position: 0 0;\n }\n 50% {\n background-position: 100% 0;\n }\n}\n::selection {\n background: #1d5999;\n}\n\nmain {\n width: 95%;\n max-width: 880px;\n}\n@media (min-width: 1000px) {\n main {\n width: 90%;\n padding-top: 10vh;\n padding-bottom: 10vh;\n }\n}\n@media (min-width: 1000px) and (max-height: 800px) {\n main {\n padding-top: 5vh;\n padding-bottom: 5vh;\n }\n}\n\np {\n margin: 0.5em 0;\n text-align: justify;\n}\n\nul {\n margin: 0.5em 0;\n padding-left: 1.1em;\n}\n\nli {\n margin: 0.3em 0;\n}\nli .md {\n vertical-align: middle;\n}\n\nh1 {\n letter-spacing: 4px;\n}\n\nh1,\nh2 {\n margin-bottom: 0;\n line-height: 1.5;\n}\n\nh2 {\n margin-top: 1.5em;\n font-size: 20px;\n}\n@media (min-width: 1000px) {\n h2 {\n font-size: 28px;\n }\n}\n\nsmall {\n font-size: 0.75em;\n}\n\nhr {\n border: 0;\n height: 1px;\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0), currentColor, rgba(0, 0, 0, 0));\n margin: 1em 0;\n}\n\n.cursor {\n animation: blink 1s step-start 0s infinite;\n}\n\n.md.hydrated {\n font-size: 1.1em;\n transform: translateX(-5px);\n}\n\n@keyframes blink {\n 50% {\n opacity: 0;\n }\n}\n.back-link {\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n line-height: 1;\n}\n.back-link a {\n display: block;\n text-decoration: none;\n color: #251d35;\n padding: 15px;\n font-size: 32px;\n text-decoration: none;\n transition: 0.3s ease;\n}\n@media (max-width: 900px) {\n .back-link a {\n padding: 10px;\n font-size: 24px;\n }\n}\n.back-link a:hover, .back-link a:focus {\n text-decoration: none;\n color: #251d35;\n transform: scale(1.5) rotate(20deg);\n}\n\n/*\n\tFORM\n*/\nbutton,\ninput[type=text],\ninput[type=number],\ninput[type=color],\ntextarea,\nselect {\n font-size: 1em;\n line-height: 1.75;\n background: #eee4e4;\n border: 1px solid rgb(137, 137, 137);\n padding: 5px 15px;\n border-radius: 8px;\n transition: 0.4s ease;\n}\nbutton:focus,\ninput[type=text]:focus,\ninput[type=number]:focus,\ninput[type=color]:focus,\ntextarea:focus,\nselect:focus {\n outline: none;\n border: 1px solid black;\n}\n\nlabel {\n cursor: pointer;\n}\n\ninput[type=text] {\n margin-top: 10px;\n width: 100%;\n}\n\ninput[type=radio],\ninput[type=checkbox] {\n filter: saturate(0) brightness(0.9);\n}\n\ntextarea {\n width: 100%;\n margin: 10px 0;\n min-height: 250px;\n}\n\nbutton {\n margin: 20px 0;\n cursor: pointer;\n transition: 0.4s ease;\n font-size: 1.1em;\n}\nbutton span {\n display: inline-block;\n margin: 0 !important;\n transition: transform 0.4s ease;\n}\nbutton:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\nbutton:not([disabled]):hover, button:not([disabled]):focus {\n filter: brightness(0.95);\n outline: none;\n border: 1px solid black;\n}\nbutton:not([disabled]):hover span, button:not([disabled]):focus span {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.04) rotate(-2deg);\n}\nbutton:not([disabled]):hover span {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.03) rotate(-1deg);\n}\nbutton:not([disabled]):active {\n transform: scale(0.9);\n}\n\n/*\n\tDARK SCHEME\n*/\nbody {\n background: rgb(12, 11, 14);\n}\n\n* {\n color: rgb(168, 166, 172);\n}\n\na, a small, a:visited, a:visited small {\n color: #578adb;\n}\na:hover, a:hover small, a:focus, a:focus small {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n}\n\n::selection {\n background: #3b609c;\n}\n\n.back-link a {\n color: rgb(190, 188, 195);\n}\n.back-link a:hover, .back-link a:focus {\n color: rgb(190, 188, 195);\n}\n\nbutton,\ninput[type=text],\ninput[type=number],\ninput[type=color],\ntextarea,\nselect {\n color: rgb(190, 188, 195);\n background: rgb(42, 42, 44);\n border-color: rgb(42, 42, 44);\n}\nbutton:focus,\ninput[type=text]:focus,\ninput[type=number]:focus,\ninput[type=color]:focus,\ntextarea:focus,\nselect:focus {\n border-color: #f4ecec;\n}\n\ninput[type=radio],\ninput[type=checkbox] {\n filter: invert(1) saturate(0);\n}\n\nbutton:not([disabled]):hover, button:not([disabled]):focus {\n filter: brightness(0.8);\n border-color: #f4ecec;\n}`, \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://petracoding-github-io/./css/main.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.tumblr-tag-list-tool span {\n display: block;\n margin-top: 30px;\n}\n.tumblr-tag-list-tool label {\n width: 100%;\n display: block;\n margin-top: 10px;\n}\n.tumblr-tag-list-tool #warning {\n color: red;\n line-height: 1;\n font-size: 0.85em;\n}\n.tumblr-tag-list-tool #output {\n padding: 20px;\n border: 2px solid lightgray;\n border-radius: 8px;\n max-height: 85vh;\n overflow-y: auto;\n margin-top: 1em;\n}\n.tumblr-tag-list-tool #output,\n.tumblr-tag-list-tool #output * {\n user-select: auto;\n}\n.tumblr-tag-list-tool #output:empty {\n display: none;\n}\n.tumblr-tag-list-tool #output a {\n color: currentColor !important;\n background: none !important;\n animation: none !important;\n transition: none !important;\n transform: none !important;\n text-decoration: underline;\n}\n.tumblr-tag-list-tool #output a:hover, .tumblr-tag-list-tool #output a:focus {\n text-decoration: none;\n}\n.tumblr-tag-list-tool .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n\n.notion-widgets button,\n.notion-widgets input[type=text],\n.notion-widgets input[type=number],\n.notion-widgets input[type=color],\n.notion-widgets textarea,\n.notion-widgets select {\n font-family: \"Mukta\", sans-serif;\n font-size: 16px;\n line-height: 1.75;\n background: #eee4e4;\n border: 1px solid rgb(137, 137, 137);\n padding: 5px 15px;\n margin-bottom: 0.5em;\n}\n@media (min-width: 1000px) {\n .notion-widgets button,\n .notion-widgets input[type=text],\n .notion-widgets input[type=number],\n .notion-widgets input[type=color],\n .notion-widgets textarea,\n .notion-widgets select {\n font-size: 22px;\n }\n}\n.notion-widgets button:focus,\n.notion-widgets input[type=text]:focus,\n.notion-widgets input[type=number]:focus,\n.notion-widgets input[type=color]:focus,\n.notion-widgets textarea:focus,\n.notion-widgets select:focus {\n outline: none;\n border: 1px solid black;\n}\n.notion-widgets input[type=text] {\n margin-top: 10px;\n width: 100%;\n}\n.notion-widgets textarea {\n width: 100%;\n min-height: 150px;\n}\n.notion-widgets h1:not(:first-child) {\n margin-top: 10vh;\n}\n.notion-widgets h2 {\n margin-top: 0;\n margin-bottom: 0.5em;\n}\n.notion-widgets span {\n display: block;\n}\n.notion-widgets label {\n width: 100%;\n display: block;\n}\n.notion-widgets input[type=radio],\n.notion-widgets input[type=checkbox] {\n filter: saturate(0) brightness(0.9);\n}\n.notion-widgets #output {\n padding: 10px;\n border: 2px solid lightgray;\n max-height: 85vh;\n overflow-y: auto;\n}\n.notion-widgets #output:empty {\n display: none;\n}\n.notion-widgets .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n.notion-widgets iframe {\n width: 100%;\n border: 1px solid rgb(137, 137, 137);\n margin-bottom: 1em;\n}\n.notion-widgets section {\n display: flex;\n gap: 30px;\n}\n.notion-widgets section > * {\n flex: 0 0 50%;\n}\n.notion-widgets .output {\n font-size: 0.85em;\n}\n\n@media (prefers-color-scheme: dark) {\n .notion-widgets input[type=text],\n .notion-widgets input[type=number],\n .notion-widgets input[type=color],\n .notion-widgets textarea,\n .notion-widgets button,\n .notion-widgets select {\n color: rgb(190, 188, 195);\n background: rgb(42, 42, 44);\n border-color: rgb(42, 42, 44);\n }\n .notion-widgets input[type=text]:focus,\n .notion-widgets input[type=number]:focus,\n .notion-widgets input[type=color]:focus,\n .notion-widgets textarea:focus,\n .notion-widgets button:focus,\n .notion-widgets select:focus {\n border-color: #f4ecec;\n }\n .notion-widgets input[type=checkbox] {\n filter: invert(1) saturate(0);\n }\n .notion-widgets button:hover, .notion-widgets button:focus {\n filter: brightness(0.8);\n }\n .notion-widgets iframe {\n border: 2px solid white;\n }\n}\n.notion-widget {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n overflow: hidden;\n background-color: white !important;\n}\n.notion-widget.dark-mode {\n background-color: rgb(25, 25, 25) !important;\n}\n.notion-widget > * {\n width: 100%;\n}\n.notion-widget > *.centered {\n display: flex;\n justify-content: center;\n}\n.notion-widget > *.centered #text {\n text-align: center;\n}\n.notion-widget #text {\n display: inline-block;\n letter-spacing: 0;\n}\n\n@media (prefers-color-scheme: dark) {\n .notion-widget {\n background-color: white !important;\n }\n .notion-widget.dark-mode {\n background-color: rgb(25, 25, 25) !important;\n }\n}\n.pinterest-board h1:not(:first-child) {\n margin-top: 10vh;\n}\n.pinterest-board h2 {\n font-size: 2em;\n margin-top: 0;\n margin-bottom: 0;\n}\n.pinterest-board span {\n display: block;\n}\n.pinterest-board label {\n width: 100%;\n display: block;\n}\n.pinterest-board #output {\n padding: 10px;\n border: 2px solid lightgray;\n max-height: 85vh;\n overflow-y: auto;\n}\n.pinterest-board #output:empty {\n display: none;\n}\n.pinterest-board .wrap {\n margin-left: 30px;\n margin-bottom: 20px;\n}\n.pinterest-board iframe {\n width: 100%;\n border: 1px solid rgb(137, 137, 137);\n border-radius: 8px;\n margin-bottom: 1em;\n height: 500px;\n}\n.pinterest-board .output,\n.pinterest-board .outputNotion {\n font-size: 0.85em;\n min-height: 2em;\n}\n@media (max-width: 900px) {\n .pinterest-board .output,\n .pinterest-board .outputNotion {\n min-height: 6em;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n .pinterest-board iframe {\n border: 2px solid white;\n }\n}\n.manual-list-sorter #word {\n font-size: 1.5em;\n}\n.manual-list-sorter #selects {\n display: flex;\n flex-wrap: wrap;\n user-select: none;\n}\n.manual-list-sorter #selects div {\n padding: 5px 10px;\n cursor: pointer;\n border-radius: 10px;\n}\n.manual-list-sorter #selects div:hover {\n background: rgba(255, 255, 255, 0.07);\n}\n.manual-list-sorter #selects div.selected {\n background: rgba(255, 255, 255, 0.2);\n}\n@media (min-width: 500px) {\n .manual-list-sorter .two-lists {\n display: flex;\n }\n .manual-list-sorter .two-lists textarea:first-child {\n margin-right: 0.5em;\n }\n .manual-list-sorter .two-lists textarea:last-child {\n margin-left: 0.5em;\n }\n .manual-list-sorter #word {\n font-size: 3em;\n }\n}\n@media (max-width: 900px) {\n .manual-list-sorter #word ~ button:last-child {\n margin-top: 0;\n }\n}\n\n* {\n font-family: \"Noto Sans Mono\", \"Consolas\", \"SF Mono\", monospace;\n box-sizing: border-box;\n color: #2f283c;\n}\n\nh1,\nh2 {\n user-select: none;\n}\n\nbody {\n padding: 10px;\n font-size: 16px;\n line-height: 1.5;\n display: flex;\n justify-content: center;\n background: #f8f2f2;\n}\n@media (min-width: 1000px) {\n body {\n font-size: 19px;\n line-height: 1.7;\n }\n}\n\na, a small, a:visited, a:visited small {\n color: #084a90;\n text-decoration: none;\n display: inline-block;\n transition: transform 0.3s ease;\n}\n@media (max-width: 900px) {\n a, a small, a:visited, a:visited small {\n display: inline;\n }\n}\na:hover, a:hover small, a:focus, a:focus small {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.03) rotate(-1deg);\n}\n\n@keyframes rainbow_animation {\n 0%, 100% {\n background-position: 0 0;\n }\n 50% {\n background-position: 100% 0;\n }\n}\n::selection {\n background: #1d5999;\n}\n\nmain {\n width: 95%;\n max-width: 880px;\n}\n@media (min-width: 1000px) {\n main {\n width: 90%;\n padding-top: 10vh;\n padding-bottom: 10vh;\n }\n}\n@media (min-width: 1000px) and (max-height: 800px) {\n main {\n padding-top: 5vh;\n padding-bottom: 5vh;\n }\n}\n\np {\n margin: 0.5em 0;\n text-align: justify;\n}\n\nul {\n margin: 0.5em 0;\n padding-left: 1.1em;\n}\n\nli {\n margin: 0.3em 0;\n}\nli .md {\n vertical-align: middle;\n}\n\nh1 {\n letter-spacing: 4px;\n}\n\nh1,\nh2 {\n margin-bottom: 0;\n line-height: 1.5;\n}\n\nh2 {\n margin-top: 1.5em;\n font-size: 20px;\n}\n@media (min-width: 1000px) {\n h2 {\n font-size: 28px;\n }\n}\n\nsmall {\n font-size: 0.75em;\n}\n\nhr {\n border: 0;\n height: 1px;\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0), currentColor, rgba(0, 0, 0, 0));\n margin: 1em 0;\n}\n\n.cursor {\n animation: blink 1s step-start 0s infinite;\n}\n\n.md.hydrated {\n font-size: 1.1em;\n transform: translateX(-5px);\n}\n\n@keyframes blink {\n 50% {\n opacity: 0;\n }\n}\n.back-link {\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n line-height: 1;\n}\n.back-link a {\n display: block;\n text-decoration: none;\n color: #251d35;\n padding: 15px;\n font-size: 32px;\n text-decoration: none;\n transition: 0.3s ease;\n}\n@media (max-width: 900px) {\n .back-link a {\n padding: 10px;\n font-size: 24px;\n }\n}\n.back-link a:hover, .back-link a:focus {\n text-decoration: none;\n color: #251d35;\n transform: scale(1.5) rotate(20deg);\n}\n\n/*\n\tFORM\n*/\nbutton,\ninput[type=text],\ninput[type=number],\ninput[type=color],\ntextarea,\nselect {\n font-size: 1em;\n line-height: 1.75;\n background: #eee4e4;\n border: 1px solid rgb(137, 137, 137);\n padding: 5px 15px;\n border-radius: 8px;\n transition: 0.4s ease;\n}\nbutton:focus,\ninput[type=text]:focus,\ninput[type=number]:focus,\ninput[type=color]:focus,\ntextarea:focus,\nselect:focus {\n outline: none;\n border: 1px solid black;\n}\n\nlabel {\n cursor: pointer;\n}\n\ninput[type=text] {\n margin-top: 10px;\n width: 100%;\n}\n\ninput[type=radio],\ninput[type=checkbox] {\n filter: saturate(0) brightness(0.9);\n}\n\ntextarea {\n width: 100%;\n margin: 10px 0;\n min-height: 250px;\n}\n\nbutton {\n margin: 20px 0;\n cursor: pointer;\n transition: 0.4s ease;\n font-size: 1.1em;\n}\nbutton span {\n display: inline-block;\n margin: 0 !important;\n transition: transform 0.4s ease;\n}\nbutton:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\nbutton:not([disabled]):hover, button:not([disabled]):focus {\n filter: brightness(0.95);\n outline: none;\n border: 1px solid black;\n}\nbutton:not([disabled]):hover span, button:not([disabled]):focus span {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.04) rotate(-2deg);\n}\nbutton:not([disabled]):hover span {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n transform: scale(1.03) rotate(-1deg);\n}\nbutton:not([disabled]):active {\n transform: scale(0.9);\n}\n\n/*\n\tDARK SCHEME\n*/\nbody {\n background: rgb(12, 11, 14);\n}\n\n* {\n color: rgb(168, 166, 172);\n}\n\na, a small, a:visited, a:visited small {\n color: #578adb;\n}\na:hover, a:hover small, a:focus, a:focus small {\n background: linear-gradient(to right, #0099ff, #00ff00, #ff3399, #6666ff);\n background-clip: text;\n color: transparent;\n animation: rainbow_animation 1.5s ease-in-out infinite;\n background-size: 400% 100%;\n text-decoration-style: wavy;\n}\n\n::selection {\n background: #3b609c;\n}\n\n.back-link a {\n color: rgb(190, 188, 195);\n}\n.back-link a:hover, .back-link a:focus {\n color: rgb(190, 188, 195);\n}\n\nbutton,\ninput[type=text],\ninput[type=number],\ninput[type=color],\ntextarea,\nselect {\n color: rgb(190, 188, 195);\n background: rgb(42, 42, 44);\n border-color: rgb(42, 42, 44);\n}\nbutton:focus,\ninput[type=text]:focus,\ninput[type=number]:focus,\ninput[type=color]:focus,\ntextarea:focus,\nselect:focus {\n border-color: #f4ecec;\n}\n\ninput[type=radio],\ninput[type=checkbox] {\n filter: invert(1) saturate(0);\n}\n\nbutton:not([disabled]):hover, button:not([disabled]):focus {\n filter: brightness(0.8);\n border-color: #f4ecec;\n}`, \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://petracoding-github-io/./css/main.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js"); /***/ }), diff --git a/manual-list-sorter.html b/manual-list-sorter.html index 2c43f4c..990da30 100644 --- a/manual-list-sorter.html +++ b/manual-list-sorter.html @@ -16,24 +16,30 @@

    Manual List Sorter Tool

    -

    This is a little tool to easily create tag lists you can share anywhere.


    Insert your comma-seperated list here:

    - + choose a mode to start: + + or + + +

    -
    - click start to start + + +

    Here are your two lists:

    From a86e2456720f16b83e91d323185b34fc7cec2ae0 Mon Sep 17 00:00:00 2001 From: petracoding Date: Mon, 30 Dec 2024 10:13:00 +0100 Subject: [PATCH 20/26] Hide footer feature for pinterest board widget --- js/pages/pinterest-board.js | 3 +++ main.js | 2 +- pinterest/board.html | 11 +++++++++++ pinterest/index.html | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/js/pages/pinterest-board.js b/js/pages/pinterest-board.js index 1461e7c..e887ac0 100644 --- a/js/pages/pinterest-board.js +++ b/js/pages/pinterest-board.js @@ -6,6 +6,7 @@ document.addEventListener("DOMContentLoaded", function () { buildURL(); document.querySelector("#your-link").addEventListener("input", buildURL); document.querySelector("#hide-header").addEventListener("input", buildURL); + document.querySelector("#hide-footer").addEventListener("input", buildURL); document.querySelector("#transparent-bg").addEventListener("input", buildURL); } }); @@ -21,6 +22,8 @@ function buildURL() { url += "?link=" + cleanPinterestUrl(link); const hideHeader = document.querySelector("#hide-header").checked; url += "&hideHeader=" + (hideHeader ? "1" : "0"); + const hideFooter = document.querySelector("#hide-footer").checked; + url += "&hideFooter=" + (hideFooter ? "1" : "0"); const transparent = document.querySelector("#transparent-bg").checked; url += "&transparent=" + (transparent ? "1" : "0"); document.querySelector("iframe").setAttribute("src", url); diff --git a/main.js b/main.js index 6443ed0..8932c00 100644 --- a/main.js +++ b/main.js @@ -56,7 +56,7 @@ eval("const isLocal = window.location.hostname == \"localhost\";\r\nconst urlBas \*************************************/ /***/ (() => { -eval("const isLocal = window.location.hostname == \"localhost\";\r\nconst urlBase = isLocal ? \"http://localhost:52330/pinterest/board.html\" : \"https://petracoding.github.io/pinterest/board.html\";\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function () {\r\n if (document.querySelector(\".pinterest-board\")) {\r\n buildURL();\r\n document.querySelector(\"#your-link\").addEventListener(\"input\", buildURL);\r\n document.querySelector(\"#hide-header\").addEventListener(\"input\", buildURL);\r\n document.querySelector(\"#transparent-bg\").addEventListener(\"input\", buildURL);\r\n }\r\n});\r\n\r\nfunction buildURL() {\r\n let url = urlBase;\r\n const link = document.querySelector(\"#your-link\").value;\r\n if (!link) {\r\n document.querySelector(\".output\").value = \"\";\r\n document.querySelector(\".outputNotion\").value = \"\";\r\n document.querySelector(\"iframe\").setAttribute(\"src\", \"\");\r\n } else {\r\n url += \"?link=\" + cleanPinterestUrl(link);\r\n const hideHeader = document.querySelector(\"#hide-header\").checked;\r\n url += \"&hideHeader=\" + (hideHeader ? \"1\" : \"0\");\r\n const transparent = document.querySelector(\"#transparent-bg\").checked;\r\n url += \"&transparent=\" + (transparent ? \"1\" : \"0\");\r\n document.querySelector(\"iframe\").setAttribute(\"src\", url);\r\n\r\n const output = ``;\r\n document.querySelector(\".output\").value = output;\r\n document.querySelector(\".outputNotion\").value = url;\r\n }\r\n}\r\n\r\nfunction cleanPinterestUrl(link) {\r\n const i = getPosition(link, \"/\", 3);\r\n return link.substr(i).substr(1);\r\n}\r\n\r\nfunction getPosition(string, subString, index) {\r\n return string.split(subString, index).join(subString).length;\r\n}\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/pinterest-board.js?"); +eval("const isLocal = window.location.hostname == \"localhost\";\r\nconst urlBase = isLocal ? \"http://localhost:52330/pinterest/board.html\" : \"https://petracoding.github.io/pinterest/board.html\";\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function () {\r\n if (document.querySelector(\".pinterest-board\")) {\r\n buildURL();\r\n document.querySelector(\"#your-link\").addEventListener(\"input\", buildURL);\r\n document.querySelector(\"#hide-header\").addEventListener(\"input\", buildURL);\r\n document.querySelector(\"#hide-footer\").addEventListener(\"input\", buildURL);\r\n document.querySelector(\"#transparent-bg\").addEventListener(\"input\", buildURL);\r\n }\r\n});\r\n\r\nfunction buildURL() {\r\n let url = urlBase;\r\n const link = document.querySelector(\"#your-link\").value;\r\n if (!link) {\r\n document.querySelector(\".output\").value = \"\";\r\n document.querySelector(\".outputNotion\").value = \"\";\r\n document.querySelector(\"iframe\").setAttribute(\"src\", \"\");\r\n } else {\r\n url += \"?link=\" + cleanPinterestUrl(link);\r\n const hideHeader = document.querySelector(\"#hide-header\").checked;\r\n url += \"&hideHeader=\" + (hideHeader ? \"1\" : \"0\");\r\n const hideFooter = document.querySelector(\"#hide-footer\").checked;\r\n url += \"&hideFooter=\" + (hideFooter ? \"1\" : \"0\");\r\n const transparent = document.querySelector(\"#transparent-bg\").checked;\r\n url += \"&transparent=\" + (transparent ? \"1\" : \"0\");\r\n document.querySelector(\"iframe\").setAttribute(\"src\", url);\r\n\r\n const output = ``;\r\n document.querySelector(\".output\").value = output;\r\n document.querySelector(\".outputNotion\").value = url;\r\n }\r\n}\r\n\r\nfunction cleanPinterestUrl(link) {\r\n const i = getPosition(link, \"/\", 3);\r\n return link.substr(i).substr(1);\r\n}\r\n\r\nfunction getPosition(string, subString, index) {\r\n return string.split(subString, index).join(subString).length;\r\n}\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/pinterest-board.js?"); /***/ }), diff --git a/pinterest/board.html b/pinterest/board.html index 5aa114f..e089b53 100644 --- a/pinterest/board.html +++ b/pinterest/board.html @@ -31,6 +31,7 @@ + diff --git a/pinterest/index.html b/pinterest/index.html index be3afba..299975a 100644 --- a/pinterest/index.html +++ b/pinterest/index.html @@ -2,7 +2,7 @@ Pinterest Board iFrame - + From b5e2f06849f21b45644284e2c54989917218dac9 Mon Sep 17 00:00:00 2001 From: petracoding Date: Thu, 30 Jan 2025 19:10:18 +0100 Subject: [PATCH 22/26] better bullet points --- js/pages/notion-to-quizlet.js | 11 ++++++----- main.js | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/js/pages/notion-to-quizlet.js b/js/pages/notion-to-quizlet.js index 49f4f5b..28e4166 100644 --- a/js/pages/notion-to-quizlet.js +++ b/js/pages/notion-to-quizlet.js @@ -18,15 +18,16 @@ document.addEventListener("DOMContentLoaded", function () { }); function generateOutput1(input) { + const bulletPoints = ["■", "✦", "✧", "●", "⬥"]; const output = input .replaceAll(/\*\*(.+)\*\*/g, "$1") // remove bold .replaceAll(/\*(.+)\*/g, "$1") // remove italic .replaceAll(/\s+!\[.*\]\(.*\)\s+/g, "\n") // remove images - .replaceAll(" -", " ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍‍ ‍ ‍✧") // level 5 - .replaceAll(" -", " ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍‍ ‍ ‍⬥") // level 4 - .replaceAll(" -", " ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍■") // level 3 - .replaceAll(" -", " ‍ ‍‍ ‍ ‍‍ ‍ ‍ ✦") // level 2 - .replaceAll("- ", "● "); // level 1 + .replaceAll(" -", " ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍ ‍ ‍‍ ‍‍ ‍ " + bulletPoints[4]) // level 5 + .replaceAll(" -", " ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍‍ ‍ ‍" + bulletPoints[3]) // level 4 + .replaceAll(" -", " ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍" + bulletPoints[2]) // level 3 + .replaceAll(" -", " ‍ ‍‍ ‍ ‍‍ " + bulletPoints[1]) // level 2 + .replaceAll("- ", bulletPoints[0] + " "); // level 1 output1.value = output; copyToClipboard(output1.value); } diff --git a/main.js b/main.js index 8932c00..3b30ddc 100644 --- a/main.js +++ b/main.js @@ -36,7 +36,7 @@ eval("document.addEventListener(\"DOMContentLoaded\", function () {\r\n if (!do \***************************************/ /***/ (() => { -eval("document.addEventListener(\"DOMContentLoaded\", function () {\r\n if (!document.querySelector(\".notion-to-quizlet\")) return;\r\n\r\n const inputEl = document.querySelector(\"#input\");\r\n const output1 = document.querySelector(\"#output1\");\r\n const output2 = document.querySelector(\"#output2\");\r\n\r\n generateOutput1(inputEl.value);\r\n // generateOutput2(inputEl.value);\r\n\r\n inputEl.addEventListener(\"change\", () => {\r\n generateOutput1(inputEl.value);\r\n // generateOutput2(inputEl.value);\r\n });\r\n inputEl.addEventListener(\"input\", () => {\r\n generateOutput1(inputEl.value);\r\n // generateOutput2(inputEl.value);\r\n });\r\n\r\n function generateOutput1(input) {\r\n const output = input\r\n .replaceAll(/\\*\\*(.+)\\*\\*/g, \"$1\") // remove bold\r\n .replaceAll(/\\*(.+)\\*/g, \"$1\") // remove italic\r\n .replaceAll(/\\s+!\\[.*\\]\\(.*\\)\\s+/g, \"\\n\") // remove images\r\n .replaceAll(\" -\", \" ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍‍ ‍ ‍✧\") // level 5\r\n .replaceAll(\" -\", \" ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍‍ ‍ ‍⬥\") // level 4\r\n .replaceAll(\" -\", \" ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍■\") // level 3\r\n .replaceAll(\" -\", \" ‍ ‍‍ ‍ ‍‍ ‍ ‍ ✦\") // level 2\r\n .replaceAll(\"- \", \"● \"); // level 1\r\n output1.value = output;\r\n copyToClipboard(output1.value);\r\n }\r\n\r\n // function generateOutput2(input) {\r\n // const output = input\r\n // .replaceAll(/\\*\\*(.+)\\*\\*/g, \"$1\")\r\n // .replaceAll(\" -\", \"      -\")\r\n // .replaceAll(\" -\", \"    -\")\r\n // .replaceAll(\" -\", \"  -\")\r\n // .replaceAll(\"\\n\", \"
    \")\r\n // .replaceAll(\"- \", \"● \");\r\n // output2.innerHTML = output;\r\n // }\r\n});\r\n\r\nfunction copyToClipboard(text) {\r\n if (window.clipboardData && window.clipboardData.setData) {\r\n // Internet Explorer-specific code path to prevent textarea being shown while dialog is visible.\r\n return window.clipboardData.setData(\"Text\", text);\r\n } else if (document.queryCommandSupported && document.queryCommandSupported(\"copy\")) {\r\n var textarea = document.createElement(\"textarea\");\r\n textarea.textContent = text;\r\n textarea.style.position = \"fixed\"; // Prevent scrolling to bottom of page in Microsoft Edge.\r\n document.body.appendChild(textarea);\r\n textarea.select();\r\n try {\r\n return document.execCommand(\"copy\"); // Security exception may be thrown by some browsers.\r\n } catch (ex) {\r\n console.warn(\"Copy to clipboard failed.\", ex);\r\n return prompt(\"Copy to clipboard: Ctrl+C, Enter\", text);\r\n } finally {\r\n document.body.removeChild(textarea);\r\n }\r\n }\r\n}\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/notion-to-quizlet.js?"); +eval("document.addEventListener(\"DOMContentLoaded\", function () {\r\n if (!document.querySelector(\".notion-to-quizlet\")) return;\r\n\r\n const inputEl = document.querySelector(\"#input\");\r\n const output1 = document.querySelector(\"#output1\");\r\n const output2 = document.querySelector(\"#output2\");\r\n\r\n generateOutput1(inputEl.value);\r\n // generateOutput2(inputEl.value);\r\n\r\n inputEl.addEventListener(\"change\", () => {\r\n generateOutput1(inputEl.value);\r\n // generateOutput2(inputEl.value);\r\n });\r\n inputEl.addEventListener(\"input\", () => {\r\n generateOutput1(inputEl.value);\r\n // generateOutput2(inputEl.value);\r\n });\r\n\r\n function generateOutput1(input) {\r\n const bulletPoints = [\"■\", \"✦\", \"✧\", \"●\", \"⬥\"];\r\n const output = input\r\n .replaceAll(/\\*\\*(.+)\\*\\*/g, \"$1\") // remove bold\r\n .replaceAll(/\\*(.+)\\*/g, \"$1\") // remove italic\r\n .replaceAll(/\\s+!\\[.*\\]\\(.*\\)\\s+/g, \"\\n\") // remove images\r\n .replaceAll(\" -\", \" ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍ ‍ ‍‍ ‍‍ ‍ \" + bulletPoints[4]) // level 5\r\n .replaceAll(\" -\", \" ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍‍ ‍ ‍\" + bulletPoints[3]) // level 4\r\n .replaceAll(\" -\", \" ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍ ‍‍ ‍\" + bulletPoints[2]) // level 3\r\n .replaceAll(\" -\", \" ‍ ‍‍ ‍ ‍‍ \" + bulletPoints[1]) // level 2\r\n .replaceAll(\"- \", bulletPoints[0] + \" \"); // level 1\r\n output1.value = output;\r\n copyToClipboard(output1.value);\r\n }\r\n\r\n // function generateOutput2(input) {\r\n // const output = input\r\n // .replaceAll(/\\*\\*(.+)\\*\\*/g, \"$1\")\r\n // .replaceAll(\" -\", \"      -\")\r\n // .replaceAll(\" -\", \"    -\")\r\n // .replaceAll(\" -\", \"  -\")\r\n // .replaceAll(\"\\n\", \"
    \")\r\n // .replaceAll(\"- \", \"● \");\r\n // output2.innerHTML = output;\r\n // }\r\n});\r\n\r\nfunction copyToClipboard(text) {\r\n if (window.clipboardData && window.clipboardData.setData) {\r\n // Internet Explorer-specific code path to prevent textarea being shown while dialog is visible.\r\n return window.clipboardData.setData(\"Text\", text);\r\n } else if (document.queryCommandSupported && document.queryCommandSupported(\"copy\")) {\r\n var textarea = document.createElement(\"textarea\");\r\n textarea.textContent = text;\r\n textarea.style.position = \"fixed\"; // Prevent scrolling to bottom of page in Microsoft Edge.\r\n document.body.appendChild(textarea);\r\n textarea.select();\r\n try {\r\n return document.execCommand(\"copy\"); // Security exception may be thrown by some browsers.\r\n } catch (ex) {\r\n console.warn(\"Copy to clipboard failed.\", ex);\r\n return prompt(\"Copy to clipboard: Ctrl+C, Enter\", text);\r\n } finally {\r\n document.body.removeChild(textarea);\r\n }\r\n }\r\n}\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/notion-to-quizlet.js?"); /***/ }), From f4ec448ed7237440f48b8aa68f04552e5f6905ac Mon Sep 17 00:00:00 2001 From: petracoding Date: Wed, 26 Feb 2025 17:19:48 +0100 Subject: [PATCH 23/26] improvements --- js/pages/manual-list-sorter.js | 11 ++++++++++- js/pages/vocabulary-manager.js | 7 +++++++ main.js | 4 ++-- manual-list-sorter.html | 7 ++++--- vocabulary-manager.html | 5 ++++- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/js/pages/manual-list-sorter.js b/js/pages/manual-list-sorter.js index 44ce5c5..21cad9d 100644 --- a/js/pages/manual-list-sorter.js +++ b/js/pages/manual-list-sorter.js @@ -13,7 +13,8 @@ document.addEventListener("DOMContentLoaded", function () { let inputList, list1 = [], list2 = [], - currentIndex; + currentIndex, + numberSelected = 0; outputTextarea1.value = ""; outputTextarea2.value = ""; @@ -29,6 +30,7 @@ document.addEventListener("DOMContentLoaded", function () { } else { outputTextarea1.value = ""; outputTextarea2.value = ""; + document.querySelector("#outputNumber").innerHTML = ""; inputList = inputListTextarea.value.replace(/,\s*$/, "").replaceAll(",,", ",").split(","); currentIndex = -1; inputListTextarea.setAttribute("disabled", "true"); @@ -87,12 +89,18 @@ document.addEventListener("DOMContentLoaded", function () { content += "
    " + listItem + "
    "; }); document.querySelector("#selects").innerHTML = content; + numberSelected = 0; + document.querySelector("#numberselected").innerHTML = numberSelected + " selected"; [...document.querySelectorAll("#selects div")].forEach((btn) => { btn.addEventListener("click", () => { if (btn.classList.contains("selected")) { btn.classList.remove("selected"); + numberSelected--; + document.querySelector("#numberselected").innerHTML = numberSelected + " selected"; } else { btn.classList.add("selected"); + numberSelected++; + document.querySelector("#numberselected").innerHTML = numberSelected + " selected"; } }); }); @@ -112,6 +120,7 @@ document.addEventListener("DOMContentLoaded", function () { outputTextarea1.value = list1.join(", "); outputTextarea2.value = list2.join(", "); + document.querySelector("#outputNumber").innerHTML = "(" + list1.length + " and " + list2.length + " items)"; }); function nextItem() { diff --git a/js/pages/vocabulary-manager.js b/js/pages/vocabulary-manager.js index 369baa0..2871711 100644 --- a/js/pages/vocabulary-manager.js +++ b/js/pages/vocabulary-manager.js @@ -75,6 +75,7 @@ function changeArray(words) { const removeDuplicates = document.querySelector("#removeDuplicates").checked; const removeAdverbDuplicates = document.querySelector("#removeAdverbDuplicates").checked; const removePluralDuplicates = document.querySelector("#removePluralDuplicates").checked; + const removeGerundDuplicates = document.querySelector("#removeGerundDuplicates").checked; const removeWords = document.querySelector("#removeWords").checked; const changedWords = [], duplicateWords = [], @@ -112,6 +113,12 @@ function changeArray(words) { if (changedWords.includes(changedWord.replace(/es$/, ""))) isDuplicate = true; if (changedWords.includes(changedWord.replace(/es$/, "e"))) isDuplicate = true; } + + if (removeGerundDuplicates) { + if (changedWords.includes(changedWord.replace(/ing$/, ""))) isDuplicate = true; + if (changedWords.includes(changedWord.replace(/ing$/, "e"))) isDuplicate = true; + if (changedWords.includes(changedWord.replace(/ing$/, "ed"))) isDuplicate = true; + } } if (removeWords) { diff --git a/main.js b/main.js index 3b30ddc..cc330b3 100644 --- a/main.js +++ b/main.js @@ -26,7 +26,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _css \****************************************/ /***/ (() => { -eval("document.addEventListener(\"DOMContentLoaded\", function () {\r\n if (!document.querySelector(\".manual-list-sorter\")) return;\r\n\r\n const startBtn = document.querySelector(\"#start\");\r\n const startBtn2 = document.querySelector(\"#select\");\r\n const btn1 = document.querySelector(\"#sortInto1\");\r\n const btn2 = document.querySelector(\"#sortInto2\");\r\n const inputListTextarea = document.querySelector(\"#input\");\r\n const outputTextarea1 = document.querySelector(\"#output1\");\r\n const outputTextarea2 = document.querySelector(\"#output2\");\r\n const wordSpan = document.querySelector(\"#word\");\r\n\r\n let inputList,\r\n list1 = [],\r\n list2 = [],\r\n currentIndex;\r\n\r\n outputTextarea1.value = \"\";\r\n outputTextarea2.value = \"\";\r\n\r\n startBtn.removeAttribute(\"disabled\");\r\n inputListTextarea.removeAttribute(\"disabled\");\r\n btn1.setAttribute(\"disabled\", \"true\");\r\n btn2.setAttribute(\"disabled\", \"true\");\r\n\r\n startBtn.addEventListener(\"click\", () => {\r\n if (!inputListTextarea.value) {\r\n alert(\"No items inserted!\");\r\n } else {\r\n outputTextarea1.value = \"\";\r\n outputTextarea2.value = \"\";\r\n inputList = inputListTextarea.value.replace(/,\\s*$/, \"\").replaceAll(\",,\", \",\").split(\",\");\r\n currentIndex = -1;\r\n inputListTextarea.setAttribute(\"disabled\", \"true\");\r\n startBtn.setAttribute(\"disabled\", \"true\");\r\n startBtn2.setAttribute(\"disabled\", \"true\");\r\n btn1.removeAttribute(\"disabled\");\r\n btn2.removeAttribute(\"disabled\");\r\n wordSpan.innerHTML = inputList[currentIndex];\r\n document.querySelector(\"#manualsorting\").style.display = \"block\";\r\n nextItem();\r\n\r\n window.onbeforeunload = function () {\r\n return \"Are you sure you want to navigate away?\";\r\n };\r\n }\r\n });\r\n\r\n btn1.addEventListener(\"click\", () => {\r\n list1.push(inputList[currentIndex]);\r\n outputTextarea1.value = list1.join(\", \");\r\n nextItem();\r\n });\r\n\r\n btn2.addEventListener(\"click\", () => {\r\n list2.push(inputList[currentIndex]);\r\n outputTextarea2.value = list2.join(\", \");\r\n nextItem();\r\n });\r\n\r\n startBtn2.addEventListener(\"click\", () => {\r\n if (!inputListTextarea.value) {\r\n alert(\"No items inserted!\");\r\n } else {\r\n outputTextarea1.value = \"\";\r\n outputTextarea2.value = \"\";\r\n inputList = inputListTextarea.value.replace(/,\\s*$/, \"\").replaceAll(\",,\", \",\").split(\",\");\r\n currentIndex = -1;\r\n inputListTextarea.setAttribute(\"disabled\", \"true\");\r\n startBtn.setAttribute(\"disabled\", \"true\");\r\n startBtn2.setAttribute(\"disabled\", \"true\");\r\n btn1.removeAttribute(\"disabled\");\r\n btn2.removeAttribute(\"disabled\");\r\n wordSpan.innerHTML = inputList[currentIndex];\r\n document.querySelector(\"#selectdone\").style.display = \"block\";\r\n prepareSelectionMode();\r\n\r\n window.onbeforeunload = function () {\r\n return \"Are you sure you want to navigate away?\";\r\n };\r\n }\r\n });\r\n\r\n function prepareSelectionMode() {\r\n let content = \"\";\r\n inputList.forEach((listItem) => {\r\n content += \"
    \" + listItem + \"
    \";\r\n });\r\n document.querySelector(\"#selects\").innerHTML = content;\r\n [...document.querySelectorAll(\"#selects div\")].forEach((btn) => {\r\n btn.addEventListener(\"click\", () => {\r\n if (btn.classList.contains(\"selected\")) {\r\n btn.classList.remove(\"selected\");\r\n } else {\r\n btn.classList.add(\"selected\");\r\n }\r\n });\r\n });\r\n }\r\n\r\n document.querySelector(\"#selectdone\").addEventListener(\"click\", () => {\r\n list1 = [];\r\n list2 = [];\r\n\r\n [...document.querySelectorAll(\"#selects div\")].forEach((btn) => {\r\n if (btn.classList.contains(\"selected\")) {\r\n list1.push(btn.innerHTML);\r\n } else {\r\n list2.push(btn.innerHTML);\r\n }\r\n });\r\n\r\n outputTextarea1.value = list1.join(\", \");\r\n outputTextarea2.value = list2.join(\", \");\r\n });\r\n\r\n function nextItem() {\r\n if (currentIndex == inputList.length - 1) {\r\n wordSpan.innerHTML = \"DONE!\";\r\n startBtn.removeAttribute(\"disabled\");\r\n inputListTextarea.removeAttribute(\"disabled\");\r\n btn1.setAttribute(\"disabled\", \"true\");\r\n btn2.setAttribute(\"disabled\", \"true\");\r\n } else {\r\n currentIndex++;\r\n wordSpan.innerHTML = inputList[currentIndex];\r\n }\r\n }\r\n});\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/manual-list-sorter.js?"); +eval("document.addEventListener(\"DOMContentLoaded\", function () {\r\n if (!document.querySelector(\".manual-list-sorter\")) return;\r\n\r\n const startBtn = document.querySelector(\"#start\");\r\n const startBtn2 = document.querySelector(\"#select\");\r\n const btn1 = document.querySelector(\"#sortInto1\");\r\n const btn2 = document.querySelector(\"#sortInto2\");\r\n const inputListTextarea = document.querySelector(\"#input\");\r\n const outputTextarea1 = document.querySelector(\"#output1\");\r\n const outputTextarea2 = document.querySelector(\"#output2\");\r\n const wordSpan = document.querySelector(\"#word\");\r\n\r\n let inputList,\r\n list1 = [],\r\n list2 = [],\r\n currentIndex,\r\n numberSelected = 0;\r\n\r\n outputTextarea1.value = \"\";\r\n outputTextarea2.value = \"\";\r\n\r\n startBtn.removeAttribute(\"disabled\");\r\n inputListTextarea.removeAttribute(\"disabled\");\r\n btn1.setAttribute(\"disabled\", \"true\");\r\n btn2.setAttribute(\"disabled\", \"true\");\r\n\r\n startBtn.addEventListener(\"click\", () => {\r\n if (!inputListTextarea.value) {\r\n alert(\"No items inserted!\");\r\n } else {\r\n outputTextarea1.value = \"\";\r\n outputTextarea2.value = \"\";\r\n document.querySelector(\"#outputNumber\").innerHTML = \"\";\r\n inputList = inputListTextarea.value.replace(/,\\s*$/, \"\").replaceAll(\",,\", \",\").split(\",\");\r\n currentIndex = -1;\r\n inputListTextarea.setAttribute(\"disabled\", \"true\");\r\n startBtn.setAttribute(\"disabled\", \"true\");\r\n startBtn2.setAttribute(\"disabled\", \"true\");\r\n btn1.removeAttribute(\"disabled\");\r\n btn2.removeAttribute(\"disabled\");\r\n wordSpan.innerHTML = inputList[currentIndex];\r\n document.querySelector(\"#manualsorting\").style.display = \"block\";\r\n nextItem();\r\n\r\n window.onbeforeunload = function () {\r\n return \"Are you sure you want to navigate away?\";\r\n };\r\n }\r\n });\r\n\r\n btn1.addEventListener(\"click\", () => {\r\n list1.push(inputList[currentIndex]);\r\n outputTextarea1.value = list1.join(\", \");\r\n nextItem();\r\n });\r\n\r\n btn2.addEventListener(\"click\", () => {\r\n list2.push(inputList[currentIndex]);\r\n outputTextarea2.value = list2.join(\", \");\r\n nextItem();\r\n });\r\n\r\n startBtn2.addEventListener(\"click\", () => {\r\n if (!inputListTextarea.value) {\r\n alert(\"No items inserted!\");\r\n } else {\r\n outputTextarea1.value = \"\";\r\n outputTextarea2.value = \"\";\r\n inputList = inputListTextarea.value.replace(/,\\s*$/, \"\").replaceAll(\",,\", \",\").split(\",\");\r\n currentIndex = -1;\r\n inputListTextarea.setAttribute(\"disabled\", \"true\");\r\n startBtn.setAttribute(\"disabled\", \"true\");\r\n startBtn2.setAttribute(\"disabled\", \"true\");\r\n btn1.removeAttribute(\"disabled\");\r\n btn2.removeAttribute(\"disabled\");\r\n wordSpan.innerHTML = inputList[currentIndex];\r\n document.querySelector(\"#selectdone\").style.display = \"block\";\r\n prepareSelectionMode();\r\n\r\n window.onbeforeunload = function () {\r\n return \"Are you sure you want to navigate away?\";\r\n };\r\n }\r\n });\r\n\r\n function prepareSelectionMode() {\r\n let content = \"\";\r\n inputList.forEach((listItem) => {\r\n content += \"
    \" + listItem + \"
    \";\r\n });\r\n document.querySelector(\"#selects\").innerHTML = content;\r\n numberSelected = 0;\r\n document.querySelector(\"#numberselected\").innerHTML = numberSelected + \" selected\";\r\n [...document.querySelectorAll(\"#selects div\")].forEach((btn) => {\r\n btn.addEventListener(\"click\", () => {\r\n if (btn.classList.contains(\"selected\")) {\r\n btn.classList.remove(\"selected\");\r\n numberSelected--;\r\n document.querySelector(\"#numberselected\").innerHTML = numberSelected + \" selected\";\r\n } else {\r\n btn.classList.add(\"selected\");\r\n numberSelected++;\r\n document.querySelector(\"#numberselected\").innerHTML = numberSelected + \" selected\";\r\n }\r\n });\r\n });\r\n }\r\n\r\n document.querySelector(\"#selectdone\").addEventListener(\"click\", () => {\r\n list1 = [];\r\n list2 = [];\r\n\r\n [...document.querySelectorAll(\"#selects div\")].forEach((btn) => {\r\n if (btn.classList.contains(\"selected\")) {\r\n list1.push(btn.innerHTML);\r\n } else {\r\n list2.push(btn.innerHTML);\r\n }\r\n });\r\n\r\n outputTextarea1.value = list1.join(\", \");\r\n outputTextarea2.value = list2.join(\", \");\r\n document.querySelector(\"#outputNumber\").innerHTML = \"(\" + list1.length + \" and \" + list2.length + \" items)\";\r\n });\r\n\r\n function nextItem() {\r\n if (currentIndex == inputList.length - 1) {\r\n wordSpan.innerHTML = \"DONE!\";\r\n startBtn.removeAttribute(\"disabled\");\r\n inputListTextarea.removeAttribute(\"disabled\");\r\n btn1.setAttribute(\"disabled\", \"true\");\r\n btn2.setAttribute(\"disabled\", \"true\");\r\n } else {\r\n currentIndex++;\r\n wordSpan.innerHTML = inputList[currentIndex];\r\n }\r\n }\r\n});\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/manual-list-sorter.js?"); /***/ }), @@ -76,7 +76,7 @@ eval("document.addEventListener(\"DOMContentLoaded\", function (event) {\r\n if \****************************************/ /***/ (() => { -eval("document.addEventListener(\"DOMContentLoaded\", function () {\r\n if (!document.querySelector(\".vocabulary-manager\")) return;\r\n\r\n const removeDuplicatesCheckbox = document.querySelector(\"#removeDuplicates\");\r\n const maxWordsCheckbox = document.querySelector(\"#maxWords\");\r\n const removeWordsCheckbox = document.querySelector(\"#removeWords\");\r\n\r\n prepare();\r\n removeDuplicatesCheckbox.addEventListener(\"change\", prepare);\r\n maxWordsCheckbox.addEventListener(\"change\", prepare);\r\n removeWordsCheckbox.addEventListener(\"change\", prepare);\r\n\r\n function prepare() {\r\n document.querySelector(\".wrap-removeDuplicates\").style.display = removeDuplicatesCheckbox.checked ? \"block\" : \"none\";\r\n document.querySelector(\".wrap-maxWords\").style.display = maxWordsCheckbox.checked ? \"block\" : \"none\";\r\n document.querySelector(\".wrap-removeWords\").style.display = removeWordsCheckbox.checked ? \"block\" : \"none\";\r\n }\r\n\r\n document.querySelector(\"#go\").addEventListener(\"click\", () => {\r\n let o;\r\n const input = document.querySelector(\"textarea\").value;\r\n const separator = document.querySelector(\"#separator\").value || \"
    \";\r\n\r\n const words = input.trim().split(/[\\n,]+/);\r\n const changedWords = changeArray(words);\r\n\r\n const sort = document.querySelector(\"#sort\").checked;\r\n if (sort) changedWords.sort();\r\n\r\n const beforeNumber = words.length;\r\n const number = changedWords.length;\r\n const removedNumber = beforeNumber - number;\r\n document.querySelector(\"#outputNumber\").innerHTML = number;\r\n document.querySelector(\"#outputRemovedNumber\").innerHTML = removedNumber;\r\n document.querySelector(\"#outputLists\").innerHTML = \"1\";\r\n\r\n const maxWords = document.querySelector(\"#maxWords\").checked;\r\n\r\n if (maxWords) {\r\n const chunkify = function* (itr, size) {\r\n let chunk = [];\r\n for (const v of itr) {\r\n chunk.push(v);\r\n if (chunk.length === size) {\r\n yield chunk;\r\n chunk = [];\r\n }\r\n }\r\n if (chunk.length) yield chunk;\r\n };\r\n\r\n const maxWordsN = document.querySelector(\"#maxWordsN\").value || 20;\r\n const randomizeOrder = document.querySelector(\"#randomizeOrder\").checked;\r\n if (randomizeOrder) shuffleArray(changedWords);\r\n\r\n const chunkedLists = [...chunkify(changedWords, parseInt(maxWordsN))];\r\n o = \"\";\r\n [...chunkedLists].forEach((list) => {\r\n if (sort && randomizeOrder) list.sort();\r\n o += list.join(separator);\r\n o += \"

    --------------------------

    \";\r\n });\r\n document.querySelector(\"#outputLists\").innerHTML = chunkedLists.length;\r\n } else {\r\n o = changedWords.join(separator);\r\n }\r\n\r\n document.querySelector(\"#output\").innerHTML = o;\r\n });\r\n});\r\n\r\nfunction changeArray(words) {\r\n const lowercase = document.querySelector(\"#lowercase\").checked;\r\n const removePunctuation = document.querySelector(\"#removePunctuation\").checked;\r\n const removeDuplicates = document.querySelector(\"#removeDuplicates\").checked;\r\n const removeAdverbDuplicates = document.querySelector(\"#removeAdverbDuplicates\").checked;\r\n const removePluralDuplicates = document.querySelector(\"#removePluralDuplicates\").checked;\r\n const removeWords = document.querySelector(\"#removeWords\").checked;\r\n const changedWords = [],\r\n duplicateWords = [],\r\n removedWords = [];\r\n\r\n words.forEach((word) => {\r\n let changedWord = word.trim();\r\n if (lowercase) changedWord = changedWord.toLowerCase();\r\n\r\n if (removePunctuation) {\r\n changedWord = changedWord\r\n .replaceAll(\",\", \"\")\r\n .replaceAll(\";\", \"\")\r\n .replaceAll(\":\", \"\")\r\n .replaceAll(\".\", \"\")\r\n .replaceAll(\"!\", \"\")\r\n .replaceAll(\"?\", \"\")\r\n .replaceAll(\"'\", \"\")\r\n .replaceAll('\"', \"\")\r\n .replaceAll(\"“\", \"\")\r\n .replaceAll(\"”\", \"\");\r\n }\r\n\r\n let isDuplicate = false;\r\n if (removeDuplicates) {\r\n if (changedWords.includes(changedWord)) isDuplicate = true;\r\n\r\n if (removeAdverbDuplicates) {\r\n if (changedWords.includes(changedWord.replace(/ly$/, \"\"))) isDuplicate = true;\r\n if (changedWords.includes(changedWord.replace(/ily$/, \"y\"))) isDuplicate = true;\r\n }\r\n\r\n if (removePluralDuplicates) {\r\n if (changedWords.includes(changedWord.replace(/s$/, \"\"))) isDuplicate = true;\r\n if (changedWords.includes(changedWord.replace(/es$/, \"\"))) isDuplicate = true;\r\n if (changedWords.includes(changedWord.replace(/es$/, \"e\"))) isDuplicate = true;\r\n }\r\n }\r\n\r\n if (removeWords) {\r\n const wordsToRemove = document.querySelector(\"#wordsToRemove\").value.toLowerCase();\r\n const wordsToRemoveArr = wordsToRemove\r\n .trim()\r\n .split(/[\\n,]+/)\r\n .map((x) => x.trim());\r\n\r\n if (wordsToRemoveArr.includes(changedWord.toLowerCase()) || wordsToRemoveArr.includes(word.toLowerCase())) {\r\n removedWords.push(changedWord);\r\n changedWord = \"\";\r\n }\r\n }\r\n\r\n if (changedWord !== \"\") {\r\n if (!isDuplicate) {\r\n changedWords.push(changedWord);\r\n } else {\r\n duplicateWords.push(changedWord);\r\n }\r\n }\r\n });\r\n\r\n console.log(\"Removed Duplicate Words:\");\r\n console.log(duplicateWords);\r\n console.log(\"Removed Words:\");\r\n console.log(removedWords);\r\n console.log(\"--------------\");\r\n\r\n return changedWords;\r\n}\r\n\r\nfunction shuffleArray(array) {\r\n for (let i = array.length - 1; i > 0; i--) {\r\n const j = Math.floor(Math.random() * (i + 1));\r\n [array[i], array[j]] = [array[j], array[i]];\r\n }\r\n}\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/vocabulary-manager.js?"); +eval("document.addEventListener(\"DOMContentLoaded\", function () {\r\n if (!document.querySelector(\".vocabulary-manager\")) return;\r\n\r\n const removeDuplicatesCheckbox = document.querySelector(\"#removeDuplicates\");\r\n const maxWordsCheckbox = document.querySelector(\"#maxWords\");\r\n const removeWordsCheckbox = document.querySelector(\"#removeWords\");\r\n\r\n prepare();\r\n removeDuplicatesCheckbox.addEventListener(\"change\", prepare);\r\n maxWordsCheckbox.addEventListener(\"change\", prepare);\r\n removeWordsCheckbox.addEventListener(\"change\", prepare);\r\n\r\n function prepare() {\r\n document.querySelector(\".wrap-removeDuplicates\").style.display = removeDuplicatesCheckbox.checked ? \"block\" : \"none\";\r\n document.querySelector(\".wrap-maxWords\").style.display = maxWordsCheckbox.checked ? \"block\" : \"none\";\r\n document.querySelector(\".wrap-removeWords\").style.display = removeWordsCheckbox.checked ? \"block\" : \"none\";\r\n }\r\n\r\n document.querySelector(\"#go\").addEventListener(\"click\", () => {\r\n let o;\r\n const input = document.querySelector(\"textarea\").value;\r\n const separator = document.querySelector(\"#separator\").value || \"
    \";\r\n\r\n const words = input.trim().split(/[\\n,]+/);\r\n const changedWords = changeArray(words);\r\n\r\n const sort = document.querySelector(\"#sort\").checked;\r\n if (sort) changedWords.sort();\r\n\r\n const beforeNumber = words.length;\r\n const number = changedWords.length;\r\n const removedNumber = beforeNumber - number;\r\n document.querySelector(\"#outputNumber\").innerHTML = number;\r\n document.querySelector(\"#outputRemovedNumber\").innerHTML = removedNumber;\r\n document.querySelector(\"#outputLists\").innerHTML = \"1\";\r\n\r\n const maxWords = document.querySelector(\"#maxWords\").checked;\r\n\r\n if (maxWords) {\r\n const chunkify = function* (itr, size) {\r\n let chunk = [];\r\n for (const v of itr) {\r\n chunk.push(v);\r\n if (chunk.length === size) {\r\n yield chunk;\r\n chunk = [];\r\n }\r\n }\r\n if (chunk.length) yield chunk;\r\n };\r\n\r\n const maxWordsN = document.querySelector(\"#maxWordsN\").value || 20;\r\n const randomizeOrder = document.querySelector(\"#randomizeOrder\").checked;\r\n if (randomizeOrder) shuffleArray(changedWords);\r\n\r\n const chunkedLists = [...chunkify(changedWords, parseInt(maxWordsN))];\r\n o = \"\";\r\n [...chunkedLists].forEach((list) => {\r\n if (sort && randomizeOrder) list.sort();\r\n o += list.join(separator);\r\n o += \"

    --------------------------

    \";\r\n });\r\n document.querySelector(\"#outputLists\").innerHTML = chunkedLists.length;\r\n } else {\r\n o = changedWords.join(separator);\r\n }\r\n\r\n document.querySelector(\"#output\").innerHTML = o;\r\n });\r\n});\r\n\r\nfunction changeArray(words) {\r\n const lowercase = document.querySelector(\"#lowercase\").checked;\r\n const removePunctuation = document.querySelector(\"#removePunctuation\").checked;\r\n const removeDuplicates = document.querySelector(\"#removeDuplicates\").checked;\r\n const removeAdverbDuplicates = document.querySelector(\"#removeAdverbDuplicates\").checked;\r\n const removePluralDuplicates = document.querySelector(\"#removePluralDuplicates\").checked;\r\n const removeGerundDuplicates = document.querySelector(\"#removeGerundDuplicates\").checked;\r\n const removeWords = document.querySelector(\"#removeWords\").checked;\r\n const changedWords = [],\r\n duplicateWords = [],\r\n removedWords = [];\r\n\r\n words.forEach((word) => {\r\n let changedWord = word.trim();\r\n if (lowercase) changedWord = changedWord.toLowerCase();\r\n\r\n if (removePunctuation) {\r\n changedWord = changedWord\r\n .replaceAll(\",\", \"\")\r\n .replaceAll(\";\", \"\")\r\n .replaceAll(\":\", \"\")\r\n .replaceAll(\".\", \"\")\r\n .replaceAll(\"!\", \"\")\r\n .replaceAll(\"?\", \"\")\r\n .replaceAll(\"'\", \"\")\r\n .replaceAll('\"', \"\")\r\n .replaceAll(\"“\", \"\")\r\n .replaceAll(\"”\", \"\");\r\n }\r\n\r\n let isDuplicate = false;\r\n if (removeDuplicates) {\r\n if (changedWords.includes(changedWord)) isDuplicate = true;\r\n\r\n if (removeAdverbDuplicates) {\r\n if (changedWords.includes(changedWord.replace(/ly$/, \"\"))) isDuplicate = true;\r\n if (changedWords.includes(changedWord.replace(/ily$/, \"y\"))) isDuplicate = true;\r\n }\r\n\r\n if (removePluralDuplicates) {\r\n if (changedWords.includes(changedWord.replace(/s$/, \"\"))) isDuplicate = true;\r\n if (changedWords.includes(changedWord.replace(/es$/, \"\"))) isDuplicate = true;\r\n if (changedWords.includes(changedWord.replace(/es$/, \"e\"))) isDuplicate = true;\r\n }\r\n\r\n if (removeGerundDuplicates) {\r\n if (changedWords.includes(changedWord.replace(/ing$/, \"\"))) isDuplicate = true;\r\n if (changedWords.includes(changedWord.replace(/ing$/, \"e\"))) isDuplicate = true;\r\n if (changedWords.includes(changedWord.replace(/ing$/, \"ed\"))) isDuplicate = true;\r\n }\r\n }\r\n\r\n if (removeWords) {\r\n const wordsToRemove = document.querySelector(\"#wordsToRemove\").value.toLowerCase();\r\n const wordsToRemoveArr = wordsToRemove\r\n .trim()\r\n .split(/[\\n,]+/)\r\n .map((x) => x.trim());\r\n\r\n if (wordsToRemoveArr.includes(changedWord.toLowerCase()) || wordsToRemoveArr.includes(word.toLowerCase())) {\r\n removedWords.push(changedWord);\r\n changedWord = \"\";\r\n }\r\n }\r\n\r\n if (changedWord !== \"\") {\r\n if (!isDuplicate) {\r\n changedWords.push(changedWord);\r\n } else {\r\n duplicateWords.push(changedWord);\r\n }\r\n }\r\n });\r\n\r\n console.log(\"Removed Duplicate Words:\");\r\n console.log(duplicateWords);\r\n console.log(\"Removed Words:\");\r\n console.log(removedWords);\r\n console.log(\"--------------\");\r\n\r\n return changedWords;\r\n}\r\n\r\nfunction shuffleArray(array) {\r\n for (let i = array.length - 1; i > 0; i--) {\r\n const j = Math.floor(Math.random() * (i + 1));\r\n [array[i], array[j]] = [array[j], array[i]];\r\n }\r\n}\r\n\n\n//# sourceURL=webpack://petracoding-github-io/./js/pages/vocabulary-manager.js?"); /***/ }), diff --git a/manual-list-sorter.html b/manual-list-sorter.html index 990da30..eea3900 100644 --- a/manual-list-sorter.html +++ b/manual-list-sorter.html @@ -2,7 +2,7 @@ Manual List Sorter - + @@ -25,7 +25,7 @@

    Manual List Sorter Tool

    choose a mode to start: or - +
    @@ -38,11 +38,12 @@

    Manual List Sorter Tool

    +

    -

    Here are your two lists:

    +

    Here are your two lists:

    diff --git a/vocabulary-manager.html b/vocabulary-manager.html index 1750489..849d411 100644 --- a/vocabulary-manager.html +++ b/vocabulary-manager.html @@ -2,7 +2,7 @@ Vocabulary Manager - + @@ -39,6 +39,9 @@

    Input:


    +

    From 5669f530be59df79942e796b8616cde28dac5160 Mon Sep 17 00:00:00 2001 From: petracoding Date: Sat, 31 Jan 2026 19:08:19 +0100 Subject: [PATCH 24/26] neocities widgets --- neocities/lastfm.html | 64 ------ neocities/stats.html | 60 ------ neocities/status.html | 42 ---- neocities/widgets/lastfm.html | 32 +++ neocities/widgets/pollcode.html | 32 +++ neocities/widgets/statuscafe.html | 34 ++++ neocities/widgets/widgets.js | 315 ++++++++++++++++++++++++++++++ 7 files changed, 413 insertions(+), 166 deletions(-) delete mode 100644 neocities/lastfm.html delete mode 100644 neocities/stats.html delete mode 100644 neocities/status.html create mode 100644 neocities/widgets/lastfm.html create mode 100644 neocities/widgets/pollcode.html create mode 100644 neocities/widgets/statuscafe.html create mode 100644 neocities/widgets/widgets.js diff --git a/neocities/lastfm.html b/neocities/lastfm.html deleted file mode 100644 index e01bec2..0000000 --- a/neocities/lastfm.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - petrapixel stats - - - - - - - - - - -
    -
    - -
    -
    - - - diff --git a/neocities/stats.html b/neocities/stats.html deleted file mode 100644 index f2eb3e4..0000000 --- a/neocities/stats.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - petrapixel stats - - - - - - - - - -
    - -
    - - - diff --git a/neocities/status.html b/neocities/status.html deleted file mode 100644 index b28f0d5..0000000 --- a/neocities/status.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - petrapixel stats - - - - - - - - - -
    -
    - -
    -
    - -
    - - diff --git a/neocities/widgets/lastfm.html b/neocities/widgets/lastfm.html new file mode 100644 index 0000000..176fa5a --- /dev/null +++ b/neocities/widgets/lastfm.html @@ -0,0 +1,32 @@ + + + + last.fm + + + + + + + + +
    + +
    loading last.fm widget...
    +
    + + diff --git a/neocities/widgets/pollcode.html b/neocities/widgets/pollcode.html new file mode 100644 index 0000000..15587cb --- /dev/null +++ b/neocities/widgets/pollcode.html @@ -0,0 +1,32 @@ + + + + pollcode + + + + + + + + +
    + +
    + +
    +
    +
    + + diff --git a/neocities/widgets/statuscafe.html b/neocities/widgets/statuscafe.html new file mode 100644 index 0000000..462b6fb --- /dev/null +++ b/neocities/widgets/statuscafe.html @@ -0,0 +1,34 @@ + + + + status + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + diff --git a/neocities/widgets/widgets.js b/neocities/widgets/widgets.js new file mode 100644 index 0000000..4bc3ee4 --- /dev/null +++ b/neocities/widgets/widgets.js @@ -0,0 +1,315 @@ +const knownParams = [ + "fontSize", + "center", + "font", + "marquee", + "linkColor", + "timeColor", + "username", + "hideUsername", + "hideEmoji", + "hideUsernameAndTime", + "swapPositions", + "delimiter", + "underline", + "pollcode", + "ignorePollcodeStyling", + "viewButtonAsLink", + "spacing", + "showAlbumCover", +]; + +/* + CACHEBUSTING IN HTML! +*/ + +document.addEventListener("DOMContentLoaded", function () { + console.log("%cWidget provided by petrapixel. Get yours: https://petrapixel.neocities.org/coding/widgets", "font-size: 14pt;", "font-size: 16pt;"); + + const params = getParameters(); + console.log("%cParameters:", "font-size: 13pt;"); + console.log(params); + doCSS(params); + + initStatuscafe(params); + initLastFm(params); + initPollcode(params); +}); + +function getParameters() { + let queryString = window.location.search.substr(1).replaceAll(";", "&"); + let hashString = window.location.hash || ""; // in case of color codes with "#" + if (!queryString) return []; + const fullString = queryString + hashString; + let fullStringFixed = fullString.replaceAll(" ", " "); // Fix for encoding + fullStringFixed = fullStringFixed.replaceAll("&%20", "&%20"); // Fix & bug with special character & + return new URLSearchParams(fullStringFixed); +} + +function doCSS(params) { + // Known: + if (params.get("center")) { + document.body.style.textAlign = params.get("center") == "1" ? "center" : "left"; + + if (params.get("center") == "0") { + document.body.querySelector("main").style.margin = "0"; + } + } + + // Backwards Compability (now unknown): + if (params.get("font")) document.body.style.fontFamily = '"' + params.get("font").replaceAll("%20", " ") + '"'; + if (params.get("fontSize")) document.body.style.fontSize = params.get("fontSize"); + + // Use unknown parameters as CSS: + const unknownParams = []; + params.forEach((v, k) => { + if (!knownParams.includes(k)) { + if (k.includes(":") && !v) { + // fix e.g. font-size:1px to font-size=1px + unknownParams.push([k.split(":")[0], k.split(":")[1]]); + } else { + unknownParams.push([k, v]); + } + } + }); + let cssCode = document.body.getAttribute("style") + ";"; + unknownParams.forEach((p) => { + if (p[0] == "color" || p[0] == "background-color") { + // deal with colors + const hasHash = p[1].includes("#"); + const needsHash = !hasHash && p[1].length == 6; + cssCode += p[0] + ":" + (needsHash ? "#" : "") + p[1] + ";"; + } else { + cssCode += p[0] + ":" + p[1].replaceAll("%20", " ") + ";"; + } + }); + + document.body.setAttribute("style", cssCode); +} + +function turnIntoMarquee() { + const marqueeHolderEl = document.getElementById("marquee-holder"); + if (!marqueeHolderEl) return; + + const marqueeEl = document.createElement("marquee"); + marqueeEl.innerHTML = marqueeHolderEl.innerHTML; + marqueeHolderEl.parentNode.replaceChild(marqueeEl, marqueeHolderEl); + + if (document.querySelector("main")) document.querySelector("main").style.width = "100%"; +} + +function decodeHtml(html) { + var txt = document.createElement("textarea"); + txt.innerHTML = html; + return txt.value; +} + +/** + * STATUS CAFE + */ +function initStatuscafe(params) { + if (!document.getElementById("statuscafe-username")) return; + + if (params.get("marquee")) { + if (params.get("marquee") == "1") turnIntoMarquee(); + } + + let username = params.get("username"); + if (!username) { + document.getElementById("statuscafe-content").innerHTML = "Please enter a username."; + } + username = username.toLowerCase().trim(); + + fetch(`https://status.cafe/users/${username}/status.json`) + .then((r) => r.json()) + .then((r) => { + if (!r.content.length) { + document.getElementById("statuscafe-content").innerHTML = "No status yet."; + return; + } + let delimiter = ""; + if (params.get("marquee")) { + if (params.get("marquee") == "1") { + delimiter = ": "; + } + } + + let emoji = r.face; + if (params.get("hideEmoji")) { + if (params.get("hideEmoji") == "1") emoji = ""; + } + + document.getElementById("statuscafe-username").innerHTML = + '' + r.author + " " + emoji + " " + r.timeAgo + delimiter + ""; + document.getElementById("statuscafe-content").innerHTML = username == "petra1999" ? "this is an example status text!" : r.content; + + // Styling: + if (params.get("linkColor")) { + document.querySelector("#statuscafe-username a").style.color = + params.get("linkColor") == "black" || params.get("linkColor") == "white" || params.get("linkColor").includes("#") ? params.get("linkColor") : "#" + params.get("linkColor"); + } + + if (params.get("timeColor")) { + document.querySelector("#statuscafe-username span").style.color = + params.get("timeColor") == "black" || params.get("timeColor") == "white" || params.get("timeColor").includes("#") ? params.get("timeColor") : "#" + params.get("timeColor"); + } + if (params.get("hideUsernameAndTime")) { + if (params.get("hideUsernameAndTime") == "1") document.querySelector("#statuscafe-username").style.display = "none"; + } + if (params.get("hideUsername")) { + if (params.get("hideUsername") == "1") document.querySelector("#statuscafe-username a").style.display = "none"; + } + if (params.get("swapPositions")) { + if (params.get("swapPositions") == "1") { + document.querySelector("#marquee-holder").style.display = "flex"; + document.querySelector("#marquee-holder").style.flexDirection = "column-reverse"; + } + } + // if (params.get("marquee")) { + // if (params.get("marquee") == "1") { + // document.querySelector("main").style.width = "100%"; + // document.querySelector("marquee").style.display = "flex"; + // document.querySelector("marquee").style.alignItems = "end"; + // document.querySelector("#statuscafe-username").style.flexShrink = "0"; + // document.querySelector("#statuscafe-username").style.marginRight = "1em"; + // document.querySelector("#statuscafe-content").style.flexShrink = "0"; + // } + // } + }); +} + +/** + * LAST FM + */ +function initLastFm(params) { + if (!document.querySelector("#song")) return; + + if (params.get("marquee")) { + if (params.get("marquee") == "1") turnIntoMarquee(); + } + + // Styling: + if (params.get("color")) document.querySelector("#song").style.color = params.get("color") == "black" || params.get("color") == "white" ? params.get("color") : "#" + params.get("color"); + if (params.get("linkColor")) + document.querySelector("#song").style.color = params.get("linkColor") == "black" || params.get("linkColor") == "white" ? params.get("linkColor") : "#" + params.get("linkColor"); + if (params.get("underline")) { + if (params.get("underline") == "0") document.querySelector("#song").style.textDecoration = "none"; + } + if (params.get("marquee")) { + if (params.get("marquee") == "1") document.querySelector("#song").style.whiteSpace = "nowrap"; + } + + let username = params.get("username"); + if (!username) { + document.getElementById("statuscafe-content").innerHTML = "Please enter a username."; + } + username = username.trim(); + + let delimiter = params.get("delimiter"); + if (!delimiter) { + delimiter = "–"; + } + if (delimiter == ":") { + delimiter = delimiter + " "; + } else { + delimiter = " " + delimiter + " "; + } + + let swapPositions = false; + if (params.get("swapPositions")) { + if (params.get("swapPositions") == "1") swapPositions = true; + } + + const url = "https://lastfm-last-played.biancarosa.com.br/" + username + "/latest-song"; + const song = document.querySelector("#song"); + fetch(url) + .then(function (response) { + return response.json(); + }) + .then(function (json) { + song.setAttribute("href", "https://www.last.fm/user/" + username); + + let artist = json["track"]["artist"]["#text"]; + let songTitle = json["track"]["name"]; + let albumCoverUrl = json["track"]["image"] ? json["track"]["image"][2]["#text"] : null; // 0=small, 1=medium, 2=large, 3=extralarge + + if (username == "Petra1999") { + // Preview data + artist = "Taylor Swift"; + songTitle = "Love Story"; + albumCoverUrl = "https://lastfm.freetls.fastly.net/i/u/300x300/acdd1489ea27beb10b07c58ffdb99a83.jpg"; + } + + let albumCoverHTML = ""; + if (params.get("showAlbumCover") && albumCoverUrl) { + if (params.get("showAlbumCover") != "0") { + const size = params.get("showAlbumCover") < 10 ? 10 : params.get("showAlbumCover"); + albumCoverHTML = ``; + } + } + + if (swapPositions) { + song.innerHTML = `${artist}${delimiter}${songTitle}` + albumCoverHTML; + } else { + song.innerHTML = ` ${songTitle}${delimiter}${artist}` + albumCoverHTML; + } + }); +} + +/** + * POLLCODE + */ +function initPollcode(params) { + const wrapper = document.querySelector("#pollcode"); + if (!wrapper) return; + + if (params.get("pollcode")) { + if (!params.get("pollcode").includes("poll.pollcode.com")) { + wrapper.innerHTML = "This doesn't seem to be a Pollcode code."; + return; + } + const encodedCode = params.get("pollcode"); + const decodedCode = decodeHtml(encodedCode); + wrapper.innerHTML = decodedCode; + } + + if (params.get("ignorePollcodeStyling")) { + if (params.get("ignorePollcodeStyling") == "1") { + const allStyledPollcodeElements = document.querySelectorAll("#pollcode [style]"); + [...allStyledPollcodeElements].forEach((el) => { + el.setAttribute("style", ""); + }); + } + } + + if (params.get("viewButtonAsLink")) { + if (params.get("viewButtonAsLink") == "1") { + const viewBtn = document.querySelector("input[name='view']"); + if (viewBtn) { + const parentEl = viewBtn.closest("div"); + viewBtn.remove(); + const pollId = document.querySelector("#pollcode form").getAttribute("action").replace("https://poll.pollcode.com/", ""); + const viewLink = "https://poll.pollcode.com/" + pollId + "_result?v"; + const viewLinkEl = document.createElement("a"); + viewLinkEl.innerHTML = "View"; + viewLinkEl.setAttribute("href", viewLink); + viewLinkEl.setAttribute("target", "_blank"); + viewLinkEl.setAttribute("style", "color: inherit;"); + parentEl.appendChild(viewLinkEl); + } + } + } + + if (params.get("spacing")) { + document.head.insertAdjacentHTML("beforeend", ""); + } + + // make sure the pollcode "voted" website opens in new tab, not the iframe: + document.querySelector("#pollcode form").setAttribute("target", "_blank"); + + // hide "pollcode.com free polls" text: + const creditText = document.querySelector("#pollcode form > div > div:last-child"); + if (creditText) { + creditText.remove(); + } +} From fe2a75cf7e061d830214c61bd8d3cae58adcc8f7 Mon Sep 17 00:00:00 2001 From: petracoding Date: Fri, 17 Apr 2026 08:59:59 +0200 Subject: [PATCH 25/26] widget marquee bugfix --- neocities/widgets/lastfm.html | 2 +- neocities/widgets/pollcode.html | 2 +- neocities/widgets/statuscafe.html | 2 +- neocities/widgets/widgets.js | 29 +++++++++-------------------- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/neocities/widgets/lastfm.html b/neocities/widgets/lastfm.html index 176fa5a..7142cf2 100644 --- a/neocities/widgets/lastfm.html +++ b/neocities/widgets/lastfm.html @@ -6,7 +6,7 @@ - +