Skip to content

Instantly share code, notes, and snippets.

@motsu0
motsu0 / image-selector.css
Last active November 8, 2023 08:46
[HTML] Create original SELECT with OPTION to include images.
@charset "utf-8";
.ImageSelector{
display: inline-flex;
position: relative;
box-sizing: border-box;
border: 1px solid #777;
background-color: #fff;
cursor: pointer;
}
.ImageSelector__display,.ImageSelector__preview,.ImageSelector__preview-child{
#players-input {
box-sizing: border-box;
width: 100%;
max-width: 600px;
height: 200px;
padding: 4px;
resize: vertical;
}
#pair-select {
height: 2em;
.sample-img {
width: 200px;
}
/* */
.settings {
display: flex;
flex-direction: column;
row-gap: 12px;
align-items: center;
}
.settings {
display: flex;
flex-wrap: wrap;
gap: 8px;
padding: 8px;
border-bottom: 1px dashed #555;
}
.number-input {
width: 100px;
padding: 0 2px;
@motsu0
motsu0 / 01multi-step-timer.css
Last active September 6, 2023 10:04
多段階タイマー
button{
cursor: pointer;
}
#bt-area{
margin: 10px 0;
text-align: right;
}
#display-box,.timer{
padding: 10px;
}
@motsu0
motsu0 / 01js-search-in-page.css
Last active August 24, 2023 11:55
keyword search in page
.s-highlight{
background-color:yellow;
}
.s-hide{
display: none;
}
.settings {
display: flex;
flex-direction: column;
align-items: center;
row-gap: 20px;
margin: 12px 0;
}
.settings-table {
border-collapse: collapse;
}
@motsu0
motsu0 / canvas-text-center-0.js
Created April 19, 2023 09:27
canvas text centering
const width_canvas = 400;
const height_canvas = 214;
<div id="demo1">
<img src="pathto/sign1.png" alt="交通標識" class="ImageSelector__option" data-value="1">
<img src="pathto/sign2.png" alt="交通標識" class="ImageSelector__option" data-value="2">
<img src="pathto/sign3.png" alt="交通標識" class="ImageSelector__option" data-value="3">
<img src="pathto/sign4.png" alt="交通標識" class="ImageSelector__option" data-value="4">
<img src="pathto/sign5.png" alt="交通標識" class="ImageSelector__option" data-value="5">
<img src="pathto/sign6.png" alt="交通標識" class="ImageSelector__option" data-value="6">
<img src="pathto/sign7.png" alt="交通標識" class="ImageSelector__option" data-value="7">
<img src="pathto/sign8.png" alt="交通標識" class="ImageSelector__option" data-value="8">
<img src="pathto/sign9.png" alt="交通標識" class="ImageSelector__option" data-value="9">
@motsu0
motsu0 / simple-dialog.css
Last active March 9, 2023 01:44
simple-dialog.js (JavaScript Library)
@charset "utf-8";
.simpleDialog_s-fix{
overflow: hidden;
}
.simpleDialog_bg{
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;