Skip to content

Commit b47eca4

Browse files
author
Khoubza Younes
committed
add try it button
1 parent 0d07b76 commit b47eca4

38 files changed

+429
-268
lines changed

_config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ defaults:
77
path: ""
88
values:
99
layout: "main"
10-
published_at: "2020-11-28"
11-
updated_at: "2022-05-18"
1210

1311
exclude:
1412
- "*.config.js"

_data/entrypoints.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,62 @@
22
"entrypoints": {
33
"homepage": {
44
"js": [
5-
"/dist/runtime.6216b94d.js",
6-
"/dist/homepage.5bf84cf8.js"
5+
"/dist/runtime.4454596f.js",
6+
"/dist/homepage.82551349.js"
77
],
88
"css": [
9-
"/dist/457.36bbd8a6.css",
9+
"/dist/857.11f63fec.css",
1010
"/dist/homepage.daa70971.css"
1111
]
1212
},
1313
"main": {
1414
"js": [
15-
"/dist/runtime.6216b94d.js",
16-
"/dist/main.e106364e.js"
15+
"/dist/runtime.4454596f.js",
16+
"/dist/main.0090a42b.js"
1717
],
1818
"css": [
19-
"/dist/457.36bbd8a6.css",
20-
"/dist/main.280c8bc0.css"
19+
"/dist/857.11f63fec.css",
20+
"/dist/main.94bbbeaa.css"
2121
]
2222
},
2323
"adapter-flasher": {
2424
"js": [
25-
"/dist/runtime.6216b94d.js",
26-
"/dist/adapter-flasher.49b0313c.js"
25+
"/dist/runtime.4454596f.js",
26+
"/dist/adapter-flasher.74de58f6.js"
2727
]
2828
},
2929
"adapter-noty": {
3030
"js": [
31-
"/dist/runtime.6216b94d.js",
32-
"/dist/339.5dbd7f6d.js",
33-
"/dist/adapter-noty.a02ba7b4.js"
31+
"/dist/runtime.4454596f.js",
32+
"/dist/814.53e000d3.js",
33+
"/dist/adapter-noty.b07d0868.js"
3434
]
3535
},
3636
"adapter-notyf": {
3737
"js": [
38-
"/dist/runtime.6216b94d.js",
39-
"/dist/adapter-notyf.26d3ddb2.js"
38+
"/dist/runtime.4454596f.js",
39+
"/dist/adapter-notyf.d8339f0e.js"
4040
]
4141
},
4242
"adapter-pnotify": {
4343
"js": [
44-
"/dist/runtime.6216b94d.js",
45-
"/dist/594.9d26d20d.js",
46-
"/dist/adapter-pnotify.51c2df67.js"
44+
"/dist/runtime.4454596f.js",
45+
"/dist/874.c656c5a9.js",
46+
"/dist/adapter-pnotify.16eed3a8.js"
4747
]
4848
},
4949
"adapter-sweetalert": {
5050
"js": [
51-
"/dist/runtime.6216b94d.js",
52-
"/dist/538.18b81106.js",
53-
"/dist/adapter-sweetalert.7631003d.js"
51+
"/dist/runtime.4454596f.js",
52+
"/dist/383.7c120f2f.js",
53+
"/dist/adapter-sweetalert.95ed9cf1.js"
5454
]
5555
},
5656
"adapter-toastr": {
5757
"js": [
58-
"/dist/runtime.6216b94d.js",
59-
"/dist/624.2385ec00.js",
60-
"/dist/adapter-toastr.ee0756a8.js"
58+
"/dist/runtime.4454596f.js",
59+
"/dist/245.aacf1689.js",
60+
"/dist/adapter-toastr.2bb263be.js"
6161
]
6262
}
6363
}

_data/manifest.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"dist/homepage.css": "/dist/homepage.daa70971.css",
3-
"dist/homepage.js": "/dist/homepage.5bf84cf8.js",
4-
"dist/main.css": "/dist/main.280c8bc0.css",
5-
"dist/main.js": "/dist/main.e106364e.js",
6-
"dist/adapter-flasher.js": "/dist/adapter-flasher.49b0313c.js",
7-
"dist/adapter-noty.js": "/dist/adapter-noty.a02ba7b4.js",
8-
"dist/adapter-notyf.js": "/dist/adapter-notyf.26d3ddb2.js",
9-
"dist/adapter-pnotify.js": "/dist/adapter-pnotify.51c2df67.js",
10-
"dist/adapter-sweetalert.js": "/dist/adapter-sweetalert.7631003d.js",
11-
"dist/adapter-toastr.js": "/dist/adapter-toastr.ee0756a8.js",
12-
"dist/runtime.js": "/dist/runtime.6216b94d.js",
13-
"dist/624.2385ec00.js": "/dist/624.2385ec00.js",
14-
"dist/538.18b81106.js": "/dist/538.18b81106.js",
15-
"dist/594.9d26d20d.js": "/dist/594.9d26d20d.js",
16-
"dist/339.5dbd7f6d.js": "/dist/339.5dbd7f6d.js",
17-
"dist/457.36bbd8a6.css": "/dist/457.36bbd8a6.css",
3+
"dist/homepage.js": "/dist/homepage.82551349.js",
4+
"dist/main.css": "/dist/main.94bbbeaa.css",
5+
"dist/main.js": "/dist/main.0090a42b.js",
6+
"dist/adapter-flasher.js": "/dist/adapter-flasher.74de58f6.js",
7+
"dist/adapter-noty.js": "/dist/adapter-noty.b07d0868.js",
8+
"dist/adapter-notyf.js": "/dist/adapter-notyf.d8339f0e.js",
9+
"dist/adapter-pnotify.js": "/dist/adapter-pnotify.16eed3a8.js",
10+
"dist/adapter-sweetalert.js": "/dist/adapter-sweetalert.95ed9cf1.js",
11+
"dist/adapter-toastr.js": "/dist/adapter-toastr.2bb263be.js",
12+
"dist/runtime.js": "/dist/runtime.4454596f.js",
13+
"dist/245.aacf1689.js": "/dist/245.aacf1689.js",
14+
"dist/383.7c120f2f.js": "/dist/383.7c120f2f.js",
15+
"dist/874.c656c5a9.js": "/dist/874.c656c5a9.js",
16+
"dist/814.53e000d3.js": "/dist/814.53e000d3.js",
17+
"dist/857.11f63fec.css": "/dist/857.11f63fec.css",
1818
"dist/fonts/fa-duotone-900.ttf": "/dist/fonts/fa-duotone-900.7aaed888.ttf",
1919
"dist/fonts/fa-thin-100.ttf": "/dist/fonts/fa-thin-100.e979819d.ttf",
2020
"dist/fonts/fa-light-300.ttf": "/dist/fonts/fa-light-300.c92b45dd.ttf",

_includes/head.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@
5656
</script>
5757
{% endunless %}
5858

59-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.28.0/themes/prism.min.css">
60-
<script defer src="https://cdn.jsdelivr.net/npm/prismjs@1.28.0/prism.min.js"></script>
61-
<script defer src="https://cdn.jsdelivr.net/npm/prismjs@1.28.0/plugins/autoloader/prism-autoloader.min.js"></script>
59+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/themes/prism.min.css">
60+
<script defer src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/prism.min.js"></script>
61+
<script defer src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>

_layouts/main.html

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,6 @@ <h4 class="text-sm leading-loose tracking-wide text-indigo-400 uppercase mt-4">{
4646
{% include prev-next.html %}
4747
</div>
4848

49-
{% unless page.hide_title %}
50-
<h1 class="mb-1">
51-
{% if page.alternate_title %}
52-
{{ page.alternate_title }}
53-
{% else %}
54-
{{ page.title }}
55-
{% endif %}
56-
</h1>
57-
<p class="text-xs text-grey-dark rounded rounded-t-none mb-4 text-shadow inline-block">
58-
{% if page.published_at != page.updated_at %}
59-
Last updated at {{ page.updated_at | date_to_long_string }} |
60-
{% endif %}
61-
Published at {{ page.published_at | date_to_long_string }}
62-
</p>
63-
{% endunless %}
64-
6549
<blockquote>
6650
<p>
6751
If you find <strong><span class="text-indigo-900">PHP<span class="text-indigo-500">Flasher</span></span></strong> useful,

assets/css/_clipboard.pcss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ pre.copyable {
33
}
44

55
pre.copyable .copy {
6-
display: none;
6+
//display: none;
7+
position: absolute;
8+
right: 1.5rem;
9+
top: 0.85rem;
710
}
811

912
pre.copyable:hover .copy {
1013
display: block;
11-
position: absolute;
12-
right: 1.5rem;
13-
top: 0.85rem;
1414
}
1515

1616
pre.copyable .copy i {

assets/css/_tryit.pcss

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
pre.tryable {
2+
position: relative;
3+
}
4+
5+
pre.tryable .tryit {
6+
position: absolute;
7+
right: 4rem;
8+
top: 0.85rem;
9+
}
10+
11+
pre.tryable:hover .tryit {
12+
display: inline-block;
13+
}
14+
15+
pre.tryable .tryit i {
16+
font-size: 1.5rem;
17+
}
18+
19+
pre.tryable .tryit:active {
20+
transform: translateY(3px);
21+
}
22+
23+
@media (max-width: 768px) {
24+
pre.tryable:hover .tryit {
25+
display: none;
26+
}
27+
}
28+
29+
pre.tryable .spin {
30+
animation: spin 1s linear infinite;
31+
}
32+
33+
@keyframes spin {
34+
from {
35+
transform: rotate(0deg);
36+
}
37+
to {
38+
transform: rotate(360deg);
39+
}
40+
}

assets/css/homepage.pcss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
left: 0;
77
height: 80vh;
88
width: 100%;
9-
background: linear-gradient(-180deg, rgba(241, 245, 248, 0) 0%, rgba(241, 245, 248, 1) 100%), url("../images/squares.svg") repeat center center;
9+
background: linear-gradient(-180deg, rgba(241, 245, 248, 0) 0%, rgba(241, 245, 248, 1) 100%),
10+
url("../images/squares.svg") repeat center center;
1011
}
1112

1213
body > header {

assets/css/main.pcss

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,23 @@ article blockquote :last-child {
6565
@apply mb-0;
6666
}
6767

68-
.overflow-x-auto::-webkit-scrollbar, .overflow-y-auto::-webkit-scrollbar {
69-
display: none;
68+
.overflow-x-auto::-webkit-scrollbar,
69+
.overflow-y-auto::-webkit-scrollbar {
70+
display: none;
7071
}
7172

72-
.overflow-x-auto, .overflow-y-auto {
73-
-ms-overflow-style: none;
74-
scrollbar-width: none;
73+
.overflow-x-auto,
74+
.overflow-y-auto {
75+
-ms-overflow-style: none;
76+
scrollbar-width: none;
7577
}
7678

7779
code {
7880
background: #f5f2f0;
7981
color: #333;
80-
padding: 0.2rem 0.4rem;
8182
border-radius: 0.3rem;
8283
}
8384

8485
#main-navigation li a.text-white i {
85-
color: #FFF;
86+
color: #fff;
8687
}

assets/js/_anchors.js

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
const container = document.querySelector('#anchor-navigation');
1+
const container = document.querySelector("#anchor-navigation");
22

33
createAnchorNavigation();
44
highlightCurrentAnchor();
55
stickyHeight();
66

7-
const links = document.querySelectorAll('a.anchor, #anchor-navigation ul li a');
8-
links.forEach(anchor => {
9-
anchor.addEventListener('click', (event) => {
7+
const links = document.querySelectorAll("a.anchor, #anchor-navigation ul li a");
8+
links.forEach((anchor) => {
9+
anchor.addEventListener("click", (event) => {
1010
event.preventDefault();
1111

1212
window.location.hash = anchor.hash;
@@ -15,32 +15,33 @@ links.forEach(anchor => {
1515
});
1616

1717
function createAnchorNavigation() {
18-
const ul = document.querySelector('#anchor-navigation ul');
19-
const anchors = document.querySelectorAll('#main-article h3, #main-article h2, #main-article a.anchor');
18+
const ul = document.querySelector("#anchor-navigation ul");
19+
const anchors = document.querySelectorAll("#main-article h3, #main-article h2, #main-article a.anchor");
2020

2121
if (anchors.length === 0) {
2222
container.remove();
2323
return;
2424
}
2525

26-
container.classList.add('lg:block');
26+
container.classList.add("lg:block");
2727

28-
anchors.forEach(anchor => {
28+
anchors.forEach((anchor) => {
2929
const parent = anchor.parentElement;
30-
parent.classList.add('px-6', 'rounded');
30+
parent.classList.add("px-6", "rounded");
3131

32-
anchor.classList.add('leading-loose');
32+
anchor.classList.add("leading-loose");
3333

34-
const link = document.createElement('a');
35-
link.href = 'A' === anchor.tagName ? anchor.hash : '#'+anchor.getAttribute('id');
36-
link.innerHTML = 'A' === anchor.tagName ? anchor.innerText : '<i class="fa-duotone fa-angle-right"></i>' + anchor.innerText;
37-
link.classList.add('leading-loose', 'text-md', 'inline-block', 'w-full', 'text-indigo-500');
34+
const link = document.createElement("a");
35+
link.href = "A" === anchor.tagName ? anchor.hash : "#" + anchor.getAttribute("id");
36+
link.innerHTML =
37+
"A" === anchor.tagName ? anchor.innerText : '<i class="fa-duotone fa-angle-right"></i>' + anchor.innerText;
38+
link.classList.add("leading-loose", "text-md", "inline-block", "w-full", "text-indigo-500");
3839

39-
const li = document.createElement('li');
40-
li.classList.add('px-6', 'rounded', 'w-full');
41-
if ('A' === anchor.tagName) {
42-
li.classList.remove('px-6');
43-
li.classList.add('px-12');
40+
const li = document.createElement("li");
41+
li.classList.add("px-6", "rounded", "w-full");
42+
if ("A" === anchor.tagName) {
43+
li.classList.remove("px-6");
44+
li.classList.add("px-12");
4445
}
4546

4647
li.appendChild(link);
@@ -50,37 +51,37 @@ function createAnchorNavigation() {
5051
}
5152

5253
function highlightCurrentAnchor(hash) {
53-
if (typeof hash === 'undefined') {
54+
if (typeof hash === "undefined") {
5455
hash = window.location.hash;
5556
}
5657

57-
const links = document.querySelectorAll('a.anchor, #anchor-navigation ul li a');
58-
links.forEach(link => {
58+
const links = document.querySelectorAll("a.anchor, #anchor-navigation ul li a");
59+
links.forEach((link) => {
5960
const parent = link.parentElement;
60-
link.classList.remove('text-gray-900');
61-
link.classList.add('text-indigo-500');
62-
parent.classList.remove('bg-indigo-500');
61+
link.classList.remove("text-gray-900");
62+
link.classList.add("text-indigo-500");
63+
parent.classList.remove("bg-indigo-500");
6364

6465
if (hash === link.hash) {
65-
link.classList.remove('text-indigo-500');
66-
link.classList.add('text-white');
66+
link.classList.remove("text-indigo-500");
67+
link.classList.add("text-white");
6768

68-
parent.classList.add('bg-indigo-500');
69+
parent.classList.add("bg-indigo-500");
6970
}
7071
});
7172
}
7273

7374
function stickyHeight() {
74-
const article = document.querySelector('#main-article');
75-
const elements = document.querySelectorAll('.sticky');
75+
const article = document.querySelector("#main-article");
76+
const elements = document.querySelectorAll(".sticky");
7677

77-
elements.forEach(element => {
78+
elements.forEach((element) => {
7879
if (element.offsetHeight <= window.innerHeight || article.clientHeight <= element.offsetHeight) {
7980
return;
8081
}
8182

82-
const div = document.createElement('div');
83-
div.classList.add('h-screen', 'overflow-y-auto');
83+
const div = document.createElement("div");
84+
div.classList.add("h-screen", "overflow-y-auto");
8485
div.innerHTML = element.innerHTML;
8586

8687
element.innerHTML = div.outerHTML;

0 commit comments

Comments
 (0)