]> git.ardis.lu - utf-8-visualizer/commitdiff
Have codepoints link to their own codepoints.net page
authorJacek Królikowski <nietaki@gmail.com>
Thu, 20 Apr 2023 00:07:46 +0000 (02:07 +0200)
committerardislu <ArdisGLu@gmail.com>
Thu, 20 Apr 2023 02:24:38 +0000 (19:24 -0700)
index.html
script.js
style.css

index d38986eff6d7327d9f03683ada11978fa3e40872..035b30a9861c66786acf921e9ee13e6fc7f21f11 100644 (file)
@@ -27,7 +27,7 @@
   <div></div>
 
   <footer>
-    <a href="https://github.com/ardislu/utf-8-visualizer">
+    <a id="github" href="https://github.com/ardislu/utf-8-visualizer">
       <svg aria-labelledby="github" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
         <title id="github">GitHub repository</title>
         <path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"></path>
@@ -87,4 +87,4 @@
   <script type="module" src="/script.js"></script>
 </body>
 
-</html>
\ No newline at end of file
+</html>
index b823312660f839c16399e404fff1825b88ef7edc..e6455fee7e929030aeaa28aad0faad49f60eabf4 100644 (file)
--- a/script.js
+++ b/script.js
@@ -76,12 +76,12 @@ function render(output) {
 
   for (const item of output) {
     const viz = document.createElement('al-point-visualization');
-    viz.insertAdjacentHTML('beforeend', `<span slot="char">${item.char}</slot>`);
-    viz.insertAdjacentHTML('beforeend', `<span slot="point">${item.point}</slot>`);
+    viz.insertAdjacentHTML('beforeend', `<span slot="char">${item.char}</span>`);
+    viz.insertAdjacentHTML('beforeend', `<span slot="point"><a href="https://codepoints.net/${item.point}">${item.point}</a></span>`);
 
     const [pointBinary, bytes] = parseBytes(item.bytes);
-    viz.insertAdjacentHTML('beforeend', `<span slot="point-binary">${pointBinary}</slot>`);
-    viz.insertAdjacentHTML('beforeend', `<span slot="bytes">${bytes}</slot>`);
+    viz.insertAdjacentHTML('beforeend', `<span slot="point-binary">${pointBinary}</span>`);
+    viz.insertAdjacentHTML('beforeend', `<span slot="bytes">${bytes}</span>`);
 
     vizContainer.insertAdjacentElement('beforeend', viz);
   }
index f7a213f1e4f38fbe3062c8f94b9fc3b3b154c901..66bba8c81787cbaed6eaae0f194fe85cef67e9a1 100644 (file)
--- a/style.css
+++ b/style.css
@@ -55,6 +55,11 @@ div#visualizations {
 }
 
 a {
+  color: inherit;
+  text-decoration: inherit;
+}
+
+a#github {
   line-height: 0;
   background: hsl(222deg 50% 30%);
   color: hsl(222deg 50% 95%);
@@ -63,19 +68,19 @@ a {
   transition: filter 800ms;
 }
 
-a:hover,
-a:focus-within {
+a#github:hover,
+a#github:focus-within {
   filter: brightness(120%) drop-shadow(0 0 4px hsl(222deg 50% 50%));
   transition: filter 400ms;
 }
 
-a>svg {
+a#github>svg {
   inline-size: 24px;
   block-size: 24px;
   transition: transform 600ms;
 }
 
-:is(a:hover, a:focus-within)>svg {
+:is(a#github:hover, a#github:focus-within)>svg {
   transform: translateY(-2px);
   transition: transform 200ms;
 }
@@ -144,4 +149,4 @@ a>svg {
   to {
     opacity: 1;
   }
-}
\ No newline at end of file
+}
This page took 0.044899 seconds and 4 git commands to generate.