mirror of
https://github.com/Noratrieb/womangling.git
synced 2026-01-14 17:05:04 +01:00
Compare commits
7 commits
c6f7915533
...
a853814581
| Author | SHA1 | Date | |
|---|---|---|---|
| a853814581 | |||
| 4c02c9f137 | |||
| 416f658e26 | |||
| c8539a7990 | |||
| 775e00cb3c | |||
| 11301447d4 | |||
| d60694f013 |
3 changed files with 43 additions and 17 deletions
27
.github/workflows/deploy.yml
vendored
Normal file
27
.github/workflows/deploy.yml
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
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,19 +1,18 @@
|
||||||
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;
|
||||||
|
|
||||||
|
|
@ -24,10 +23,10 @@ function next() {
|
||||||
children[1].textContent = mangle ? item.means : item.mangle;
|
children[1].textContent = mangle ? item.means : item.mangle;
|
||||||
|
|
||||||
const options = [
|
const options = [
|
||||||
randomItem(item),
|
nextRandomItem(item),
|
||||||
randomItem(item),
|
nextRandomItem(item),
|
||||||
randomItem(item),
|
nextRandomItem(item),
|
||||||
randomItem(item),
|
nextRandomItem(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 structures are reserved by the C
|
letter. All symbols of that structure 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