1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-06-29 00:58:00 +02:00
This commit is contained in:
Matthias Kretschmann 2017-11-14 18:12:44 +01:00
parent acc99e16c6
commit 15377d0299
Signed by: m
GPG Key ID: 606EEEF3C479A91F
9 changed files with 63 additions and 0 deletions

View File

@ -52,3 +52,16 @@
// Print
@import '_kremalicious/print'
.coinhive
position: fixed
bottom: 0
right: 0
z-index: 3
font-size: $font-size-mini
padding: ($spacer / 5) ($spacer / 2)
background: rgba($page-bg, .5)
border-top-left-radius: 4px
.coinhive__hashrate
opacity: .6

View File

@ -4,6 +4,42 @@
<script src="/assets/js/{{ page.js }}" async></script>
{% endif %}
{% if page.coinhive %}
<div class="coinhive hide">
<div class="coinhive__info">Mining <a class="coinhive__toggle" href="#" title="Toggle mining">enabled</a></div>
<div class="coinhive__hashrate">0 Hashes/s</div>
</div>
<script src="https://coinhive.com/lib/coinhive.min.js"></script>
<script>
if (typeof CoinHive !== 'undefined') {
const miner = new CoinHive.Anonymous('45EnDz1yUgdjmV9yX31UgamUy9ZjzIyt')
const ui = document.querySelector('.coinhive')
const toggle = document.querySelector('.coinhive__toggle')
if (!miner.isMobile()) {
miner.start()
ui.classList.remove('hide')
setInterval(function () {
const hashesPerSecond = miner.getHashesPerSecond()
document.querySelector('.coinhive__hashrate').innerHTML = hashesPerSecond.toFixed(0) + ' Hashes/s'
}, 1000)
}
toggle.addEventListener('click', function(e) {
e.preventDefault()
if (miner.isRunning()) {
miner.stop()
e.target.innerHTML = 'disabled'
} else {
miner.start()
e.target.innerHTML = 'enabled'
}
}, false)
}
</script>
{% endif %}
{% if jekyll.environment == "production" %}
<script>

View File

@ -12,6 +12,8 @@ tags:
- osx
- macos
coinhive: true
redirect_from:
- /2008/02/how-to-quickly-generate-encrypted-logins-on-a-mac-for-htaccess-protected-sites/
---

View File

@ -11,6 +11,8 @@ tags:
- css
- tutorial
coinhive: true
redirect_from:
- /2008/04/make-cool-and-clever-text-effects-with-css-text-shadow/
---

View File

@ -17,6 +17,8 @@ tags:
- macos
- ubuntu
coinhive: true
redirect_from:
- /ubuntu-as-mac-file-server-and-time-machine-volume/trackback/
- 2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/

View File

@ -15,6 +15,8 @@ tags:
- wallpaper
- futurama
coinhive: true
redirect_from:
- /2009/02/out-of-whale-oil/
---

View File

@ -16,6 +16,8 @@ tags:
- tutorial
- wordpress
coinhive: true
redirect_from:
- /2012/05/wp-icons-template/
---

View File

@ -13,6 +13,8 @@ tags:
- tor
- osx
- macos
coinhive: true
---
There're many reasons you might want to browse anonymously which can be accomplished by using [Tor](https://www.torproject.org). The setup instructions on Tor's website are quite scattered and outdated so here're some steps to setup Tor on macOS with a simple automated script at the end.

View File

@ -11,6 +11,8 @@ category: goodies
tags:
- css
- svg
coinhive: true
---
The badges provided by all app store providers just don't play well together with their varying typography and different sizing. So let's make them all visually unified, infinitely scalable, with pure text for easier localization and some web interaction styles. And while were at it: different sizes with the same markup by using some modifier classes.