Initial commit

Have got a question working
This commit is contained in:
Leon Mika 2025-06-18 13:49:42 +02:00
commit 37d70eed8f
21 changed files with 719 additions and 0 deletions

2
README.txt Normal file
View file

@ -0,0 +1,2 @@
Icons from Iconic http://somerandomdude.com/work/iconic/
via https://fontello.com

BIN
fontello-f6bebbfe.zip Normal file

Binary file not shown.

12
fontello/LICENSE.txt Normal file
View file

@ -0,0 +1,12 @@
Font license info
## Iconic
Copyright (C) 2012 by P.J. Onori
Author: P.J. Onori
License: SIL (http://scripts.sil.org/OFL)
Homepage: http://somerandomdude.com/work/iconic/

75
fontello/README.txt Normal file
View file

@ -0,0 +1,75 @@
This webfont is generated by https://fontello.com open source project.
================================================================================
Please, note, that you should obey original font licenses, used to make this
webfont pack. Details available in LICENSE.txt file.
- Usually, it's enough to publish content of LICENSE.txt file somewhere on your
site in "About" section.
- If your project is open-source, usually, it will be ok to make LICENSE.txt
file publicly available in your repository.
- Fonts, used in Fontello, don't require a clickable link on your site.
But any kind of additional authors crediting is welcome.
================================================================================
Comments on archive content
---------------------------
- /font/* - fonts in different formats
- /css/* - different kinds of css, for all situations. Should be ok with
twitter bootstrap. Also, you can skip <i> style and assign icon classes
directly to text elements, if you don't mind about IE7.
- demo.html - demo file, to show your webfont content
- LICENSE.txt - license info about source fonts, used to build your one.
- config.json - keeps your settings. You can import it back into fontello
anytime, to continue your work
Why so many CSS files ?
-----------------------
Because we like to fit all your needs :)
- basic file, <your_font_name>.css - is usually enough, it contains @font-face
and character code definitions
- *-ie7.css - if you need IE7 support, but still don't wish to put char codes
directly into html
- *-codes.css and *-ie7-codes.css - if you like to use your own @font-face
rules, but still wish to benefit from css generation. That can be very
convenient for automated asset build systems. When you need to update font -
no need to manually edit files, just override old version with archive
content. See fontello source code for examples.
- *-embedded.css - basic css file, but with embedded WOFF font, to avoid
CORS issues in Firefox and IE9+, when fonts are hosted on the separate domain.
We strongly recommend to resolve this issue by `Access-Control-Allow-Origin`
server headers. But if you ok with dirty hack - this file is for you. Note,
that data url moved to separate @font-face to avoid problems with <IE9, when
string is too long.
- animate.css - use it to get ideas about spinner rotation animation.
Attention for server setup
--------------------------
You MUST setup server to reply with proper `mime-types` for font files -
otherwise some browsers will fail to show fonts.
Usually, `apache` already has necessary settings, but `nginx` and other
webservers should be tuned. Here is list of mime types for our file extensions:
- `application/vnd.ms-fontobject` - eot
- `application/x-font-woff` - woff
- `application/x-font-ttf` - ttf
- `image/svg+xml` - svg

22
fontello/config.json Normal file
View file

@ -0,0 +1,22 @@
{
"name": "",
"css_prefix_text": "icon-",
"css_use_suffix": false,
"hinting": true,
"units_per_em": 1000,
"ascent": 850,
"glyphs": [
{
"uid": "b90d80c250a9bbdd6cd3fe00e6351710",
"css": "ok",
"code": 59392,
"src": "iconic"
},
{
"uid": "11e664deed5b2587456a4f9c01d720b6",
"css": "cancel",
"code": 59393,
"src": "iconic"
}
]
}

85
fontello/css/animation.css vendored Normal file
View file

@ -0,0 +1,85 @@
/*
Animation example, for spinners
*/
.animate-spin {
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
-webkit-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
display: inline-block;
}
@-moz-keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@-webkit-keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@-o-keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@-ms-keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@keyframes spin {
0% {
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-moz-transform: rotate(359deg);
-o-transform: rotate(359deg);
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}

3
fontello/css/fontello-codes.css vendored Normal file
View file

@ -0,0 +1,3 @@
.icon-ok:before { content: '\e800'; } /* '' */
.icon-cancel:before { content: '\e801'; } /* '' */

61
fontello/css/fontello-embedded.css vendored Normal file

File diff suppressed because one or more lines are too long

3
fontello/css/fontello-ie7-codes.css vendored Normal file
View file

@ -0,0 +1,3 @@
.icon-ok { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
.icon-cancel { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe801;&nbsp;'); }

14
fontello/css/fontello-ie7.css vendored Normal file
View file

@ -0,0 +1,14 @@
[class^="icon-"], [class*=" icon-"] {
font-family: 'fontello';
font-style: normal;
font-weight: normal;
/* fix buttons height */
line-height: 1em;
/* you can be more comfortable with increased icons size */
/* font-size: 120%; */
}
.icon-ok { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
.icon-cancel { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe801;&nbsp;'); }

58
fontello/css/fontello.css vendored Normal file
View file

@ -0,0 +1,58 @@
@font-face {
font-family: 'fontello';
src: url('../font/fontello.eot?98975117');
src: url('../font/fontello.eot?98975117#iefix') format('embedded-opentype'),
url('../font/fontello.woff2?98975117') format('woff2'),
url('../font/fontello.woff?98975117') format('woff'),
url('../font/fontello.ttf?98975117') format('truetype'),
url('../font/fontello.svg?98975117#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
/*
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'fontello';
src: url('../font/fontello.svg?98975117#fontello') format('svg');
}
}
*/
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "fontello";
font-style: normal;
font-weight: normal;
speak: never;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
/* opacity: .8; */
/* For safety - reset parent styles, that can break glyph codes*/
font-variant: normal;
text-transform: none;
/* fix buttons height, for twitter bootstrap */
line-height: 1em;
/* Animation center compensation - margins should be symmetric */
/* remove if not needed */
margin-left: .2em;
/* you can be more comfortable with increased icons size */
/* font-size: 120%; */
/* Font smoothing. That was taken from TWBS */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/* Uncomment for 3D effect */
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}
.icon-ok:before { content: '\e800'; } /* '' */
.icon-cancel:before { content: '\e801'; } /* '' */

224
fontello/demo.html Normal file
View file

@ -0,0 +1,224 @@
<!DOCTYPE html>
<html>
<head>
<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<meta charset="UTF-8">
<style>
html {
font-size: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
a:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
a:hover,
a:active {
outline: 0;
}
input {
margin: 0;
font-size: 100%;
vertical-align: middle;
*overflow: visible;
line-height: normal;
}
input::-moz-focus-inner {
padding: 0;
border: 0;
}
body {
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 20px;
color: #333;
background-color: #fff;
}
a {
color: #08c;
text-decoration: none;
}
a:hover {
color: #005580;
text-decoration: underline;
}
.row {
margin-left: -20px;
*zoom: 1;
}
.row:before,
.row:after {
display: table;
content: "";
line-height: 0;
}
.row:after {
clear: both;
}
.span3 {
float: left;
min-height: 1px;
margin-left: 20px;
width: 220px;
}
.container {
width: 940px;
margin-right: auto;
margin-left: auto;
*zoom: 1;
}
.container:before,
.container:after {
display: table;
content: "";
line-height: 0;
}
.container:after {
clear: both;
}
small {
font-size: 85%;
}
h1 {
margin: 10px 0;
font-family: inherit;
font-weight: bold;
line-height: 20px;
color: inherit;
text-rendering: optimizelegibility;
line-height: 40px;
font-size: 38.5px;
}
h1 small {
font-weight: normal;
line-height: 1;
color: #999;
font-size: 24.5px;
}
body {
margin-top: 90px;
}
.header {
position: fixed;
top: 0;
left: 50%;
margin-left: -480px;
background-color: #fff;
border-bottom: 1px solid #ddd;
padding-top: 10px;
z-index: 10;
}
.footer {
color: #ddd;
font-size: 12px;
text-align: center;
margin-top: 20px;
}
.footer a {
color: #ccc;
text-decoration: underline;
}
.the-icons {
font-size: 14px;
line-height: 24px;
}
.switch {
position: absolute;
right: 0;
bottom: 10px;
color: #666;
}
.switch input {
margin-right: 0.3em;
}
.codesOn .i-name {
display: none;
}
.codesOn .i-code {
display: inline;
}
.i-code {
display: none;
}
@font-face {
font-family: 'fontello';
src: url('./font/fontello.eot?57366926');
src: url('./font/fontello.eot?57366926#iefix') format('embedded-opentype'),
url('./font/fontello.woff?57366926') format('woff'),
url('./font/fontello.ttf?57366926') format('truetype'),
url('./font/fontello.svg?57366926#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
.demo-icon {
font-family: "fontello";
font-style: normal;
font-weight: normal;
speak: never;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
/* opacity: .8; */
/* For safety - reset parent styles, that can break glyph codes*/
font-variant: normal;
text-transform: none;
/* fix buttons height, for twitter bootstrap */
line-height: 1em;
/* Animation center compensation - margins should be symmetric */
/* remove if not needed */
margin-left: .2em;
/* You can be more comfortable with increased icons size */
/* font-size: 120%; */
/* Font smoothing. That was taken from TWBS */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/* Uncomment for 3D effect */
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}
</style>
<link rel="stylesheet" href="css/animation.css"><!--[if IE 7]><link rel="stylesheet" href="css/" + font.fontname + "-ie7.css"><![endif]-->
<script>
function toggleCodes(on) {
var obj = document.getElementById('icons');
if (on) {
obj.className += ' codesOn';
} else {
obj.className = obj.className.replace(' codesOn', '');
}
}
</script>
</head>
<body>
<div class="container header">
<h1>fontello <small>font demo</small></h1>
<label class="switch">
<input type="checkbox" onclick="toggleCodes(this.checked)">show codes
</label>
</div>
<div class="container" id="icons">
<div class="row">
<div class="span3" title="Code: 0xe800">
<i class="demo-icon icon-ok">&#xe800;</i> <span class="i-name">icon-ok</span><span class="i-code">0xe800</span>
</div>
<div class="span3" title="Code: 0xe801">
<i class="demo-icon icon-cancel">&#xe801;</i> <span class="i-name">icon-cancel</span><span class="i-code">0xe801</span>
</div>
</div>
</div>
<div class="container footer">Generated by <a href="https://fontello.com">fontello.com</a></div>
</body>
</html>

BIN
fontello/font/fontello.eot Normal file

Binary file not shown.

View file

@ -0,0 +1,14 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Copyright (C) 2025 by original authors @ fontello.com</metadata>
<defs>
<font id="fontello" horiz-adv-x="1000" >
<font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
<missing-glyph horiz-adv-x="1000" />
<glyph glyph-name="ok" unicode="&#xe800;" d="M352-10l-334 333 158 160 176-174 400 401 159-160z" horiz-adv-x="928" />
<glyph glyph-name="cancel" unicode="&#xe801;" d="M799 116l-156-157-234 235-235-235-156 157 234 234-234 234 156 157 235-235 234 235 156-157-234-234z" horiz-adv-x="817" />
</font>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 774 B

BIN
fontello/font/fontello.ttf Normal file

Binary file not shown.

BIN
fontello/font/fontello.woff Normal file

Binary file not shown.

Binary file not shown.

41
question.html Normal file
View file

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
<link rel="stylesheet" href="./style.css">
<link rel="stylesheet" href="./fontello/css/fontello.css">
</head>
<body>
<div class="question" data-controller="picker" data-picker-answer-value="2">
<p>What is the thing and the other thing that goes here?</p>
<label>
<input type="radio" name="ans" value="1" data-picker-target="radio">
<i class="icon-cancel"></i>
Blue
</label>
<label>
<input type="radio" name="ans" value="2" data-picker-target="radio">
<i class="icon-ok"></i>
Green
</label>
<label>
<input type="radio" name="ans" value="3" data-picker-target="radio">
<i class="icon-cancel"></i>
Red
</label>
<label>
<input type="radio" name="ans" value="4" data-picker-target="radio">
<i class="icon-cancel"></i>
Yellow
</label>
<button data-action="picker#submitAnswer">Submit</button>
</div>
<script src="./scripts/main.js" type="module"></script>
</body>
</html>

View file

@ -0,0 +1,25 @@
import { Controller } from "https://unpkg.com/@hotwired/stimulus/dist/stimulus.js";
export default class extends Controller {
static targets = [ "radio" ];
static values = {
answer: String
};
connect() {
}
submitAnswer(ev) {
ev.preventDefault();
this.radioTargets.forEach(e => {
e.disabled = true;
if (e.value === this.answerValue) {
e.classList.add("answer");
} else {
e.classList.add("wrong");
}
});
}
};

7
scripts/main.js Normal file
View file

@ -0,0 +1,7 @@
import { Application } from "https://unpkg.com/@hotwired/stimulus/dist/stimulus.js";
import PickerController from "./controllers/picker.js";
window.Stimulus = Application.start();
Stimulus.register("picker", PickerController);

73
style.css Normal file
View file

@ -0,0 +1,73 @@
label:has(input[type=radio]) {
width: 100%;
border-style: solid;
border-color: var(--border);
border-width: 1px;
border-radius: var(--standard-border-radius);
text-align: center;
position: relative;
transition: background-color 0.2s, color 0.2s, border-color 0.2s;
margin-block: 0.5em;
padding-block: 0.4em;
font-size: 0.9em;
font-weight: bold;
box-sizing: border-box;
}
label:has(input[type=radio]):hover {
border-color: var(--accent-hover);
color: var(--accent-hover);
}
label:has(input[type=radio]:disabled):hover {
border-color: var(--border);
color: var(--text);
}
label:has(input[type=radio]:checked) {
color: var(--accent-text);
background-color: var(--accent);
}
label:has(input[type=radio].answer:checked) {
background: green;
color: white;
}
label:has(input[type=radio].answer) {
border-color: green;
color: green;
border-width: 2px;
padding-block: calc(0.4em - 1px);
}
label:has(input[type=radio].wrong:checked) {
background: red;
color: white;
border-color: grey;
}
label i {
position: absolute;
left: 6px;
display: none;
}
label:has(input[type=radio].wrong:checked) i,
label:has(input[type=radio].answer) i {
display: inline-block;
}
input[type=radio] {
visibility: hidden;
height: 0;
width: 0;
padding: 0;
margin: 0;
margin-inline-start: -1px;
}