mirror of
https://github.com/maikka39/Personal-Website.git
synced 2026-11-27 12:32:56 +00:00
Set html size attributes for images
This commit is contained in:
@@ -33,24 +33,25 @@ When opening the website we're provided with a login form. If we fill in the for
|
|||||||
Let's open the source and take a look at the form. Here we can see that when the form is submitted, a javascript function called `checkPass()` is called.
|
Let's open the source and take a look at the form. Here we can see that when the form is submitted, a javascript function called `checkPass()` is called.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<form action="/index.php" onsubmit='checkPass(); return false'>
|
<form action="/index.php" onsubmit="checkPass(); return false"></form>
|
||||||
```
|
```
|
||||||
|
|
||||||
To find this funtion, enter `checkPass` in the devtools console and click on the three dots at the bottom of the output.
|
To find this funtion, enter `checkPass` in the devtools console and click on the three dots at the bottom of the output.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
function checkPass()
|
function checkPass() {
|
||||||
{
|
var username = document.getElementById("username").value;
|
||||||
var username = document.getElementById('username').value;
|
var password = document.getElementById("password").value;
|
||||||
var password = document.getElementById('password').value;
|
|
||||||
|
|
||||||
var novi = '-NOVI';
|
var novi = "-NOVI";
|
||||||
|
|
||||||
if (password == btoa(username + novi)) {
|
if (password == btoa(username + novi)) {
|
||||||
window.setTimeout(function() {
|
window.setTimeout(function () {
|
||||||
window.location.assign('inde' + 'x.php?username='+ username +'&password=' + password);
|
window.location.assign(
|
||||||
}, 500);
|
"inde" + "x.php?username=" + username + "&password=" + password
|
||||||
}
|
);
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ a {
|
|||||||
|
|
||||||
img {
|
img {
|
||||||
display: block;
|
display: block;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|
||||||
&.left {
|
&.left {
|
||||||
|
|||||||
@@ -37,11 +37,14 @@
|
|||||||
|
|
||||||
{{ if .Params.Cover }}
|
{{ if .Params.Cover }}
|
||||||
<figure class="post-cover">
|
<figure class="post-cover">
|
||||||
|
{{ $img := imageConfig (printf "static/%s" .Params.Cover) }}
|
||||||
|
|
||||||
{{ if .Params.UseRelativeCover }}
|
{{ if .Params.UseRelativeCover }}
|
||||||
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}"
|
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" alt="{{ .Title | plainify | default " " }}"
|
||||||
alt="{{ .Title | plainify | default " " }}" />
|
width="{{ $img.Width }}" height="{{ $img.Height }}" />
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title | plainify | default " " }}" />
|
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title | plainify | default " " }}"
|
||||||
|
width="{{ $img.Width }}" height="{{ $img.Height }}" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if .Params.CoverCaption }}
|
{{ if .Params.CoverCaption }}
|
||||||
|
|||||||
@@ -34,9 +34,11 @@
|
|||||||
<hr />
|
<hr />
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{ with .Params.Cover }}
|
{{- if .Params.Cover }}
|
||||||
<img src="/{{ . }}" class="post-cover" />
|
{{ $img := imageConfig (printf "static/%s" .Params.Cover) }}
|
||||||
{{ end }}
|
<img src="/{{ .Params.Cover }}" class="post-cover" alt="{{ .Title | plainify | default " " }}"
|
||||||
|
width="{{ $img.Width }}" height="{{ $img.Height }}" />
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
|
|||||||
Reference in New Issue
Block a user