Remove all advertising-related code
This commit is contained in:
@@ -1,23 +0,0 @@
|
|||||||
# Advertising on pixeldrain
|
|
||||||
|
|
||||||
Pixeldrain uses A-ads for its primary ad space. This space is located at the
|
|
||||||
bottom of the file viewer where everyone goes to download files. The ad will not
|
|
||||||
show if either the downloading user or the owner of the file is a Patreon
|
|
||||||
supporter. The ad unit is a standard leaderboard format of 728x90 px.
|
|
||||||
|
|
||||||
A-ads is an advertising network which respects the privacy advertisers,
|
|
||||||
publishers and even the viewers. A-ads only accepts cryptocurrencies for
|
|
||||||
advertising campaigns. The banners are static images with no javascript and do
|
|
||||||
not set any cookies in the broweser. You can use adnimated GIF or PNG images to
|
|
||||||
show animations in your banner ads.
|
|
||||||
|
|
||||||
We also employ other ad formats based on the size of the file which is being
|
|
||||||
shared. If the file is larger than 10 MB we add a little floating pop-up ad in
|
|
||||||
the bottom-right corner of the screen, and if the file is larger than 250 MB we
|
|
||||||
add a popunder ad which is displayed when the user clicks anywhere on the page.
|
|
||||||
These formats are purely to cover the bandwidth costs assiciated with sharing
|
|
||||||
such large files.
|
|
||||||
|
|
||||||
<img src="/res/img/advertising/advert_example_1.png">
|
|
||||||
|
|
||||||
Here you see A-Ads advertsising its own services.
|
|
@@ -1,55 +0,0 @@
|
|||||||
# Brave and Pixeldrain
|
|
||||||
|
|
||||||
## <img src="/res/img/brave_lion.svg" style="height: 0.8em;"/> What is Brave?
|
|
||||||
|
|
||||||
Brave is a web browser focused on privacy and speed. In some tests Brave is up
|
|
||||||
to 3 times faster than Chrome and Firefox. It does this by blocking
|
|
||||||
advertisements and tracking scripts before they even get a chance to load.
|
|
||||||
Beside the speed improvements this also saves a lot of power and data, very
|
|
||||||
useful for mobile phones.
|
|
||||||
|
|
||||||
Websites look much cleaner without all those advertisements. I don't like
|
|
||||||
putting ads on pixeldrain either, but I need the money to keep the website
|
|
||||||
running. Brave tries to solve this by giving users the choice if they want to
|
|
||||||
see ads. If you opt in to seeing ads from Brave you will receive notifications
|
|
||||||
with promotional offers once in a while. Brave protects your privacy by putting
|
|
||||||
the logic for showing relevant ads directly in the browser itself. This way your
|
|
||||||
browser history never leaves your computer and the tech giants can't follow you
|
|
||||||
around the web. The earnings from these ads are distributed between the websites
|
|
||||||
which you love most, a small cut goes to Brave itself for developing the
|
|
||||||
browser, and some of it goes to you. That's right, you get paid for viewing ads!
|
|
||||||
|
|
||||||
<div style="text-align: center; margin-bottom: 3em;">
|
|
||||||
<a class="button button_highlight" style="font-size: 1.5em;"
|
|
||||||
href="https://pixeldrain.com/click/MdUXxSov?target=https%3A%2F%2Fbrave.com%2Fpix009">
|
|
||||||
<img src="/res/img/brave_lion.svg" style="height: 1.5em; vertical-align: middle;"/>
|
|
||||||
Get started with Brave
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## <img src="/res/img/bat_full_color.svg" style="height: 0.8em;"/> Basic attention tokens
|
|
||||||
|
|
||||||
<img src="/res/img/bat_wallet.png" style="float: right; max-width: 40%; margin: 0 0.5em;"/>
|
|
||||||
|
|
||||||
The money that you get from viewing ads (and receiving free token grants) goes
|
|
||||||
into a cryptocurrency wallet which is built right into the browser. Once you
|
|
||||||
have earned some rewards you have a few options. You can choose to automatically
|
|
||||||
distribute them between websites which you spend the most time on, you can tip
|
|
||||||
your favourite websites by pressing the tip button in the address bar or you can
|
|
||||||
convert the money to your own currency and deposit it to your bank account.
|
|
||||||
|
|
||||||
Of course I would really appreciate it if you tipped some coins to pixeldrain
|
|
||||||
once in a while ;-)
|
|
||||||
|
|
||||||
<div style="text-align: center;">
|
|
||||||
<a class="button" style="font-size: 1.2em;"
|
|
||||||
href="https://pixeldrain.com/click/MdUXxSov?target=https%3A%2F%2Fbrave.com%2Fpix009">
|
|
||||||
<img src="/res/img/brave_lion.svg" style="height: 1.2em; vertical-align: middle;"/>
|
|
||||||
Download Brave here
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
If you want to learn more about Brave and its goals I can recommend checking out
|
|
||||||
the [blog](https://brave.com/blog). If you want to get in touch there is also
|
|
||||||
the [community forum](https://community.brave.com) and a [reddit
|
|
||||||
forum](https://www.reddit.com/r/brave_browser).
|
|
@@ -1 +0,0 @@
|
|||||||
# Pixeldrain does not run ads
|
|
Binary file not shown.
Before Width: | Height: | Size: 152 KiB |
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
Binary file not shown.
@@ -1,33 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="218px" height="256px" viewBox="0 0 218 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<!-- Generator: Sketch 51.2 (57519) - http://www.bohemiancoding.com/sketch -->
|
|
||||||
<title>build-icons/Stable Copy 3</title>
|
|
||||||
<desc>Created with Sketch.</desc>
|
|
||||||
<defs>
|
|
||||||
<linearGradient x1="0%" y1="50.7055163%" x2="100%" y2="50.7055163%" id="linearGradient-1">
|
|
||||||
<stop stop-color="#FF5500" offset="0%"></stop>
|
|
||||||
<stop stop-color="#FF5500" offset="40.9877232%"></stop>
|
|
||||||
<stop stop-color="#FF2000" offset="58.1981215%"></stop>
|
|
||||||
<stop stop-color="#FF2000" offset="100%"></stop>
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient x1="2.1484375%" y1="50.7055163%" x2="100%" y2="50.7055163%" id="linearGradient-2">
|
|
||||||
<stop stop-color="#FF452A" offset="0%"></stop>
|
|
||||||
<stop stop-color="#FF2000" offset="100%"></stop>
|
|
||||||
</linearGradient>
|
|
||||||
<path d="M170.272109,25.3359387 L147.968109,0.00010893617 L108.800109,0.00010893617 L69.6321088,0.00010893617 L47.3281088,25.3359387 C47.3281088,25.3359387 27.7441088,19.8891302 18.4961088,29.1487047 C18.4961088,29.1487047 44.6081088,26.7886026 53.5841088,41.4040238 C53.5841088,41.4040238 77.7921088,46.0338111 81.0561088,46.0338111 C84.3201088,46.0338111 91.3921088,43.3104068 97.9201088,41.1316834 C104.448109,38.95296 108.800109,38.9371643 108.800109,38.9371643 C108.800109,38.9371643 113.152109,38.95296 119.680109,41.1316834 C126.208109,43.3104068 133.280109,46.0338111 136.544109,46.0338111 C139.808109,46.0338111 164.016109,41.4040238 164.016109,41.4040238 C172.992109,26.7886026 199.104109,29.1487047 199.104109,29.1487047 C189.856109,19.8891302 170.272109,25.3359387 170.272109,25.3359387" id="path-3"></path>
|
|
||||||
</defs>
|
|
||||||
<g id="starting-collection" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<g id="Build-Icons" transform="translate(-70.000000, -350.000000)">
|
|
||||||
<g id="build-icons/Stable" transform="translate(50.000000, 350.000000)">
|
|
||||||
<g id="Logo" transform="translate(20.114286, 0.000000)">
|
|
||||||
<path d="M209.984109,61.2848749 L215.968109,46.5784919 C215.968109,46.5784919 208.352109,38.4082791 199.104109,29.1487047 C189.856109,19.8891302 170.272109,25.3359387 170.272109,25.3359387 L147.968109,0.00010893617 L108.800109,0.00010893617 L69.6321088,0.00010893617 L47.3281088,25.3359387 C47.3281088,25.3359387 27.7441088,19.8891302 18.4961088,29.1487047 C9.2481088,38.4082791 1.6321088,46.5784919 1.6321088,46.5784919 L7.6161088,61.2848749 L0.0001088,83.0721089 C0.0001088,83.0721089 22.3993088,168.017811 25.0241088,178.391258 C30.1921088,198.81679 33.7281088,206.714662 48.4161088,217.063598 C63.1041088,227.412534 89.7601088,245.387003 94.1121088,248.110407 C98.4641088,250.833811 103.904109,255.472858 108.800109,255.472858 C113.696109,255.472858 119.136109,250.833811 123.488109,248.110407 C127.840109,245.387003 154.496109,227.412534 169.184109,217.063598 C183.872109,206.714662 187.408109,198.81679 192.576109,178.391258 C195.200365,168.017811 217.600109,83.0721089 217.600109,83.0721089 L209.984109,61.2848749 Z" id="Head" fill="url(#linearGradient-1)"></path>
|
|
||||||
<path d="M164.016109,41.4040238 C164.016109,41.4040238 192.704493,76.1274281 192.704493,83.5487047 C192.704493,90.9699813 189.095597,92.9286536 185.467117,96.7866281 C181.838637,100.644603 165.991373,117.49376 163.956269,119.657232 C161.921165,121.821249 157.684493,125.101862 160.176557,131.006747 C162.668621,136.911632 166.344973,144.425505 162.256813,152.046679 C158.168109,159.667854 151.164109,164.754628 146.676109,163.913641 C142.188109,163.072109 131.648109,157.557215 127.772109,155.038066 C123.896109,152.518917 111.611501,142.374781 111.611501,138.493386 C111.611501,134.612534 124.310093,127.643888 126.655821,126.0605 C129.002637,124.477658 139.703117,118.349454 139.922349,115.944143 C140.141037,113.538288 140.057805,112.832926 136.899885,106.889369 C133.741965,100.945266 128.054989,93.0136238 129.001549,87.7362111 C129.948109,82.459343 139.119949,79.7152409 145.665357,77.2402111 C152.209677,74.765726 164.811437,70.0918196 166.385229,69.3652153 C167.960109,68.6380664 167.553197,67.945777 162.783949,67.4931472 C158.015789,67.0405174 144.483245,65.2419813 138.382285,66.9446536 C132.281325,68.647326 121.858285,71.2378281 121.013997,72.6115132 C120.169709,73.9851983 119.424973,74.0314962 120.292109,78.7702196 C121.158701,83.508943 125.622765,106.24719 126.055789,110.285998 C126.489357,114.324807 127.336909,116.994832 122.987629,117.990509 C118.637805,118.986186 111.316109,120.715003 108.800109,120.715003 C106.284109,120.715003 98.9618688,118.986186 94.6125888,117.990509 C90.2627648,116.994832 91.1103168,114.324807 91.5438848,110.285998 C91.9774528,106.24719 96.4409728,83.508943 97.3081088,78.7702196 C98.1747008,74.0314962 97.4299648,73.9851983 96.5862208,72.6115132 C95.7419328,71.2378281 85.3183488,68.647326 79.2173888,66.9446536 C73.1164288,65.2419813 59.5844288,67.0405174 54.8157248,67.4931472 C50.0470208,67.945777 49.6401088,68.6380664 51.2144448,69.3652153 C52.7887808,70.0918196 65.3905408,74.765726 71.9348608,77.2402111 C78.4797248,79.7152409 87.6521088,82.459343 88.5986688,87.7362111 C89.5452288,93.0136238 83.8577088,100.945266 80.7003328,106.889369 C77.5424128,112.832926 77.4586368,113.538288 77.6778688,115.944143 C77.8965568,118.349454 88.5975808,124.477658 90.9438528,126.0605 C93.2901248,127.643888 105.988173,134.612534 105.988173,138.493386 C105.988173,142.374781 93.7041088,152.518917 89.8281088,155.038066 C85.9521088,157.557215 75.4121088,163.072109 70.9241088,163.913641 C66.4361088,164.754628 59.4321088,159.667854 55.3434048,152.046679 C51.2552448,144.425505 54.9315968,136.911632 57.4231168,131.006747 C59.9151808,125.101862 55.6790528,121.821249 53.6434048,119.657232 C51.6088448,117.49376 35.7610368,100.644603 32.1325568,96.7866281 C28.5040768,92.9286536 24.8957248,90.9699813 24.8957248,83.5487047 C24.8957248,76.1274281 53.5841088,41.4040238 53.5841088,41.4040238 C53.5841088,41.4040238 77.7921088,46.0338111 81.0561088,46.0338111 C84.3201088,46.0338111 91.3921088,43.3104068 97.9201088,41.1316834 C104.448109,38.95296 108.800109,38.9371643 108.800109,38.9371643 C108.800109,38.9371643 113.152109,38.95296 119.680109,41.1316834 C126.208109,43.3104068 133.280109,46.0338111 136.544109,46.0338111 C139.808109,46.0338111 164.016109,41.4040238 164.016109,41.4040238 Z M142.509504,174.227935 C144.28512,175.341263 143.202016,177.439918 141.584704,178.584837 C139.966848,179.729757 118.228064,196.584361 116.118432,198.447169 C114.008256,200.310523 110.908,203.387425 108.8,203.387425 C106.692,203.387425 103.5912,200.310523 101.481568,198.447169 C99.371392,196.584361 77.633152,179.729757 76.015296,178.584837 C74.39744,177.439918 73.31488,175.341263 75.090496,174.227935 C76.866656,173.115152 82.422528,170.306233 90.08912,166.333876 C97.754624,162.362063 107.308896,158.985042 108.8,158.985042 C110.291104,158.985042 119.844832,162.362063 127.511424,166.333876 C135.177472,170.306233 140.733344,173.115152 142.509504,174.227935 Z" id="Face" fill="#FFFFFF"></path>
|
|
||||||
<mask id="mask-4" fill="white">
|
|
||||||
<use xlink:href="#path-3"></use>
|
|
||||||
</mask>
|
|
||||||
<use id="Top-Head" fill="url(#linearGradient-2)" xlink:href="#path-3"></use>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 7.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 9.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 60 KiB |
18
svelte/package-lock.json
generated
18
svelte/package-lock.json
generated
@@ -193,9 +193,9 @@
|
|||||||
"integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA=="
|
"integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/jsmediatags": {
|
"node_modules/@types/jsmediatags": {
|
||||||
"version": "3.9.3",
|
"version": "3.9.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/jsmediatags/-/jsmediatags-3.9.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/jsmediatags/-/jsmediatags-3.9.4.tgz",
|
||||||
"integrity": "sha512-oNEPG+SI5E/VWK0x9JTWwkU+LmmOgW4tisCE4IrxiyNfzIRyg9kspNjaoqknpN9HUIexDvbD2/wbViw6TGIFgw==",
|
"integrity": "sha512-uWB29K/5Qh5tyeuRcl9dRnqvqJAP2Z4b4uCZtM50SkzCb9X50zEJbpqXmwHOF1fakV4pD1B2L1J/QxGnKNchVQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/resolve": {
|
"node_modules/@types/resolve": {
|
||||||
@@ -737,9 +737,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/resolve": {
|
"node_modules/resolve": {
|
||||||
"version": "1.22.4",
|
"version": "1.22.6",
|
||||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz",
|
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz",
|
||||||
"integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==",
|
"integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"is-core-module": "^2.13.0",
|
"is-core-module": "^2.13.0",
|
||||||
@@ -763,9 +763,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/rollup": {
|
"node_modules/rollup": {
|
||||||
"version": "3.29.1",
|
"version": "3.29.2",
|
||||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.1.tgz",
|
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.2.tgz",
|
||||||
"integrity": "sha512-c+ebvQz0VIH4KhhCpDsI+Bik0eT8ZFEVZEYw0cGMVqIP8zc+gnwl7iXCamTw7vzv2MeuZFZfdx5JJIq+ehzDlg==",
|
"integrity": "sha512-CJouHoZ27v6siztc21eEQGo0kIcE5D1gVPA571ez0mMYb25LGYGKnVNXpEj5MGlepmDWGXNjDB5q7uNiPHC11A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"rollup": "dist/bin/rollup"
|
"rollup": "dist/bin/rollup"
|
||||||
|
@@ -6,27 +6,6 @@ import terser from '@rollup/plugin-terser';
|
|||||||
|
|
||||||
const production = !process.env.ROLLUP_WATCH;
|
const production = !process.env.ROLLUP_WATCH;
|
||||||
|
|
||||||
function serve() {
|
|
||||||
let server;
|
|
||||||
|
|
||||||
function toExit() {
|
|
||||||
if (server) server.kill(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
writeBundle() {
|
|
||||||
if (server) return;
|
|
||||||
server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {
|
|
||||||
stdio: ['ignore', 'inherit', 'inherit'],
|
|
||||||
shell: true
|
|
||||||
});
|
|
||||||
|
|
||||||
process.on('SIGTERM', toExit);
|
|
||||||
process.on('exit', toExit);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const builddir = "../res/static/svelte"
|
const builddir = "../res/static/svelte"
|
||||||
export default [
|
export default [
|
||||||
"file_viewer",
|
"file_viewer",
|
||||||
@@ -84,7 +63,7 @@ export default [
|
|||||||
|
|
||||||
// If we're building for production (npm run build
|
// If we're building for production (npm run build
|
||||||
// instead of npm run dev), minify
|
// instead of npm run dev), minify
|
||||||
production && terser()
|
production && terser(),
|
||||||
],
|
],
|
||||||
watch: {
|
watch: {
|
||||||
clearScreen: false
|
clearScreen: false
|
||||||
|
@@ -1,73 +0,0 @@
|
|||||||
<script context="module">
|
|
||||||
import { writable } from "svelte/store";
|
|
||||||
export const adsplus_load = writable(false)
|
|
||||||
export const adsplus_loaded = writable(false)
|
|
||||||
export const adaround_load = writable(false)
|
|
||||||
export const adaround_loaded = writable(false)
|
|
||||||
export const flyingsquare_load = writable(false)
|
|
||||||
export const flyingsquare_loaded = writable(false)
|
|
||||||
export const valueimpression_load = writable(false)
|
|
||||||
export const valueimpression_loaded = writable(false)
|
|
||||||
|
|
||||||
export const load_ad = (ad_type) => {
|
|
||||||
if (ad_type === "ads.plus") {
|
|
||||||
adsplus_load.set(true)
|
|
||||||
} else if (ad_type === "adaround") {
|
|
||||||
adaround_load.set(true)
|
|
||||||
} else if (ad_type === "flyingsquare") {
|
|
||||||
flyingsquare_load.set(true)
|
|
||||||
} else if (ad_type === "valueimpression") {
|
|
||||||
valueimpression_load.set(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// This script makes sure that each head element is only loaded once. The _load
|
|
||||||
// stores are for telling this script to load a head element, and the _loaded
|
|
||||||
// stores are for telling the ads that the head element has finished loading
|
|
||||||
|
|
||||||
let adsplus = false
|
|
||||||
adsplus_load.subscribe(v => adsplus = v)
|
|
||||||
const adsplus_load_event = () => {
|
|
||||||
adsplus_loaded.set(true)
|
|
||||||
console.debug("finished loading adsplus head element")
|
|
||||||
}
|
|
||||||
|
|
||||||
let adaround = false
|
|
||||||
adaround_load.subscribe(v => adaround = v)
|
|
||||||
const adaround_load_event = () => {
|
|
||||||
adaround_loaded.set(true)
|
|
||||||
console.debug("finished loading adaround head element")
|
|
||||||
}
|
|
||||||
|
|
||||||
let flyingsquare = false
|
|
||||||
flyingsquare_load.subscribe(v => flyingsquare = v)
|
|
||||||
const flyingsquare_load_event = () => {
|
|
||||||
flyingsquare_loaded.set(true)
|
|
||||||
console.debug("finished loading flyingsquare head element")
|
|
||||||
}
|
|
||||||
|
|
||||||
let valueimpression = false
|
|
||||||
valueimpression_load.subscribe(v => valueimpression = v)
|
|
||||||
const valueimpression_load_event = () => {
|
|
||||||
valueimpression_loaded.set(true)
|
|
||||||
console.debug("finished loading valueimpression head element")
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<svelte:head>
|
|
||||||
{#if adsplus}
|
|
||||||
<script on:load={adsplus_load_event} async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
|
|
||||||
{/if}
|
|
||||||
{#if adaround}
|
|
||||||
<script on:load={adaround_load_event} async src="/res/script/adaround.js"></script>
|
|
||||||
{/if}
|
|
||||||
{#if flyingsquare}
|
|
||||||
<script on:load={flyingsquare_load_event} async src="/res/script/flyingsquare.js"></script>
|
|
||||||
{/if}
|
|
||||||
{#if valueimpression}
|
|
||||||
<script on:load={valueimpression_load_event} async defer src="//services.vlitag.com/adv1/?q=f8197b031408cd00d0ba7385af21bec5"></script>
|
|
||||||
<script> var vitag = vitag || {};</script>
|
|
||||||
{/if}
|
|
||||||
</svelte:head>
|
|
@@ -1,248 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { onMount } from "svelte"
|
|
||||||
import Mastodon from "../icons/Mastodon.svelte";
|
|
||||||
import Reddit from "../icons/Reddit.svelte";
|
|
||||||
import Twitter from "../icons/Twitter.svelte";
|
|
||||||
import { color_by_name_no_prefix } from "../util/Util.svelte";
|
|
||||||
import * as head from "./AdHead.svelte"
|
|
||||||
|
|
||||||
let container
|
|
||||||
let banner
|
|
||||||
let ad_type = ""
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
let url_ads = new URL(window.location.href).searchParams.get("ads")
|
|
||||||
if (url_ads) {
|
|
||||||
set_ad_type(url_ads)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 20% pixeldrain socials
|
|
||||||
// 20% reviews
|
|
||||||
// 50% patreon
|
|
||||||
|
|
||||||
let rand = Math.random()
|
|
||||||
if (rand < 0.2) {
|
|
||||||
set_ad_type("socials")
|
|
||||||
} else if (rand < 0.4) {
|
|
||||||
set_ad_type("reviews")
|
|
||||||
} else {
|
|
||||||
set_ad_type("patreon_support")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
let set_ad_type = async t => {
|
|
||||||
ad_type = t
|
|
||||||
head.load_ad(t)
|
|
||||||
resize()
|
|
||||||
|
|
||||||
console.log("leaderboard ad is " + t)
|
|
||||||
}
|
|
||||||
|
|
||||||
// We scale the size of the banner based on the size of the screen. But because
|
|
||||||
// some things don't scale easily like iframes and javascript ads we use a CSS
|
|
||||||
// transformation instead of changing the actual dimensions
|
|
||||||
const resize = () => {
|
|
||||||
if (!banner) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
let scaleWidth = 1
|
|
||||||
let scaleHeight = 1
|
|
||||||
let minWindowHeight = 600
|
|
||||||
let bannerWidth = banner.offsetWidth
|
|
||||||
let bannerHeight = banner.offsetHeight
|
|
||||||
|
|
||||||
if (window.innerWidth < bannerWidth) {
|
|
||||||
scaleWidth = window.innerWidth / bannerWidth
|
|
||||||
}
|
|
||||||
if (window.innerHeight < minWindowHeight) {
|
|
||||||
scaleHeight = window.innerHeight / minWindowHeight
|
|
||||||
}
|
|
||||||
|
|
||||||
// The smaller scale is the scale we'll use
|
|
||||||
let scale = scaleWidth < scaleHeight ? scaleWidth : scaleHeight
|
|
||||||
|
|
||||||
// Because of the scale transformation the automatic margins don't work
|
|
||||||
// anymore. So we have to manually calculate the margin. Here we take the
|
|
||||||
// width of the viewport - the width of the ad to calculate the amount of
|
|
||||||
// pixels around the ad. We multiply the ad size by the scale we calculated
|
|
||||||
// to account for the smaller size.
|
|
||||||
let offset = (window.innerWidth - (bannerWidth * scale)) / 2
|
|
||||||
|
|
||||||
container.style.height = (bannerHeight * scale) + "px"
|
|
||||||
banner.style.marginLeft = offset + "px"
|
|
||||||
banner.style.transform = "scale(" + scale + ")"
|
|
||||||
}
|
|
||||||
|
|
||||||
head.adsplus_loaded.subscribe(v => {
|
|
||||||
if (v) {
|
|
||||||
window.googletag = window.googletag || {cmd: []};
|
|
||||||
googletag.cmd.push(function() {
|
|
||||||
googletag.defineSlot('/21673142571/299__pixeldrain.com__default__728x90_1', [728, 90], 'div-gpt-ad-pixeldraincom728x90_1').addService(googletag.pubads());
|
|
||||||
googletag.pubads().collapseEmptyDivs();
|
|
||||||
googletag.enableServices();
|
|
||||||
});
|
|
||||||
googletag.cmd.push(function() { googletag.display('div-gpt-ad-pixeldraincom728x90_1'); });
|
|
||||||
}
|
|
||||||
})
|
|
||||||
head.valueimpression_loaded.subscribe(v => {
|
|
||||||
if (v) {
|
|
||||||
(vitag.Init = window.vitag.Init || []).push(function(){viAPItag.display("vi_1994884987")})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<svelte:window on:resize={resize} on:load={resize}/>
|
|
||||||
|
|
||||||
<svelte:head>
|
|
||||||
{#if ad_type === "nextmillennium"}
|
|
||||||
<script async src="https://powerad.ai/script.js"></script>
|
|
||||||
{/if}
|
|
||||||
</svelte:head>
|
|
||||||
|
|
||||||
<div bind:this={container}>
|
|
||||||
{#if ad_type === "aads"}
|
|
||||||
<iframe bind:this={banner} class="banner"
|
|
||||||
data-aa="73974"
|
|
||||||
src="//ad.a-ads.com/73974?size=728x90&background_color={color_by_name_no_prefix('body_color')}&text_color={color_by_name_no_prefix('body_text_color')}&title_color={color_by_name_no_prefix('highlight_color')}&title_hover_color={color_by_name_no_prefix('highlight_color')}&link_color={color_by_name_no_prefix('highlight_color')}&link_hover_color={color_by_name_no_prefix('highlight_color')}"
|
|
||||||
style="width:728px; height:90px; border:0px; padding:0; overflow:hidden; background-color: transparent;"
|
|
||||||
title="A-ads advertisement">
|
|
||||||
</iframe>
|
|
||||||
{:else if ad_type === "brave"}
|
|
||||||
<a bind:this={banner} class="banner" style="display: inline-block; width: 728px; height: 90px;" href="/click/MdUXxSov?target=https%3A%2F%2Fbrave.com%2Fpix009">
|
|
||||||
<img src="/res/img/misc/brave-728x90.png" style="width: 100%; height: 100%" alt="Brave ad"/>
|
|
||||||
</a>
|
|
||||||
{:else if ad_type === "ads.plus"}
|
|
||||||
<!-- This is the tag for the unit and should be placed in the respective ad spot in the body part of the page -->
|
|
||||||
<!-- /21673142571/299__pixeldrain.com__default__728x90_1 -->
|
|
||||||
<div bind:this={banner} class="banner" id='div-gpt-ad-pixeldraincom728x90_1' style='width: 728px; height: 90px;'>
|
|
||||||
</div>
|
|
||||||
{:else if ad_type === "pixfuture"}
|
|
||||||
<!-- We don't bind the pixfuture ad to the banner variable because pixfuture does its own scaling -->
|
|
||||||
<!-- AuctionX Display platform tag START -->
|
|
||||||
<div class="banner" id="27517x728x90x4605x_ADSLOT1" clickTrack="%%CLICK_URL_ESC%%"></div>
|
|
||||||
<script type="text/javascript" async src="https://served-by.pixfuture.com/www/delivery/headerbid.js" slotId="27517x728x90x4605x_ADSLOT1" refreshTime="5" refreshInterval="60"></script>
|
|
||||||
<!-- AuctionX Display platform tag END -->
|
|
||||||
{:else if ad_type === "adaround"}
|
|
||||||
<div bind:this={banner} class="_fa7cdd4c68507744 banner" data-zone="d8764be36c134d3d807abb2a073dc010" style="width:728px;height:90px;display: inline-block;margin: 0 auto"></div>
|
|
||||||
{:else if ad_type === "flyingsquare"}
|
|
||||||
<div bind:this={banner} class="xc449bad4854773ff banner" data-zone="28ebf286bb7d4446a5ba43b0ead8f1bb" style="width:728px;height:90px;display: inline-block;margin: 0 auto"></div>
|
|
||||||
{:else if ad_type === "valueimpression"}
|
|
||||||
<!-- Valueimpression overrides the style of its div after loading,
|
|
||||||
messing up our scaling script, so we wrap it in another div of the
|
|
||||||
correct size -->
|
|
||||||
<div bind:this={banner} class="banner" style="width: 728px; height: 90px; overflow: hidden;">
|
|
||||||
<div class="adsbyvli" data-ad-slot="vi_1994884987" style="width: 728px; height: 90px"></div>
|
|
||||||
</div>
|
|
||||||
{:else if ad_type === "nextmillennium"}
|
|
||||||
|
|
||||||
<div bind:this={banner} class="banner" style="width: 728px; height: 90px;"></div>
|
|
||||||
|
|
||||||
{:else if ad_type === "pixeldrain_social"}
|
|
||||||
|
|
||||||
<map name="socials_map">
|
|
||||||
<area target="_blank" alt="Pixeldrain on Reddit" title="Pixeldrain on Reddit" href="https://reddit.com/r/pixeldrain" coords="0,38,364,90" shape="rect">
|
|
||||||
<area target="_blank" alt="Pixeldrain on Twitter" title="Pixeldrain on Twitter" href="https://twitter.com/Fornax96" coords="364,38,728,90" shape="rect">
|
|
||||||
</map>
|
|
||||||
<img bind:this={banner} usemap="#socials_map" class="banner" src="/res/img/advertising/pixeldrain_socials.webp" style="display: inline-block; width: 728px; height: 90px;" alt="Pixeldrain social media"/>
|
|
||||||
|
|
||||||
{:else if ad_type === "patreon_support"}
|
|
||||||
|
|
||||||
<div class="banner support_banner">
|
|
||||||
<span style="display: block; margin-bottom: 2px;">
|
|
||||||
No ads today. Pixeldrain is currently funded by our subscribers!
|
|
||||||
</span>
|
|
||||||
<a href="/#pro" rel="noreferrer" class="button button_highlight" target="_blank">
|
|
||||||
<i class="icon">bolt</i>
|
|
||||||
Support Pixeldrain to help keep the project going
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{:else if ad_type === "socials"}
|
|
||||||
<div class="banner center">
|
|
||||||
<div class="socials">
|
|
||||||
Pixeldrain is on the fediverse!<br/>
|
|
||||||
|
|
||||||
<a href="https://mastodon.social/@fornax" rel="noreferrer" class="button" target="_blank" style="background-color: #595aff; color: #ffffff;">
|
|
||||||
<i class="icon small">people</i>
|
|
||||||
Mastodon
|
|
||||||
</a>
|
|
||||||
<a href="https://lemmy.fornaxian.tech/c/pixeldrain"
|
|
||||||
rel="noreferrer" class="button" target="_blank" style="background-color: #14854f; color: #ffffff;"
|
|
||||||
>
|
|
||||||
<i class="icon small">people</i>
|
|
||||||
Lemmy
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="socials">
|
|
||||||
And on legacy media too<br/>
|
|
||||||
|
|
||||||
<a href="https://twitter.com/Fornax96" rel="noreferrer" class="button" target="_blank" style="background-color: #1a8cd8; color: #ffffff;">
|
|
||||||
<i class="icon small">people</i>
|
|
||||||
Twitter
|
|
||||||
</a>
|
|
||||||
<a href="https://www.reddit.com/r/PixelDrain"
|
|
||||||
rel="noreferrer" class="button" target="_blank" style="background-color: #ff4500; color: #ffffff;"
|
|
||||||
>
|
|
||||||
<i class="icon small">people</i>
|
|
||||||
Reddit
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{:else if ad_type === "reviews"}
|
|
||||||
|
|
||||||
<div class="banner support_banner">
|
|
||||||
<span style="display: block; margin-bottom: 2px;">
|
|
||||||
Are you liking pixeldrain? Write a review! It really helps
|
|
||||||
</span>
|
|
||||||
<a href="https://alternativeto.net/software/pixeldrain/about/"
|
|
||||||
rel="noreferrer" class="button" target="_blank" style="background-color: #0C9EF0; color: #FFFFFF; font-weight: bold;"
|
|
||||||
>
|
|
||||||
<i class="icon">rate_review</i>
|
|
||||||
AlternativeTo
|
|
||||||
</a>
|
|
||||||
<a href="https://www.trustpilot.com/review/pixeldrain.com"
|
|
||||||
rel="noreferrer" class="button" target="_blank" style="background-color: #00B67A; color: #FFFFFF; font-weight: bold;"
|
|
||||||
>
|
|
||||||
<i class="icon">rate_review</i>
|
|
||||||
Trustpilot
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.banner {
|
|
||||||
display: block;
|
|
||||||
margin: auto;
|
|
||||||
transform-origin: 0 0;
|
|
||||||
font-size: 1.2em;
|
|
||||||
}
|
|
||||||
.center {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.support_banner {
|
|
||||||
text-align: center;
|
|
||||||
padding: 2px;
|
|
||||||
}
|
|
||||||
.socials {
|
|
||||||
display: inline-block;
|
|
||||||
text-align: center;
|
|
||||||
margin: 0 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Try to avoid text wrapping */
|
|
||||||
@media(max-width: 600px) {
|
|
||||||
.banner {
|
|
||||||
font-size: 1em;
|
|
||||||
}
|
|
||||||
.socials {
|
|
||||||
font-size: 0.8em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@@ -1,101 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { createEventDispatcher, onMount, tick } from "svelte"
|
|
||||||
import { color_by_name_no_prefix } from "../util/Util.svelte";
|
|
||||||
import * as head from "./AdHead.svelte"
|
|
||||||
|
|
||||||
let dispatch = createEventDispatcher()
|
|
||||||
let ad_type = ""
|
|
||||||
let visible = false
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
let url_ads = new URL(window.location.href).searchParams.get("ads")
|
|
||||||
if (url_ads) {
|
|
||||||
set_ad_type(url_ads)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the screen is too small to display the full skyscraper ad, we don't
|
|
||||||
// show it
|
|
||||||
if (document.body.clientWidth < 800 || document.body.clientHeight < 700) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
set_ad_type("pixfuture")
|
|
||||||
})
|
|
||||||
|
|
||||||
let set_ad_type = async t => {
|
|
||||||
ad_type = t
|
|
||||||
head.load_ad(t)
|
|
||||||
|
|
||||||
visible = true
|
|
||||||
await tick() // Wait for skyscraper div to render
|
|
||||||
dispatch("visibility", true)
|
|
||||||
|
|
||||||
console.log("skyscraper ad is " + t)
|
|
||||||
}
|
|
||||||
|
|
||||||
head.adsplus_loaded.subscribe(v => {
|
|
||||||
if (v) {
|
|
||||||
window.googletag = window.googletag || {cmd: []};
|
|
||||||
googletag.cmd.push(function() {
|
|
||||||
googletag.defineSlot('/21673142571/299__pixeldrain.com__default__160x600_1', [160, 600], 'div-gpt-ad-pixeldraincom160x600_1').addService(googletag.pubads());
|
|
||||||
googletag.pubads().collapseEmptyDivs();
|
|
||||||
googletag.enableServices();
|
|
||||||
});
|
|
||||||
googletag.cmd.push(function() { googletag.display('div-gpt-ad-pixeldraincom160x600_1'); });
|
|
||||||
}
|
|
||||||
})
|
|
||||||
head.valueimpression_loaded.subscribe(v => {
|
|
||||||
if (v) {
|
|
||||||
(vitag.Init = window.vitag.Init || []).push(function(){viAPItag.display("vi_1994884988")})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{#if visible}
|
|
||||||
<div class="skyscraper">
|
|
||||||
<div class="ad_space">
|
|
||||||
{#if ad_type === "aads"}
|
|
||||||
<iframe
|
|
||||||
data-aa="1811738"
|
|
||||||
src="//ad.a-ads.com/1811738?size=160x600&background_color={color_by_name_no_prefix('body_color')}&text_color={color_by_name_no_prefix('body_text_color')}&title_color={color_by_name_no_prefix('highlight_color')}&title_hover_color={color_by_name_no_prefix('highlight_color')}&link_color={color_by_name_no_prefix('highlight_color')}&link_hover_color={color_by_name_no_prefix('highlight_color')}"
|
|
||||||
style="width:160px; height:600px; border:0px; padding:0; overflow:hidden; background-color: transparent;"
|
|
||||||
title="A-ads advertisement">
|
|
||||||
</iframe>
|
|
||||||
{:else if ad_type === "ads.plus"}
|
|
||||||
<!-- /21673142571/299__pixeldrain.com__default__160x600_1 -->
|
|
||||||
<div id='div-gpt-ad-pixeldraincom160x600_1' style='width: 160px; height: 600px;'></div>
|
|
||||||
{:else if ad_type === "pixfuture"}
|
|
||||||
<!-- AuctionX Display platform tag START -->
|
|
||||||
<div id="27513x160x600x4605x_ADSLOT1" clickTrack="%%CLICK_URL_ESC%%" style="display: block; margin: auto;"></div>
|
|
||||||
<script type="text/javascript" async src="https://served-by.pixfuture.com/www/delivery/headerbid.js" slotId="27513x160x600x4605x_ADSLOT1" refreshTime="5" refreshInterval="60"></script>
|
|
||||||
<!-- AuctionX Display platform tag END -->
|
|
||||||
{:else if ad_type === "adaround"}
|
|
||||||
<div class="_fa7cdd4c68507744" data-zone="2a0dbd4b7c484e9e824d211a57fa6b93" style="width:160px;height:600px;display: inline-block;margin: 0 auto"></div>
|
|
||||||
{:else if ad_type === "flyingsquare"}
|
|
||||||
<div class="xc449bad4854773ff" data-zone="d675792db61d408287d0d694d03d12e5" style="width:160px;height:600px;display: inline-block;margin: 0 auto"></div>
|
|
||||||
{:else if ad_type === "valueimpression"}
|
|
||||||
<div class="adsbyvli" data-ad-slot="vi_1994884988" style="width: 160px; height: 600px"></div>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.skyscraper {
|
|
||||||
position: absolute;
|
|
||||||
width: 160px;
|
|
||||||
z-index: 49;
|
|
||||||
overflow: hidden;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
top: 0;
|
|
||||||
padding: 0;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.ad_space {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
159
svelte/src/file_viewer/BottomBanner.svelte
Normal file
159
svelte/src/file_viewer/BottomBanner.svelte
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
<script>
|
||||||
|
import { onMount } from "svelte"
|
||||||
|
|
||||||
|
let ad_type = ""
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
// 20% pixeldrain socials
|
||||||
|
// 20% reviews
|
||||||
|
// 10% battle cry
|
||||||
|
// 40% patreon
|
||||||
|
|
||||||
|
let rand = Math.random()
|
||||||
|
if (rand < 0.2) {
|
||||||
|
ad_type = "socials"
|
||||||
|
} else if (rand < 0.4) {
|
||||||
|
ad_type = "reviews"
|
||||||
|
} else if (rand < 0.5) {
|
||||||
|
ad_type = "slava_ukraini"
|
||||||
|
} else {
|
||||||
|
ad_type = "patreon_support"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if ad_type === "patreon_support"}
|
||||||
|
|
||||||
|
<div class="banner support_banner">
|
||||||
|
<span style="display: block; margin-bottom: 2px;">
|
||||||
|
No ads today. Pixeldrain is currently funded by our subscribers!
|
||||||
|
</span>
|
||||||
|
<a href="/#pro" rel="noreferrer" class="button button_highlight" target="_blank">
|
||||||
|
<i class="icon">bolt</i>
|
||||||
|
Support Pixeldrain to help keep the project going
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{:else if ad_type === "socials"}
|
||||||
|
|
||||||
|
<div class="banner center">
|
||||||
|
<div class="socials">
|
||||||
|
Pixeldrain is on the fediverse!<br/>
|
||||||
|
|
||||||
|
<a href="https://mastodon.social/@fornax" rel="noreferrer" class="button" target="_blank" style="background-color: #595aff; color: #ffffff;">
|
||||||
|
<i class="icon small">people</i>
|
||||||
|
Mastodon
|
||||||
|
</a>
|
||||||
|
<a href="https://lemmy.fornaxian.tech/c/pixeldrain"
|
||||||
|
rel="noreferrer" class="button" target="_blank" style="background-color: #14854f; color: #ffffff;"
|
||||||
|
>
|
||||||
|
<i class="icon small">people</i>
|
||||||
|
Lemmy
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="socials">
|
||||||
|
And on legacy media too<br/>
|
||||||
|
|
||||||
|
<a href="https://twitter.com/Fornax96" rel="noreferrer" class="button" target="_blank" style="background-color: #1a8cd8; color: #ffffff;">
|
||||||
|
<i class="icon small">people</i>
|
||||||
|
Twitter
|
||||||
|
</a>
|
||||||
|
<a href="https://www.reddit.com/r/PixelDrain"
|
||||||
|
rel="noreferrer" class="button" target="_blank" style="background-color: #ff4500; color: #ffffff;"
|
||||||
|
>
|
||||||
|
<i class="icon small">people</i>
|
||||||
|
Reddit
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{:else if ad_type === "reviews"}
|
||||||
|
|
||||||
|
<div class="banner support_banner">
|
||||||
|
<span style="display: block; margin-bottom: 2px;">
|
||||||
|
Are you liking pixeldrain? Write a review! It really helps
|
||||||
|
</span>
|
||||||
|
<a href="https://alternativeto.net/software/pixeldrain/about/"
|
||||||
|
rel="noreferrer" class="button" target="_blank" style="background-color: #0C9EF0; color: #FFFFFF; font-weight: bold;"
|
||||||
|
>
|
||||||
|
<i class="icon">rate_review</i>
|
||||||
|
AlternativeTo
|
||||||
|
</a>
|
||||||
|
<a href="https://www.trustpilot.com/review/pixeldrain.com"
|
||||||
|
rel="noreferrer" class="button" target="_blank" style="background-color: #00B67A; color: #FFFFFF; font-weight: bold;"
|
||||||
|
>
|
||||||
|
<i class="icon">rate_review</i>
|
||||||
|
Trustpilot
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{:else if ad_type === "slava_ukraini"}
|
||||||
|
|
||||||
|
<a href="https://en.wikipedia.org/wiki/War_crimes_in_the_Russian_invasion_of_Ukraine" class="banner flag" target="_blank" rel="noreferrer">
|
||||||
|
<div class="flag_top">
|
||||||
|
We do not forget
|
||||||
|
</div>
|
||||||
|
<div class="flag_bottom">
|
||||||
|
Slava Ukraini!
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.banner {
|
||||||
|
display: block;
|
||||||
|
margin: auto;
|
||||||
|
transform-origin: 0 0;
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
.center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.support_banner {
|
||||||
|
text-align: center;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
.socials {
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
|
margin: 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Try to avoid text wrapping */
|
||||||
|
@media(max-width: 600px) {
|
||||||
|
.banner {
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
.socials {
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.flag {
|
||||||
|
display: block;
|
||||||
|
margin: auto;
|
||||||
|
padding: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-decoration: none;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1.1em;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
.flag_top {
|
||||||
|
background-color: #0057b7;
|
||||||
|
color: #ffd700;
|
||||||
|
padding: 2px;
|
||||||
|
border-top-left-radius: 10px;
|
||||||
|
border-top-right-radius: 10px;
|
||||||
|
}
|
||||||
|
.flag_bottom {
|
||||||
|
background-color: #ffd700;
|
||||||
|
color: #0057b7;
|
||||||
|
padding: 2px;
|
||||||
|
border-bottom-left-radius: 10px;
|
||||||
|
border-bottom-right-radius: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
@@ -12,8 +12,7 @@ import EditWindow from "./EditWindow.svelte";
|
|||||||
import EmbedWindow from "./EmbedWindow.svelte";
|
import EmbedWindow from "./EmbedWindow.svelte";
|
||||||
import ReportWindow from "./ReportWindow.svelte";
|
import ReportWindow from "./ReportWindow.svelte";
|
||||||
import IntroPopup from "./IntroPopup.svelte";
|
import IntroPopup from "./IntroPopup.svelte";
|
||||||
import AdHead from "./AdHead.svelte";
|
import BottomBanner from "./BottomBanner.svelte";
|
||||||
import AdLeaderboard from "./AdLeaderboard.svelte";
|
|
||||||
import Sharebar from "./Sharebar.svelte";
|
import Sharebar from "./Sharebar.svelte";
|
||||||
import GalleryView from "./GalleryView.svelte";
|
import GalleryView from "./GalleryView.svelte";
|
||||||
import Downloader from "./Downloader.svelte";
|
import Downloader from "./Downloader.svelte";
|
||||||
@@ -383,15 +382,11 @@ const keyboard_event = evt => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:window on:keydown={keyboard_event} on:hashchange={hash_change}/>
|
<svelte:window on:keydown={keyboard_event} on:hashchange={hash_change}/>
|
||||||
|
|
||||||
<div class="file_viewer">
|
<div class="file_viewer">
|
||||||
<!-- Head elements for the ads -->
|
|
||||||
<AdHead></AdHead>
|
|
||||||
|
|
||||||
<LoadingIndicator loading={loading}/>
|
<LoadingIndicator loading={loading}/>
|
||||||
|
|
||||||
<div class="headerbar">
|
<div class="headerbar">
|
||||||
@@ -612,7 +607,7 @@ const keyboard_event = evt => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if ads_enabled}
|
{#if ads_enabled}
|
||||||
<AdLeaderboard></AdLeaderboard>
|
<BottomBanner/>
|
||||||
<TransferLimit/>
|
<TransferLimit/>
|
||||||
{:else if custom_footer}
|
{:else if custom_footer}
|
||||||
<CustomBanner src={custom_footer} link={custom_footer_link}></CustomBanner>
|
<CustomBanner src={custom_footer} link={custom_footer_link}></CustomBanner>
|
||||||
|
@@ -20,16 +20,17 @@ $: {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $download_limits.loaded}
|
<!-- Always show the outer bar to prevent layout shift -->
|
||||||
<div class="progress_bar_outer" title="{title}">
|
<div class="progress_bar_outer" title="{title}">
|
||||||
|
{#if $download_limits.loaded}
|
||||||
<div class="progress_bar_text">
|
<div class="progress_bar_text">
|
||||||
{title}
|
{title}
|
||||||
</div>
|
</div>
|
||||||
<div class="progress_bar_inner" style="width: {percent}%;">
|
<div class="progress_bar_inner" style="width: {percent}%;">
|
||||||
{title}
|
{title}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.progress_bar_outer {
|
.progress_bar_outer {
|
||||||
|
@@ -60,7 +60,7 @@ onMount(() => {
|
|||||||
Downloading
|
Downloading
|
||||||
</div>
|
</div>
|
||||||
<div class="feature_cell free_feat">
|
<div class="feature_cell free_feat">
|
||||||
<span class="bold">10 GB per day</span><br/>
|
<span class="bold">5 GB per day</span><br/>
|
||||||
|
|
||||||
Download speed is reduced to 1 MiB/s when exceeded. Max 3 concurrent
|
Download speed is reduced to 1 MiB/s when exceeded. Max 3 concurrent
|
||||||
downloads
|
downloads
|
||||||
|
@@ -241,6 +241,11 @@ onDestroy(() => {
|
|||||||
{#if window.user.balance_micro_eur !== 0}
|
{#if window.user.balance_micro_eur !== 0}
|
||||||
<li>
|
<li>
|
||||||
Current account balance: <Euro amount={window.user.balance_micro_eur}></Euro>
|
Current account balance: <Euro amount={window.user.balance_micro_eur}></Euro>
|
||||||
|
{#if window.user.subscription.id === ""}
|
||||||
|
<br/>
|
||||||
|
You have account credit but no active subscription. Activate
|
||||||
|
a subscription on the <a href="/user/prepaid/subscriptions">subscriptions page</a>
|
||||||
|
{/if}
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
|
@@ -1,37 +0,0 @@
|
|||||||
package webcontroller
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net/http"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"fornaxian.tech/log"
|
|
||||||
"fornaxian.tech/util"
|
|
||||||
"github.com/julienschmidt/httprouter"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (wc *WebController) serveAdClick(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
|
||||||
// Redirect the user to the target page
|
|
||||||
w.Header().Set("Referrer-Policy", "origin")
|
|
||||||
http.Redirect(w, r, r.URL.Query().Get("target"), http.StatusTemporaryRedirect)
|
|
||||||
|
|
||||||
// The Real IP is used in the API server to determine that the view is not
|
|
||||||
// fake
|
|
||||||
var api = wc.api.RealIP(util.RemoteAddress(r)).RealAgent(r.UserAgent())
|
|
||||||
|
|
||||||
// Log a view on the file
|
|
||||||
if err := api.PostFileView(p.ByName("id"), wc.viewTokenOrBust()); err != nil {
|
|
||||||
log.Error("Failed to log view: %s", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (wc *WebController) serveCampaignPartner(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
|
||||||
http.SetCookie(w, &http.Cookie{
|
|
||||||
Name: "pd_campaign",
|
|
||||||
Value: p.ByName("id"),
|
|
||||||
Path: "/",
|
|
||||||
Expires: time.Now().AddDate(0, 0, 7),
|
|
||||||
})
|
|
||||||
|
|
||||||
// Redirect the user to the home page
|
|
||||||
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
|
|
||||||
}
|
|
@@ -125,7 +125,6 @@ func (tm *TemplateManager) ParseTemplates(silent bool) {
|
|||||||
// Import template functions
|
// Import template functions
|
||||||
tpl.Funcs(template.FuncMap{
|
tpl.Funcs(template.FuncMap{
|
||||||
"cacheID": tm.cacheID,
|
"cacheID": tm.cacheID,
|
||||||
"isBrave": tm.isBrave,
|
|
||||||
"debugMode": tm.debugMode,
|
"debugMode": tm.debugMode,
|
||||||
"apiUrl": tm.apiURL,
|
"apiUrl": tm.apiURL,
|
||||||
"pageNr": tm.pageNr,
|
"pageNr": tm.pageNr,
|
||||||
@@ -218,10 +217,6 @@ var cacheID = time.Now().Unix() / 3600
|
|||||||
func (tm *TemplateManager) cacheID() int64 {
|
func (tm *TemplateManager) cacheID() int64 {
|
||||||
return cacheID
|
return cacheID
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tm *TemplateManager) isBrave(useragent string) bool {
|
|
||||||
return strings.Contains(useragent, "Brave")
|
|
||||||
}
|
|
||||||
func (tm *TemplateManager) debugMode() bool {
|
func (tm *TemplateManager) debugMode() bool {
|
||||||
return tm.debugModeEnabled
|
return tm.debugModeEnabled
|
||||||
}
|
}
|
||||||
|
@@ -87,7 +87,6 @@ func New(r *httprouter.Router, prefix string, conf Config) (wc *WebController) {
|
|||||||
// Static assets
|
// Static assets
|
||||||
r.GET(prefix+"/favicon.ico" /* */, wc.serveFile("/favicon.ico"))
|
r.GET(prefix+"/favicon.ico" /* */, wc.serveFile("/favicon.ico"))
|
||||||
r.GET(prefix+"/robots.txt" /* */, wc.serveFile("/robots.txt"))
|
r.GET(prefix+"/robots.txt" /* */, wc.serveFile("/robots.txt"))
|
||||||
r.GET(prefix+"/ads.txt" /* */, wc.serveFile("/ads.txt"))
|
|
||||||
|
|
||||||
if conf.MaintenanceMode {
|
if conf.MaintenanceMode {
|
||||||
r.NotFound = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
r.NotFound = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -143,12 +142,10 @@ func New(r *httprouter.Router, prefix string, conf Config) (wc *WebController) {
|
|||||||
{GET, "d/*path" /* */, wc.serveDirectory},
|
{GET, "d/*path" /* */, wc.serveDirectory},
|
||||||
{GET, "t" /* */, wc.serveTemplate("text_upload", handlerOpts{})},
|
{GET, "t" /* */, wc.serveTemplate("text_upload", handlerOpts{})},
|
||||||
{GET, "donation" /* */, wc.serveMarkdown("donation.md", handlerOpts{})},
|
{GET, "donation" /* */, wc.serveMarkdown("donation.md", handlerOpts{})},
|
||||||
{GET, "advertising" /* */, wc.serveMarkdown("advertising.md", handlerOpts{})},
|
|
||||||
{GET, "widgets" /* */, wc.serveTemplate("widgets", handlerOpts{})},
|
{GET, "widgets" /* */, wc.serveTemplate("widgets", handlerOpts{})},
|
||||||
{GET, "about" /* */, wc.serveMarkdown("about.md", handlerOpts{})},
|
{GET, "about" /* */, wc.serveMarkdown("about.md", handlerOpts{})},
|
||||||
{GET, "appearance" /* */, wc.serveTemplate("appearance", handlerOpts{})},
|
{GET, "appearance" /* */, wc.serveTemplate("appearance", handlerOpts{})},
|
||||||
{GET, "hosting" /* */, wc.serveMarkdown("hosting.md", handlerOpts{})},
|
{GET, "hosting" /* */, wc.serveMarkdown("hosting.md", handlerOpts{})},
|
||||||
{GET, "brave" /* */, wc.serveMarkdown("brave.md", handlerOpts{})},
|
|
||||||
{GET, "acknowledgements" /**/, wc.serveMarkdown("acknowledgements.md", handlerOpts{})},
|
{GET, "acknowledgements" /**/, wc.serveMarkdown("acknowledgements.md", handlerOpts{})},
|
||||||
{GET, "business" /* */, wc.serveMarkdown("business.md", handlerOpts{})},
|
{GET, "business" /* */, wc.serveMarkdown("business.md", handlerOpts{})},
|
||||||
{GET, "limits" /* */, wc.serveMarkdown("limits.md", handlerOpts{})},
|
{GET, "limits" /* */, wc.serveMarkdown("limits.md", handlerOpts{})},
|
||||||
@@ -205,10 +202,6 @@ func New(r *httprouter.Router, prefix string, conf Config) (wc *WebController) {
|
|||||||
{GET, "admin/globals" /* */, wc.serveForm(wc.adminGlobalsForm, handlerOpts{Auth: true})},
|
{GET, "admin/globals" /* */, wc.serveForm(wc.adminGlobalsForm, handlerOpts{Auth: true})},
|
||||||
{PST, "admin/globals" /* */, wc.serveForm(wc.adminGlobalsForm, handlerOpts{Auth: true})},
|
{PST, "admin/globals" /* */, wc.serveForm(wc.adminGlobalsForm, handlerOpts{Auth: true})},
|
||||||
|
|
||||||
// Advertising related
|
|
||||||
{GET, "click/:id" /* */, wc.serveAdClick},
|
|
||||||
{GET, "campaign/:id" /* */, wc.serveCampaignPartner},
|
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
{GET, "misc/sharex/pixeldrain.com.sxcu", wc.serveShareXConfig},
|
{GET, "misc/sharex/pixeldrain.com.sxcu", wc.serveShareXConfig},
|
||||||
{GET, "theme.css", wc.themeHandler},
|
{GET, "theme.css", wc.themeHandler},
|
||||||
|
Reference in New Issue
Block a user