Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: highlight code snippets #17

Merged
merged 4 commits into from
Jul 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
<style>
.o-a {overflow-x: auto;}
.mw-800p {max-width: 800px; margin: auto;}
.bg-gray-700 {background-color: #4A5568;}
pre {margin-top: auto; margin-bottom: auto;}
</style>
</head>
<body class="text-center pt-1">
Expand All @@ -66,7 +68,11 @@ <h1><a href="https://github.com/brentvollebregt/hit-counter">Hit Counter</a></h1

<h2 class="mt-4">Get the Image for the Page It's On</h2>
<p class="my-1">If you want to get the hit count image for a page you can edit and you want to count, add this line:</p>
<p id="standard" class="text-primary my-0 o-a">&lt;img src="<script>host()</script>/count/tag.svg" alt="Hits"&gt;</p>
<div>
<pre class="bg-gray-700 mw-100 rounded py-2 px-4 d-inline-flex align-items-center justify-content-center">
<code class="text-white">&lt;img src="<script>host()</script>/count/tag.svg" alt="Hits"&gt;</code>
</pre>
</div>
<button type="button" class="btn btn-outline-primary mt-3" onclick="copyContentOf('standard')">Copy HTML Snippet</button>

<h2 class="mt-4">Generate SVG Code For A Different Website</h2>
Expand All @@ -87,9 +93,17 @@ <h2 class="mt-4">Generate SVG Code For A Different Website</h2>
<img id="resultImage" src="" alt="Selected Hit Counter">
</div>
<p class="text-muted my-1">Image Tag</p>
<p id="resultImageTag" class="text-primary my-0 o-a"></p>
<div>
<pre class="bg-gray-700 mw-100 rounded py-2 px-4 d-inline-flex align-items-center justify-content-center">
<code class="text-white" id="resultImageTag"></code>
</pre>
</div>
<p class="text-muted my-1">Markdown</p>
<p id="resultMarkdown" class="text-primary my-0 o-a"></p>
<div>
<pre class="bg-gray-700 mw-100 rounded py-2 px-4 d-inline-flex align-items-center justify-content-center">
<code class="text-white" id="resultMarkdown"></code>
</pre>
</div>
<button type="button" class="btn btn-outline-primary mt-3" onclick="copyContentOf('resultImageTag')">Copy Image Tag</button>
<button type="button" class="btn btn-outline-primary mt-3" onclick="copyContentOf('resultMarkdown')">Copy Markdown</button>

Expand Down