Add: show modal when selecting

This commit is contained in:
cutls 2020-02-08 23:35:22 +09:00
parent e1a0a69a2a
commit 72daf55e4e
4 changed files with 401 additions and 339 deletions

View File

@ -1,547 +1,564 @@
/*共通CSS*/ /*共通CSS*/
html, html,
body { body {
/*transform: translate3d(0,0,0);*/ /*transform: translate3d(0,0,0);*/
overflow: hidden; overflow: hidden;
user-select: none; user-select: none;
cursor: default; cursor: default;
font-size: 13px; font-size: 13px;
height: 100vh; height: 100vh;
color: var(--color); color: var(--color);
} }
.btn { .btn {
margin: 5px; margin: 5px;
text-transform: none; text-transform: none;
} }
.markdown { .markdown {
display: none; display: none;
} }
help { help {
display: none; display: none;
} }
.show-help { .show-help {
display: inline; display: inline;
} }
option { option {
display: none; display: none;
} }
#mainView { #mainView {
padding: 10px; padding: 10px;
overflow: scroll; overflow: scroll;
height: auto; height: auto;
} }
#message { #message {
display: none; display: none;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
background-color: black; background-color: black;
color: white; color: white;
z-index: 9999; z-index: 9999;
} }
#imagemodal, #imagemodal,
#videomodal { #videomodal {
display: none; display: none;
max-width: 100vw; max-width: 100vw;
max-height: 100vh; max-height: 100vh;
position: fixed; position: fixed;
z-index: 9; z-index: 9;
top: 0 !important; top: 0 !important;
} }
#videomodal, #videomodal,
#tootmodal { #tootmodal {
background-color: var(--modal); background-color: var(--modal);
} }
#imagemodal .modal-content { #imagemodal .modal-content {
overflow: hidden; overflow: hidden;
padding: 0; padding: 0;
} }
#imagemodal .modal-footer { #imagemodal .modal-footer {
overflow-x: scroll; overflow-x: scroll;
overflow-y: hidden; overflow-y: hidden;
} }
#imagewrap { #imagewrap {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.pointer { .pointer {
cursor: pointer; cursor: pointer;
} }
.badge { .badge {
min-width: 0 !important; min-width: 0 !important;
margin-left: 5px !important; margin-left: 5px !important;
} }
.unvisible { .unvisible {
opacity: 0; opacity: 0;
} }
.bbcode-pulse-loadings, .bbcode-pulse-loadings,
.bbcode-pulse-loading, .bbcode-pulse-loading,
.fa-pulse { .fa-pulse {
display: inline-block; display: inline-block;
animation-duration: 3s; animation-duration: 3s;
animation-fill-mode: both; animation-fill-mode: both;
animation-iteration-count: infinite; animation-iteration-count: infinite;
animation-name: pulse; animation-name: pulse;
} }
@keyframes pulse { @keyframes pulse {
from, from,
50%, 50%,
to { to {
opacity: 1; opacity: 1;
} }
25%, 25%,
75% { 75% {
opacity: 0; opacity: 0;
} }
} }
@keyframes shake { @keyframes shake {
from, from,
to { to {
-webkit-transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
} }
10%, 10%,
30%, 30%,
50%, 50%,
70%, 70%,
90% { 90% {
-webkit-transform: translate3d(-10px, 0, 0); -webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0); transform: translate3d(-10px, 0, 0);
} }
20%, 20%,
40%, 40%,
60%, 60%,
80% { 80% {
-webkit-transform: translate3d(10px, 0, 0); -webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0); transform: translate3d(10px, 0, 0);
} }
} }
.shake { .shake {
display: inline-block; display: inline-block;
animation-duration: 1s; animation-duration: 1s;
animation-fill-mode: both; animation-fill-mode: both;
animation-iteration-count: infinite; animation-iteration-count: infinite;
animation-name: shake; animation-name: shake;
} }
code:before, code:before,
.pre:before { .pre:before {
content: "Code"; content: 'Code';
font-size: 1.8rem; font-size: 1.8rem;
line-height: 1em; line-height: 1em;
font-family: monospace, monospace; font-family: monospace, monospace;
color: #999; color: #999;
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
} }
code, code,
pre { pre {
color: white; color: white;
display: block; display: block;
border-left: 5px solid; border-left: 5px solid;
border-color: #079903; border-color: #079903;
padding-left: 10px; padding-left: 10px;
margin-top: 5px; margin-top: 5px;
margin-bottom: 5px; margin-bottom: 5px;
margin-left: 5px; margin-left: 5px;
background-color: #000; background-color: #000;
padding: 1em 1em 1em; padding: 1em 1em 1em;
position: relative; position: relative;
border-top-left-radius: 10px; border-top-left-radius: 10px;
border-bottom-right-radius: 10px; border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px; border-bottom-left-radius: 10px;
} }
blockquote, blockquote,
.quote p { .quote p {
margin: 0; margin: 0;
} }
blockquote, blockquote,
.quote { .quote {
color: black; color: black;
background-color: #ddd; background-color: #ddd;
padding: 1em 1em 1em; padding: 1em 1em 1em;
position: relative; position: relative;
border-top-left-radius: 10px; border-top-left-radius: 10px;
border-bottom-right-radius: 10px; border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px; border-bottom-left-radius: 10px;
} }
blockquote:before, blockquote:before,
.quote:before { .quote:before {
content: "Quote"; content: 'Quote';
font-size: 1.8rem; font-size: 1.8rem;
line-height: 1em; line-height: 1em;
font-family: Open Sans, cursive; font-family: Open Sans, cursive;
color: #999; color: #999;
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
} }
.pixiv-post { .pixiv-post {
color: black; color: black;
background-color: #fff; background-color: #fff;
padding: 1em 1em 1em; padding: 1em 1em 1em;
position: relative; position: relative;
border-top-left-radius: 10px; border-top-left-radius: 10px;
border-bottom-right-radius: 10px; border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px; border-bottom-left-radius: 10px;
border-left: 5px solid #0096fa; border-left: 5px solid #0096fa;
} }
.pixiv-post :before { .pixiv-post :before {
content: "From Pixiv"; content: 'From Pixiv';
font-size: 1.8rem; font-size: 1.8rem;
line-height: 1em; line-height: 1em;
font-family: Open Sans; font-family: Open Sans;
color: #999; color: #999;
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
} }
#start { #start {
display: none; display: none;
position: fixed; position: fixed;
width: 100vw; width: 100vw;
height: calc(100vh - 40px); height: calc(100vh - 40px);
background-color: var(--bg); background-color: var(--bg);
color: var(--color); color: var(--color);
z-index: 99999; z-index: 99999;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
#drag { #drag {
display: none; display: none;
position: fixed; position: fixed;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
background-color: var(--bg); background-color: var(--bg);
color: var(--color); color: var(--color);
z-index: 99999; z-index: 99999;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
#drag-content { #drag-content {
font-size: 2rem; font-size: 2rem;
} }
#pip { #pip {
z-index: 504; z-index: 504;
width: 418px; width: 418px;
background-color: var(--subcolor); background-color: var(--subcolor);
position: absolute; position: absolute;
} }
.pip-bottom { .pip-bottom {
bottom: 10px; bottom: 10px;
} }
.pip-left { .pip-left {
left: 10px; left: 10px;
} }
.pip-top { .pip-top {
top: 10px; top: 10px;
} }
.pip-right { .pip-right {
right: 10px; right: 10px;
} }
#pip-content .material-icons { #pip-content .material-icons {
display: none; display: none;
} }
.big-text { .big-text {
font-size: 1.2rem; font-size: 1.2rem;
} }
#releasenote { #releasenote {
background-color: var(--modal); background-color: var(--modal);
} }
#releasenote li { #releasenote li {
list-style-type: disc; list-style-type: disc;
} }
@media only screen and (min-width: 993px) { @media only screen and (min-width: 993px) {
#toast-container { #toast-container {
top: auto; top: auto;
right: auto; right: auto;
bottom: 5%; bottom: 5%;
left: 4%; left: 4%;
max-width: 86%; max-width: 86%;
} }
} }
.show { .show {
animation: show 0.2s linear 0s; animation: show 0.2s linear 0s;
} }
@keyframes show { @keyframes show {
from { from {
opacity: 0; opacity: 0;
} }
to { to {
opacity: 1; opacity: 1;
} }
} }
.hide-anime { .hide-anime {
animation: hide 0.2s linear 0s; animation: hide 0.2s linear 0s;
display: none; display: none;
} }
@keyframes hide { @keyframes hide {
from { from {
opacity: 1; opacity: 1;
} }
to { to {
opacity: 0; opacity: 0;
} }
} }
.collapsible-header, .collapsible-header,
.tabs { .tabs {
background-color: var(--subcolor); background-color: var(--subcolor);
} }
.collapsible-header:focus { .collapsible-header:focus {
background-color: var(--subcolor) !important; background-color: var(--subcolor) !important;
} }
.modal-footer { .modal-footer {
background-color: var(--modalfooter) !important; background-color: var(--modalfooter) !important;
} }
.font { .font {
font-size: 1.5rem; font-size: 1.5rem;
margin-bottom: 5px; margin-bottom: 5px;
} }
.font:hover { .font:hover {
background-color: #999; background-color: #999;
} }
.release-do { .release-do {
border: solid 2px; border: solid 2px;
border-color: var(--color); border-color: var(--color);
padding: 5px; padding: 5px;
} }
#pickers { #pickers {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
#menu { #menu {
position: fixed; position: fixed;
z-index: 9999; z-index: 9999;
background-color: var(--postbox); background-color: var(--postbox);
width: 540px; width: 540px;
top: calc(50% - 150px); top: calc(50% - 150px);
left: calc(50% - 250px); left: calc(50% - 250px);
padding: 5px; padding: 5px;
border: thin solid gray; border: thin solid gray;
border-radius: 5px; border-radius: 5px;
overflow: hidden; overflow: hidden;
} }
#menu-wrapper { #menu-wrapper {
margin-left: -5px; margin-left: -5px;
display: flex; display: flex;
height: calc(100% - 3.5rem); height: calc(100% - 3.5rem);
overflow: hidden; overflow: hidden;
} }
#left-menu { #left-menu {
width: 230px; width: 230px;
} }
#left-menu div { #left-menu div {
padding-left: 5px; padding-left: 5px;
width: 100%; width: 100%;
height: 50px; height: 50px;
display: flex; display: flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
} }
#left-menu div:hover { #left-menu div:hover {
background-color: var(--beforehover); background-color: var(--beforehover);
} }
#left-menu span { #left-menu span {
margin-left: 5px; margin-left: 5px;
} }
#left-menu div.active { #left-menu div.active {
background-color: var(--emphasized); background-color: var(--emphasized);
} }
#right-menu { #right-menu {
width: 100%; width: 100%;
overflow-y: scroll; overflow-y: scroll;
overflow-x: hidden; overflow-x: hidden;
padding: 5px; padding: 5px;
} }
#tltype { #tltype {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
#tltype .type { #tltype .type {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
width: 170px; width: 170px;
height: 40px; height: 40px;
cursor: pointer; cursor: pointer;
} }
#tltype .type span { #tltype .type span {
width: calc(100% - 30px); width: calc(100% - 30px);
} }
#tltype .type:hover { #tltype .type:hover {
background-color: var(--beforehover); background-color: var(--beforehover);
} }
#tltype .active { #tltype .active {
background-color: var(--emphasized); background-color: var(--emphasized);
} }
#tltype i { #tltype i {
font-size: 30px; font-size: 30px;
} }
#tltype i.sub-icon { #tltype i.sub-icon {
font-size: 20px; font-size: 20px;
position: absolute; position: absolute;
color: var(--beforehover); color: var(--beforehover);
left: 10px; left: 10px;
bottom: 5px; bottom: 5px;
background-color: #fff; background-color: #fff;
} }
.drag-bar { .drag-bar {
cursor: move; cursor: move;
text-align: center; text-align: center;
width: calc(100% + 10px); width: calc(100% + 10px);
border-radius: 5px; border-radius: 5px;
background-color: var(--box); background-color: var(--box);
filter: brightness(80%); filter: brightness(80%);
margin-left: -5px; margin-left: -5px;
margin-right: -5px; margin-right: -5px;
margin-top: -5px; margin-top: -5px;
font-size: 16px; font-size: 16px;
padding: 4px; padding: 4px;
} }
#something-wrong { #something-wrong {
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
height: 100%; height: 100%;
position: absolute; position: absolute;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
#support-btm { #support-btm {
position: fixed; position: fixed;
bottom: -300px; bottom: -300px;
width: 100vw; width: 100vw;
background-color: var(--box); background-color: var(--box);
z-index: 9999; z-index: 9999;
padding: 10px; padding: 10px;
display: grid; display: grid;
grid-template-columns: 3fr 1fr 1fr; grid-template-columns: 3fr 1fr 1fr;
grid-template-rows: 1fr 36px; grid-template-rows: 1fr 36px;
grid-template-areas: "note middle right" "note close close"; grid-template-areas: 'note middle right' 'note close close';
} }
#support-btm-en, #support-btm-en,
#support-btm-ja { #support-btm-ja {
grid-area: note; grid-area: note;
} }
#support-btm-middle { #support-btm-middle {
grid-area: middle; grid-area: middle;
} }
#support-btm-right { #support-btm-right {
grid-area: right; grid-area: right;
} }
#support-btm-close { #support-btm-close {
grid-area: close; grid-area: close;
} }
.select-wrapper .dropdown-content { .select-wrapper .dropdown-content {
width: 250px !important; width: 250px !important;
} }
input, input,
textarea { textarea {
color: var(--color); color: var(--color);
font-size: 1rem !important; font-size: 1rem !important;
font-family: inherit; font-family: inherit;
} }
.swal2-popup { .swal2-popup {
background-color: var(--notfbox) !important; background-color: var(--notfbox) !important;
} }
.swal2-title, .swal2-title,
.swal2-content { .swal2-content {
color: var(--color) !important; color: var(--color) !important;
} }
#src-contents svg { #src-contents svg {
margin-right: 5px; margin-right: 5px;
} }
.contributor { .contributor {
cursor: pointer; cursor: pointer;
} }
.contributor img { .contributor img {
width: 1rem; width: 1rem;
} }
.tagComp{ .tagComp {
display: grid; display: grid;
grid-template-columns: 60px 80px 1fr; grid-template-columns: 60px 80px 1fr;
grid-template-rows: 1fr 1fr; grid-template-rows: 1fr 1fr;
grid-template-areas: "svg toot user" "svg toot tag" "svg toots tag"; grid-template-areas: 'svg toot user' 'svg toot tag' 'svg toots tag';
border-top: dotted 0.5px var(--gray); border-top: dotted 0.5px var(--gray);
padding: 5px padding: 5px;
} }
.tagCompSvg { .tagCompSvg {
grid-area: svg; grid-area: svg;
} }
.tagCompToot { .tagCompToot {
grid-area: toot; grid-area: toot;
text-align: center; text-align: center;
} }
.tagCompToots { .tagCompToots {
grid-area: toots; grid-area: toots;
text-align: center; text-align: center;
} }
.tagCompUser { .tagCompUser {
grid-area: user; grid-area: user;
} }
.tagCompTag { .tagCompTag {
grid-area: tag; grid-area: tag;
padding-top: 10px; padding-top: 10px;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
} }
#sabakanMark { #sabakanMark {
background-color: var(--emphasized); background-color: var(--emphasized);
}
#pageSrc {
position: fixed;
top: 0;
left: calc(50vw - 150px);
width: 300px;
max-width: 100%;
background-color: var(--box);
z-index: 501;
padding: 5px;
}
#pageSrcInput {
width: 160px;
}
@media (max-width: 500px) {
#pageSrc {
left: 0;
}
} }
/*スクロールバー*/ /*スクロールバー*/
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 5px; width: 5px;
height: 10px; height: 10px;
background: rgba(0, 0, 0, 0.05); background: rgba(0, 0, 0, 0.05);
} }
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
-webkit-border-radius: 5px; -webkit-border-radius: 5px;
border-radius: 5px; border-radius: 5px;
} }
/* Handle */ /* Handle */
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
-webkit-border-radius: 5px; -webkit-border-radius: 5px;
border-radius: 5px; border-radius: 5px;
background: #607d8b; background: #607d8b;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5); -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
} }
/* Web Fonts */ /* Web Fonts */
@font-face { @font-face {
font-family: "Open Sans"; font-family: 'Open Sans';
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
src: local("Open Sans Light"), local("OpenSans-Light"), src: local('Open Sans Light'), local('OpenSans-Light'),
url(https://fonts.gstatic.com/s/opensans/v17/mem5YaGs126MiZpBA-UN_r8OUuhp.woff2) url(https://fonts.gstatic.com/s/opensans/v17/mem5YaGs126MiZpBA-UN_r8OUuhp.woff2) format('woff2');
format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F,
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
U+FEFF, U+FFFD;
} }
@font-face { @font-face {
font-family: "Material Icons"; font-family: 'Material Icons';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: url(https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) src: url(https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2)
format("woff2"); format('woff2');
} }
.material-icons { .material-icons {
font-family: "Material Icons"; font-family: 'Material Icons';
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
font-size: 24px; font-size: 24px;
line-height: 1; line-height: 1;
letter-spacing: normal; letter-spacing: normal;
text-transform: none; text-transform: none;
display: inline-block; display: inline-block;
white-space: nowrap; white-space: nowrap;
word-wrap: normal; word-wrap: normal;
direction: ltr; direction: ltr;
-webkit-font-feature-settings: "liga"; -webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
} }

View File

@ -218,7 +218,7 @@ function graphDraw(tag, acct_id) {
var his = tag.history var his = tag.history
return graphDrawCore(his, tag) return graphDrawCore(his, tag)
} }
function graphDrawCore(his, tag){ function graphDrawCore(his, tag) {
var max = Math.max.apply(null, [ var max = Math.max.apply(null, [
his[0].uses, his[0].uses,
his[1].uses, his[1].uses,
@ -252,7 +252,9 @@ function graphDrawCore(his, tag){
toot toot
</div> </div>
<div class="tagCompTag"> <div class="tagCompTag">
<a onclick="tl('tag','${escapeHTML(tag.name)}','${acct_id}','add')" class="pointer" title="${escapeHTML(tag.name)}"> <a onclick="tl('tag','${escapeHTML(
tag.name
)}','${acct_id}','add')" class="pointer" title="${escapeHTML(tag.name)}">
#${escapeHTML(tag.name)} #${escapeHTML(tag.name)}
</a> </a>
</div> </div>
@ -308,3 +310,40 @@ function trend() {
}) })
}) })
} }
function srcBox(mode) {
var selectedText = window.getSelection().toString()
if (mode == 'open') {
$('#pageSrc').removeClass('hide')
} else if (mode == 'close') {
if(!selectedText) {
$('#pageSrc').addClass('hide')
}
} else {
$('#pageSrc').toggleClass('hide')
}
if(!$('#pageSrc').hasClass('keep')) {
$('#pageSrcInput').val(selectedText)
}
}
$('#pageSrcInput').click(function() {
$('#pageSrc').addClass('keep')
})
$('#pageSrcInput').on('input', function(evt) {
if(!$('#pageSrcInput').val()) {
$('#pageSrc').removeClass('keep')
}
})
document.addEventListener('selectionchange', function() {
var selectedText = window.getSelection().toString()
if (selectedText && !$('input').is(':focus') && !$('textarea').is(':focus')) {
srcBox('open')
}
})
function doSrc(type) {
var q = $('#pageSrcInput').val()
if(type == 'web') {
postMessage(["openUrl", 'https://google.com/search?q=' + q], "*")
} else if(type == 'ts') {
tsAdd(q)
}
}

View File

@ -122,6 +122,7 @@ $('#timeline-container,#group').click(function(e) {
selectedColumn = 0 selectedColumn = 0
selectedToot = 0 selectedToot = 0
localStorage.removeItem('nohide') localStorage.removeItem('nohide')
srcBox('close')
}) })
$('#contextWrap').click(function(e) { $('#contextWrap').click(function(e) {
$('#contextWrap').addClass('hide') $('#contextWrap').addClass('hide')

View File

@ -35,6 +35,11 @@
</script> </script>
<textarea id="copy" style="top:-100px; position:fixed;"></textarea> <textarea id="copy" style="top:-100px; position:fixed;"></textarea>
<canvas id="canvas" style="top:-100px; position:fixed;width:32px;height:32px" width="32" height="32"></canvas> <canvas id="canvas" style="top:-100px; position:fixed;width:32px;height:32px" width="32" height="32"></canvas>
<div id="pageSrc" class="hide z-depth-5">
<input type="text" id="pageSrcInput">
<button class="btn waves-effect" onclick="doSrc('web')" title="@@webSrc@@"><i class="material-icons">open_in_browser</i></button>
<button class="btn waves-effect" onclick="doSrc('ts')" title="@@tsSrc@@"><i class="material-icons">chat</i></button>
</div>
<div id="tl"> <div id="tl">
<!--TL--> <!--TL-->
<!--スターター--> <!--スターター-->