mirror of
https://github.com/ivabus/www
synced 2024-11-22 02:05:06 +03:00
Merge pull request #291 from teaxyz/small-fixes
A series of small fixes
This commit is contained in:
commit
1da1268e9b
7 changed files with 57 additions and 29 deletions
|
@ -291,11 +291,11 @@
|
|||
</div>
|
||||
<div class="col">
|
||||
<p class="text-xl-center text-lg-center text-md-left text-sm-left text-left black">STAR COUNT</p>
|
||||
<a href="https://github.com/teaxyz/cli/stargazers" target="_blank"><h1 class="display-2 text-xl-center text-lg-center text-md-left text-sm-left text-left black"><span class="stargazers">56,987</span></h1></a>
|
||||
<a href="https://github.com/teaxyz/cli/stargazers" target="_blank"><h1 class="display-2 text-xl-center text-lg-center text-md-left text-sm-left text-left black"><span class="stargazers">6.1k</span></h1></a>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="text-xl-center text-lg-center text-md-left text-sm-left text-left black">CURRENT RELEASE</p>
|
||||
<a href="https://github.com/teaxyz/cli/releases" target="_blank"><h1 class="display-2 text-xl-center text-lg-center text-md-left text-sm-left text-left black"><span class="release" style="text-transform:lowercase;">56,987</span></h1></a>
|
||||
<a href="https://github.com/teaxyz/cli/releases" target="_blank"><h1 class="display-2 text-xl-center text-lg-center text-md-left text-sm-left text-left black"><span class="release" style="text-transform:lowercase;">v0.24.9</span></h1></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
const commands4 = [
|
||||
{ input: '$ tea github.com/teaxyz/hello-universe.sh<br><br>', output: `*** Interpreters ***<br><br>`},
|
||||
{ input: '$ tea https://github.com/teaxyz/demos/blob/main/hello-universe.sh<br><br>', output: `*** Interpreters ***<br><br>`},
|
||||
{ input: '', output: `TypeScript: Hello, World!<br>`},
|
||||
{ input: '', output: `Go: Hello, World!<br>`},
|
||||
{ input: '', output: `JavaScript: Hello, World!<br>`},
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
<div class="row desktop-ctas">
|
||||
<div class="col-xl-6 col-lg-6 col-md-12 col-sm-12 col-12">
|
||||
<a href="https://github.com/teaxyz/cli#getting-started">
|
||||
<button class="hbtn hb-fill-right github-click" style="width:100% !important;">INSTALL TEA (<span class="release" style="text-transform:lowercase;"></span>)</button>
|
||||
<button class="hbtn hb-fill-right github-click" style="width:100% !important;">INSTALL TEA <span class="release" style="text-transform:lowercase;"></span></button>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xl-6 col-lg-6 col-md-12 col-sm-12 col-12">
|
||||
<a href="https://github.com/teaxyz/cli">
|
||||
<button class="hbtn-light hb-light-fill-right github-click-secondary" style="width:100% !important;">GITHUB (<span class="stargazers" style="text-transform:uppercase;"></span>)</button>
|
||||
<button class="hbtn-light hb-light-fill-right github-click-secondary" style="width:100% !important;">GITHUB <span class="stargazers" style="text-transform:uppercase;"></span></button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<a href="https://twitter.com/teaxyz">
|
||||
<i class="icon-twitter lead me-2"></i>
|
||||
</a>
|
||||
<a href="https://discord.gg/KCZsXfJphn">
|
||||
<a href="https://discord.gg/tea-906608167901876256">
|
||||
<i class="icon-discord lead me-2"></i>
|
||||
</a>
|
||||
<a href="https://github.com/teaxyz/cli">
|
||||
|
|
|
@ -141,26 +141,51 @@ integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+
|
|||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var repository = "teaxyz/cli";
|
||||
var url = "https://api.github.com/repos/" + repository;
|
||||
var repository = "teaxyz/cli";
|
||||
var urlRepo = "https://api.github.com/repos/" + repository;
|
||||
var urlRelease = "https://api.github.com/repos/" + repository + "/releases/latest";
|
||||
var token = "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";
|
||||
|
||||
$.get(url, function(data) {
|
||||
var stargazers = numeral(data.stargazers_count).format("0.0a");
|
||||
$(".stargazers").html(stargazers).hide().fadeIn(400);
|
||||
// Check if the data is already stored in local storage
|
||||
var dataRepo = JSON.parse(localStorage.getItem('dataRepo'));
|
||||
var dataRelease = JSON.parse(localStorage.getItem('dataRelease'));
|
||||
|
||||
if (dataRepo && dataRelease) {
|
||||
// If the data is already stored, use it to update the page
|
||||
var stargazers = "(" + numeral(dataRepo.stargazers_count).format("0.0a") + ")";
|
||||
var release = dataRelease.tag_name;
|
||||
$(".stargazers").html(stargazers).hide().fadeIn(400);
|
||||
$(".release").html(release).hide().fadeIn(400);
|
||||
} else {
|
||||
// If the data is not stored, make the API requests
|
||||
$.when(
|
||||
$.ajax({
|
||||
url: urlRepo,
|
||||
headers: {
|
||||
"Authorization": "token " + token
|
||||
},
|
||||
}),
|
||||
$.ajax({
|
||||
url: urlRelease,
|
||||
headers: {
|
||||
"Authorization": "token " + token
|
||||
},
|
||||
})
|
||||
).done(function(dataRepo, dataRelease) {
|
||||
// Store the response data in local storage
|
||||
localStorage.setItem('dataRepo', JSON.stringify(dataRepo[0]));
|
||||
localStorage.setItem('dataRelease', JSON.stringify(dataRelease[0]));
|
||||
|
||||
// Update the page with the response data
|
||||
var stargazers = "(" + numeral(JSON.parse(localStorage.getItem('dataRepo')).stargazers_count).format("0.0a") + ")";
|
||||
var release = JSON.parse(localStorage.getItem('dataRelease')).tag_name;
|
||||
$(".stargazers").html(stargazers).hide().fadeIn(400);
|
||||
$(".release").html(release).hide().fadeIn(400);
|
||||
|
||||
// Reserve the space for the stargazers element
|
||||
var stargazersWidth = $(".stargazers").width();
|
||||
$(".content").css("min-width", stargazersWidth);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
var repository = "teaxyz/cli";
|
||||
var url = "https://api.github.com/repos/"+ repository +"/releases/latest";
|
||||
|
||||
$.get(url, function(data) {
|
||||
var release = data.tag_name;
|
||||
$(".release").html(release).hide().fadeIn(400);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</li>
|
||||
{{ end }}
|
||||
<li class="nav-item mt-lg-0 mt-md-0 mt-sm-3 mt-3">
|
||||
<a class="top-nav-link nav-link" aria-current="page" href="https://github.com/teaxyz/cli/stargazers"><i class="icon-github" style="position:relative;top:2px;"></i> (<span class="stargazers"></span>)</a>
|
||||
<a class="top-nav-link nav-link" aria-current="page" href="https://github.com/teaxyz/cli/stargazers"><i class="icon-github" style="position:relative;top:2px;"></i> <span class="stargazers"></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -13,7 +13,10 @@
|
|||
</li>
|
||||
{{ end }}
|
||||
<li class="nav-item mt-lg-0 mt-md-0 mt-sm-3 mt-3 top-nav-item">
|
||||
<a class="nav-link" aria-current="page" href="https://github.com/teaxyz/cli/stargazers"><i class="icon-github" style="position:relative;top:2px;"></i> (<span class="stargazers"></span>)</a>
|
||||
<a class="nav-link" aria-current="page" href="https://github.com/teaxyz/cli/stargazers" style="min-width:75px;"><i class="icon-github" style="position:relative;top:2px;float:left;"></i> <span class="stargazers"></span></a>
|
||||
</li>
|
||||
<li class="nav-item mt-lg-0 mt-md-0 mt-sm-3 mt-3 top-nav-item">
|
||||
<a class="nav-link" aria-current="page" href="https://discord.gg/tea-906608167901876256"><i class="icon-discord" style="position:relative;top:2px;"></i></a>
|
||||
</li>
|
||||
<style>
|
||||
|
||||
|
|
Loading…
Reference in a new issue