Skip to content

Commit 34f1a97

Browse files
committed
feat(*): initial commit
1 parent 3cf12f7 commit 34f1a97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1624
-450
lines changed

.formatter.exs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[
2+
import_deps: [:ecto, :phoenix],
3+
inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs}"],
4+
subdirectories: ["priv/*/migrations"]
5+
]

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# The directory Mix will write compiled artifacts to.
2+
/_build/
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover/
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps/
9+
10+
# Where 3rd-party dependencies like ExDoc output generated docs.
11+
/doc/
12+
13+
# Ignore .fetch files in case you like to edit your project deps locally.
14+
/.fetch
15+
16+
# If the VM crashes, it generates a dump, let's ignore it too.
17+
erl_crash.dump
18+
19+
# Also ignore archive artifacts (built via "mix archive.build").
20+
*.ez
21+
22+
# Ignore package tarball (built via "mix hex.build").
23+
profile-*.tar
24+
25+
# Ignore assets that are produced by build tools.
26+
/priv/static/assets/
27+
28+
# Ignore digested assets cache.
29+
/priv/static/cache_manifest.json
30+
31+
# In case you use Node.js/npm, you want to ignore these.
32+
npm-debug.log
33+
/assets/node_modules/
34+

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<div align="center">
2+
3+
# Profile
4+
### My personal website made using Elixir with Phoenix web framework.
5+
6+
</div>

assets/css/app.css

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/* This file is for your main application CSS */
2+
@import "./phoenix.css";
3+
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300&display=swap');
4+
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script&display=swap');
5+
@import url('https://fonts.googleapis.com/css2?family=Silkscreen&display=swap');
6+
7+
:root {
8+
/*Rosé Pìne theme*/
9+
--base: #232136;
10+
--surface: #2a273f;
11+
--overlay: #393552;
12+
--muted: #9893a5;
13+
--subtle: #797593;
14+
--text: #575279;
15+
--love: #b4637a;
16+
--gold: #ea9d34;
17+
--rose: #d7827e;
18+
--pine: #286983;
19+
--foam: #56949f;
20+
--iris: #907aa9;
21+
--hightlight: #44415a;
22+
--low: #2a283e;
23+
24+
/*Darcula theme*/
25+
--background: #282a36;
26+
--current_line: #242236;
27+
--selection: #44475a;
28+
--foreground: #f8f8f2;
29+
--comment: #6272a4;
30+
--cyan: #8be9fd;
31+
--green: #50fa7b;
32+
--orange: #ffb86c;
33+
--pink: #ff79c6;
34+
--purple: #bd93f9;
35+
--red: #ff5555;
36+
--yellow: #f1fa8c;
37+
}
38+
39+
body {
40+
background: var(--base);
41+
}
42+
43+
.navbar {
44+
overflow: hidden;
45+
width: 100%;
46+
height: 40px;
47+
position: fixed;
48+
top: 0;
49+
left: 0;
50+
z-index: 100;
51+
background: var(--overlay);
52+
margin: 0;
53+
padding: 0;
54+
}
55+
56+
.navbar-items {
57+
margin: 10px 0 0 0;
58+
display: flex;
59+
flex-direction: row;
60+
padding: 0;
61+
text-align: center;
62+
justify-content: center;
63+
}
64+
65+
.navbar-item {
66+
list-style-type: none;
67+
transition: 0.2s;
68+
}
69+
70+
.navbar-link {
71+
text-decoration: none;
72+
text-transform: uppercase;
73+
font-family: 'Silkscreen', cursive;
74+
color: var(--foreground);
75+
font-size: 15px;
76+
}
77+
78+
.navbar-item:hover {
79+
opacity: 75%;
80+
transition: 0.2s;
81+
}
82+
83+
.trt {
84+
text-transform: uppercase;
85+
font-family: 'Silkscreen', cursive;
86+
color: var(--foreground);
87+
font-size: 15px;
88+
margin-left: 5px;
89+
margin-right: 5px;
90+
}

assets/css/phoenix.css

Whitespace-only changes.

assets/js/app.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// We import the CSS which is extracted to its own file by esbuild.
2+
// Remove this line if you add a your own CSS build pipeline (e.g postcss).
3+
import "../css/app.css"
4+
5+
// If you want to use Phoenix channels, run `mix help phx.gen.channel`
6+
// to get started and then uncomment the line below.
7+
// import "./user_socket.js"
8+
9+
// You can include dependencies in two ways.
10+
//
11+
// The simplest option is to put them in assets/vendor and
12+
// import them using relative paths:
13+
//
14+
// import "../vendor/some-package.js"
15+
//
16+
// Alternatively, you can `npm install some-package --prefix assets` and import
17+
// them using a path starting with the package name:
18+
//
19+
// import "some-package"
20+
//
21+
22+
// Include phoenix_html to handle method=PUT/DELETE in forms and buttons.
23+
import "phoenix_html"
24+
// Establish Phoenix Socket and LiveView configuration.
25+
import {Socket} from "phoenix"
26+
import {LiveSocket} from "phoenix_live_view"
27+
import topbar from "../vendor/topbar"
28+
29+
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
30+
let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}})
31+
32+
// Show progress bar on live navigation and form submits
33+
topbar.config({barColors: {0: "#29d"}, shadowColor: "rgba(0, 0, 0, .3)"})
34+
window.addEventListener("phx:page-loading-start", info => topbar.show())
35+
window.addEventListener("phx:page-loading-stop", info => topbar.hide())
36+
37+
// connect if there are any LiveViews on the page
38+
liveSocket.connect()
39+
40+
// expose liveSocket on window for web console debug logs and latency simulation:
41+
// >> liveSocket.enableDebug()
42+
// >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session
43+
// >> liveSocket.disableLatencySim()
44+
window.liveSocket = liveSocket
45+
File renamed without changes.

assets/vendor/topbar.js

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
/**
2+
* @license MIT
3+
* topbar 1.0.0, 2021-01-06
4+
* https://buunguyen.github.io/topbar
5+
* Copyright (c) 2021 Buu Nguyen
6+
*/
7+
(function (window, document) {
8+
"use strict";
9+
10+
// https://gist.github.com/paulirish/1579671
11+
(function () {
12+
var lastTime = 0;
13+
var vendors = ["ms", "moz", "webkit", "o"];
14+
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
15+
window.requestAnimationFrame =
16+
window[vendors[x] + "RequestAnimationFrame"];
17+
window.cancelAnimationFrame =
18+
window[vendors[x] + "CancelAnimationFrame"] ||
19+
window[vendors[x] + "CancelRequestAnimationFrame"];
20+
}
21+
if (!window.requestAnimationFrame)
22+
window.requestAnimationFrame = function (callback, element) {
23+
var currTime = new Date().getTime();
24+
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
25+
var id = window.setTimeout(function () {
26+
callback(currTime + timeToCall);
27+
}, timeToCall);
28+
lastTime = currTime + timeToCall;
29+
return id;
30+
};
31+
if (!window.cancelAnimationFrame)
32+
window.cancelAnimationFrame = function (id) {
33+
clearTimeout(id);
34+
};
35+
})();
36+
37+
var canvas,
38+
progressTimerId,
39+
fadeTimerId,
40+
currentProgress,
41+
showing,
42+
addEvent = function (elem, type, handler) {
43+
if (elem.addEventListener) elem.addEventListener(type, handler, false);
44+
else if (elem.attachEvent) elem.attachEvent("on" + type, handler);
45+
else elem["on" + type] = handler;
46+
},
47+
options = {
48+
autoRun: true,
49+
barThickness: 3,
50+
barColors: {
51+
0: "rgba(26, 188, 156, .9)",
52+
".25": "rgba(52, 152, 219, .9)",
53+
".50": "rgba(241, 196, 15, .9)",
54+
".75": "rgba(230, 126, 34, .9)",
55+
"1.0": "rgba(211, 84, 0, .9)",
56+
},
57+
shadowBlur: 10,
58+
shadowColor: "rgba(0, 0, 0, .6)",
59+
className: null,
60+
},
61+
repaint = function () {
62+
canvas.width = window.innerWidth;
63+
canvas.height = options.barThickness * 5; // need space for shadow
64+
65+
var ctx = canvas.getContext("2d");
66+
ctx.shadowBlur = options.shadowBlur;
67+
ctx.shadowColor = options.shadowColor;
68+
69+
var lineGradient = ctx.createLinearGradient(0, 0, canvas.width, 0);
70+
for (var stop in options.barColors)
71+
lineGradient.addColorStop(stop, options.barColors[stop]);
72+
ctx.lineWidth = options.barThickness;
73+
ctx.beginPath();
74+
ctx.moveTo(0, options.barThickness / 2);
75+
ctx.lineTo(
76+
Math.ceil(currentProgress * canvas.width),
77+
options.barThickness / 2
78+
);
79+
ctx.strokeStyle = lineGradient;
80+
ctx.stroke();
81+
},
82+
createCanvas = function () {
83+
canvas = document.createElement("canvas");
84+
var style = canvas.style;
85+
style.position = "fixed";
86+
style.top = style.left = style.right = style.margin = style.padding = 0;
87+
style.zIndex = 100001;
88+
style.display = "none";
89+
if (options.className) canvas.classList.add(options.className);
90+
document.body.appendChild(canvas);
91+
addEvent(window, "resize", repaint);
92+
},
93+
topbar = {
94+
config: function (opts) {
95+
for (var key in opts)
96+
if (options.hasOwnProperty(key)) options[key] = opts[key];
97+
},
98+
show: function () {
99+
if (showing) return;
100+
showing = true;
101+
if (fadeTimerId !== null) window.cancelAnimationFrame(fadeTimerId);
102+
if (!canvas) createCanvas();
103+
canvas.style.opacity = 1;
104+
canvas.style.display = "block";
105+
topbar.progress(0);
106+
if (options.autoRun) {
107+
(function loop() {
108+
progressTimerId = window.requestAnimationFrame(loop);
109+
topbar.progress(
110+
"+" + 0.05 * Math.pow(1 - Math.sqrt(currentProgress), 2)
111+
);
112+
})();
113+
}
114+
},
115+
progress: function (to) {
116+
if (typeof to === "undefined") return currentProgress;
117+
if (typeof to === "string") {
118+
to =
119+
(to.indexOf("+") >= 0 || to.indexOf("-") >= 0
120+
? currentProgress
121+
: 0) + parseFloat(to);
122+
}
123+
currentProgress = to > 1 ? 1 : to;
124+
repaint();
125+
return currentProgress;
126+
},
127+
hide: function () {
128+
if (!showing) return;
129+
showing = false;
130+
if (progressTimerId != null) {
131+
window.cancelAnimationFrame(progressTimerId);
132+
progressTimerId = null;
133+
}
134+
(function loop() {
135+
if (topbar.progress("+.1") >= 1) {
136+
canvas.style.opacity -= 0.05;
137+
if (canvas.style.opacity <= 0.05) {
138+
canvas.style.display = "none";
139+
fadeTimerId = null;
140+
return;
141+
}
142+
}
143+
fadeTimerId = window.requestAnimationFrame(loop);
144+
})();
145+
},
146+
};
147+
148+
if (typeof module === "object" && typeof module.exports === "object") {
149+
module.exports = topbar;
150+
} else if (typeof define === "function" && define.amd) {
151+
define(function () {
152+
return topbar;
153+
});
154+
} else {
155+
this.topbar = topbar;
156+
}
157+
}.call(this, window, document));

config/config.exs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This file is responsible for configuring your application
2+
# and its dependencies with the aid of the Config module.
3+
#
4+
# This configuration file is loaded before any dependency and
5+
# is restricted to this project.
6+
7+
# General application configuration
8+
import Config
9+
10+
config :profile,
11+
ecto_repos: [Profile.Repo]
12+
13+
# Configures the endpoint
14+
config :profile, ProfileWeb.Endpoint,
15+
url: [host: "localhost"],
16+
render_errors: [view: ProfileWeb.ErrorView, accepts: ~w(html json), layout: false],
17+
pubsub_server: Profile.PubSub,
18+
live_view: [signing_salt: "eo4oO/SS"]
19+
20+
# Configures the mailer
21+
#
22+
# By default it uses the "Local" adapter which stores the emails
23+
# locally. You can see the emails in your browser, at "/dev/mailbox".
24+
#
25+
# For production it's recommended to configure a different adapter
26+
# at the `config/runtime.exs`.
27+
config :profile, Profile.Mailer, adapter: Swoosh.Adapters.Local
28+
29+
# Swoosh API client is needed for adapters other than SMTP.
30+
config :swoosh, :api_client, false
31+
32+
# Configure esbuild (the version is required)
33+
config :esbuild,
34+
version: "0.14.29",
35+
default: [
36+
args:
37+
~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
38+
cd: Path.expand("../assets", __DIR__),
39+
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
40+
]
41+
42+
# Configures Elixir's Logger
43+
config :logger, :console,
44+
format: "$time $metadata[$level] $message\n",
45+
metadata: [:request_id]
46+
47+
# Use Jason for JSON parsing in Phoenix
48+
config :phoenix, :json_library, Jason
49+
50+
# Import environment specific config. This must remain at the bottom
51+
# of this file so it overrides the configuration defined above.
52+
import_config "#{config_env()}.exs"

0 commit comments

Comments
 (0)