Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for blink style (#847) #853

Merged
merged 1 commit into from
Dec 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions js/hoverzoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,24 @@ var hoverZoom = {
}`;
document.head.appendChild(styleFlip);

// blinker
var styleBlink = document.createElement('style');
styleBlink.innerHTML = `
@keyframes blinkWarning {
0% { color: red; }
100% { color: white; }
}
@-webkit-keyframes blinkWarning {
0% { color: red; }
100% { color: white; }
}
.blinkWarning {
-webkit-animation: blinkWarning 1s linear infinite;
-moz-animation: blinkWarning 1s linear infinite;
animation: blinkWarning 1s linear infinite;
}`;
document.head.appendChild(styleBlink);

var flashFixDomains = [
'www.redditmedia.com'
];
Expand Down Expand Up @@ -964,7 +982,7 @@ var hoverZoom = {
// NotAllowedError: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD
cLog("Play not allowed: " + error);
let videoMsgDiv = $('<div/>');
$('<p/>').text(chrome.i18n.getMessage("msgClickPageToPlayVideo")).css(videoErrorMsgCss).appendTo(videoMsgDiv);
$('<p/>').text(chrome.i18n.getMessage("msgClickPageToPlayVideo")).css(videoErrorMsgCss).addClass('blinkWarning').appendTo(videoMsgDiv);
$(hz.hzImg.hzImgContainer).css(hz.hzImgContainerCss);
$(videoMsgDiv).css({'width':'100%','position':'absolute'}).appendTo(hz.hzImg.hzImgContainer);
video.removeAttribute('poster');
Expand Down Expand Up @@ -1052,7 +1070,7 @@ var hoverZoom = {
// NotAllowedError: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD
cLog("Play not allowed: " + error);
let videoMsgDiv = $('<div/>');
$('<p/>').text(chrome.i18n.getMessage("msgClickPageToPlayVideo")).css(videoErrorMsgCss).appendTo(videoMsgDiv);
$('<p/>').text(chrome.i18n.getMessage("msgClickPageToPlayVideo")).css(videoErrorMsgCss).addClass('blinkWarning').appendTo(videoMsgDiv);
$(hz.hzImg.hzImgContainer).css(hz.hzImgContainerCss);
$(videoMsgDiv).css({'width':'100%','position':'absolute'}).appendTo(hz.hzImg.hzImgContainer);
video.removeAttribute('poster');
Expand Down Expand Up @@ -1180,7 +1198,7 @@ var hoverZoom = {
.css('opacity', 1);
canvas.appendTo(hz.hzImg);
}

hz.hzImg.hzImgContainer = $('<div id="hzImgContainer"/>').css(hz.hzImgContainerCss).appendTo(hz.hzImg);
imgFullSize.css(imgFullSizeCss).appendTo(hz.hzImg.hzImgContainer);

Expand Down