forked from Trivernis/no-chromium
Compare commits
29 Commits
feature/sv
...
main
Author | SHA1 | Date |
---|---|---|
Trivernis | e7c015e47b | 1 year ago |
punishedbernadetta | 7babf4f929 | 1 year ago |
trivernis | 62132def6d | 1 year ago |
trivernis | 9a7ffb2aca | 1 year ago |
trivernis | 113d43bdaa | 1 year ago |
Trivernis | 4418c4dfe0 | 1 year ago |
trivernis | ea7ee26271 | 1 year ago |
trivernis | 295092f660 | 1 year ago |
trivernis | ddf5fd0ad5 | 1 year ago |
Trivernis | 60d1c27ac3 | 1 year ago |
trivernis | 11779ab348 | 1 year ago |
Trivernis | 05b0ec3c45 | 1 year ago |
Trivernis | 0370269e52 | 1 year ago |
trivernis | 01771ee3d3 | 1 year ago |
Nex | 8739bc84cc | 1 year ago |
Trivernis | 016e3a14c5 | 1 year ago |
trivernis | c526911449 | 1 year ago |
Trivernis | ee8e3f1062 | 1 year ago |
trivernis | c2e672ea29 | 1 year ago |
trivernis | 4a4d9b37e5 | 1 year ago |
Trivernis | c1c41b7c1f | 1 year ago |
trivernis | 287a3d3e66 | 1 year ago |
Trivernis | b472e7e7ce | 1 year ago |
trivernis | e6b7a9849f | 1 year ago |
Trivernis | 7cb7042bc6 | 1 year ago |
trivernis | 5d2ddea3c3 | 1 year ago |
Trivernis | 13c42a8c55 | 1 year ago |
trivernis | 15ce841dfa | 1 year ago |
Trivernis | 293d66e1bc | 1 year ago |
@ -1,38 +1,11 @@
|
||||
# create-svelte
|
||||
# No Chromium
|
||||
|
||||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
|
||||
This is the source code for [no-chromium.org](https://no-chromium.org/).
|
||||
|
||||
## Creating a project
|
||||
## Contributing
|
||||
|
||||
If you're seeing this, you've probably already done this step. Congrats!
|
||||
Yes. Read [this](./CODE_OF_CONDUCT.md).
|
||||
|
||||
```bash
|
||||
# create a new project in the current directory
|
||||
npm create svelte@latest
|
||||
## License
|
||||
|
||||
# create a new project in my-app
|
||||
npm create svelte@latest my-app
|
||||
```
|
||||
|
||||
## Developing
|
||||
|
||||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
|
||||
# or start the server and open the app in a new browser tab
|
||||
npm run dev -- --open
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
To create a production version of your app:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
You can preview the production build with `npm run preview`.
|
||||
|
||||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
||||
CNPLv7+
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,14 @@
|
||||
import { handler } from "./handler.js";
|
||||
import express from "express";
|
||||
import cors from 'cors';
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use("/popup/", cors());
|
||||
|
||||
// let SvelteKit handle everything else, including serving prerendered pages and static assets
|
||||
app.use(handler);
|
||||
|
||||
app.listen(3000, () => {
|
||||
console.log("listening on port 3000");
|
||||
});
|
@ -1,42 +1,9 @@
|
||||
html {
|
||||
font-family: Noto Sans, sans-serif;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
*, *:before, *:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
body {
|
||||
font-family: Noto Sans, sans serif;
|
||||
min-height: 1vh;
|
||||
min-height: 100vh;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 1.5rem;
|
||||
}
|
||||
|
||||
.banner {
|
||||
margin: 10%;
|
||||
font-size: 2em;
|
||||
margin: 0 auto 4rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin: 0 10%;
|
||||
padding: 0 1rem;
|
||||
margin: 0 auto;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
height: 100vh;
|
||||
height: 100dvh;
|
||||
}
|
@ -0,0 +1 @@
|
||||
export const prerender = true;
|
@ -0,0 +1,13 @@
|
||||
<script lang="ts">
|
||||
|
||||
export let url: string;
|
||||
export let title: string;
|
||||
export let author: string;
|
||||
|
||||
</script>
|
||||
|
||||
<a href="{ url }">
|
||||
<span class="author">{ author }</span>
|
||||
-
|
||||
<i class="title">{ title }</i>
|
||||
</a>
|
@ -0,0 +1 @@
|
||||
export const prerender = true;
|
@ -0,0 +1,78 @@
|
||||
<div id="no-chromium-head">
|
||||
|
||||
<style lang="scss">
|
||||
#no-chromium-popup {
|
||||
position: fixed;
|
||||
display: flex;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: rgba(0, 0, 0, 0.125);
|
||||
font-family: Noto Sans, sans serif;
|
||||
color: white;
|
||||
z-index: 10;
|
||||
|
||||
.nc-popup-inner {
|
||||
display: block;
|
||||
position: relative;
|
||||
margin: auto;
|
||||
background-color: #FF6F00;
|
||||
padding: 1em;
|
||||
border-radius: 5px;
|
||||
|
||||
button {
|
||||
border-style: none;
|
||||
font-weight: bold;
|
||||
background-colour: white;
|
||||
font-size: 2em;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
margin: 3px;
|
||||
color: white;
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
}
|
||||
|
||||
transition-duration: 0.1s;
|
||||
|
||||
&.nc-no {
|
||||
background-color: #800;
|
||||
|
||||
&:hover {
|
||||
background-color: #B00;
|
||||
}
|
||||
}
|
||||
|
||||
&.nc-ok {
|
||||
background-color: #080;
|
||||
|
||||
&:hover {
|
||||
background-color: #0B0;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="no-chromium-body">
|
||||
|
||||
<div id="no-chromium-popup" style="display: none">
|
||||
|
||||
<div class="nc-popup-inner">
|
||||
<center><h1>Stop using Chromium based Web Browsers</h1></center>
|
||||
<a href="https://no-chromium.org/redirect"><button class="nc-no">No</button></a>
|
||||
<button class="nc-ok" id="no-chromium-hide-button">Ok</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
@ -0,0 +1,26 @@
|
||||
async function showNoChromiumPopup() {
|
||||
if (navigator.userAgent.includes("Chrome") && localStorage.getItem("no-chromium-popup-shown") != "1") {
|
||||
|
||||
const divPage = document.createElement("div");
|
||||
const response = await fetch("https://no-chromium.org/popup/");
|
||||
divPage.innerHTML = await response.text();
|
||||
|
||||
for (const child of divPage.querySelectorAll("#no-chromium-head > *")) {
|
||||
document.head.appendChild(child);
|
||||
}
|
||||
|
||||
for (const child of divPage.querySelectorAll("#no-chromium-body > *")) {
|
||||
document.body.appendChild(child);
|
||||
}
|
||||
|
||||
document.querySelector("#no-chromium-popup").style = "z-index: 9999;";
|
||||
document.querySelector("#no-chromium-hide-button").addEventListener("click", hideNoChromiumPopup);
|
||||
}
|
||||
}
|
||||
|
||||
function hideNoChromiumPopup() {
|
||||
document.querySelector("#no-chromium-popup").remove();
|
||||
localStorage.setItem("no-chromium-popup-shown", "1");
|
||||
}
|
||||
|
||||
showNoChromiumPopup();
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script type="text/javascript" src="/popup.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,9 +1,13 @@
|
||||
const plugin = require("tailwindcss/plugin");
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
content: ["./src/**/*.{htm,js,svelte,ts}"],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
plugins: [
|
||||
require('@tailwindcss/typography'),
|
||||
],
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue