add australian localization

This commit is contained in:
b1ek 2023-02-28 17:07:35 +10:00
parent 492dd382ce
commit 2871224a4e
Signed by: blek
GPG Key ID: 14546221E3595D0C
6 changed files with 60 additions and 5 deletions

BIN
public/content/au_flag.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

BIN
public/content/uk_flag.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 B

2
public/static/js/jquery.js vendored Normal file

File diff suppressed because one or more lines are too long

20
public/static/js/main.js Normal file
View File

@ -0,0 +1,20 @@
(
function() {
'use strict';
$('span.flag_btn').css('visibility', 'visible');
const au_btn = $('#aussy_language span');
const body = $('body')
let isAustralian = false;
au_btn.on('click', () => {
au_btn.attr('title', isAustralian ? 'Australian' : 'English');
au_btn.css('background', isAustralian ? 'url(/content/au_flag.jpg)' : 'url(/content/uk_flag.jpg)')
isAustralian = !isAustralian;
body.css('transform', isAustralian ? 'rotate(180deg)' : 'none');
})
}
)()

View File

@ -39,10 +39,11 @@ a:visited {
.side_menu { .side_menu {
width: 200px; width: 200px;
border-right: 1px solid #c2c4c2; border-right: 1px solid #c2c4c2;
padding: 0 padding: 0;
font-size: 9pt;
} }
.side_menu h1 { .side_menu h1 {
font-size: 1.5em; font-size: 1.75em;
padding-left: 3px; padding-left: 3px;
} }
.side_menu h1 a { .side_menu h1 a {
@ -54,10 +55,13 @@ a:visited {
.side_menu ul { .side_menu ul {
list-style: none; list-style: none;
padding: 0; padding: 0;
font-size: 11pt; font-size: 10pt;
padding-left: 4px; padding-left: 4px;
line-height: 125%; line-height: 125%;
} }
.side_menu p {
padding-left: 14px;
}
.main_contents { .main_contents {
padding: 16px 12px; padding: 16px 12px;
} }
@ -87,4 +91,19 @@ hr {
padding:2px 4px; padding:2px 4px;
text-decoration:none; text-decoration:none;
text-shadow:0px 1px 0px #ffffff; text-shadow:0px 1px 0px #ffffff;
}
span.flag_btn {
width: 30px;
height: 20px;
border: 1px solid #606060;
border-radius: 2px;
display: inline-block;
box-shadow: inset 0 1px 3px #e1e3e160;
margin-left: 10px;
visibility: hidden;
}
span.au_flag {
background: url(/content/au_flag.jpg);
} }

View File

@ -37,11 +37,25 @@ html(style='overflow-y:auto')
| > #{name} | > #{name}
else else
a(href=route) #{name} a(href=route) #{name}
hr
p This site is also available in:
p
a(href='#' id='aussy_language')
span(class='flag_btn au_flag' title='Australian')
td(class='main_contents') td(class='main_contents')
block content block content
block foot block foot
block scripts
// js dependencies
script(src='/static/js/jquery.js')
// global js
script(src='/static/js/main.js')
script(type='text/javascript'). script(type='text/javascript').
setTimeout(function() { setTimeout(function() {
alert('Congratulations! You have spent 10 years on this page. Go fuck yourself.\n\nUwU'); alert('Congratulations! You have spent 10 years on this page. Go fuck yourself.\n\nUwU');
}, 1000 * 60 * 60 * 24 * 365 * 10); }, 1000 * 60 * 60 * 24 * 365 * 10);
// page js
block scripts