mirror of
https://github.com/aquatix/alfagok.git
synced 2025-12-06 21:05:10 +01:00
Compare commits
2 Commits
v0.3.0
...
7912c5c897
| Author | SHA1 | Date | |
|---|---|---|---|
| 7912c5c897 | |||
| 34db4e34e7 |
@@ -33,8 +33,8 @@ a.title {
|
||||
padding: 2rem 0 0 0;
|
||||
}
|
||||
|
||||
.guessesheading {
|
||||
color: #CCC;;
|
||||
.guessesheading, .copied {
|
||||
color: #CCC;
|
||||
}
|
||||
|
||||
.guessesheading, .guessesbefore, .guessesafter {
|
||||
|
||||
@@ -24,6 +24,8 @@ document.addEventListener('alpine:init', () => {
|
||||
resultGuesses: Alpine.$persist('').as('resultGuesses'),
|
||||
resultTimeTaken: Alpine.$persist('').as('resultTimeTaken'),
|
||||
|
||||
resultsCopied: false,
|
||||
|
||||
async init() {
|
||||
/** Initialise the application after loading */
|
||||
await this.getGameID();
|
||||
@@ -108,7 +110,6 @@ document.addEventListener('alpine:init', () => {
|
||||
this.resultGuesses = '🤔 '+ this.nrGuesses + ' gokken';
|
||||
let winTimeDate = new Date(this.winTime);
|
||||
let startTimeDate = new Date(this.startTime);
|
||||
// this.resultTimeTaken = '⏱️ ' + getFormattedTime(this.winTime - this.startTime);
|
||||
this.resultTimeTaken = '⏱️ ' + this.getFormattedTime(winTimeDate - startTimeDate);
|
||||
}
|
||||
},
|
||||
@@ -190,23 +191,6 @@ document.addEventListener('alpine:init', () => {
|
||||
|
||||
});
|
||||
|
||||
|
||||
/* Clipboard stuff **/
|
||||
|
||||
let clip = new ClipboardJS('.copy');
|
||||
|
||||
clip.on("success", function(e) {
|
||||
document.getElementById('copyresults').innerHTML = '<p style="font-size:var(--small);opacity:50%">Gekopieerd! Deel je resultaat.</p>';
|
||||
e.clearSelection();
|
||||
});
|
||||
|
||||
clip.on("error", function() {
|
||||
document.getElementById('copyresults').innerHTML = '<p style="font-size:var(--small);opacity:50%">Fout. Graag handmatig kopiëren...</p>';
|
||||
});
|
||||
|
||||
|
||||
/* Get current gameID etc **/
|
||||
|
||||
// document.addEventListener('alpine:initialized', () => {
|
||||
/* On AlpineJS completely loaded, do all this */
|
||||
// Alpine.store('alfagok').getGameID();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/static/images/favicon-16x16.png">
|
||||
<link rel="manifest" href="/static/images/site.webmanifest">
|
||||
<script src="https://cdn.jsdelivr.net/npm/@alpinejs/persist@3.x.x/dist/cdn.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@ryangjchandler/alpine-clipboard@2.x.x/dist/alpine-clipboard.js" defer></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -49,8 +50,8 @@
|
||||
<p>🔗 <span class="link">alfagok.diginaut.net</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="copyresults"></div>
|
||||
<button class="copy" data-clipboard-target="#results">
|
||||
<div class="copied" x-show="$store.alfagok.resultsCopied">Gekopieerd! Deel je resultaat.</div>
|
||||
<button class="copy" @click="$clipboard($store.alfagok.resultGameID + '\n' + $store.alfagok.resultGuesses + '\n' + $store.alfagok.resultTimeTaken + '\n' + '🔗 alfagok.diginaut.net'); $store.alfagok.resultsCopied = true">
|
||||
Tik om te kopiëren en te delen ❤️
|
||||
</button>
|
||||
</div>
|
||||
@@ -64,12 +65,10 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js"></script>
|
||||
<script src="/static/game.js?v={{ version }}"></script>
|
||||
{#
|
||||
<button x-data @click="$store.darkMode.toggle()">Toggle Dark Mode</button>
|
||||
<div x-data :class="$store.darkMode.on && 'bg-black'">...</div>
|
||||
#}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user