From f797271fa5e87f8a9c5b223cad6c59a417277563 Mon Sep 17 00:00:00 2001 From: Warwick Date: Mon, 16 Oct 2023 00:07:03 +0100 Subject: [PATCH] initial site commit --- .gitignore | 3 + archetypes/default.md | 6 ++ config.yml | 4 + content/greeter.md | 9 ++ content/posts/hello-world.md | 7 ++ themes/warwick_portfolio/LICENSE | 20 +++++ .../warwick_portfolio/archetypes/default.md | 2 + .../warwick_portfolio/assets/css/greeter.css | 21 +++++ themes/warwick_portfolio/assets/css/main.css | 76 ++++++++++++++++ .../warwick_portfolio/assets/js/background.js | 86 +++++++++++++++++++ themes/warwick_portfolio/layouts/404.html | 0 .../layouts/_default/baseof.html | 11 +++ .../layouts/_default/list.html | 0 .../layouts/_default/single.html | 13 +++ themes/warwick_portfolio/layouts/index.html | 22 +++++ .../layouts/partials/footer.html | 0 .../layouts/partials/greeter.html | 7 ++ .../layouts/partials/head.html | 6 ++ .../layouts/partials/header.html | 0 themes/warwick_portfolio/theme.toml | 21 +++++ 20 files changed, 314 insertions(+) create mode 100644 .gitignore create mode 100644 archetypes/default.md create mode 100644 config.yml create mode 100644 content/greeter.md create mode 100644 content/posts/hello-world.md create mode 100644 themes/warwick_portfolio/LICENSE create mode 100644 themes/warwick_portfolio/archetypes/default.md create mode 100644 themes/warwick_portfolio/assets/css/greeter.css create mode 100644 themes/warwick_portfolio/assets/css/main.css create mode 100755 themes/warwick_portfolio/assets/js/background.js create mode 100644 themes/warwick_portfolio/layouts/404.html create mode 100644 themes/warwick_portfolio/layouts/_default/baseof.html create mode 100644 themes/warwick_portfolio/layouts/_default/list.html create mode 100644 themes/warwick_portfolio/layouts/_default/single.html create mode 100644 themes/warwick_portfolio/layouts/index.html create mode 100644 themes/warwick_portfolio/layouts/partials/footer.html create mode 100644 themes/warwick_portfolio/layouts/partials/greeter.html create mode 100644 themes/warwick_portfolio/layouts/partials/head.html create mode 100644 themes/warwick_portfolio/layouts/partials/header.html create mode 100644 themes/warwick_portfolio/theme.toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e84eea6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.hugo_build.lock +/public/ +/resources/ diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..d0bdf42 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +tags: draft +--- + diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..f219410 --- /dev/null +++ b/config.yml @@ -0,0 +1,4 @@ +baseURL: https://warwick-new.co.uk +languageCode: en-us +title: Warwick's Portfolio Site +theme: warwick_portfolio diff --git a/content/greeter.md b/content/greeter.md new file mode 100644 index 0000000..f58a002 --- /dev/null +++ b/content/greeter.md @@ -0,0 +1,9 @@ +--- +title: "Greeter" +date: 2023-10-15T21:48:35+01:00 +--- +### Hi, I'm Warwick. And I: +- Make Games +- Make Websites +- Research Papers +- Teach Computing at Falmouth University diff --git a/content/posts/hello-world.md b/content/posts/hello-world.md new file mode 100644 index 0000000..12ff884 --- /dev/null +++ b/content/posts/hello-world.md @@ -0,0 +1,7 @@ +--- +title: "Hello World!" +date: 2023-10-15 20:25:14.038 +0100 +--- + +# Hello World! +Eyy *Finger Guns* diff --git a/themes/warwick_portfolio/LICENSE b/themes/warwick_portfolio/LICENSE new file mode 100644 index 0000000..17993f6 --- /dev/null +++ b/themes/warwick_portfolio/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2023 YOUR_NAME_HERE + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/themes/warwick_portfolio/archetypes/default.md b/themes/warwick_portfolio/archetypes/default.md new file mode 100644 index 0000000..ac36e06 --- /dev/null +++ b/themes/warwick_portfolio/archetypes/default.md @@ -0,0 +1,2 @@ ++++ ++++ diff --git a/themes/warwick_portfolio/assets/css/greeter.css b/themes/warwick_portfolio/assets/css/greeter.css new file mode 100644 index 0000000..33d25d9 --- /dev/null +++ b/themes/warwick_portfolio/assets/css/greeter.css @@ -0,0 +1,21 @@ +@keyframes slideInLeft { + 0% { + transform: translateX(-100%); + opacity: 0; + } + 100% { + transform: translateX(0); + opacity: 1; + } +} + +#greeter { + margin: 5% 10% 5% 50%; + animation: 1s ease-out 0s 1 slideInLeft; + background: var(--paper); + padding: 40px; +} + +#greeter li { + font-size: 133%; +} diff --git a/themes/warwick_portfolio/assets/css/main.css b/themes/warwick_portfolio/assets/css/main.css new file mode 100644 index 0000000..9cda38c --- /dev/null +++ b/themes/warwick_portfolio/assets/css/main.css @@ -0,0 +1,76 @@ +/* Font stuff */ +@import url('https://fonts.googleapis.com/css?family=Abel:700|Abel:400'); +body { + font-family: 'Abel'; + font-weight: 400; +} +h1, h2, h3, h4, h5 { + font-family: 'Abel'; + font-weight: 700; +} +html {font-size: 100%;} /* 16px */ +h1 {font-size: 4.210rem; /* 67.36px */} +h2 {font-size: 3.158rem; /* 50.56px */} +h3 {font-size: 2.369rem; /* 37.92px */} +h4 {font-size: 1.777rem; /* 28.48px */} +h5 {font-size: 1.333rem; /* 21.28px */} +small {font-size: 0.750rem; /* 12px */} + +/* Colour Scheme stuff +:root[data-theme="light"] { + --text: #070808; + --background: #f7f8f8; + --primary: #aeb4bc; + --secondary: #dcd5d5; + --accent: #7d7468; +} +:root[data-theme="dark"] { + --text: #f7f8f8; + --background: #070808; + --primary: #434951; + --secondary: #2a2323; + --accent: #978e82; +}*/ +:root { + /*color-scheme: light dark;*/ + --text: #f7f8f8; + --background: #070808; + --primary: #434951; + --secondary: #2a2323; + --accent: #978e82; + --paper: #181b1b; +} + +/* Custom CSS */ +body { + color-scheme: dark; + background-color: var(--background); + accent-color: var(--accent); + caret-color: var(--text); + color: var(--text); + + padding: 0; + margin: 0; +} + +a:link, a:active{ + color: var(--primary); +} +a:hover { + color: var(--secondary); +} +a:visited { + color: var(--accent); +} + +.homepage-header { + background-color: var(--paper); + padding: 2rem; +} + +.container { + width: 1000px; + padding: 10px; + background-color: var(--paper); + margin: 0 auto; +} diff --git a/themes/warwick_portfolio/assets/js/background.js b/themes/warwick_portfolio/assets/js/background.js new file mode 100755 index 0000000..8b2371d --- /dev/null +++ b/themes/warwick_portfolio/assets/js/background.js @@ -0,0 +1,86 @@ +// create background element +let canvas = document.createElement("canvas"); +document.body.appendChild(canvas); +canvas.style.cssText = ` + background: var(--background); + position:fixed; + left:0; + top:0; + z-index:-99999; + ` +// set it's size +canvas.width = window.innerWidth; +canvas.height = window.innerHeight; + +let context = canvas.getContext('2d'); + +// this will be populated and used later +drawableObjectList = []; + +// this is the object that'll look cool +class Point { + constructor() { + this.x = Math.random() * window.innerWidth; + this.y = Math.random() * window.innerHeight; + + this.dx = (Math.random()) - 0.5; + this.dy = (Math.random()) - 0.5; + } + draw() { + context.fillStyle = "#2a2323" + context.strokeStyle = "#2a2323" + // find and draw links + drawableObjectList.forEach((point) => { + if (point.x > this.x - 100 && point.x < this.x + 100 && + point.y > this.y - 100 && point.y < this.y + 100) { + context.beginPath() + context.moveTo(this.x, this.y) + context.lineTo(point.x, point.y) + context.stroke(); + } + }); + + // draw point + context.beginPath(); + context.arc(this.x, this.y, 3, 0, Math.PI * 2, false); + context.fill(); + context.stroke(); + + // move point + this.x += this.dx; + this.y += this.dy; + + // keep point in bounds + if (this.x > window.innerWidth || this.x < 0) { + this.dx *= -1 + } + if (this.y > window.innerHeight || this.y < 0) { + this.dy *= -1 + } + } +} + +// populate element array +for (let i = 0; i < 100; i++) { + drawableObjectList.push(new Point()); +} + +function loop() { + // Loop and clear frame + requestAnimationFrame(loop); + context.clearRect(0, 0, window.innerWidth, window.innerHeight); + + // Draw objects. + drawableObjectList.forEach((point) => { + point.draw(); + }); + + // Handle page size change + if (canvas.width != window.innerWidth) { + canvas.width = window.innerWidth; + } + if (canvas.height != window.innerHeight) { + canvas.height = window.innerHeight; + } +} +loop(); diff --git a/themes/warwick_portfolio/layouts/404.html b/themes/warwick_portfolio/layouts/404.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/warwick_portfolio/layouts/_default/baseof.html b/themes/warwick_portfolio/layouts/_default/baseof.html new file mode 100644 index 0000000..5f8e2ec --- /dev/null +++ b/themes/warwick_portfolio/layouts/_default/baseof.html @@ -0,0 +1,11 @@ + + + {{- partial "head.html" . -}} + + {{- partial "header.html" . -}} +
+ {{- block "main" . }}{{- end }} +
+ {{- partial "footer.html" . -}} + + diff --git a/themes/warwick_portfolio/layouts/_default/list.html b/themes/warwick_portfolio/layouts/_default/list.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/warwick_portfolio/layouts/_default/single.html b/themes/warwick_portfolio/layouts/_default/single.html new file mode 100644 index 0000000..d94e531 --- /dev/null +++ b/themes/warwick_portfolio/layouts/_default/single.html @@ -0,0 +1,13 @@ +{{define "main"}} +
+
+
+

{{.Title}}

+
+
+
+{{end}} diff --git a/themes/warwick_portfolio/layouts/index.html b/themes/warwick_portfolio/layouts/index.html new file mode 100644 index 0000000..91e2bca --- /dev/null +++ b/themes/warwick_portfolio/layouts/index.html @@ -0,0 +1,22 @@ +{{ define "main" }} +{{ partial "greeter.html" .}} +
+
+

{{.Title}}

+
+
+ +
+
+ {{ range where .Site.RegularPages "Type" "posts" }} +
+

{{ .Title }}

+

{{.Summary}}

+ +
+
+ {{ end }} +
+
+ +{{ end }} diff --git a/themes/warwick_portfolio/layouts/partials/footer.html b/themes/warwick_portfolio/layouts/partials/footer.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/warwick_portfolio/layouts/partials/greeter.html b/themes/warwick_portfolio/layouts/partials/greeter.html new file mode 100644 index 0000000..b57505c --- /dev/null +++ b/themes/warwick_portfolio/layouts/partials/greeter.html @@ -0,0 +1,7 @@ +{{ with .Site.GetPage "/greeter" }} + {{$greeter_style := resources.Get "css/greeter.css"}} + +
+ {{ .Content }} +
+{{ end }} diff --git a/themes/warwick_portfolio/layouts/partials/head.html b/themes/warwick_portfolio/layouts/partials/head.html new file mode 100644 index 0000000..bd43e92 --- /dev/null +++ b/themes/warwick_portfolio/layouts/partials/head.html @@ -0,0 +1,6 @@ + + {{$styles := resources.Get "css/main.css"}} + + {{$background := resources.Get "js/background.js"}} + + diff --git a/themes/warwick_portfolio/layouts/partials/header.html b/themes/warwick_portfolio/layouts/partials/header.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/warwick_portfolio/theme.toml b/themes/warwick_portfolio/theme.toml new file mode 100644 index 0000000..919b6ec --- /dev/null +++ b/themes/warwick_portfolio/theme.toml @@ -0,0 +1,21 @@ +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemes#themetoml for an example + +name = "Warwick_portfolio" +license = "MIT" +licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE" +description = "" +homepage = "http://example.com/" +tags = [] +features = [] +min_version = "0.41.0" + +[author] + name = "" + homepage = "" + +# If porting an existing theme +[original] + name = "" + homepage = "" + repo = ""