Skip to content

Commit

Permalink
Merge pull request #1 from Cyb3rM0nk3ys/refactoring
Browse files Browse the repository at this point in the history
Refactoring
  • Loading branch information
secchipietro04 authored Nov 29, 2023
2 parents c2d5bc6 + cb70b78 commit 765af49
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 54 deletions.
5 changes: 5 additions & 0 deletions _includes/head-custom-metadata.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
<link rel="icon" type="image/x-icon" href="/assets/images/team-logo-optimized.webp">
25 changes: 17 additions & 8 deletions _includes/head-custom.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
<!-- start custom head snippets, customize with your own _includes/head-custom.html file -->

<!-- Setup theme-color -->
{% include head-custom-theme-colors.html %}

<!-- Setup Google Analytics -->
{% include head-custom-google-analytics.html %}

<!-- link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.ico' | relative_url }}" -->

<!-- Setup favicon, stylesheets and metadata -->
{% include head-custom-metadata.html %}


<header>
<div class="container">
<div class="container">
<center>
<img src="/assets/images/team-logo.svg" alt="Cyb3rM0nk3ys logo" width="7%" height="7%"/>
<img src="/assets/images/team-logo.png" alt="Cyb3rM0nk3ys logo" width="7%" height="7%"/>

<a id="a-title" href="/">
<h1>Cyb3rM0nk3ys</h1>
</a>
<h2>Cyb3rM0nk3ys is a CTF team based in Verona.</h2>
<h2>Cyb3rM0nk3ys is a ...CTF team...</h2>

<a href="/">
<a href="/home">
Home</a>
<a href="/about">
About us
</a>
<a href="/join">
Join us</a>
<a href="/members">
Monkeys</a>
<a href="/join">
Join us</a>
<!-- profiles -->
</center>
</div>
</header>

<!-- end custom head snippets -->
<!-- end custom head snippets -->
43 changes: 34 additions & 9 deletions _layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
<html lang="{{ site.lang | default: " en-US" }}">

<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">

{% include head-custom.html %}

{% seo %}
Expand All @@ -14,7 +11,9 @@
<body>
<div class="container">
<center>
<b><h1>404 ~ banana not found</h1></b>
<b>
<h1>404 ~ banana not found</h1>
</b>
<section id="main_content">
<div id="gif-container">
<img id="gif" src="">
Expand All @@ -27,11 +26,37 @@
// chatGPT make a js function that returns a random GIF
function getRandomGif() {
const gifFiles = [
"shocked-monkey1.gif",
"shocked-monkey2.gif",
"shocked-monkey1",
"shocked-monkey2",
"shocked-monkey3",
"angry-monkey",
"type-monkey",
];
const randomGif = gifFiles[Math.floor(Math.random() * gifFiles.length)];
document.getElementById("gif").src = `/assets/gifs/${randomGif}`;
const randomIndex = Math.floor(Math.random() * gifFiles.length);
const randomGif = gifFiles[randomIndex];
const placeholderImage = new Image();

// Preload webp image as a placeholder
placeholderImage.src = `assets/images/gifs-first-image/${randomGif.concat(".webp")}`;
placeholderImage.onload = function () {
// Once the webp image is loaded, set it as the placeholder
let existingImage = document.getElementById("gif");

existingImage.parentNode.replaceChild(placeholderImage, existingImage);
placeholderImage.id = "gif"

// Load the actual GIF in the background
const actualGif = new Image();
actualGif.src = `assets/gifs/${randomGif.concat(".gif")}`;
actualGif.onload = function () {
// Replace the placeholder with the loaded GIF
existingImage = document.getElementById("gif");

existingImage.parentNode.replaceChild(actualGif, existingImage);
existingImage.id = "gif"
};
};

}
window.onload = getRandomGif;
</script>
Expand Down
9 changes: 3 additions & 6 deletions _layouts/achievement.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
<html lang="{{ site.lang | default: " en-US" }}">

<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">

{% include head-custom.html %}

{% seo %}
Expand All @@ -14,8 +11,8 @@
<body>
<div class="container">
<section id="writeup">
<small>{{ page.date | date: "%-d %B %Y" }}</small>
<h1><b>{{ page.title }}</b></h1>
<small>{{ page.date | date: "%-d %B %Y" }}</small>
<h1><b>{{ page.title }}</b></h1>
<hr>
{{content}}
</section>
47 changes: 23 additions & 24 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
<!DOCTYPE html>
<html lang="{{ site.lang | default: "en-US" }}">
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
{% include head-custom.html %}
<html lang="{{ site.lang | default: " en-US" }}">

{% seo %}
</head>
<head>

<body>
<div class="container">
<section id="main_content">
<div id="ascii-art"></div>
<div id="left-column">
<!-- mi annoiavo di questi investigatori scarsi quindi ho deciso di leakare una vera flag :) -->
<pre>
{% include head-custom.html %}

{% seo %}
</head>

<body>
<div class="container">
<section id="main_content">
<div id="ascii-art"></div>
<div id="left-column">
<!-- mi annoiavo di questi investigatori scarsi quindi ho deciso di leakare una vera flag :) -->
<pre>
██
██ ██████████ ████████████
██████████▒▒▒▒▒▒▒▒▒▒████████▒▒▒▒▒▒▒▒▒▒▒▒██
Expand Down Expand Up @@ -67,11 +65,12 @@
░░░░░░██░░▒▒████████████████████████░░▒▒████░░░░░░░░░░░░░░░░
░░░░░░████░░░░░░░░░░░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░
</pre>
</div>
<div id="right-column">
{{ content }}
</div>
</section>
</div>
</body>
</html>
</div>
<div id="right-column">
{{ content }}
</div>
</section>
</div>
</body>

</html>
11 changes: 4 additions & 7 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
<html lang="{{ site.lang | default: " en-US" }}">

<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">

{% include head-custom.html %}

{% seo %}
Expand All @@ -14,9 +11,9 @@
<body>
<div class="container">
<section id="writeup">
<small>{{ page.date | date: "%-d %B %Y" }}</small>
<h1><b>{{ page.title }}</b></h1>
<p class="view">by {{ page.author | default: site.author }} | Category: {{ page.chall-category }}</p>
<small>{{ page.date | date: "%-d %B %Y" }}</small>
<h1><b>{{ page.title }}</b></h1>
<p class="view">by {{ page.author | default: site.author }} | Category: {{ page.chall-category }}</p>
<hr>
{{content}}

Expand Down
Binary file added assets/gifs/angry-monkey.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/gifs/shocked-monkey3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/gifs/type-monkey.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/gifs-first-image/angry-monkey.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added assets/images/gifs-first-image/type-monkey.webp
Binary file not shown.
Binary file added assets/images/team-logo-optimized.webp
Binary file not shown.
Binary file added assets/images/team-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 765af49

Please sign in to comment.