@dos1fy

Как исправить ошибку?

Простейший скрипт js в html даёт сбой. Как исправить?
html
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1", maximum-scale="1">
	<title>dos1fy des1gn</title>
	<link rel="stylesheet" type="text/css" href="style.css">
	<link rel="manifest" href="/manifest.json"> <script src="/app.js"></script>
</head>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.js">
	$ const handleChange = (isCheked) => {
      if (isChecked) {
        document.body.setAttribute('dark', '');
      } else {
        document.body.removeAttribute('dark');
      }
    }
</script>
<body>
		<input type="checkbox" id="lol-checkbox" onchange="handleChange(this.checked)"/>
		<label id="button" for="lol-checkbox">
  <div id="knob"></div>
  <div id="subscribe">Light</div>
  <div id="alright">Dark</div>
</label>
	<div class="main">
		<div class="text-main">
			<img src="avatar.png" width="250" height="250">
			<h1>Dos1fy des1gn<span>_</span></h1>
			<p>Motion - 2D - 3D </p>
		</div>
	</div>
		</div>
	<div class="container">
  <div class="box">
    <span></span>
    <div class="content">
      <h2>Rule #1</h2>
      <p>
We are the most responsive company and a sign of quality for you!</p>
    </div>
  </div>
  <div class="box">
    <span></span>
    <div class="content">
      <h2>Rule #2</h2>
      <p><font face="Arial">
We'll be sure to let you know what you want!</font></p>
    </div>
  </div>
  <div class="box">
    <span></span>
    <div class="content">
      <h2>Rule #3</h2>
      <p>
Quick order! Fast and convenient payment! Quick order receipt!</p>
    </div>
  </div>
</div>

	<div class="portfolio">
		<h2>Portfolio</h2>
		<div class="row">
				</div>
				
				<!-- Photo Grid -->
				<div class="row"> 
				  <div class="column">
					<img src="img/1.jpg" style="width:100%">
					<img src="img/12.png" style="width:100%">
					<img src="img/2.jpg" style="width:100%">
					<img src="img/2d.jpg" style="width:100%">
				  </div>
				  <div class="column">
					<img src="img/3.jpg" style="width:100%">
					<img src="img/3d.jpg" style="width:100%">
					<img src="img/4.jpg" style="width:100%">
				  </div>
				  <div class="column">
					<img src="img/5.jpg" style="width:100%">
					<img src="img/6.jpg" style="width:100%">
					<img src="img/7.jpg" style="width:100%">
				  </div>
				  <div class="column">
					<img src="img/monik_s_proektom.png" style="width:100%">
					<img src="img/motion.jpg" style="width:100%">
					<img src="img/wallpaper.png" style="width:100%">
				  </div>
				</div>
  
</body>
</html>



css
:root {
  --var-main-bg: #F5DEB3;
  --var-body-fc: #696969;
  --var-header-bg: #fff;
}

[dark] {
  --var-main-bg: #696969;
  --var-body-fc: #F5DEB3;
  --var-header-bg: #696969;
}

*{
	margin: 0;
	padding: 0;
}
.wrapper {
	height: 100%;
	width: 100%;
	height: 100vh;
  }
.main{
	width: 100%;
	height: 80vh;
	background-color: var(--var-main-bg);
}
.text-main{
	position: relative;
	text-align: center;
	top: 25%;
	color: var(--var-body-fc);
}
.main h1{
	font-size: 4rem;
	text-transform: uppercase;
	font-family: 'Arial';
}
h1 span {
	opacity: 0.1;
	font-size: 2rem;
	animation-name: glowing;
	animation-duration: 0.7s;
	animation-iteration-count: infinite;
}

@keyframes glowing {
	0%, 100%{
		opacity: 1;
	}
	0%, 20% {
		opacity: 0;
	}
	0%, 90%{
		opacity: 1;
	}
}
.main p{
	margin-top: 10px;
	font-size: 1.5rem;
	font-family: 'Arial';
	text-transform: uppercase;
}
.portfolio{
	height: 80vh;
	width: 95%;
	margin-left: auto;
	margin-right: auto;
}
.portfolio h1{
	font-size: 3rem;
	color: #987654;
	font-family: Arial;
	text-transform: uppercase;
	text-align: center;
	margin-top: 30px;
	margin-bottom: 30px;
}
.portfolio h2{
	font-size: 3rem;
	color: #987654;
	font-family: Arial;
	text-transform: uppercase;
	text-align: center;
	margin-top: 30px;
	margin-bottom: 30px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: Arial;
}

.header {
	text-align: center;
	padding: 32px;
}

.row {
	display: -ms-flexbox; /* IE10 */
	display: flex;
	-ms-flex-wrap: wrap; /* IE10 */
	flex-wrap: wrap;

}

/* Create four equal columns that sits next to each other */
.column {
	-ms-flex: 25%; /* IE10 */
	flex: 25%;
	max-width: 25%;
	padding: 0 4px;
}

.column img {
	margin-top: 8px;
	vertical-align: middle;
}

/* Responsive layout - makes a two column-layout instead of four columns */
@media screen and (max-width: 800px) {
	.column {
		-ms-flex: 50%;
		flex: 50%;
		max-width: 50%;
	}
}

/* Responsive layout - makes the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 600px) {
	.column {
		-ms-flex: 100%;
		flex: 100%;
		max-width: 100%;
	}
}
/* Responsive layout - makes the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 375px) {
	.column {
		-ms-flex: 100%;
		flex: 100%;
		max-width: 100%;
	}
}
/* Responsive layout - makes the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 667px) {
	.column {
		-ms-flex: 100%;
		flex: 50%;
		max-width: 50%;
	}
}
.container
{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 40px 0;
  font-family: Arial;
}

.container .box
{
  position: relative;
  width: 320px;
  height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 40px 30px;
  transition: 0.5s;
}

.container .box::before
{
  content:' ';
  position: absolute;
  top: 0;
  left: 50px;
  width: 50%;
  height: 100%;
  text-decoration: none;
  background: #fff;
  border-radius: 8px;
  transform: skewX(15deg);
  transition: 0.5s;
}

.container .box::after
{
  content:'';
  position: absolute;
  top: 0;
  left: 50;
  width: 50%;
  height: 100%;
  background: #fff;
  border-radius: 8px;
  transform: skewX(15deg);
  transition: 0.5s;
  filter: blur(30px);
}

.container .box:hover:before,
.container .box:hover:after
{
  transform: skewX(0deg);
  left: 20px;
  width: calc(100% - 90px);
  
}

.container .box:nth-child(1):before,
.container .box:nth-child(1):after
{
  background: linear-gradient(315deg, #ffbc00, #ff0058)
}

.container .box:nth-child(2):before,
.container .box:nth-child(2):after
{
  background: linear-gradient(315deg, #03a9f4, #ff0058)
}

.container .box:nth-child(3):before,
.container .box:nth-child(3):after
{
  background: linear-gradient(315deg, #4dff03, #00d0ff)
}

.container .box span
{
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  pointer-events: none;
}

.container .box span::before
{
  content:'';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: 0.1s;  
  animation: animate 2s ease-in-out infinite;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08)
}

.container .box:hover span::before
{
  top: -50px;
  left: 50px;
  width: 100px;
  height: 100px;
  opacity: 1;
}

.container .box span::after
{
  content:'';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: 0.5s;
  animation: animate 2s ease-in-out infinite;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  animation-delay: -1s;
}

.container .box:hover span:after
{
  bottom: -50px;
  right: 50px;
  width: 100px;
  height: 100px;
  opacity: 1;
}

@keyframes animate
{
  0%, 100%
  {
    transform: translateY(10px);
  }
  
  50%
  {
    transform: translate(-10px);
  }
}

.container .box .content
{
  position: relative;
  left: 0;
  padding: 20px 40px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  z-index: 1;
  transform: 0.5s;
  color: #fff;
}

.container .box:hover .content
{
  left: -25px;
  padding: 60px 40px;
}

.container .box .content h2
{
  font-size: 2em;
  color: #fff;
  margin-bottom: 10px;
}

.container .box .content p
{
  font-size: 1.1em;
  margin-bottom: 10px;
  line-height: 1.4em;
}

.container .box .content a
{
  display: inline-block;
  font-size: 1.1em;
  color: #111;
  background: #fff;
  padding: 10px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  margin-top: 5px;
}

.container .box .content a:hover
{
  background: #ffcf4d;
  border: 1px solid rgba(255, 0, 88, 0.4);
  box-shadow: 0 1px 15px rgba(1, 1, 1, 0.2);
}
* {
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  height: 100vh;
  margin: 0;
  background-color: var(--var-header-bg);
}

input[type="checkbox"] {
  display: none;
}

#button {
  position: relative;
  display: block;
  width: 697px;
  height: 346px;
  background-color: #000;
  border-radius: 350px;
  cursor: pointer;
  transform: scale(0.4);
  margin: -96px;
  margin-left: -150px;
}

#knob {
  width: 290px;
  height: 290px;
  background-size: 700px;
  position: relative;
  top: 30px;
  left: 30px;
  border-radius: 290px;
  transition: 0.4s ease left, 0.4s ease background-position;
  z-index: 2;
}

#subscribe,
#alright {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 58px;
  font-weight: bold;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin-left: 389px;
  z-index: 1;
}

#alright {
  margin-left: 30px;
}

#lol-checkbox:checked + #button #knob {
  left: 380px;
  background-position: -350px 0;
}
.theme {
  float: right;
}
  • Вопрос задан
  • 124 просмотра
Пригласить эксперта
Ответы на вопрос 2
adsvlad
@adsvlad
Разработка сайтов frontend && baсkand
Дело в том (насколько помню) что браузер сходит сума не зная что выполнять то что указано в src или в содержимое тега скрипт . Подключаите библтотеку отдельно а потом пишите либо в скрипте на странице (что не очень приветствуется) или тоже в отдельном файле.
Ответ написан
@GrayHorse
$

Удали.
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы