Comienzo de nueva version de la pagina de inicio

This commit is contained in:
2021-12-16 00:17:07 -03:00
parent 853cfa5da3
commit 8ac3179b35
26 changed files with 7301 additions and 155 deletions

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
/node_modules/
/public/build/
.DS_Store

5
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,5 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/

5
.idea/codeStyles/codeStyleConfig.xml generated Normal file
View File

@@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

View File

@@ -0,0 +1,36 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="HttpUrlsUsage" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredUrls">
<list>
<option value="http://localhost" />
<option value="http://127.0.0.1" />
<option value="http://0.0.0.0" />
<option value="http://www.w3.org/" />
<option value="http://json-schema.org/draft" />
<option value="http://java.sun.com/" />
<option value="http://xmlns.jcp.org/" />
<option value="http://javafx.com/javafx/" />
<option value="http://javafx.com/fxml" />
<option value="http://maven.apache.org/xsd/" />
<option value="http://maven.apache.org/POM/" />
<option value="http://www.springframework.org/schema/" />
<option value="http://www.springframework.org/tags" />
<option value="http://www.springframework.org/security/tags" />
<option value="http://www.thymeleaf.org" />
<option value="http://www.jboss.org/j2ee/schema/" />
<option value="http://www.jboss.com/xml/ns/" />
<option value="http://www.ibm.com/webservices/xsd" />
<option value="http://activemq.apache.org/schema/" />
<option value="http://schema.cloudfoundry.org/spring/" />
<option value="http://schemas.xmlsoap.org/" />
<option value="http://cxf.apache.org/schemas/" />
<option value="http://primefaces.org/ui" />
<option value="http://tiles.apache.org/" />
<option value="http://" />
</list>
</option>
</inspection_tool>
</profile>
</component>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/start.danielcortes.xyz.iml" filepath="$PROJECT_DIR$/.idea/start.danielcortes.xyz.iml" />
</modules>
</component>
</project>

13
.idea/start.danielcortes.xyz.iml generated Normal file
View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
<excludeFolder url="file://$MODULE_DIR$/public/build" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -1,2 +1,2 @@
FROM nginx:latest
COPY . /usr/share/nginx/html
COPY ./public/ /usr/share/nginx/html/

109
README.md Normal file
View File

@@ -0,0 +1,109 @@
*Psst — looking for a more complete solution? Check out [SvelteKit](https://kit.svelte.dev), the official framework for building web applications of all sizes, with a beautiful development experience and flexible filesystem-based routing.*
*Looking for a shareable component template instead? You can [use SvelteKit for that as well](https://kit.svelte.dev/docs#packaging) or the older [sveltejs/component-template](https://github.com/sveltejs/component-template)*
---
# svelte app
This is a project template for [Svelte](https://svelte.dev) apps. It lives at https://github.com/sveltejs/template.
To create a new project based on this template using [degit](https://github.com/Rich-Harris/degit):
```bash
npx degit sveltejs/template svelte-app
cd svelte-app
```
*Note that you will need to have [Node.js](https://nodejs.org) installed.*
## Get started
Install the dependencies...
```bash
cd svelte-app
npm install
```
...then start [Rollup](https://rollupjs.org):
```bash
npm run dev
```
Navigate to [localhost:5000](http://localhost:5000). You should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes.
By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the `sirv` commands in package.json to include the option `--host 0.0.0.0`.
If you're using [Visual Studio Code](https://code.visualstudio.com/) we recommend installing the official extension [Svelte for VS Code](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode). If you are using other editors you may need to install a plugin in order to get syntax highlighting and intellisense.
## Building and running in production mode
To create an optimised version of the app:
```bash
npm run build
```
You can run the newly built app with `npm run start`. This uses [sirv](https://github.com/lukeed/sirv), which is included in your package.json's `dependencies` so that the app will work when you deploy to platforms like [Heroku](https://heroku.com).
## Single-page app mode
By default, sirv will only respond to requests that match files in `public`. This is to maximise compatibility with static fileservers, allowing you to deploy your app anywhere.
If you're building a single-page app (SPA) with multiple routes, sirv needs to be able to respond to requests for *any* path. You can make it so by editing the `"start"` command in package.json:
```js
"start": "sirv public --single"
```
## Using TypeScript
This template comes with a script to set up a TypeScript development environment, you can run it immediately after cloning the template with:
```bash
node scripts/setupTypeScript.js
```
Or remove the script via:
```bash
rm scripts/setupTypeScript.js
```
If you want to use `baseUrl` or `path` aliases within your `tsconfig`, you need to set up `@rollup/plugin-alias` to tell Rollup to resolve the aliases. For more info, see [this StackOverflow question](https://stackoverflow.com/questions/63427935/setup-tsconfig-path-in-svelte).
## Deploying to the web
### With [Vercel](https://vercel.com)
Install `vercel` if you haven't already:
```bash
npm install -g vercel
```
Then, from within your project folder:
```bash
cd public
vercel deploy --name my-project
```
### With [surge](https://surge.sh/)
Install `surge` if you haven't already:
```bash
npm install -g surge
```
Then, from within your project folder:
```bash
npm run build
surge public my-project.surge.sh
```

View File

@@ -1,154 +0,0 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Start</title>
<style>
:root {
--background: #ffffff;
--foreground: #000000;
--width: 70ch;
}
* {
font-family: "Work Sans";
font-size: 20px;
}
::selection {
color: var(--background);
background: var(--foreground);
}
html {
background-color: var(--background);
color: var(--foreground);
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
}
.items {
display: grid;
grid-template-columns: 10ch auto;
grid-template-rows: auto auto auto auto;
max-width: var(--width);
width: 100%;
}
.items > div {
margin-bottom: 1ch;
}
.search {
max-width: var(--width);
width: 100%;
margin-bottom: 1ch;
}
.search > input{
width: 100%;
background: var(--background);
color: var(--foreground);
border: solid 2px var(--foreground);
padding: 1ch;
}
.title {
font-weight: 700;
width: 8ch;
}
.link {
margin-right: 1ch;
}
.link a {
text-decoration: none;
color: var(--foreground);
}
.link a:hover {
text-decoration: underline
}
link a:visited {
color: var(--foreground);
}
</style>
</head>
<body>
<div class='container'>
<div class='search'>
<input type='search' name='q' autocomplete='off' autofocus>
</div>
<div class='items'>
<span class='title'>General</span>
<div>
<span class='link'>[<a href="https://tweetdeck.twitter.com">twitter</a>]</span>
<span class='link'>[<a href="https://www.youtube.com">youtube</a>]</span>
<span class='link'>[<a href="https://news.ycombinator.com">hacker_news</a>]</span>
<span class='link'>[<a href="https://lobste.rs">lobsters</a>]</span>
<span class='link'>[<a href="https://web.whatsapp.com">whatsapp</a>]</span>
</div>
<span class='title'>Inacap</span>
<div>
<span class='link'>[<a href="https://www.inacap.cl">home</a>]</span>
<span class='link'>[<a href="https://adfs.inacap.cl/adfs/ls/?wtrealm=https://siga.inacap.cl/sts/&wa=wsignin1.0&wreply=https://siga.inacap.cl/sts/&wctx=https%3a%2f%2fadfs.inacap.cl%2fadfs%2fls%2f%3fwreply%3dhttps%3a%2f%2fwww.inacap.cl%2ftportalvp%2fintranet-alumno%26wtrealm%3dhttps%3a%2f%2fwww.inacap.cl%2f">intranet</a>]</span>
<span class='link'>[<a href="https://www.inacap.cl/tportalvp/procesar_link.php?url=https://lms.inacap.cl/auth/saml2/login.php?wants=https://lms.inacap.cl/my/">aprendizaje</a>]</span>
<span class='link'>[<a href="https://docs.google.com">docs</a>]</span>
</div>
<span class='title'>Reddit</span>
<div>
<span class='link'>[<a href="https://www.reddit.com">frontpage</a>]</span>
<span class='link'>[<a href="https://www.reddit.com/r/unixporn">/r/unixporn</a>]</span>
<span class='link'>[<a href="https://www.reddit.com/r/piracy">/r/piracy</a>]</span>
<span class='link'>[<a href="https://www.reddit.com/r/roms">/r/roms</a>]</span>
<span class='link'>[<a href="https://www.reddit.com/r/chile">/r/chile</a>]</span>
</div>
<span class='title'>4chan</span>
<div>
<span class='link'>[<a href="https://4chan.org/g/catalog">/g/</a>]</span>
<span class='link'>[<a href="https://4chan.org/wg/catalog">/wg/</a>]</span>
<span class='link'>[<a href="https://4chan.org/v/catalog">/v/</a>]</span>
<span class='link'>[<a href="https://4chan.org/x/catalog">/x/</a>]</span>
</div>
</div>
</div>
<script>
document.onkeydown = function(e) {
q = document.getElementsByName('q')[0].value;
if(q.length === 0){
return;
}
if(e.key === 'Enter'){
if(e.ctrlKey) {
window.location.href = 'https://' + q;
} else if(q[0] === '!'){
switch(q.slice(1)) {
case 't': window.location.href = 'https://www.twitter.com'; break;
case 'w': window.location.href = 'https://www.wikipedia.com'; break;
case 'y': window.location.href = 'https://www.youtube.com'; break;
case 'r': window.location.href = 'https://www.reddit.com'; break;
default : window.location.href = 'https://www.duckduckgo.com/?q=' + encodeURIComponent(q); break;
}
} else {
window.location.href = 'https://www.duckduckgo.com/?q=' + encodeURIComponent(q);
}
}
}
</script>
</body>
</html>

6324
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

36
package.json Normal file
View File

@@ -0,0 +1,36 @@
{
"name": "svelte-app",
"version": "1.0.0",
"private": true,
"scripts": {
"build:tailwind": "cross-env NODE_ENV=production npx postcss public/tailwind.css -o public/index.css",
"watch:tailwind": "npx postcss public/tailwind.css -o public/index.css -w",
"build:svelte": "rollup -c",
"watch:svelte": "rollup -c -w",
"build": "npm run build:tailwind && npm run build:svelte",
"dev": "concurrently npm:watch:*",
"start": "sirv public --no-clear"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-node-resolve": "^11.0.0",
"autoprefixer": "^10.4.0",
"concurrently": "^6.4.0",
"cross-env": "^7.0.3",
"postcss": "^8.4.5",
"postcss-cli": "^9.1.0",
"rollup": "^2.3.4",
"rollup-plugin-css-only": "^3.1.0",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-svelte": "^7.0.0",
"rollup-plugin-terser": "^7.0.0",
"svelte": "^3.0.0",
"tailwindcss": "^3.0.5"
},
"dependencies": {
"sirv-cli": "^1.0.0"
}
}

6
postcss.config.js Normal file
View File

@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
}
}

BIN
public/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

515
public/index.css Normal file
View File

@@ -0,0 +1,515 @@
/*
! tailwindcss v3.0.5 | MIT License | https://tailwindcss.com
*//*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/
*,
::before,
::after {
box-sizing: border-box; /* 1 */
border-width: 0; /* 2 */
border-style: solid; /* 2 */
border-color: currentColor; /* 2 */
}
::before,
::after {
--tw-content: '';
}
/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
*/
html {
line-height: 1.5; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
-moz-tab-size: 4; /* 3 */
-o-tab-size: 4;
tab-size: 4; /* 3 */
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
}
/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/
body {
margin: 0; /* 1 */
line-height: inherit; /* 2 */
}
/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/
hr {
height: 0; /* 1 */
color: inherit; /* 2 */
border-top-width: 1px; /* 3 */
}
/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/
abbr[title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
/*
Remove the default font size and weight for headings.
*/
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: inherit;
font-weight: inherit;
}
/*
Reset links to optimize for opt-in styling instead of opt-out.
*/
a {
color: inherit;
text-decoration: inherit;
}
/*
Add the correct font weight in Edge and Safari.
*/
b,
strong {
font-weight: bolder;
}
/*
1. Use the user's configured `mono` font family by default.
2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp,
pre {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */
font-size: 1em; /* 2 */
}
/*
Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/
table {
text-indent: 0; /* 1 */
border-color: inherit; /* 2 */
border-collapse: collapse; /* 3 */
}
/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: inherit; /* 1 */
color: inherit; /* 1 */
margin: 0; /* 2 */
padding: 0; /* 3 */
}
/*
Remove the inheritance of text transform in Edge and Firefox.
*/
button,
select {
text-transform: none;
}
/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/
button,
[type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button; /* 1 */
background-color: transparent; /* 2 */
background-image: none; /* 2 */
}
/*
Use the modern Firefox focus style for all focusable elements.
*/
:-moz-focusring {
outline: auto;
}
/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/
:-moz-ui-invalid {
box-shadow: none;
}
/*
Add the correct vertical alignment in Chrome and Firefox.
*/
progress {
vertical-align: baseline;
}
/*
Correct the cursor style of increment and decrement buttons in Safari.
*/
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
height: auto;
}
/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/
[type='search'] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/*
Remove the inner padding in Chrome and Safari on macOS.
*/
::-webkit-search-decoration {
-webkit-appearance: none;
}
/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/*
Add the correct display in Chrome and Safari.
*/
summary {
display: list-item;
}
/*
Removes the default spacing and border for appropriate elements.
*/
blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
margin: 0;
}
fieldset {
margin: 0;
padding: 0;
}
legend {
padding: 0;
}
ol,
ul,
menu {
list-style: none;
margin: 0;
padding: 0;
}
/*
Prevent resizing textareas horizontally by default.
*/
textarea {
resize: vertical;
}
/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/
input::-moz-placeholder, textarea::-moz-placeholder {
opacity: 1; /* 1 */
color: #9ca3af; /* 2 */
}
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
opacity: 1; /* 1 */
color: #9ca3af; /* 2 */
}
input::placeholder,
textarea::placeholder {
opacity: 1; /* 1 */
color: #9ca3af; /* 2 */
}
/*
Set the default cursor for buttons.
*/
button,
[role="button"] {
cursor: pointer;
}
/*
Make sure disabled buttons don't get the pointer cursor.
*/
:disabled {
cursor: default;
}
/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
This can trigger a poorly considered lint error in some tools but is included by design.
*/
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
display: block; /* 1 */
vertical-align: middle; /* 2 */
}
/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/
img,
video {
max-width: 100%;
height: auto;
}
/*
Ensure the default browser behavior of the `hidden` attribute.
*/
[hidden] {
display: none;
}
*, ::before, ::after {
--tw-border-opacity: 1;
border-color: rgb(229 231 235 / var(--tw-border-opacity));
}
.container {
width: 100%;
}
@media (min-width: 640px) {
.container {
max-width: 640px;
}
}
@media (min-width: 768px) {
.container {
max-width: 768px;
}
}
@media (min-width: 1024px) {
.container {
max-width: 1024px;
}
}
@media (min-width: 1280px) {
.container {
max-width: 1280px;
}
}
@media (min-width: 1536px) {
.container {
max-width: 1536px;
}
}
.flex {
display: flex;
}
.grid {
display: grid;
}
.h-screen {
height: 100vh;
}
.w-screen {
width: 100vw;
}
.w-2\/3 {
width: 66.666667%;
}
.w-full {
width: 100%;
}
.max-w-screen-lg {
max-width: 1024px;
}
.max-w-screen-md {
max-width: 768px;
}
.cursor-pointer {
cursor: pointer;
}
.grid-cols-\[10ch_auto\] {
grid-template-columns: 10ch auto;
}
.flex-col {
flex-direction: column;
}
.items-center {
align-items: center;
}
.justify-center {
justify-content: center;
}
.space-y-2 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));
}
.space-x-2 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(0.5rem * var(--tw-space-x-reverse));
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}
.space-x-3 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(0.75rem * var(--tw-space-x-reverse));
margin-left: calc(0.75rem * calc(1 - var(--tw-space-x-reverse)));
}
.border {
border-width: 1px;
}
.border-2 {
border-width: 2px;
}
.border-black {
--tw-border-opacity: 1;
border-color: rgb(0 0 0 / var(--tw-border-opacity));
}
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
}
.bg-blue-500 {
--tw-bg-opacity: 1;
background-color: rgb(59 130 246 / var(--tw-bg-opacity));
}
.bg-green-500 {
--tw-bg-opacity: 1;
background-color: rgb(34 197 94 / var(--tw-bg-opacity));
}
.p-2 {
padding: 0.5rem;
}
.py-2 {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
.px-2 {
padding-left: 0.5rem;
padding-right: 0.5rem;
}
.font-bold {
font-weight: 700;
}
.hover\:font-bold:hover {
font-weight: 700;
}
.hover\:underline:hover {
-webkit-text-decoration-line: underline;
text-decoration-line: underline;
}

18
public/index.html Normal file
View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<title></title>
<link rel='icon' type='image/png' href='/favicon.png'>
<link rel='stylesheet' href='/index.css'>
<link rel='stylesheet' href='/build/bundle.css'>
<script defer src='/build/bundle.js'></script>
</head>
<body>
</body>
</html>

3
public/tailwind.css Normal file
View File

@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

67
rollup.config.js Normal file
View File

@@ -0,0 +1,67 @@
import svelte from 'rollup-plugin-svelte';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import livereload from 'rollup-plugin-livereload';
import {terser} from 'rollup-plugin-terser';
import postcss from 'rollup-plugin-postcss'
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);
}
};
}
export default {
input: 'src/main.js',
output: {
sourcemap: true,
format: 'iife',
name: 'app',
file: 'public/build/bundle.js'
},
plugins: [
svelte({
compilerOptions: {
// enable run-time checks when not in production
dev: !production
}
}),
postcss({
plugins: []
}),
resolve({
browser: true,
dedupe: ['svelte']
}),
commonjs(),
!production && serve(),
!production && livereload('public'),
production && terser()
],
watch: {
clearScreen: false
}
};

18
src/App.svelte Normal file
View File

@@ -0,0 +1,18 @@
<script>
import Search from "./Search.svelte";
import LinkGroup from "./LinkGroup.svelte";
import Container from "./Container.svelte";
import {groups} from "./store";
</script>
<Container>
<Search slot="search"/>
<svelte:fragment slot="groups">
{#each $groups as group}
<LinkGroup group="{group}"/>
{/each}
</svelte:fragment>
</Container>

8
src/Container.svelte Normal file
View File

@@ -0,0 +1,8 @@
<div class="h-screen w-screen flex items-center justify-center">
<div class="flex flex-col w-full max-w-screen-md p-2 space-y-2">
<slot name="search"/>
<div class="grid grid-cols-[10ch_auto] p-2">
<slot name="groups"/>
</div>
</div>
</div>

11
src/Link.svelte Normal file
View File

@@ -0,0 +1,11 @@
<script>
export let link;
</script>
<a
href="{link.href}"
referrerpolicy="no-referrer"
class="cursor-pointer hover:underline"
>
[{link.name}]
</a>

15
src/LinkGroup.svelte Normal file
View File

@@ -0,0 +1,15 @@
<script>
import Link from "./Link.svelte";
export let group = {
name: '',
links: []
};
</script>
<span class="font-bold">{group.name}</span>
<div class="space-x-3">
{#each group.links as link}
<Link link="{link}"/>
{/each}
</div>

38
src/Search.svelte Normal file
View File

@@ -0,0 +1,38 @@
<script>
let search = '';
function doNavigation(url) {
if(
url.slice(0,7) === 'http://' ||
url.slice(0,8) === 'https://' ||
url.slice(0,2) === '//'
){
window.location.href=url;
} else {
window.location.href=`//${url}`;
}
}
function doSearch(term) {
doNavigation(`https://duckduckgo.com/?q=${term}`);
}
function submit(event) {
if(event.key !== 'Enter') return;
if(search.trim() === '') return;
if(event.composed && event.ctrlKey){
doNavigation(search);
}else{
doSearch(search);
}
}
</script>
<input
type="search"
autocomplete="false"
bind:value={search}
on:keyup|preventDefault={submit}
class="border-2 border-black py-2 px-2"
/>

5
src/main.js Normal file
View File

@@ -0,0 +1,5 @@
import App from './App.svelte';
const app = new App({target: document.body});
export default app;

43
src/store.js Normal file
View File

@@ -0,0 +1,43 @@
import {readable} from "svelte/store";
const defaultGroups = [
{
name: 'General',
links: [
{name: 'twitter', link: 'https://twitter.com'},
{name: 'youtube', link: 'https://youtube.com'},
{name: 'hacker_news', link: 'https://news.ycombinator.com'},
{name: 'lobsters', link: 'https://lobste.rs'},
{name: 'whatsapp', link: 'https://web.whatsapp.com'},
]
},
{
name: 'Inacap',
links: [
{name: 'home', link: 'https://www.inacap.cl/'},
{name: 'intranet', link: 'https://adfs.inacap.cl/adfs/ls/?wtrealm=https://siga.inacap.cl/sts/&wa=wsignin1.0&wreply=https://siga.inacap.cl/sts/&wctx=https%3a%2f%2fadfs.inacap.cl%2fadfs%2fls%2f%3fwreply%3dhttps%3a%2f%2fwww.inacap.cl%2ftportalvp%2fintranet-alumno%26wtrealm%3dhttps%3a%2f%2fwww.inacap.cl%2f'},
{name: 'aprendizaje', link: 'https://www.inacap.cl/tportalvp/procesar_link.php?url=https://lms.inacap.cl/auth/saml2/login.php?wants=https://lms.inacap.cl/my/'},
]
},
{
name: 'Reddit',
links: [
{name: 'frontpage', link: 'https://reddit.com'},
{name: 'r/unixporn', link: 'https://reddit.com/r/unixporn'},
{name: 'r/piracy', link: 'https://reddit.com/r/piracy'},
{name: 'r/roms', link: 'https://reddit.com/r/roms'},
{name: 'r/chile', link: 'https://reddit.com/r/chile'},
]
},
{
name: '4chan',
links: [
{name: '/g/', link: 'https://4chan.org/g/catalog'},
{name: '/wg/', link: 'https://4chan.org/wg/catalog'},
{name: '/v/', link: 'https://4chan.org/v/catalog'},
{name: '/x/', link: 'https://4chan.org/x/catalog'},
]
},
]
export const groups = readable(defaultGroups, () => {}, ()=>{})

7
tailwind.config.js Normal file
View File

@@ -0,0 +1,7 @@
module.exports = {
content: ["./src/**/*.{html,js,svelte}"],
theme: {
extend: {},
},
plugins: [],
}