Skip to content

Commit 85cd8da

Browse files
committed
With design
1 parent f469f59 commit 85cd8da

File tree

5 files changed

+76
-111
lines changed

5 files changed

+76
-111
lines changed

.scripts/fix_headings_parser.py

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +0,0 @@
1-
#!/usr/bin/env python3
2-
import re
3-
import sys
4-
from pathlib import Path
5-
import subprocess
6-
7-
posts = Path('_posts')
8-
md_files = sorted(posts.glob('*.md'))
9-
changed_files = []
10-
for f in md_files:
11-
s = f.read_text(encoding='utf-8')
12-
lines = s.splitlines()
13-
new_lines = []
14-
last_level = 0
15-
changed = False
16-
for i, line in enumerate(lines, start=1):
17-
m = re.match(r'^(#{1,6})\s', line)
18-
if m:
19-
level = len(m.group(1))
20-
if level > last_level + 1:
21-
# decrement one '#'
22-
new_level = level - 1
23-
new_line = '#' * new_level + line[level:]
24-
new_lines.append(new_line)
25-
changed = True
26-
last_level = new_level
27-
else:
28-
new_lines.append(line)
29-
last_level = level
30-
else:
31-
new_lines.append(line)
32-
if changed:
33-
old = s
34-
new = '\n'.join(new_lines) + ("\n" if s.endswith('\n') else "")
35-
f.write_text(new, encoding='utf-8')
36-
changed_files.append(f)
37-
# show git diff
38-
try:
39-
diff = subprocess.check_output(['git','--no-pager','--no-color','diff','--',str(f)], text=True)
40-
print(f"\n--- Diff for {f} ---\n{diff}")
41-
except subprocess.CalledProcessError:
42-
print(f"Edited {f}")
43-
44-
# Re-run linter
45-
print('\nRe-running linter:')
46-
subprocess.call(['npx','--yes','markdownlint-cli','--config','./.markdownlint.json','_posts'])
47-
48-
if not changed_files:
49-
print('No files changed')
50-
else:
51-
print('\nFiles changed:')
52-
for f in changed_files:
53-
print('-', f)

.scripts/fix_md_headings.sh

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +0,0 @@
1-
#!/usr/bin/env bash
2-
set -euo pipefail
3-
LINT_OUTPUT=$(mktemp)
4-
ERRS_FILE=$(mktemp)
5-
sh ./scripts/markdown_lint.sh _posts | tee "$LINT_OUTPUT" || true
6-
awk -F: '/_posts/ {print $1":"$2}' "$LINT_OUTPUT" | sort -u > "$ERRS_FILE"
7-
echo "Found the following file:line entries to fix:"
8-
cat "$ERRS_FILE"
9-
while IFS=":" read -r file line; do
10-
[ -z "$file" ] && continue
11-
echo "\n--- Fixing $file:$line ---"
12-
# Remove one leading # from the specific line
13-
sed -i '' "${line}s/^#//" "$file"
14-
echo "Diff for $file:"
15-
git --no-pager --no-color diff -- "$file" | sed -n '1,200p' || true
16-
done < "$ERRS_FILE"
17-
18-
echo "\nRe-running linter to verify fixes:"
19-
sh ./scripts/markdown_lint.sh _posts || true
20-
rm -f "$LINT_OUTPUT" "$ERRS_FILE"

.scripts/fix_md_headings_json.sh

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +0,0 @@
1-
#!/usr/bin/env bash
2-
set -euo pipefail
3-
TMP=$(mktemp)
4-
# get JSON output
5-
npx --yes markdownlint-cli --config ./.markdownlint.json --json _posts > "$TMP" || true
6-
# parse file:line pairs using node
7-
PAIRS=$(node -e 'const fs=require("fs"); const s=fs.readFileSync(0,"utf8"); if(!s.trim()){process.exit(0);} const arr=JSON.parse(s); arr.forEach(e=>console.log(e.fileName+":"+e.lineNumber));' < "$TMP")
8-
if [ -z "$PAIRS" ]; then
9-
echo "No MD001 errors found (no file:line pairs)."
10-
rm -f "$TMP"
11-
# still run linter to show status
12-
npx --yes markdownlint-cli --config ./.markdownlint.json _posts || true
13-
exit 0
14-
fi
15-
# dedupe and iterate
16-
printf "%s\n" "$PAIRS" | sort -u > "$TMP.pairs"
17-
cat "$TMP.pairs"
18-
while IFS=":" read -r file line; do
19-
[ -z "$file" ] && continue
20-
echo "\n--- Fixing $file:$line ---"
21-
sed -i '' "${line}s/^#//" "$file"
22-
echo "Diff for $file:"
23-
git --no-pager --no-color diff -- "$file" | sed -n '1,200p' || true
24-
done < "$TMP.pairs"
25-
26-
echo "\nRe-running linter to verify fixes:"
27-
npx --yes markdownlint-cli --config ./.markdownlint.json _posts || true
28-
rm -f "$TMP" "$TMP.pairs"

lotion/bg.jpg

11.4 MB
Loading

lotion/index.html

Lines changed: 76 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,86 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>Auto playing sound</title>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>LOTION</title>
7+
<style>
8+
html, body {
9+
height: 100%;
10+
margin: 0;
11+
background: url('bg.jpg') no-repeat center center fixed;
12+
background-size: cover;
13+
color: #fff;
14+
display: flex;
15+
flex-direction: column;
16+
align-items: center;
17+
justify-content: center;
18+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
19+
text-align: center;
20+
}
21+
22+
h1 {
23+
font-size: 12vw;
24+
font-weight: 700;
25+
letter-spacing: 0.05em;
26+
margin: 0;
27+
text-transform: uppercase;
28+
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
29+
}
30+
31+
h2 {
32+
font-size: 6vw; /* half the h1 size */
33+
font-weight: 400;
34+
letter-spacing: 0.2em;
35+
margin: 0.5em 0 0;
36+
text-transform: uppercase;
37+
text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
38+
}
39+
40+
#playSound {
41+
position: fixed;
42+
bottom: 2rem;
43+
left: 50%;
44+
transform: translateX(-50%);
45+
background: rgba(0, 0, 0, 0.6);
46+
color: #fff;
47+
border: 1px solid #fff;
48+
border-radius: 100px;
49+
padding: 0.75rem 1.5rem;
50+
font-size: 0.9rem;
51+
font-family: inherit;
52+
text-transform: uppercase;
53+
cursor: pointer;
54+
transition: background 0.3s, color 0.3s;
55+
}
56+
57+
#playSound:hover {
58+
background: #fff;
59+
color: #000;
60+
}
61+
</style>
762
</head>
863
<body>
64+
65+
<h1>LOTION</h1>
66+
<h2>BY EIDRA</h2>
67+
968
<audio id="warning" src="warning.mp3" autoplay muted loop></audio>
1069

11-
<button id="playSound">Play warning sound</button>
70+
<button id="playSound">Play sound</button>
71+
72+
<script>
73+
const audio = document.getElementById('warning');
74+
const button = document.getElementById('playSound');
75+
76+
function enableSound() {
77+
audio.muted = false;
78+
audio.play().catch(err => console.warn('Playback blocked:', err));
79+
button.style.display = 'none';
80+
}
1281

13-
<script>
14-
document.addEventListener('touchstart', () => {
15-
const a = document.getElementById('warning');
16-
a.muted = false;
17-
});
18-
</script>
82+
document.addEventListener('touchstart', enableSound, { once: true });
83+
document.addEventListener('click', enableSound, { once: true });
84+
</script>
1985
</body>
2086
</html>

0 commit comments

Comments
 (0)