mirror of
https://github.com/Noratrieb/womangling.git
synced 2026-01-17 10:25:03 +01:00
Compare commits
No commits in common. "a853814581960e2fbacfc7614f513dd525c43400" and "c6f7915533b2df2c589f4486898d1f9f848c35e5" have entirely different histories.
a853814581
...
c6f7915533
3 changed files with 17 additions and 43 deletions
27
.github/workflows/deploy.yml
vendored
27
.github/workflows/deploy.yml
vendored
|
|
@ -1,27 +0,0 @@
|
||||||
name: deploy
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
environment: garage
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Copy website
|
|
||||||
run: |
|
|
||||||
mkdir dist
|
|
||||||
files=$(git ls-files | grep -E '\.(html|css|js)$')
|
|
||||||
cp --parents $files ./dist
|
|
||||||
- name: Deploy website
|
|
||||||
run: |
|
|
||||||
aws configure set default.s3.addressing_style path
|
|
||||||
aws s3 sync ./dist s3://womangling.noratrieb.dev
|
|
||||||
env:
|
|
||||||
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_KEY_ID }}"
|
|
||||||
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_KEY }}"
|
|
||||||
AWS_REGION: garage
|
|
||||||
AWS_ENDPOINT_URL: https://garage.noratrieb.dev
|
|
||||||
31
flashcard.js
31
flashcard.js
|
|
@ -1,18 +1,19 @@
|
||||||
|
const randomItem = (not) => {
|
||||||
|
let item;
|
||||||
|
|
||||||
|
do {
|
||||||
|
const idx = Math.floor(Math.random() * window.ITEMS.length);
|
||||||
|
item = window.ITEMS[idx];
|
||||||
|
} while (not && item === not);
|
||||||
|
|
||||||
|
return item;
|
||||||
|
};
|
||||||
|
|
||||||
const infoText = document.querySelector("#info-text");
|
const infoText = document.querySelector("#info-text");
|
||||||
|
|
||||||
function next() {
|
function next() {
|
||||||
infoText.textContent = "";
|
infoText.textContent = "";
|
||||||
|
const item = randomItem();
|
||||||
const candiates = [...window.ITEMS];
|
|
||||||
|
|
||||||
const nextRandomItem = () => {
|
|
||||||
const idx = Math.floor(Math.random() * candiates.length);
|
|
||||||
const result = candiates[idx];
|
|
||||||
candiates.splice(idx, 1);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
const item = nextRandomItem();
|
|
||||||
|
|
||||||
const mangle = Math.random() > 0.5;
|
const mangle = Math.random() > 0.5;
|
||||||
|
|
||||||
|
|
@ -23,10 +24,10 @@ function next() {
|
||||||
children[1].textContent = mangle ? item.means : item.mangle;
|
children[1].textContent = mangle ? item.means : item.mangle;
|
||||||
|
|
||||||
const options = [
|
const options = [
|
||||||
nextRandomItem(item),
|
randomItem(item),
|
||||||
nextRandomItem(item),
|
randomItem(item),
|
||||||
nextRandomItem(item),
|
randomItem(item),
|
||||||
nextRandomItem(item),
|
randomItem(item),
|
||||||
];
|
];
|
||||||
const correctIdx = Math.floor(Math.random() * options.length);
|
const correctIdx = Math.floor(Math.random() * options.length);
|
||||||
options[correctIdx] = item;
|
options[correctIdx] = item;
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
Every C++ mangled symbol is prefixed with the string
|
Every C++ mangled symbol is prefixed with the string
|
||||||
<code>_Z</code>. This signifies that this is a mangled C++ symbol.
|
<code>_Z</code>. This signifies that this is a mangled C++ symbol.
|
||||||
<code>_Z</code> starts with an underscore followed by an uppercase
|
<code>_Z</code> starts with an underscore followed by an uppercase
|
||||||
letter. All symbols of that structure are reserved by the C
|
letter. All symbols of that structures are reserved by the C
|
||||||
standard and cannot be used by programs. This ensures that there are
|
standard and cannot be used by programs. This ensures that there are
|
||||||
no name collisions with normal C functions and mangled C++
|
no name collisions with normal C functions and mangled C++
|
||||||
functions.
|
functions.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue