first commit
This commit is contained in:
@@ -0,0 +1,403 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;500;700;800&family=Roboto&display=swap');
|
||||
|
||||
#nri-slug-wrapper {
|
||||
position: relative;
|
||||
min-width: calc(100% - 80px);
|
||||
}
|
||||
|
||||
.nri-nice-review * {
|
||||
font-family: 'Montserrat';
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
|
||||
.nri-nice-review *:not(.nri-background-pattern) {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.nri-nice-review.nri-CDP {
|
||||
--accent-color: #6BB4A7;
|
||||
--accent-color-hover: #5fa296;
|
||||
}
|
||||
|
||||
.nri-nice-review.nri-BM {
|
||||
--accent-color: #0F9990;
|
||||
--accent-color-hover: #0d877f;
|
||||
}
|
||||
|
||||
.nri-nice-review-wrapper {
|
||||
width: calc(100% - 20px);
|
||||
padding-right: 20px;
|
||||
justify-content: center;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.nri-nice-review-wrapper,
|
||||
.nri-nice-review,
|
||||
.nri-content,
|
||||
.nri-options-section {
|
||||
display: -webkit-inline-flex;
|
||||
display: -ms-inline-flex;
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.nri-nice-review {
|
||||
background-color: #ffffff;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
padding: 25px;
|
||||
max-width: 975px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-background-pattern {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.nri-CDP .nri-BM-background {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-BM-background {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-main-image-content {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-main-image-part-1,
|
||||
.nri-nice-review .nri-main-image-part-2,
|
||||
.nri-nice-review .nri-main-image-part-3,
|
||||
.nri-nice-review .nri-main-image-part-4 {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-main-image-part-1 {
|
||||
top: 4px;
|
||||
left: 20px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-main-image-part-1 path,
|
||||
.nri-nice-review .nri-main-image-part-3 path {
|
||||
fill: var(--accent-color);
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-main-image-part-2 {
|
||||
top: -7px;
|
||||
right: -4px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-main-image-part-3 {
|
||||
bottom: 24px;
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-main-image-part-4 {
|
||||
bottom: 0px;
|
||||
left: 6px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-content {
|
||||
-webkit-flex-direction: column;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-text p {
|
||||
font-weight: 300;
|
||||
color: #000000;
|
||||
font-weight: 300;
|
||||
font-size: 15px;
|
||||
letter-spacing: -0.6px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-text p a {
|
||||
font-weight: 700;
|
||||
color: var(--accent-color);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-text p a:hover {
|
||||
color: var(--accent-color-hover);
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-text p a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-text p b {
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-text p:first-child {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-text p:not(:first-child) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-options-section {
|
||||
max-width: 660px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-1 {
|
||||
position: relative;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-round-button,
|
||||
.nri-nice-review .nri-option-1 svg text {
|
||||
font-weight: 800;
|
||||
font-size: 16px;
|
||||
line-height: 16px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-round-button {
|
||||
background: var(--accent-color);
|
||||
border-radius: 100px;
|
||||
border: 0;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-1 svg path {
|
||||
fill: var(--accent-color);
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-1:hover .nri-round-button {
|
||||
background: var(--accent-color-hover);
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-1:hover svg path {
|
||||
fill: var(--accent-color-hover);
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-1:hover span {
|
||||
color: var(--accent-color-hover);
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-1 span {
|
||||
font-weight: 500;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
color: var(--accent-color);
|
||||
position: absolute;
|
||||
top: calc(100% + 5px);
|
||||
left: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-2 button,
|
||||
.nri-nice-review .nri-option-3 button,
|
||||
.nri-nice-review .nri-option-4 button {
|
||||
font-weight: 300;
|
||||
font-size: 13px;
|
||||
line-height: 13px;
|
||||
color: #373737;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-2 button:hover,
|
||||
.nri-nice-review .nri-option-3 button:hover,
|
||||
.nri-nice-review .nri-option-4 button:hover {
|
||||
opacity: .8;
|
||||
}
|
||||
|
||||
@media (min-width: 1301px) {
|
||||
.nri-nice-review .nri-background-pattern {
|
||||
width: 85%;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-text {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-text p {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-options-section {
|
||||
margin-top: 17px;
|
||||
}
|
||||
|
||||
.visible-max-1300 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1300px) {
|
||||
.nri-nice-review {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.nri-main-image-wrapper {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-text p {
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-options-section {
|
||||
margin-top: 25px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 645px) and (max-width: 1300px) {
|
||||
.nri-nice-review .nri-background-pattern {
|
||||
max-width: 85%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1030px) and (max-width: 1300px), (min-width: 896px) and (max-width: 960px) {
|
||||
.nri-nice-review .nri-text {
|
||||
padding-right: 70px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1030px), (min-width: 896px) and (max-width: 960px) {
|
||||
.nri-nice-review {
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-content {
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-1 svg {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 961px) and (max-width: 1029px), (min-width: 645px) and (max-width: 895px) {
|
||||
.nri-nice-review {
|
||||
padding-bottom: 90px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-content {
|
||||
margin-left: 40px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-leave-review-link,
|
||||
.nri-nice-review .nri-option-1 {
|
||||
display: -webkit-inline-flex;
|
||||
display: -ms-inline-flex;
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-1 .nri-round-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-2 {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-options-section {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 35px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 701px) {
|
||||
.nri-nice-review .nri-text p {
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.nri-nice-review .nri-text p {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 645px) {
|
||||
.nri-nice-review .nri-round-button {
|
||||
padding: 7px 32px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-3,
|
||||
.nri-nice-review .nri-option-4 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-2 button,
|
||||
.nri-nice-review .nri-option-3 button,
|
||||
.nri-nice-review .nri-option-4 button {
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 644px) {
|
||||
.nri-nice-review,
|
||||
.nri-nice-review .nri-options-section {
|
||||
-webkit-flex-direction: column;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-background-pattern {
|
||||
max-width: 660px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-main-image-wrapper {
|
||||
display: -webkit-inline-flex;
|
||||
display: -ms-inline-flex;
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-round-button {
|
||||
padding: 7px 48px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-2 {
|
||||
margin-left: 0;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-3,
|
||||
.nri-nice-review .nri-option-4 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-2 button,
|
||||
.nri-nice-review .nri-option-3 button,
|
||||
.nri-nice-review .nri-option-4 button {
|
||||
width: 220px;
|
||||
padding: 7px;
|
||||
border-radius: 100px;
|
||||
background-color: rgba(250, 250, 250, .7);
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
|
||||
.nri-nice-review .nri-option-1 svg {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 400px) {
|
||||
.nri-nice-review .nri-background-pattern {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 57 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 164 KiB |
@@ -0,0 +1,3 @@
|
||||
<svg width="21" height="22" viewBox="0 0 21 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.5787 21.5685L0.686523 11.0769L10.5787 0.585205L20.4708 11.0769L10.5787 21.5685ZM5.85449 11.0769L10.5787 16.0882L15.3036 11.0769L10.5787 6.06558L5.85449 11.0769Z" fill="#FFD520"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 335 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="15" height="16" viewBox="0 0 15 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.86668 15.0751C6.50325 15.0748 5.17054 14.6527 4.037 13.8621C2.90347 13.0715 2.02004 11.9479 1.49837 10.6335C0.976709 9.319 0.840242 7.87264 1.10623 6.47726C1.37222 5.08189 2.02872 3.80013 2.99273 2.79405C3.95675 1.78796 5.185 1.10275 6.52218 0.824978C7.85937 0.547207 9.24547 0.689383 10.5052 1.23353C11.765 1.77767 12.8419 2.69937 13.5997 3.88207C14.3575 5.06477 14.7623 6.45537 14.7628 7.87808C14.7615 9.78626 14.0346 11.6159 12.7416 12.9653C11.4487 14.3147 9.69535 15.0735 7.86668 15.0751ZM7.86668 4.11079C7.15198 4.11068 6.4533 4.33179 5.85903 4.7461C5.26476 5.16041 4.8016 5.74933 4.52814 6.43837C4.25468 7.1274 4.18322 7.88555 4.32279 8.61698C4.46235 9.3484 4.80666 10.0202 5.31218 10.5474C5.8177 11.0746 6.46172 11.4335 7.16275 11.5787C7.86377 11.7239 8.59032 11.6488 9.25048 11.3631C9.91064 11.0773 10.4748 10.5937 10.8715 9.97336C11.2682 9.353 11.4796 8.62386 11.4791 7.87808C11.4773 6.87914 11.096 5.92164 10.4189 5.21549C9.74178 4.50934 8.82399 4.1121 7.86668 4.11079Z" fill="#FFD41F"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,62 @@
|
||||
<svg width="133" height="129" viewBox="0 0 133 129" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M116.772 21.2431C128.976 34.844 131.236 50.2939 131.893 55.1426C135.057 79.1393 125.196 108.519 101.117 121.75C83.2837 131.57 64.8752 128.489 61.7935 127.913C51.0278 125.941 43.2207 121.339 38.6186 118.545C26.7435 111.395 20.0869 103.013 18.4433 100.835C17.9091 100.136 17.4982 99.6022 17.3749 99.3967C12.9372 93.3565 0.486843 74.7837 6.69147 62.2923C10.7183 54.1975 18.3611 55.2247 20.5389 47.3765C22.7577 39.2406 14.7041 35.1316 16.2244 26.1739C17.7858 17.0108 28.1406 11.3815 33.2768 8.62841C55.2601 -2.95904 94.1726 -3.9863 116.772 21.2431ZM5.08895 52.143C5.08895 52.143 13.0194 51.691 14.4575 46.3082C15.2793 43.1853 14.0466 39.405 12.855 36.8163C11.9921 34.9262 9.56778 34.2687 7.88309 35.5014C7.88309 35.5014 7.842 35.5014 7.842 35.5425C1.96609 39.7337 -0.663683 48.8147 2.04827 51.3623C2.45917 51.7732 3.32207 52.2662 5.08895 52.143Z" fill="#F4F4F4"/>
|
||||
<mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="133" height="129">
|
||||
<path d="M116.772 21.2431C128.976 34.844 131.236 50.2939 131.893 55.1426C135.057 79.1393 125.196 108.519 101.117 121.75C83.2837 131.57 64.8752 128.489 61.7935 127.913C51.0278 125.941 43.2207 121.339 38.6186 118.545C26.7435 111.395 20.0869 103.013 18.4433 100.835C17.9091 100.136 17.4982 99.6022 17.3749 99.3967C12.9372 93.3565 0.486843 74.7837 6.69147 62.2923C10.7183 54.1975 18.3611 55.2247 20.5389 47.3765C22.7577 39.2406 14.7041 35.1316 16.2244 26.1739C17.7858 17.0108 28.1406 11.3815 33.2768 8.62841C55.2601 -2.95904 94.1726 -3.9863 116.772 21.2431ZM5.08895 52.143C5.08895 52.143 13.0194 51.691 14.4575 46.3082C15.2793 43.1853 14.0466 39.405 12.855 36.8163C11.9921 34.9262 9.56778 34.2687 7.88309 35.5014C7.88309 35.5014 7.842 35.5014 7.842 35.5425C1.96609 39.7337 -0.663683 48.8147 2.04827 51.3623C2.45917 51.7732 3.32207 52.2662 5.08895 52.143Z" fill="#F4F4F4"/>
|
||||
</mask>
|
||||
<g mask="url(#mask0)">
|
||||
<path d="M45.4793 68.4962L-0.665039 114.682V137.446H19.8801L67.1339 90.1508L45.4793 68.4962Z" fill="#FBB381"/>
|
||||
<path d="M97.0476 60.1549L97.9105 61.0178C99.5952 62.7025 99.5952 65.4144 97.9105 67.0991L70.9142 94.0543L64.011 87.1511L90.9662 60.1959C92.6509 58.4702 95.3629 58.4702 97.0476 60.1549Z" fill="url(#paint0_linear)"/>
|
||||
<path d="M97.9105 44.6227L98.7734 45.4856C100.458 47.1703 100.458 49.8823 98.7734 51.567L63.6001 86.7402L56.697 79.8371L91.8702 44.6638C93.5138 42.9791 96.2258 42.9791 97.9105 44.6227Z" fill="url(#paint1_linear)"/>
|
||||
<path d="M93.2672 34.6378L94.1301 35.5007C95.8148 37.1854 95.8148 39.8974 94.1301 41.5821L56.286 79.4262L49.3829 72.523L87.227 34.6789C88.9117 32.9531 91.6236 32.9531 93.2672 34.6378Z" fill="url(#paint2_linear)"/>
|
||||
<path d="M81.2689 31.967L82.1318 32.8299C83.8165 34.5146 83.8165 37.2265 82.1318 38.9112L48.9309 72.1121L42.0277 65.209L75.2286 32.0081C76.8722 30.3234 79.6253 30.3234 81.2689 31.967Z" fill="url(#paint3_linear)"/>
|
||||
<path d="M56.5326 99.9713C67.8112 99.9713 76.9544 90.8281 76.9544 79.5494C76.9544 68.2708 67.8112 59.1276 56.5326 59.1276C45.2539 59.1276 36.1107 68.2708 36.1107 79.5494C36.1107 90.8281 45.2539 99.9713 56.5326 99.9713Z" fill="url(#paint4_linear)"/>
|
||||
<path d="M85.3779 79.5495L56.5326 50.663L42.0277 65.1679L70.9141 94.0543L85.3779 79.5495Z" fill="url(#paint5_linear)"/>
|
||||
<path d="M85.0918 26.3376L92.4058 41.1712C92.8989 42.1984 93.8851 42.897 95.0356 43.0613L111.431 45.4446C114.266 45.8555 115.416 49.3481 113.362 51.3616L101.487 62.9079C100.665 63.6886 100.295 64.8391 100.501 65.9897L103.295 82.3025C103.788 85.1377 100.788 87.3155 98.2818 85.9595L83.6125 78.2346C82.5853 77.7004 81.3937 77.7004 80.3664 78.2346L65.6972 85.9595C63.1496 87.3155 60.1911 85.1377 60.6842 82.3025L63.4783 65.9897C63.6838 64.8802 63.314 63.7297 62.4922 62.9079L50.6171 51.3616C48.5626 49.3481 49.7131 45.8555 52.5483 45.4446L68.9433 43.0613C70.0528 42.897 71.0389 42.1984 71.5731 41.1712L78.8872 26.3376C80.161 23.7489 83.818 23.7489 85.0918 26.3376Z" fill="url(#paint6_linear)"/>
|
||||
<path d="M63.3535 64.305L63.4768 63.5653C63.6822 62.4559 63.3124 61.3054 62.4906 60.4836L50.6155 48.9372C50.2457 48.5674 49.9581 48.1154 49.7937 47.6634C49.3417 48.855 49.5472 50.2932 50.6155 51.3205L62.4906 62.8668C62.8604 63.3188 63.1892 63.8119 63.3535 64.305Z" fill="#FFAB00"/>
|
||||
<path d="M113.319 48.9372L101.444 60.4836C100.622 61.2643 100.253 62.4148 100.458 63.5653L100.581 64.305C100.746 63.7708 101.033 63.3188 101.444 62.9079L113.319 51.3615C114.388 50.3343 114.593 48.8961 114.141 47.7045C114.018 48.1565 113.73 48.5674 113.319 48.9372Z" fill="#FFAB00"/>
|
||||
<path d="M103.17 81.6039C102.513 83.4941 100.253 84.6035 98.2802 83.5763L83.611 75.8513C82.5838 75.3171 81.3921 75.3171 80.3649 75.8513L65.6957 83.5763C63.6823 84.6446 61.4223 83.4941 60.8059 81.6039L60.6827 82.3436C60.1896 85.1788 63.1892 87.3566 65.6957 86.0006L80.3649 78.2756C81.3921 77.7415 82.5838 77.7415 83.611 78.2756L98.2802 86.0006C100.828 87.3566 103.786 85.1788 103.293 82.3436L103.17 81.6039Z" fill="#FFAB00"/>
|
||||
<path d="M75.0642 51.2383C75.0642 52.3066 74.2013 53.1695 73.133 53.1695C72.0646 53.1695 71.2017 52.3066 71.2017 51.2383C71.2017 50.1699 72.0646 49.307 73.133 49.307C74.2013 49.307 75.0642 50.1699 75.0642 51.2383Z" fill="#424242"/>
|
||||
<path d="M92.7331 51.2383C92.7331 52.3066 91.8702 53.1695 90.8019 53.1695C89.7335 53.1695 88.8706 52.3066 88.8706 51.2383C88.8706 50.1699 89.7335 49.307 90.8019 49.307C91.8702 49.307 92.7331 50.1699 92.7331 51.2383Z" fill="#424242"/>
|
||||
<path d="M90.432 58.9632C91.788 58.9632 92.6919 60.4014 91.9934 61.593C90.432 64.346 86.5284 66.2773 81.9674 66.2773C77.4064 66.2773 73.4617 64.346 71.9414 61.593C71.2839 60.4014 72.1468 58.9632 73.5028 58.9632H90.432Z" fill="#424242"/>
|
||||
<path d="M76.6667 65.3322C78.2282 65.9486 80.0362 66.2773 81.9674 66.2773C83.8986 66.2773 85.7066 65.9075 87.268 65.3322C87.0215 62.5792 84.7615 60.4425 81.9674 60.4425C79.1733 60.4425 76.9133 62.5792 76.6667 65.3322Z" fill="#F44336"/>
|
||||
<path d="M49.3007 82.508C54.9287 82.508 59.4911 77.9456 59.4911 72.3176C59.4911 66.6896 54.9287 62.1272 49.3007 62.1272C43.6727 62.1272 39.1104 66.6896 39.1104 72.3176C39.1104 77.9456 43.6727 82.508 49.3007 82.508Z" fill="#FBB381"/>
|
||||
<path d="M49.4239 72.4409L42.0688 65.1268L59.8609 47.3347C60.395 46.8006 61.2579 46.8006 61.7921 47.3347L62.9015 48.4442C65.7779 51.3205 65.7779 56.0048 62.9015 58.9222L49.4239 72.4409Z" fill="#FBB381"/>
|
||||
<path d="M42.0688 65.1268C34.0973 73.0983 34.0973 86.0418 42.0688 94.0133L56.4915 79.5906L42.0688 65.1268Z" fill="#FBB381"/>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear" x1="76.9028" y1="47.8357" x2="84.384" y2="92.0628" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FBB381"/>
|
||||
<stop offset="0.2694" stop-color="#A95B35"/>
|
||||
<stop offset="0.8919" stop-color="#FBB381"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear" x1="75.67" y1="48.1601" x2="83.1409" y2="92.3266" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FBB381"/>
|
||||
<stop offset="0.2694" stop-color="#A95B35"/>
|
||||
<stop offset="0.8919" stop-color="#FBB381"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear" x1="71.2931" y1="48.9641" x2="78.7614" y2="93.1155" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FBB381"/>
|
||||
<stop offset="0.2694" stop-color="#A95B35"/>
|
||||
<stop offset="0.8919" stop-color="#FBB381"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint3_linear" x1="62.726" y1="50.452" x2="70.199" y2="94.6312" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FBB381"/>
|
||||
<stop offset="0.2694" stop-color="#A95B35"/>
|
||||
<stop offset="0.8919" stop-color="#FBB381"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint4_linear" x1="51.9302" y1="52.4043" x2="59.3544" y2="96.2943" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FBB381"/>
|
||||
<stop offset="0.2694" stop-color="#A95B35"/>
|
||||
<stop offset="0.8919" stop-color="#FBB381"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint5_linear" x1="60.1041" y1="51.0217" x2="67.5283" y2="94.9119" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FBB381"/>
|
||||
<stop offset="0.2694" stop-color="#A95B35"/>
|
||||
<stop offset="0.8919" stop-color="#FBB381"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint6_linear" x1="81.979" y1="86.3779" x2="81.979" y2="24.3903" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FFEB3B"/>
|
||||
<stop offset="1" stop-color="#FFC107"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.1 KiB |
@@ -0,0 +1,35 @@
|
||||
// Always close the code, cause you can make conflicts (same for css use prefixes)
|
||||
(function ($) {
|
||||
|
||||
let slug = $('#nri-slug-wrapper').data('slug');
|
||||
|
||||
function banner_hide() {
|
||||
$('#nri-sub-wrapper').hide(450);
|
||||
$('#nri-slug-wrapper').hide(400);
|
||||
}
|
||||
|
||||
$('.nri-dismiss').on('click', function () {
|
||||
|
||||
$.post(ajaxurl, { action: 'inisev_review', nonce: inisev_review_dismiss.nonce, token: 'irbh', slug: slug, mode: 'dismiss' }).done(function (res) {
|
||||
|
||||
}).fail(function (err) {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
banner_hide();
|
||||
|
||||
});
|
||||
|
||||
$('.nri-remind').on('click', function () {
|
||||
|
||||
$.post(ajaxurl, { action: 'inisev_review', nonce: inisev_review_dismiss.nonce, token: 'irbh', slug: slug, mode: 'remind' }).done(function (res) {
|
||||
|
||||
}).fail(function (err) {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
banner_hide();
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
331
wp-content/plugins/copy-delete-posts/modules/review/review.php
Normal file
331
wp-content/plugins/copy-delete-posts/modules/review/review.php
Normal file
@@ -0,0 +1,331 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* File for our cool review ask in the header
|
||||
*
|
||||
* @category Child Plugin
|
||||
* @version v0.1.0
|
||||
* @since v0.1.0
|
||||
* @author iClyde <kontakt@iclyde.pl>
|
||||
*/
|
||||
|
||||
// Namespace
|
||||
namespace Inisev\Subs;
|
||||
|
||||
// Disallow direct access
|
||||
if (defined('ABSPATH')) {
|
||||
|
||||
/**
|
||||
* Main class for handling the Review
|
||||
*/
|
||||
if (!class_exists('Inisev\Subs\Inisev_Review')) {
|
||||
class Inisev_Review {
|
||||
|
||||
/**
|
||||
* Local variables
|
||||
*/
|
||||
private $root; // __ROOT__ of plugin's root
|
||||
private $file; // __FILE__ of plugin's root
|
||||
private $slug; // Plugin's slug
|
||||
private $name; // Name displayed in banner
|
||||
private $days; // Days displayed in banner
|
||||
private $minutes; // Minutes displayed in banner
|
||||
private $debug = false; // If true it will display minutes
|
||||
private $minimum_time = (30 * 24 * 60 * 60); // Minimum time required to display (in seconds)
|
||||
// private $minimum_time = (3 * 60); // Minimum time required to display (in seconds)
|
||||
private $remind_time = '+14 days'; // Time when banner will be reminded
|
||||
private $time_between = '+2 days'; // Time when new banner can be displayed
|
||||
|
||||
/**
|
||||
* Local URLs
|
||||
*/
|
||||
private $root_url; // Root URL for plugin's dir
|
||||
private $assets_url; // Root URL for review assets
|
||||
private $review_url; // Review URL
|
||||
private $plugin_menu_url; // Plugin's settings menu
|
||||
public $option_name = '_irb_h_bn_review'; // Option name for this module
|
||||
public $using_since; // Check since user uses this plugin
|
||||
|
||||
/**
|
||||
* __construct:
|
||||
* Compile some variables for "future use"
|
||||
* Such as slug of current plugin, root dir of plugin
|
||||
*
|
||||
* @param string $root_file __FILE__ of plugin's main file
|
||||
* @param string $root_dir __DIR__ of plugin's main file
|
||||
* @param string $individual_slug Individual slug - mostly plugin's slug
|
||||
* @param string $display_name The name that will be displayed in the banner
|
||||
* @param string $review_url The URL that will be served as review one
|
||||
* @param string $plugin_menu_url Plugin menu slug example.com/wp-admin/admin.php?page=<this slug here>
|
||||
* @return Inisev_Review The review object
|
||||
*/
|
||||
function __construct($root_file, $root_dir, $individual_slug, $display_name, $review_url, $plugin_menu_url) {
|
||||
|
||||
$this->file = $root_file;
|
||||
$this->root = $root_dir;
|
||||
$this->slug = $individual_slug;
|
||||
$this->name = $display_name;
|
||||
|
||||
$this->review_url = $review_url;
|
||||
$this->plugin_menu_url = admin_url('admin.php?page=' . $plugin_menu_url);
|
||||
|
||||
$this->root_url = plugin_dir_url($this->file);
|
||||
$this->assets_url = $this->root_url . 'modules/review/assets/';
|
||||
$option_name = $this->option_name;
|
||||
$empty = ['users' => []];
|
||||
$empty[$individual_slug] = time();
|
||||
|
||||
$data = get_option($option_name, false);
|
||||
|
||||
if ($data != false && isset($data) && is_array($data)) {
|
||||
|
||||
if (!array_key_exists($individual_slug, $data)) {
|
||||
|
||||
$data[$individual_slug] = time();
|
||||
update_option($option_name, $data);
|
||||
|
||||
}
|
||||
|
||||
$this->using_since = $data;
|
||||
|
||||
} else {
|
||||
|
||||
if ($individual_slug == 'copy-delete-posts' && get_option('_cdp_review', false) != false) {
|
||||
if (isset(get_option('_cdp_review', false)['installed'])) {
|
||||
$empty[$individual_slug] = get_option('_cdp_review', false)['installed'];
|
||||
}
|
||||
}
|
||||
|
||||
update_option($option_name, $empty);
|
||||
$this->using_since = $empty;
|
||||
|
||||
}
|
||||
|
||||
// Add handler for Ajax request
|
||||
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
|
||||
// Check if slug is defined
|
||||
if (isset($_POST['slug']) && !empty($_POST['slug'])) {
|
||||
|
||||
// Handle the request
|
||||
add_action('wp_ajax_inisev_review', [&$this, 'handle_review_action']);
|
||||
|
||||
}
|
||||
|
||||
// Stop for POST
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
add_action('wp_loaded', [&$this, 'init_review']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* __asset - Loads assets
|
||||
*
|
||||
* @param string $file path relative
|
||||
* @return string file URL
|
||||
*/
|
||||
private function __asset($file) {
|
||||
|
||||
return $this->assets_url . $file;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* __dir_asset - Loads assets
|
||||
*
|
||||
* @param string $file path relative
|
||||
* @return string absolute path
|
||||
*/
|
||||
private function __dir_asset($file) {
|
||||
|
||||
return __DIR__ . '/assets' . '/' . $file;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* _asset - Loads assets and automatically echo
|
||||
*
|
||||
* @param string $file path relative
|
||||
* @echo string file URL
|
||||
*/
|
||||
private function _asset($file) {
|
||||
|
||||
echo $this->assets_url . $file;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* _dir_asset - Loads assets and automatically echo
|
||||
*
|
||||
* @param string $file path relative
|
||||
* @echo string absolute path
|
||||
*/
|
||||
private function _dir_asset($file) {
|
||||
|
||||
echo __DIR__ . '/assets' . '/' . $file;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* can_be_displayed - check if the banner should be displayed
|
||||
*
|
||||
* @return bool true if banner can be displayed
|
||||
*/
|
||||
private function can_be_displayed() {
|
||||
|
||||
global $pagenow;
|
||||
|
||||
if ($pagenow == 'post.php' || $pagenow == 'profile.php') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$uid = get_current_user_id();
|
||||
if (!defined('IRB_H_CHECK_LOADED') && function_exists('get_current_user_id') && isset($uid) && intval($uid) > 0) {
|
||||
|
||||
$since = intval($this->using_since[$this->slug]);
|
||||
$diff = time() - $since;
|
||||
|
||||
if ($diff > $this->minimum_time) {
|
||||
|
||||
$seconds = $diff;
|
||||
$minutes = intval($diff / 60);
|
||||
$hours = intval($minutes / 60);
|
||||
$days = intval($hours / 24);
|
||||
|
||||
$this->days = $days;
|
||||
$this->minutes = $minutes;
|
||||
$data = $this->using_since;
|
||||
|
||||
if (isset($data['users']) && isset($data['users'][$uid])) {
|
||||
|
||||
if (isset($data['users'][$uid]['delay_between'])) {
|
||||
if (time() <= intval($data['users'][$uid]['delay_between'])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($data['users'][$uid][$this->slug])) {
|
||||
if (isset($data['users'][$uid][$this->slug]['remind'])) {
|
||||
if (time() <= intval($data['users'][$uid][$this->slug]['remind'])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (isset($data['users'][$uid][$this->slug]['dismiss'])) {
|
||||
if ($data['users'][$uid][$this->slug]['dismiss'] == true || $data['users'][$uid][$this->slug]['dismiss'] == 'true') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
define('IRB_H_CHECK_LOADED', true);
|
||||
return true;
|
||||
|
||||
} else return false;
|
||||
|
||||
} else return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* add_assets - adds required assests by the banner
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add_assets() {
|
||||
|
||||
if (!defined('IRB_H_ASSETS_LOADED')) {
|
||||
define('IRB_H_ASSETS_LOADED', true);
|
||||
wp_enqueue_script('inisev-review-script', $this->__asset('js/script.js'), [], filemtime($this->__dir_asset('js/script.js')), true);
|
||||
wp_enqueue_style('inisev-review-style', $this->__asset('css/style.css'), [], filemtime($this->__dir_asset('css/style.css')));
|
||||
wp_localize_script('inisev-review-script', 'inisev_review_dismiss', [
|
||||
'nonce' => wp_create_nonce('inisev_review_dismiss'),
|
||||
], true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* display_review - loads the HTML and prints it in the header only once
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function display_review() {
|
||||
|
||||
if (!defined('IRB_H_HTML_LOADED')) {
|
||||
define('IRB_H_HTML_LOADED', true);
|
||||
include_once __DIR__ . '/views/banner.php';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* handle_review_action - Handles all POST actions
|
||||
*
|
||||
* @param string $_POST['token'] - must be === 'irbh'
|
||||
* @param string $_POST['slug'] - the unique slug
|
||||
* @param string $_POST['mode'] - the unique action remind/dismiss
|
||||
*
|
||||
* @return json returns it to browser
|
||||
*/
|
||||
public function handle_review_action() {
|
||||
|
||||
if (check_ajax_referer('inisev_review_dismiss', 'nonce', false) === false) {
|
||||
return wp_send_json_error();
|
||||
}
|
||||
|
||||
$slug = sanitize_text_field($_POST['slug']);
|
||||
$mode = sanitize_text_field($_POST['mode']);
|
||||
|
||||
if (!empty($_POST['slug']) && isset($mode) && in_array($mode, ['dismiss', 'remind'])) {
|
||||
$option_name = $this->option_name;
|
||||
$data = get_option($option_name, false);
|
||||
if ($data != false) {
|
||||
|
||||
$uid = get_current_user_id();
|
||||
|
||||
if (!array_key_exists('users', $data)) $data['users'] = [];
|
||||
if (!array_key_exists($uid, $data['users'])) $data['users'][$uid] = [];
|
||||
if (!array_key_exists($slug, $data['users'][$uid])) $data['users'][$uid][$slug] = [];
|
||||
|
||||
$data['users'][$uid]['delay_between'] = strtotime($this->time_between);
|
||||
|
||||
if ($mode == 'remind') {
|
||||
$data['users'][$uid][$slug]['remind'] = strtotime($this->remind_time);
|
||||
}
|
||||
|
||||
if ($mode == 'dismiss') {
|
||||
$data['users'][$uid][$slug]['dismiss'] = true;
|
||||
}
|
||||
|
||||
update_option($option_name, $data);
|
||||
|
||||
wp_send_json_success();
|
||||
|
||||
} else wp_send_json_error();
|
||||
} else wp_send_json_error();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* init_review - initialization when the user is authenticated already
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init_review() {
|
||||
|
||||
if ($this->can_be_displayed()) {
|
||||
add_action('admin_enqueue_scripts', [&$this, 'add_assets']);
|
||||
add_action('admin_notices', [&$this, 'display_review']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Main renderer for the Review Banner
|
||||
*
|
||||
* @category Child Plugin
|
||||
* @author iClyde <kontakt@iclyde.pl>
|
||||
*/
|
||||
|
||||
// Namespace
|
||||
namespace Inisev\Subs;
|
||||
|
||||
// Disallow direct access
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
?>
|
||||
|
||||
<section class="nri-nice-review-wrapper" id="nri-slug-wrapper" data-slug="<?php echo esc_html($this->slug); ?>">
|
||||
<div class="nri-nice-review nri-CDP" id="nri-sub-wrapper">
|
||||
<img src="<?php $this->_asset('imgs/background-pattern.svg'); ?>" alt="Background with stars" class="nri-background-pattern">
|
||||
<img src="<?php $this->_asset('imgs/BM-background.svg'); ?>" alt="Background Image" class="nri-BM-background">
|
||||
<div class="nri-main-image-wrapper">
|
||||
<div class="nri-main-image-content">
|
||||
<img src="<?php $this->_asset('imgs/main-image.svg'); ?>" alt="Images top" class="nri-main-image">
|
||||
<svg class="nri-main-image-part-1" width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.16333 20.7604V0.976166L19.9476 10.8713L0.16333 20.7604ZM3.9547 7.10886V14.6277L11.4697 10.8713L3.9547 7.10886Z" fill="#6BB4A7"/>
|
||||
</svg>
|
||||
<img src="<?php $this->_asset('imgs/main-image-part-2.svg'); ?>" alt="Images middle" class="nri-main-image-part-2">
|
||||
<svg class="nri-main-image-part-3" width="32" height="12" viewBox="0 0 32 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.05762 11.0941L0.098938 4.57857L2.51846 2.03343L7.05821 6.28666L12.8091 0.902252L18.5583 6.28666L24.3115 0.902252L31.2741 7.41783L28.8552 9.96297L24.3115 5.70974L18.5578 11.0941L12.8086 5.70974L7.05762 11.0941Z" fill="#6BB4A7"/>
|
||||
</svg>
|
||||
<img src="<?php $this->_asset('imgs/main-image-part-4.svg'); ?>" alt="Images end" class="nri-main-image-part-4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="nri-content">
|
||||
<div class="nri-text">
|
||||
<p>You’ve been using the <a href="<?php echo $this->plugin_menu_url; ?>"><?php echo $this->name; ?></a> plugin for over <?php echo $this->days; ?> days<?php echo (($this->debug === true)?' ('.$this->minutes.' minutes)':''); ?> now – entirely <b>for FREE :)</b></p>
|
||||
<p>Don’t worry, we’re not asking you to upgrade to premium.<br class="visible-max-1300"> But maybe you can give us a nice review (if you like it)? We put a lot of effort into the free plugin, and made it feature-rich. It would motivate us a lot! Is that fair?</p>
|
||||
</div>
|
||||
<div class="nri-options-section">
|
||||
<a href="<?php echo $this->review_url; ?>" target="_blank" class="nri-leave-review-link nri-dismiss">
|
||||
<div class="nri-option-1">
|
||||
<button class="nri-round-button">Yes, that's fair!</button>
|
||||
<svg width="185" height="34">
|
||||
<path d="M 0 0 L 185 0 L 165 17 L 185 34 L 0 34 Z" />
|
||||
<text x="85" y="19" fill="#FFFFFF" text-anchor="middle" alignment-baseline="middle">
|
||||
Yes, that's fair!
|
||||
</text>
|
||||
</svg>
|
||||
<span>Let me give a nice review</span>
|
||||
</div>
|
||||
</a>
|
||||
<div class="nri-option-2">
|
||||
<button class="nri-remind">Ask me later</button>
|
||||
</div>
|
||||
<div class="nri-option-3">
|
||||
<button class="nri-dismiss">I already did</button>
|
||||
</div>
|
||||
<div class="nri-option-4">
|
||||
<button class="nri-dismiss">I'm just taking, not giving</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,430 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* File for our cool try it out module
|
||||
* That allows people to try out any plugin within WP directory
|
||||
* Before they install it on their real website, this feature
|
||||
* Is completely free and available for everyone
|
||||
*
|
||||
* @category Child Plugin
|
||||
* @version v0.1.3
|
||||
* @since v0.1.0
|
||||
* @author iClyde <kontakt@iclyde.pl>
|
||||
*/
|
||||
|
||||
// Namespace
|
||||
namespace Inisev\Subs;
|
||||
|
||||
// Disallow direct access
|
||||
if (defined('ABSPATH')) {
|
||||
|
||||
/**
|
||||
* Main class for handling the Review
|
||||
*/
|
||||
if (!class_exists('Inisev\Subs\Inisev_Try_Out_Plugins')) {
|
||||
class Inisev_Try_Out_Plugins {
|
||||
|
||||
public $pluginDir;
|
||||
public $pluginFile;
|
||||
public $pluginName;
|
||||
public $pluginPageURL;
|
||||
|
||||
function __construct($plugin_file, $plugin_dir, $plugin_name, $plugin_menu_page) {
|
||||
|
||||
if (!is_admin() || !current_user_can('install_plugins')) return;
|
||||
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
add_action('wp_ajax_tifm_notice_actions', [&$this, 'noticeAjax']);
|
||||
}
|
||||
|
||||
if (get_option('_tifm_feature_enabled') == 'enabled') {
|
||||
update_option('_tifm_force_disable_feature_update', true);
|
||||
} else if (get_option('_tifm_force_disable_feature_update', 'no') === 'no') {
|
||||
delete_option('_tifm_feature_enabled');
|
||||
delete_option('_tifm_hide_notice_forever');
|
||||
delete_option('_tifm_disable_feature_forever');
|
||||
update_option('_tifm_force_disable_feature_update', true);
|
||||
}
|
||||
|
||||
global $pagenow;
|
||||
if (!($pagenow == 'plugin-install.php' || $pagenow == 'admin-ajax.php')) return;
|
||||
if (get_option('_tifm_disable_feature_forever', false) != false) return;
|
||||
|
||||
$this->pluginDir = $plugin_dir;
|
||||
$this->pluginFile = $plugin_file;
|
||||
$this->pluginName = $plugin_name;
|
||||
$this->pluginPageURL = admin_url($plugin_menu_page) . '&scrollToSection=testPlugins';
|
||||
|
||||
$this->showInformativeNotice();
|
||||
$this->insertActionButton();
|
||||
|
||||
}
|
||||
|
||||
public function showInformativeNotice() {
|
||||
|
||||
add_action('in_admin_footer', [&$this, 'tryItOutScript']);
|
||||
|
||||
if (get_option('_tifm_hide_notice_forever', false) != false) return;
|
||||
|
||||
add_action('admin_notices', [&$this, 'informativeAdminNoticeHandler']);
|
||||
add_action('admin_head', [&$this, 'noticeStyles']);
|
||||
add_action('in_admin_footer', [&$this, 'noticeScripts']);
|
||||
|
||||
}
|
||||
|
||||
public function noticeStyles() {
|
||||
?>
|
||||
|
||||
<style media="screen">
|
||||
#tifm_new_feature_notice {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
#tifm_paragraph_notice {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
#tifm_new_feature_notice span {
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
#tifm_new_feature_notice .tifm_poweredby {
|
||||
line-height: 30px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
#tifm_paragraph_notice .tifm_darker_a, #tifm_paragraph_notice .tifm_darker_a_preview {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
#tifm_paragraph_notice .tifm_darker_a_muted {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
#tifm_new_feature_notice .tifm_brought_url {
|
||||
color: #00a32a;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#tifm_paragraph_notice .tifm-grow-1 {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
#tifm_paragraph_notice .tifm-grow-2 {
|
||||
flex-grow: 2;
|
||||
text-align: right;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
#tifm_paragraph_notice .tifm-grow-5 {
|
||||
flex-grow: 5;
|
||||
}
|
||||
|
||||
#tifm_paragraph_notice .tifm_btn {
|
||||
padding: 6px 18px;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
text-decoration: none;
|
||||
border: 1px solid black;
|
||||
transition: 0.3s all;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#tifm_paragraph_notice .tifm_btn_green {
|
||||
background: #00a32a;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#tifm_paragraph_notice .tifm_btn_grey {
|
||||
background: #d9e3f4;
|
||||
margin-left: 15px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
#tifm_paragraph_notice .tifm_btn_green:hover, #tifm_paragraph_notice .tifm_btn_grey:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
#tifm_paragraph_notice .tifm_btn_green:active, #tifm_paragraph_notice .tifm_btn_grey:active {
|
||||
transition: 0 all !important;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1400px) {
|
||||
#tifm_paragraph_notice {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
public function noticeScripts() {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
$('#tifm_new_feature_notice').on('click', '.notice-dismiss', hideAndDismissNotice);
|
||||
|
||||
$('#tifm_new_feature_notice').on('click', '.tifm_darker_a', enableAndDismissNotice);
|
||||
|
||||
$('#tifm_new_feature_notice').on('click', '.tifm_darker_a_preview', previewNotice);
|
||||
|
||||
$('#tifm_new_feature_notice').on('click', '.tifm_darker_a_muted', disableFeatureAndDismiss);
|
||||
|
||||
let nonce = "<?php echo wp_create_nonce('tifm_notice_nonce') ?>";
|
||||
|
||||
function hideAndDismissNotice(e) {
|
||||
|
||||
let dismiss = false;
|
||||
let enable = false;
|
||||
if (typeof e != 'string') {
|
||||
e.preventDefault();
|
||||
} else if (e == 'dismiss') {
|
||||
dismiss = true;
|
||||
} else if (e == 'enable') {
|
||||
enable = true;
|
||||
}
|
||||
|
||||
$('#tifm_new_feature_notice').hide(300);
|
||||
setTimeout(function () {
|
||||
$('#tifm_new_feature_notice').remove();
|
||||
}, 350);
|
||||
|
||||
let method = 'dismiss_notice';
|
||||
if (dismiss == true) {
|
||||
method = 'dismiss_notice_and_disable';
|
||||
}
|
||||
|
||||
if (enable == true) {
|
||||
method = 'dismiss_notice_and_enable';
|
||||
}
|
||||
|
||||
if (method == 'dismiss_notice') return;
|
||||
|
||||
$.post(ajaxurl, { action: 'tifm_notice_actions', nonce: nonce, method: method }).done(function () {
|
||||
if (method == 'dismiss_notice_and_disable') {
|
||||
window.location.reload();
|
||||
}
|
||||
}).fail(function (e) {
|
||||
alert('Error occurred, please refresh and try again.' + JSON.stringify(e));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
let isDisplayed = false;
|
||||
function previewNotice(e) {
|
||||
|
||||
e.preventDefault();
|
||||
if (isDisplayed) return hideNotice(e);
|
||||
|
||||
$('#tifmPreviewCSS').remove();
|
||||
|
||||
let $style = document.createElement('style');
|
||||
$style.setAttribute('media', 'screen');
|
||||
$style.setAttribute('id', 'tifmPreviewCSS');
|
||||
|
||||
$style.innerText = '.tifm-btn{transform:scale(1.0)!important;opacity:1!important;max-height:60px!important;}';
|
||||
|
||||
$('head').append($style);
|
||||
|
||||
$('.tifm_darker_a_preview').text('Hide preview');
|
||||
isDisplayed = true;
|
||||
window.tifmObserver = true;
|
||||
|
||||
}
|
||||
|
||||
function hideNotice(e) {
|
||||
|
||||
e.preventDefault();
|
||||
if (!isDisplayed) return previewNotice(e);
|
||||
|
||||
$('#tifmPreviewCSS').remove();
|
||||
|
||||
$('.tifm_darker_a_preview').text('Show me a preview');
|
||||
isDisplayed = false;
|
||||
window.tifmObserver = false;
|
||||
|
||||
}
|
||||
|
||||
function disableFeatureAndDismiss(e) {
|
||||
|
||||
e.preventDefault();
|
||||
hideNotice(e);
|
||||
hideAndDismissNotice('dismiss');
|
||||
|
||||
}
|
||||
|
||||
function enableAndDismissNotice(e) {
|
||||
|
||||
e.preventDefault();
|
||||
previewNotice(e);
|
||||
hideAndDismissNotice('enable');
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
public function tryItOutScript() {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
<?php if (get_option('_tifm_feature_enabled') == 'enabled'): ?>
|
||||
window.tifmObserver = true;
|
||||
<?php endif; ?>
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
function makeButton(slug) {
|
||||
|
||||
if (typeof window.tifmObserver == 'undefined' || window.tifmObserver == false) return;
|
||||
|
||||
let a = document.createElement('A');
|
||||
a.classList.add('button');
|
||||
a.classList.add('button-primary');
|
||||
a.classList.add('tifm-btn-iframe');
|
||||
a.classList.add('right');
|
||||
a.style.color = '#fff';
|
||||
a.style.background = '#2d9418';
|
||||
a.style.borderColor = '#2d9418';
|
||||
a.style.boxShadow = 'none';
|
||||
a.style.marginRight = '15px';
|
||||
a.setAttribute('href', 'https://tastewp.com/plugins/' + slug);
|
||||
a.setAttribute('target', '_blank');
|
||||
a.innerText = 'Try it first';
|
||||
|
||||
return a;
|
||||
|
||||
}
|
||||
|
||||
const observer = new MutationObserver(function (mutations_list) {
|
||||
mutations_list.forEach(function (mutation) {
|
||||
mutation.addedNodes.forEach(function (added_node) {
|
||||
if (added_node.id == 'TB_window') {
|
||||
$('#TB_window #TB_iframeContent')[0].onload = function () {
|
||||
let iframe = $('#TB_iframeContent').contents();
|
||||
let footer = iframe.find('#plugin-information-footer');
|
||||
let slug = footer.find('#plugin_install_from_iframe').data('slug');
|
||||
let btn = makeButton(slug);
|
||||
footer.append(btn);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.querySelector('body'), { subtree: false, childList: true });
|
||||
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
public function informativeAdminNoticeHandler() {
|
||||
|
||||
?>
|
||||
|
||||
<div class="notice notice-success is-dismissible" id="tifm_new_feature_notice">
|
||||
<p id="tifm_paragraph_notice">
|
||||
<span class="tifm-grow-1">
|
||||
<b>New: </b> Add a
|
||||
<a class="button" style="color:#2d9418;border-color:#2d9418;text-align:center;width:88px" href="#!">Try it first</a>
|
||||
button to try out plugins before installing on your site.
|
||||
</span>
|
||||
|
||||
<span class="tifm-grow-5">
|
||||
<a class="tifm_darker_a tifm_btn tifm_btn_green" href="#">Sounds cool!</a>
|
||||
<a class="tifm_darker_a_preview tifm_btn tifm_btn_grey" href="#">Show me a preview</a>
|
||||
</span>
|
||||
|
||||
<span class="tifm-grow-2">
|
||||
<a class="tifm_darker_a_muted" href="#">Not needed, I'm good</a>
|
||||
</span>
|
||||
|
||||
</p>
|
||||
<span class="tifm_poweredby">
|
||||
Brought to you by <a class="tifm_brought_url" href="<?php echo esc_html($this->pluginPageURL); ?>"><?php echo esc_html($this->pluginName); ?></a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
public function insertActionButton() {
|
||||
|
||||
add_filter('plugin_install_action_links', [&$this, 'actionButtonHandler'], 10, 2);
|
||||
|
||||
}
|
||||
|
||||
public static function noticeAjax() {
|
||||
|
||||
// Nonce verification
|
||||
if (!isset($_POST['nonce']) || !wp_verify_nonce(sanitize_text_field($_POST['nonce']), 'tifm_notice_nonce')) {
|
||||
wp_send_json_error();
|
||||
return;
|
||||
}
|
||||
|
||||
$method = '';
|
||||
if (isset($_POST['method'])) {
|
||||
|
||||
$method = sanitize_text_field($_POST['method']);
|
||||
|
||||
}
|
||||
|
||||
if ($method == 'dismiss_notice') {
|
||||
|
||||
update_option('_tifm_hide_notice_forever', true);
|
||||
wp_send_json_success();
|
||||
exit;
|
||||
|
||||
} else if ($method == 'dismiss_notice_and_enable') {
|
||||
|
||||
update_option('_tifm_feature_enabled', 'enabled');
|
||||
update_option('_tifm_hide_notice_forever', true);
|
||||
delete_option('_tifm_disable_feature_forever');
|
||||
wp_send_json_success();
|
||||
exit;
|
||||
|
||||
} else if ($method == 'dismiss_notice_and_disable') {
|
||||
|
||||
update_option('_tifm_hide_notice_forever', true);
|
||||
update_option('_tifm_disable_feature_forever', true);
|
||||
update_option('_tifm_feature_enabled', 'disabled');
|
||||
wp_send_json_success();
|
||||
exit;
|
||||
|
||||
} else {
|
||||
|
||||
wp_send_json_error();
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function actionButtonHandler($links, $plugin) {
|
||||
|
||||
$url = 'https://tastewp.com/plugins/' . $plugin['slug'] . '/?anchor=wpsite';
|
||||
$css = 'style="transition: 0.4s all;transform: scale(0.0);opacity:0;max-height:0px;"';
|
||||
|
||||
if (get_option('_tifm_feature_enabled') == 'enabled') {
|
||||
$css = '';
|
||||
}
|
||||
|
||||
$button = ['<div class="tifm-btn" ' . $css . '><a class="button" style="color:#2d9418;border-color:#2d9418;text-align:center;width:88px;" target="_blank" href="' . $url . '">Try it first</a></div>'];
|
||||
array_splice($links, 1, 0, $button);
|
||||
|
||||
return $links;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user